test-reviewer must judge only the test-writer's own diff, not the whole working tree against HEAD #597

Open
opened 2026-09-15 15:29:42 +00:00 by jared · 1 comment
Owner

VERDICT: CREATE — Data-loss hard floor: unrecoverable destructive git checkout of un-committed production work, distinct scope from #556.

test-reviewer must judge only the test-writer's own diff, not the whole working tree against HEAD [capture]

Context

In the poodr-ticket-implementation map, a failed behavior-verifier sends the run back to test-writer for a second red round. At that point the working tree can hold the programmer's production changes from the first increment. These changes are uncommitted, because the ADR-0171 commit step is opt-in and off. The test-reviewer charter says the test set "changes no production code". The reviewer checks this against HEAD. It sees the programmer's production diff and rejects the round for a reason the test-writer did not cause. Ticket #556 already proposes a start_commit column so runner diffs (code_changes, test_changes) use the implementation's open commit instead of HEAD. This ticket covers the test-reviewer and test-writer charters, and the destructive action the test-writer took in response.

Observed

Implementation 21 on ticket #595, session 3affeb44-19f4-4275-8c3a-d51963d17139, 2026-09-15.
Dispatch 268 (programmer) passed green: gate diff-test exit 0, lint exit 0. It modified plugins/os-sdlc/lib/os_sdlc/project.rb and plugins/os-sdlc/lib/os_sdlc/project/config.rb.
Dispatch 269 (behavior-verifier) failed on outstanding tasks and routed the run back to test-writer.
Dispatches 271, 273, and 275 (test-reviewer) each returned fail. The reviewer ran git diff -- plugins/os-sdlc/lib and saw the programmer's production changes still in the tree.
Dispatch 274 (test-writer) ran the command below and reported: "Reverted the illegal production changes".

/usr/bin/git checkout -- plugins/os-sdlc/lib/os_sdlc/project.rb plugins/os-sdlc/lib/os_sdlc/project/config.rb

The run ended implementation_failed, reason bound_exhausted:test-reviewer/fail, after 12 dispatches. The programmer's increment was never committed or stashed, so it is unrecoverable from git.

Reproduce

any ticket where behavior-verifier fails once after a green programmer round, with commit_on_complete off

Expected

The test-reviewer must compare the tree against the test-writer dispatch's own start point, not HEAD, once #556's start_commit exists. Until then, the test-reviewer and test-writer charters must state plainly: production changes present in the tree before the dispatch started are not the test-writer's, and must never be reverted, checked out, or restored by any pipeline agent that did not itself write them.

Owner sketch

The reviewer half shipped 2026-09-15 (commit on main: maps enrich test_changes for test-reviewer; charter judges only supplied facts and settles error with MISSING when a fact is absent). What remains is the mechanical invariant "test-writer changed nothing under code_path", enforced by the test-writer gate against a per-dispatch base:

module OsSdlc
  module Git
    class Repo
      def snapshot_tree   # GIT_INDEX_FILE=<tmp> git add -A && git write-tree; no index, tree, or stash change
    end
  end
  class Runner
    class Dispatch       # new column start_tree (schema 24), written at subagent-start
    class GateCommands
      def code_unchanged_since(dispatch)   # git diff --name-only <start_tree> -- <code_path> must be empty
    end
  end
end

Map: test-writer gates gain { gate: code-untouched, expect: empty } (name open). Charter test-writer: "Never checkout, restore, or reset any file. Files changed before your dispatch are not yours."

Cases

  1. Given a dispatch starts with uncommitted production changes from an earlier dispatch, when subagent-start runs, then the dispatch row records a start_tree and the working tree, index, and stash are unchanged.
  2. Given a test-writer dispatch that adds only test files on top of an earlier production increment, when its gate runs, then the code-untouched step passes.
  3. Given a test-writer dispatch that edits a file under code_path, when its gate runs, then the code-untouched step fails naming the file.
  4. Given the implementation's first dispatch, when #556 needs a start commit, then start_tree of that dispatch is the base (cross-reference, no new work).

Origin

  • Trigger: implementation_failed on ticket #595.
  • Improvised this session: none.
  • Chain: programmer's uncommitted increment destroyed ← test-writer ran git checkout obeying the reviewer's fail ← reviewer diffed the whole tree against HEAD, not its own dispatch's start point ← DESIGN: no per-dispatch diff base for judgment agents (ADR-0171 commit step is opt-in and off).
  • Root candidate: ticket #556 covers the diff-base mechanism; this ticket covers the reviewer/test-writer charter wording and the checkout prohibition, which #556 does not mention.
  • Where: plugins/os-sdlc/agents/test-reviewer.md, plugins/os-sdlc/agents/test-writer.md, plugins/os-sdlc/lib/os_sdlc/runner (brief_facts / gate diff base).
  • Session: 3affeb44-19f4-4275-8c3a-d51963d17139
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/3affeb44-19f4-4275-8c3a-d51963d17139.jsonl
VERDICT: CREATE — Data-loss hard floor: unrecoverable destructive git checkout of un-committed production work, distinct scope from #556. # test-reviewer must judge only the test-writer's own diff, not the whole working tree against HEAD [capture] ## Context In the poodr-ticket-implementation map, a failed behavior-verifier sends the run back to test-writer for a second red round. At that point the working tree can hold the programmer's production changes from the first increment. These changes are uncommitted, because the ADR-0171 commit step is opt-in and off. The test-reviewer charter says the test set "changes no production code". The reviewer checks this against HEAD. It sees the programmer's production diff and rejects the round for a reason the test-writer did not cause. Ticket #556 already proposes a `start_commit` column so runner diffs (`code_changes`, `test_changes`) use the implementation's open commit instead of HEAD. This ticket covers the test-reviewer and test-writer charters, and the destructive action the test-writer took in response. ## Observed Implementation 21 on ticket #595, session 3affeb44-19f4-4275-8c3a-d51963d17139, 2026-09-15. Dispatch 268 (programmer) passed green: gate diff-test exit 0, lint exit 0. It modified `plugins/os-sdlc/lib/os_sdlc/project.rb` and `plugins/os-sdlc/lib/os_sdlc/project/config.rb`. Dispatch 269 (behavior-verifier) failed on outstanding tasks and routed the run back to test-writer. Dispatches 271, 273, and 275 (test-reviewer) each returned fail. The reviewer ran `git diff -- plugins/os-sdlc/lib` and saw the programmer's production changes still in the tree. Dispatch 274 (test-writer) ran the command below and reported: "Reverted the illegal production changes". ``` /usr/bin/git checkout -- plugins/os-sdlc/lib/os_sdlc/project.rb plugins/os-sdlc/lib/os_sdlc/project/config.rb ``` The run ended `implementation_failed`, reason `bound_exhausted:test-reviewer/fail`, after 12 dispatches. The programmer's increment was never committed or stashed, so it is unrecoverable from git. ## Reproduce ``` any ticket where behavior-verifier fails once after a green programmer round, with commit_on_complete off ``` ## Expected The test-reviewer must compare the tree against the test-writer dispatch's own start point, not HEAD, once #556's `start_commit` exists. Until then, the test-reviewer and test-writer charters must state plainly: production changes present in the tree before the dispatch started are not the test-writer's, and must never be reverted, checked out, or restored by any pipeline agent that did not itself write them. ## Owner sketch The reviewer half shipped 2026-09-15 (commit on main: maps enrich test_changes for test-reviewer; charter judges only supplied facts and settles error with MISSING when a fact is absent). What remains is the mechanical invariant "test-writer changed nothing under code_path", enforced by the test-writer gate against a per-dispatch base: module OsSdlc module Git class Repo def snapshot_tree # GIT_INDEX_FILE=<tmp> git add -A && git write-tree; no index, tree, or stash change end end class Runner class Dispatch # new column start_tree (schema 24), written at subagent-start class GateCommands def code_unchanged_since(dispatch) # git diff --name-only <start_tree> -- <code_path> must be empty end end end Map: test-writer gates gain `{ gate: code-untouched, expect: empty }` (name open). Charter test-writer: "Never checkout, restore, or reset any file. Files changed before your dispatch are not yours." ## Cases 1. Given a dispatch starts with uncommitted production changes from an earlier dispatch, when subagent-start runs, then the dispatch row records a start_tree and the working tree, index, and stash are unchanged. 2. Given a test-writer dispatch that adds only test files on top of an earlier production increment, when its gate runs, then the code-untouched step passes. 3. Given a test-writer dispatch that edits a file under code_path, when its gate runs, then the code-untouched step fails naming the file. 4. Given the implementation's first dispatch, when #556 needs a start commit, then start_tree of that dispatch is the base (cross-reference, no new work). ## Origin - Trigger: `implementation_failed` on ticket #595. - Improvised this session: none. - Chain: programmer's uncommitted increment destroyed ← test-writer ran `git checkout` obeying the reviewer's fail ← reviewer diffed the whole tree against HEAD, not its own dispatch's start point ← DESIGN: no per-dispatch diff base for judgment agents (ADR-0171 commit step is opt-in and off). - Root candidate: ticket #556 covers the diff-base mechanism; this ticket covers the reviewer/test-writer charter wording and the checkout prohibition, which #556 does not mention. - Where: plugins/os-sdlc/agents/test-reviewer.md, plugins/os-sdlc/agents/test-writer.md, plugins/os-sdlc/lib/os_sdlc/runner (brief_facts / gate diff base). - Session: 3affeb44-19f4-4275-8c3a-d51963d17139 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/3affeb44-19f4-4275-8c3a-d51963d17139.jsonl
Author
Owner

Scope narrowed 2026-09-15: the reviewer-side fix shipped on main (test_changes enriched, charter forbids commands, MISSING error). Remaining scope is the gate-side code-untouched invariant on a per-dispatch start_tree.

Scope narrowed 2026-09-15: the reviewer-side fix shipped on main (test_changes enriched, charter forbids commands, MISSING error). Remaining scope is the gate-side code-untouched invariant on a per-dispatch start_tree.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#597
No description provided.