Repository navigation
fix: deliver only the diff the Judge saw; DOT never closes the card - #180
Merged
Merged
Conversation
- `verify` and `deliver` refuse code that differs from the gated diff.patch (committed or not), so evidence, review and verdict always match what ships. - `gate maker --from-git` refuses to overwrite a gated diff and diffs against the Run's starting commit, so an early commit no longer hides the change. - New `run --reopen --reason` starts a fresh iteration from MAKER_COMPLETE through JUDGED_PASS instead of forcing `run --abandon`. - DOT adapter: delivery never closes the card; reference issues as `Refs #<iid>`, never after a GitLab closing keyword. - Tests: rework-after-pass, dot-no-auto-close; bench sandbox `rework` scenario. 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.
Why
In a real DOT project, a run got stuck after Judge PASS. Test fixes for Devil's Advocate findings changed the diff,
gate maker --from-gitoverwrote the judgeddiff.patch, and the only way out wasrun --abandon. The MR, card and Mattermost steps still went ahead, but the run never passed the delivery gate.We reproduced it on 3.0.1 in scratch repos (same flow as
bench/sandbox/scenario.sh) and found that the e2ehappyscenario never edits code after PASS. Four gaps came up:verifyran on the working tree but recorded evidence against the stalediff.patchhash, so a fix made aftergate makerwas verified while DA and the Judge reviewed the old diffrun --reopendelivernever compared the committed code with the judged diff, so code added after PASS was DELIVERED unjudgedrun --reopengate maker --from-gitwrotediff.patchbefore checking state, so any call after MAKER_COMPLETE corrupted the run permanently, with misleading WHY/FIXrun --reopen --reasonstarts a new iteration and archives the old evidence--from-gitdiffed againstHEAD, so committing before the Maker gate gave "no changes against HEAD" with no WHY/FIXstartedRevisionThe ITERATE path (DA HIGH → Judge ITERATE → iteration 2) was already fine and still works.
Also in this PR
The DOT adapter now states that delivery never closes the card. GitLab closes an issue on merge to the default branch when a commit or MR text says
Closes/Fixes/Resolves/Implements #n. References must now beRefs #<iid>,Related to #<iid>or the bare URL, andglab issue closeis forbidden. The Coreview commit template no longer readsresolve <...>.tests/dot-no-auto-close.test.jsscans every DOT adapter file for closing keywords. (The CHANGELOG line for this already landed with #179; the docs and test did not.)Changes
lib/change-diff.js(new): one diff capture againststartedRevision, shared by the Maker gate,verifyanddeliverlib/gates.js,lib/run-state.js,lib/workflow-runtime.js,bin/ai-engineering-loop.js,lib/cli-args.js: reopen,assertMakerDiffWritable, judged-diff checksskill-src/ael/references/loop-deliver.md,loop-judge.md(and the rebuilt host copies),core/iteration-policy.md: tell the agent to reopen instead of abandoningbench/sandbox: newreworkscenariotests/rework-after-pass.test.js,tests/dot-no-auto-close.test.jsVerification
npm run check:skills: passnpm test: 924/926. The two failures (hosts-registry.test.js:164,setup-run-flags.test.js:33) also fail onmainon this machine, because a localopencodeinstall leaks into host detection.run --reopen→ loop → commit →deliverreaches DELIVERED.🤖 Generated with Claude Code