feat(foreman): enforce reviewer execution runs via a no-test-run rail - #1747
feat(foreman): enforce reviewer execution runs via a no-test-run rail#1747Defilan wants to merge 2 commits into
Conversation
The reviewer rubric's Section K mandated two execution runs (run the diff's own new test; probe one near-miss) whenever the diff touches .go files, but the first live Section-K review performed every read and skipped both runs, disclosing the omission in onTrust instead. Numbered step sequences are followed faithfully; checklist prose is treated as advisory, so the execution mandate did not self-enforce. Move the two runs into Step 1 as mandatory items 7-8 so they sit in the numbered sequence the model follows, and add a deterministic review-execution rail (defilantech#1618) that mirrors reviewer_diff_gate.go: for a GO on a .go diff whose transcript never ran `go test`, record the rail skipped and demote GO to NO-GO so the approval does not stand on an unexecuted branch. Non-.go diffs are exempt, keeping docs/YAML-only changes unaffected. The demotion is stamped like scope-overlap (verdictDemoted / verdictDemotedBy / verdictClaimed / demotionReason); it is not inert, so it routes to escalation and can iterate. Fixes defilantech#1618 Signed-off-by: Foreman Bot <chris@mahercode.io>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Human review of the Foreman branch. Two changes needed before this leaves draft, one process note, one minor. 1. Demotion goes beyond what #1618 asked. The issue says "Marking, not demotion, until the fleet shows the runs fit the turn budget." 2. The transcript scan has a false positive that this very PR triggers. 3. The review that opened this PR carries no weight. The reviewer task ended 4. Minor. Finalization: the commit is signed by the Foreman bot. After the two fixes, |
…counts only executed go test (defilantech#1618) The review-execution rail (defilantech#1618) previously demoted a reviewer's GO to NO-GO when a .go diff's transcript carried no `go test` run, stamping verdictDemoted / verdictDemotedBy / verdictClaimed / demotionReason exactly like the scope-overlap demotion rail. Issue defilantech#1618 calls for marking, not demotion, until the fleet shows the runs fit the turn budget. The rail now records the skipped rail on extra (railsSkipped: review-execution: no-test-run), leaves the verdict as the model returned it, and logs that the rail was recorded rather than the verdict rewritten. Demotion is left as a later flip for when transcripts show the runs happening. When extra is nil, it logs that the rail could not record and returns the verdict untouched. The rail also counted a `go test` that was merely mentioned: the tool-role arm matched the string inside ANY tool result, so a read_file of a file whose text carries the literal `go test` (the review_execution_gate_test.go fixtures do exactly that) satisfied the rail with nothing executed. Only a bash tool_call whose arguments are a real `go test` invocation now counts in the assistant arm, and a tool-role message counts only when correlated (via callNameByToolCallID) to a bash tool_call. The regexp is anchored on a command position so `grep "go test" Makefile` no longer counts. Fixes defilantech#1618 Signed-off-by: Foreman Bot <chris@mahercode.io>
|
Re-review of the revision commit (70478bb). Approve. Both findings are addressed as asked, and the revision touched only the three files the review named. 1. Mark, not demote. The four demotion stamps and the NO-GO return are gone; 2. Executed bash only. Assistant tool calls count only when Ran Process note, same as the first round: the in-cluster review of this commit was again marked ungrounded by its own rails (no diff captured, 7 turns, no test run). Once this rail is deployed, that review would carry Ready to leave draft; squash-merge keeps the two Foreman commits as one, as with #1741 and #1751. |
What
Make the reviewer rubric's execution steps enforceable. The two runs Section K asked for (run the diff's own new test; probe one adversarial near-miss) move into Step 1 as mandatory numbered items 7 and 8, and a deterministic rail (
pkg/foreman/agent/review_execution_gate.go) checks the review transcript of any.godiff for ago testinvocation. A GO with no such run is recorded as skipping thereview-executionrail (no-test-run). The three reviewer Agent manifests are themake sync-reviewer-promptsoutput of the rubric change.Why
Refs #1618
The first live Section-K review (
wl-1616-added-lines-review-1616-0) performed every numbered read, skipped both execution runs, and disclosed the omission inonTrust. Numbered step sequences are followed faithfully; checklist prose is treated as advisory. So the mandate has to sit in the numbered sequence, and the transcript has to be checked by code rather than trusted.How
The rail mirrors
reviewer_diff_gate.go: walk the stored transcript, correlate tool results to the assistant tool call that produced them, return a finding, and record a skipped rail through the samerecordRailSkippedmechanism (rail_skip.gogainsrailExecutionandskipReasonNoTestRun). It is wired inexecutor_native.godirectly after the diff gate so its verdict rewrite is what the findings summary reports. Non-.godiffs are exempt; a non-GO verdict is left alone. Tests cover: a Go diff whose transcript rango test(GO stands), one that did not (rail recorded, verdict untouched, no demotion markers), a docs-only diff (exempt), a NO-GO input (untouched), a bash result correlated to a bash call (counts), aread_fileresult containing the literal (does not count), and a grep mention versus acd && go test(only the latter counts).The second commit is a Foreman revision pass driven by the human review below: the rail now marks instead of demoting (the verdict stands, the skipped rail is the record), and the transcript scan counts only executed
bashcommands, correlated through the same tool-call map the diff gate uses, with the regex anchored on a command position so agrep "go test"or aread_fileof a test fixture cannot satisfy it.Checklist
make testpasses locally (verify gate GATE-PASS on the branch; CI green)make lintpasses locally (CI)git commit -s) per DCO (currently signed by the Foreman bot; finalized with a human sign-off viascripts/foreman-finalize.shbefore merge)Assisted-by: Foreman (coder
dsv4-flash-coder, DeepSeek-V4-Flash-Vision-Exp on vLLM) generated the code, tests and rubric edit from a decided design, then applied the human review findings in a second pass through the revise seam (#951); the verify gate ran the full check suite on both commits. The in-cluster reviewer's GO does not count either time: it captured no diff and ran no tests. Human review and the merge are mine.