Implement ObjectFinder with ambiguity resolution #294
Labels
No labels
Blocked
Duplicate
MoSCoW/Could Have
MoSCoW/Must Have
MoSCoW/Should Have
Points/1
Points/13
Points/2
Points/21
Points/3
Points/5
Points/8
Priority/Backlog
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
State/Completed
State/In progress
State/In review
State/Paused
State/Unverified
State/Verified
State/Wont Do
Type/Bug
Type/Epic
Type/Feature
Type/Legendary
Type/Task
Type/Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#291 Epic: Input Validation Framework
aethyr/Aethyr
Reference: aethyr/Aethyr#294
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
feature/m1-object-finderfeat: implement ObjectFinder with ambiguity resolutionBackground and Context
In a MUD, players frequently refer to game objects by partial names ("sword", "red potion", "2nd bag"). The ObjectFinder is responsible for resolving these textual references to actual game objects within a given scope (room, inventory, equipment, etc.). When multiple objects match, it must prompt the player to disambiguate rather than silently picking one.
Expected Behavior
ObjectFinder takes a text reference, a scope (e.g.,
:room,:inventory,:equipment,:area), and a context (player, room). It searches the scope for matching objects and returns:AmbiguityErrorcontaining numbered options for the player. Example prompt: "Which sword do you mean? 1) iron sword 2) rusty sword". The player's numeric reply resolves the ambiguity.ObjectNotFoundErrorwith a descriptive message.Matching supports: exact name match, partial name match, ordinal prefixes ("2nd sword"), adjective+noun ("rusty sword"), and item keywords.
Acceptance Criteria
ObjectFinder#resolveaccepts a text reference and scope.AmbiguityPromptwith numbered options.ObjectNotFoundError.:room,:inventory,:equipment, and:areaare supported.Subtasks
Code
ObjectFinderclass with#resolve(text, scope:)method.:room,:inventory,:equipment,:area.AmbiguityPromptvalue object with match list and prompt text.ObjectNotFoundErrorvalue object.Quality
tests/unit/object_finder.featurecovering exact match, partial match, ordinal prefix, adjective+noun, multiple matches triggering disambiguation, no match error, disambiguation reply, scope filtering.tests/integration/for ObjectFinder resolving text references to game objects with ambiguity prompts.bundle exec rake unit_profileand verify no performance regressions.bundle exec rake unit. If coverage is <97% then review the current unit test coverage report atbuild/tests/unit/coverage/and use it to write new Cucumber based unit tests to improve coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerunbundle exec rake unitto verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.bundle exec rake(default task: unit tests with coverage) andbundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.Definition of Done
This issue is complete when:
master, reviewed, and merged before this issue is marked done.