Repository navigation
The doctor's arc walk respects locks: a key must be reachable without passing its own door - #378
Merged
Merged
Conversation
… passing the door it opens Story::Doctor#reachable_from_the_opening now opens a keyed door only once its key (or any lockpick) lies somewhere already reached, iterated to a fixed point; a jammed door can always be forced. A new warning, lock_whose_key_lies_behind_it, names each door that walk leaves shut with its key behind it, behind another unopenable lock, or nowhere; a target stranded behind one is quest_target_unreachable (fatal) as before. Adds the sweep world a-key-locked-in-with-its-door, which trips both, and Story::DoctorLocksTest. Graph idea from Scouten2/LevelDesignSkill graph_check.py (MIT), reimplemented over the doctor's own records.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
G1 from the design research report: the doctor's "the arc can complete" check (P3) ignored locks. It walked every connection row, so a world whose key lay behind its own door passed as completable.
Story::Doctor#reachable_from_the_openingis now lock-aware. A keyed door opens only once its key, or any lockpick (the engine'spickchoice), lies somewhere already reached. The walk repeats until the set of keys in hand stops growing, so chained keys are followed and a key behind its own lock, or a cycle of keys behind each other's locks, opens nothing. A jammed door always counts as passable, becauseforceneeds no tool. Where a door has rows in both directions, each direction follows its own row; where only one row is recorded, the walk uses that row both ways, as before.lock_whose_key_lies_behind_it(remedymanual). It names each door the walk leaves shut with its far side out of reach, and says where the key is: on the far side of that same door, behind another lock whose key is also out of reach, or nowhere reachable. Any arc target behind such a door is still reported as the fatalquest_target_unreachable. A door whose near side is itself out of reach is not reported; the lock in front of it is the one to fix.lib/engine_sweep/worlds/a-key-locked-in-with-its-door.ymltrips both findings: one key behind its own door, and two keys behind each other's doors.EngineSweepTestlets this world, and only this world, carry those two findings. No sweep script walks it, because scripts play against engine-vendored goldens.Story::DoctorLocksTestcovers passing and failing cases: a key on the near side, a key in the protagonist's starting hands, a chain of keys, a reachable lockpick, a jammed door, a key behind its own lock, a two-key cycle, and the sweep world.SeededWorldsTest's arc findings now include the new code.The doctor still only reads and reports. It never changes a world.
Idea source: Scouten2/LevelDesignSkill
graph_check.py(MIT). This is a Ruby reimplementation over the doctor's own records; no code was copied.Every world doctored
The doctor was run over every hand-made world in
db/seeds/worlds/and every sweep world. No hand-made world fails. The only world with either finding is the new one.a-key-for-the-other-doorkeeps a key behind its own lock but passes, because a lockpick lies in the opening room.Checks
The full suite passes except two
ViewportPinControllerTestcases that failed on the second run with a headless Chromium/dbus error. They are unrelated to this change, and they passed on the first full run.rubocop,zeitwerk:checkandbrakemanare clean.bin/rails engine:rust_gatespasses on all 114 scripts. No model calls were made: the model keys were unset.