story-019: Revert an implementer's edits to where the stage found them, not to HEAD - #17
Merged
Conversation
…m, not to HEAD Implemented by the l5 harness story workflow.
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.
Summary
story-017's revert check decides whether an implementer's edits under a governed prefix were forced, by reverting them and seeing whether the suite fails. It reverted them with
git checkout HEAD -- <paths>, which is the right baseline only for files that existed before the story.On a retry, the implementer routinely edits a test the tester created earlier in the same run — a file with no version at
HEAD, because the coordinator commits only at_complete. The checkout fails, the check reports it could not run, and the run escalates. story-018 hit exactly that:Attempt 1 is the check working as designed. Attempt 2 is it unable to decide, on the ordinary shape of a retry — a clean-clone or verifier failure is frequently a defect in a test written this run, and the retry sends the implementer to fix it.
This story reverts each governed path to the state it was in when the stage started, not to
HEAD. For a file that predates the story that is itsHEADversion and nothing changes; for a file created during the run it is the content the previous stage left.Changes
orchestration/story_coordinator.py— a per-attempt baseline is captured before a stage runs, and never re-captured over one that already exists. The revert check restores from it instead of fromHEAD.workflows/story-workflow.json—revert_checkbecomes an object naming both artifacts:The key still turns the check on, and both names still come off the loaded definition rather than out of orchestration.
schemas/revert-check-result.schema.json— thepathsdescription no longer says "reverted from HEAD".tests/test_story_019_validation.py(new, tester stage) — 44 tests.tests/test_story_010_validation.py,tests/test_story_017_validation.py— repaired by the implementer, which the revert check itself permitted: "the suite fails with tests/test_story_010_validation.py, tests/test_story_017_validation.py reverted."Testing
878 passedin the working tree and878 passedin a fresh clone with the story committed, on Python 3.10.20 (clean-clone-result.json,exit_code: 0). Verification passed first iteration, zero blocking issues.Notes for review
stage-baseline/— the coordinator loaded the workflow before thebaselinekey existed in it. Same self-reference as story-014's clean-clone check, story-012's retry history and story-017's own revert check. The first story it governs is the next one.tests/at 4.1 MB across 26 files, per stage per attempt. Run directories were ~3.3 MB total for sixteen runs before this. It is gitignored and removed with the run, but a long retry chain is no longer cheap on disk.git clonefailure — both cannot-run tests monkeypatch_build_cloneto raise — and the pre-change end-to-end run was confirmed by readingHEADrather than re-executed.🤖 Generated with Claude Code