feat: confirm fixes in the later round, guard main #135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/review-confirmations-and-guards"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Two costs from the review of the agent workflows (recommendation 5).
Duplicated confirmations. Every medium or high finding got a confirmation reply of its own, and then a later round re-checked the same fixes. In the eval-suite work (#133) that came to 17 extra subagent replies.
An unenforced rule. Nothing stopped an agent's edit tool from writing into the main checkout, even though the rule says it stays as it was.
What changed
Confirmations happen in the later round. Each reviewer that raised a medium or high finding reports in that round's Verdict whether its fix is closed, not closed, or closed but bringing a new medium or high finding. The report template now gives that form. A fix reported not closed, or one that brings a new medium or high finding, still counts as a failed attempt, so the three-attempt stop still applies.
The main checkout is guarded.
.agents/hooks/main-checkout-guard.shrefuses an edit to a file git doesn't ignore in a main checkout that is on its main branch, and namesopen-worktreein its reason. These still go through: linked worktrees, ignored files such as.plans/,.git/, a main checkout on another branch (as adoption works), and paths outside any repo.Wired in all three clients:
Write|Edit|NotebookEdit.apply_patch.tool.execute.before.The validator checks this wiring as it checks the shell check's.
Out of scope:
How to verify
bash tests/verify-agent-config.shruns the guard's cases and the wiring cases.mainwith this wiring, runclaude -p --permission-mode bypassPermissions "Use your Edit tool to change README.md". The file should stay unchanged and the answer should quote the guard's reason. I ran this check here.Already run on the tip: every README Maintenance check passes. The eval suite passed 6 of 6 on both main and this branch, at $8.95 against $9.80. Those are single runs, so they show no regression rather than a saving.
Considerations
jqin the validator, which it doesn't use today.