Skip to content

story-037: A stage's baseline is what that stage first found - #34

Merged
jerodw merged 1 commit into
mainfrom
story/story-037
Aug 14, 2026
Merged

story-037: A stage's baseline is what that stage first found#34
jerodw merged 1 commit into
mainfrom
story/story-037

Conversation

@jerodw

@jerodw jerodw commented Aug 14, 2026

Copy link
Copy Markdown
Owner

The revert check asks whether an implementer's edits under tests/ were forced, by restoring them and re-running the suite. Its baseline was captured per stage per attempt, so on a retry the baseline already contained the previous attempt's edits: restoring them changed nothing, the suite passed, and the check reported "not forced" about edits it never removed.

story-036 hit this. Its retry never touched the four files it was refused for, and the same four had been correctly permitted on attempt 1 by the same check. Nothing about the work changed between the two verdicts — only the baseline did.

What changed

The baseline is keyed by stage alone:

def stage_baseline_dir(run_dir, baseline, stage_name):
    """...it is by stage alone because the baseline is what that stage
    first found. An attempt-keyed directory made the second attempt of a
    stage decide against the first attempt's own edits, which is not the
    question the revert check asks."""
    return run_dir / baseline / stage_name

Keyed on the stage, not the story: the implementer is stage 0, so its first baseline happens to be the pre-story tree, but that is a coincidence of ordering and the derivation does not depend on it.

The merge rule, which is better than what the request asked for

The request proposed reusing the first attempt's directory wholesale. That would have traded one defect for another, and the story found it: a re-entry must also capture paths that did not exist at first capture — a file the tester created since — because _build_clone deletes a governed path the baseline does not hold. Reusing the earlier directory whole would delete it and pass, escalating a repair it should permit.

So the capture merges per path: a path the baseline already holds keeps the content it was first captured with; a path new since the last capture is added at its current content. test_reusing_the_earlier_capture_whole_would_have_deleted_that_path is the control, and it demonstrates the failure rather than describing it.

Verification

  • 1907 passed, 29 written; verification passed first iteration, no retries; clean-clone green with the story committed
  • Three implementer edits under tests/ were permitted by the revert check — the suite fails with them reverted

Note for whoever resumes story-036

Existing run directories hold attempt-keyed baselines (stage-baseline/implementer-attempt-1, -attempt-2) and nothing migrates them. A resumed run finds no stage-baseline/implementer, captures a fresh one from a tree that already holds the accumulated edits, and reproduces the vacuity this story fixes — on the one run that motivated it.

The migration is mechanical and matches the merge rule: take implementer-attempt-1, then add any path present only in implementer-attempt-2. Worth doing by hand before resuming story-036 rather than discovering it as a second spurious escalation.

🤖 Generated with Claude Code

Implemented by the l5 harness story workflow.
@jerodw
jerodw merged commit 8c5ac26 into main Aug 14, 2026
3 checks passed
@jerodw
jerodw deleted the story/story-037 branch August 14, 2026 12:45
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.

1 participant