Repository navigation
Test the Repair loop's rules in-process behind a seam for its outside effects - #373
Merged
Merged
Conversation
… effects (#372) The Repair loop moves into a private submodule of the Delivery module and reaches the Issue branch, CI, the Repair sessions, the Base fix, the pull request, the interrupt flag and its progress lines only through one internal Outside trait. It names each Repair by kind; the production adapter builds the same prompts as before. The budgets return their lines. Unit tests drive the loop against a scripted adapter, and the CI, Merge run and mergeable end-to-end tests that only checked a loop decision go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each upstream-move counter now builds its own progress line, rather than the shared one handing back the line it was given. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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
The Repair loop moves into its own private submodule of the Delivery module. It reaches the outside only through one internal seam,
Outside. Its rules are now tested in-process against a scripted adapter.RunOutsidebuilds the same prompts as before through the prompt module.Evidence
Before: apart from the budget arithmetic, the loop's rules could only be checked end to end, against a git origin, the fake
ghand the fakeclaude.After: 25 unit tests in
delivery::repair_loopdrivetake_to_goalagainst a scripted adapter. They assert on the result, the recorded effects in order and the lines, for example:I mutation-checked them: dropping the budget comparison in the Policy refusal rule, or flipping the ReadyForReview goal check, makes 3 tests fail.
I deleted 23 end-to-end tests that only checked a loop decision (CI, Merge run and mergeable suites). Each production adapter call keeps at least one end-to-end test:
gh run rerunCheck re-run;The Spec run and Base fix suites are unchanged.
cargo test: 880 passed, 0 failed.cargo clippy --all-targetsandcargo fmt --checkare clean.Merge Danger
Door: two-way
A refactor plus test deletions; a revert restores both.
Blast Radius: internal
Every Run and Spec run goes through this loop. A behaviour slip would show up as a different Repair order or different budgets, but the logic is a line-for-line port.
Unaddressed findings
Standards
Budgetsunit tests test past the interface ("replace, don't layer"). Skipped: the issue says "The three existing budget tests stay, adjusted to the returned lines."Outsideseam is wide, with 19 methods; bundle some. Skipped: the issue lists exactly what the seam carries, and bundling would hide the order of a round that the tests check.Outside/RunOutsideare mysterious names. Skipped: the seam is the loop's "outside effects", as the issue's title puts it, and the doc comments say what each one holds.next_repairreturns a positional(String, String). Skipped: it has one private caller, and the doc comment names both parts.pending(Merge)is Feature Envy and belongs onMergein the worktree. Skipped: it maps worktree types for the seam only, and moving it would widen the worktree's interface for one adapter.&mut self. Skipped: the issue decided "The seam's methods take&mut self."Spec
Budgetsfields. Skipped: the issue keeps those three tests explicitly. The interface tests never assert on internal state.Closes #372
🤖 Generated with Claude Code