fix(dev-auto): commit must match the reviewed diff; declare scope expansion (#2563)

- step-04 finalize: commit every file in the reviewed diff, tracked and
  untracked; verify and amend if any reviewed file is missing. Leftover
  porcelain entries are by definition not part of the change: left in
  place, never committed/deleted/gitignored, declared as residual
  artifacts (the next run's step-01 clean-tree check is the enforcement
  point)
- handoff report: the implementation subagent declares any files
  changed beyond the spec's tasks and why each was needed; triage and
  the human judge the reasons under the intent-authority rule

Observed in a live run: a new test file was left untracked, so the
commit omitted a file the review had approved; the same run expanded
scope beyond the spec (correctly, per the repo's architecture) with no
declaration anywhere.
This commit is contained in:
Alex Verkhovsky
2026-07-06 07:17:22 -07:00
committed by GitHub
parent 56a081fcaa
commit cf5415551b
2 changed files with 2 additions and 2 deletions
@@ -49,7 +49,7 @@ Launch a subagent with no prior conversation context, with this prompt:
> - Do not revert or overwrite changes unrelated to this spec.
> - Run the verification described in the spec, plus focused checks for the code you touched.
>
> When done, report: files changed with one line each, verification commands run and their outcomes, anything you could not complete and why, and residual risks.
> When done, report: files changed with one line each, verification commands run and their outcomes, any files changed beyond the spec's tasks and why each was needed, anything you could not complete and why, and residual risks.
"""
# Review layers for the review step. `instruction` is the layer's whole
@@ -86,7 +86,7 @@ Prepare `Auto Run Result` details:
Set `{spec_file}` frontmatter `followup_review_recommended` from the judgment above.
If version control is available, commit. Do not push.
If version control is available, commit every file in the reviewed diff — tracked and untracked. Do not push. After committing, verify the commit contains each file from the reviewed diff; if any is missing, add it and amend before proceeding. Anything still visible in `git status --porcelain` is by definition not part of the change: leave it in place — do not commit, delete, or gitignore it — and list it under `Auto Run Result` as residual artifacts.
Capture `final_revision` (current HEAD after committing, or `NO_VCS` if version control is unavailable) into `{spec_file}` frontmatter.