Skip to content

Fix case-sensitive full-name parser disambiguation - #379

Merged
Marc-Alexandre Côté (MarcCote) merged 1 commit into
microsoft:mainfrom
cmarcotte-lawzero:fix/case-insensitive-parser-preference
Sep 29, 2026
Merged

Marc-Alexandre Côté (MarcCote) merged 1 commit into
microsoft:mainfrom
cmarcotte-lawzero:fix/case-insensitive-parser-preference

Conversation

@cmarcotte-lawzero

Copy link
Copy Markdown
Contributor

The generated full-name preference rule can ask for clarification even when a command includes the exact object names. Inform's parser lowercases the command, but the rule compares it against printed names case-sensitively. With open containers named box and red box, and an object named Ruby inside box, take Ruby from box asks which box the player means.

Make all four printed-name comparisons in the generated Does the player mean rule explicitly case-insensitive. This preserves the existing preference logic while allowing capitalized printed names.

Add native parser regressions for one- and two-object commands, mixed-case names in either argument, and original/lowercase/uppercase command input. The tests check tracked moves and the resulting object facts, including that the other container stays closed in the one-object case.

Validation:

  • Before the fix: four mixed-case cases fail with clarification prompts; both lowercase controls pass.
  • After the fix: 37 tests pass across textworld/generator/inform7/tests/test_world2inform7.py and textworld/envs/wrappers/tests/test_tw_inform7.py, using Python 3.13 on macOS arm64 with Inform 7 6M62.
  • git diff --check passes.

This change does not alter the planner or address separate ambiguities caused by overlapping object names across command arguments.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@cmarcotte-lawzero

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="LawZero"

@MarcCote

Copy link
Copy Markdown
Contributor

Good catch. Thanks for the fix.

@MarcCote
Marc-Alexandre Côté (MarcCote) merged commit 6d88a08 into microsoft:main Sep 29, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants