Skip to content

v1.92.82.0 fix(ship): verify re-derives each merged finding from the reader's output (GST-541) - #3717

Merged
capy-ai[bot] merged 13 commits into
mainfrom
gst-541-verify-binding
Nov 2, 2026
Merged

capy-ai[bot] merged 13 commits into
mainfrom
gst-541-verify-binding

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3717,
  "head": "3fefd1faa78a1d80bf8da0155840340d2e1d9803",
  "version": "1.92.66.0",
  "base": "main",
  "gate": {
    "pregate.json/remote_gate": {
      "pass": 3582,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "a6c66c05aa2e9e248ac0f82f477e862108383c55",
  "product_patch_id": "67cf9063d9fd8f822f35c1cc3adeff5ff80ce02e",
  "gstack_version": "1.92.65.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 83,
    "rules": "551486253e156572",
    "base": "3d99c224972942c447c1f94c9061da900e667aab",
    "registry": "3d99c224972942c447c1f94c9061da900e667aab",
    "gate_scan": {
      "tagged": 0,
      "head": "3fefd1faa78a1d80bf8da0155840340d2e1d9803"
    },
    "reasons": [
      "risk:money",
      "runtime=83"
    ],
    "risk": [
      "money"
    ]
  },
  "pregate": "requires-remote cleared @a6c66c05aa2e (1 checks, current for 3fefd1faa78a)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41444182550/job/125273092716",
    "pregate.json/remote_gate: remote-gate tree=a6c66c05aa2e tests=5968"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      3701
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md (verify docs: docs/review-policy.md, ship/DRIVER.md, ship/sections/adversarial.md, capy/skill/gstack/SKILL.md)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 9,
    "deferred": 1,
    "noted": 3,
    "fixed": 11,
    "scope": "frozen",
    "fix_checks": 6,
    "rounds": 8,
    "dispatches": {
      "specialist": 1,
      "targeted": 4,
      "fix-check": 7,
      "adversarial-native": 2,
      "specialist-batched": 1,
      "red-team": 1,
      "outside-voice": 1
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "c82addff6fb60fa0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "348eba6f233f8f9a326cb78b98957bee4038bdc9",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  },
  "carry": {
    "from": "5d2ba4f6f2b4e97f9ede69f6f1d9e4c747b7c81a",
    "reason": "base merge + base context moved (scoped review by google/gemini-4-argon: lib/review-ledger.ts) + release metadata",
    "product_patch_id": "67cf9063d9fd8f822f35c1cc3adeff5ff80ce02e",
    "changed_paths": [
      "metadata:CHANGELOG.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:bin/gstack-checks",
      "product:bin/gstack-developer-profile",
      "product:bin/gstack-diff-scope",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-gate-diff",
      "product:bin/gstack-patch-names",
      "product:bin/gstack-pregate",
      "product:bin/gstack-retro-metrics",
      "product:bin/gstack-review-plan",
      "product:bin/gstack-review-scope",
      "product:bin/gstack-skill-name.sh",
      "product:bin/gstack-uninstall",
      "product:capy/skill/gstack/SKILL.md",
      "product:docs/designs/HONEST_WORK_GATE_INTEGRITY.md",
      "product:docs/pregate.md",
      "product:docs/review-policy.md",
      "product:docs/ship-policy.md",
      "product:docs/skills.md",
      "product:docs/troubleshooting.md",
      "product:docs/unattended.md",
      "product:health/SKILL.md",
      "product:health/SKILL.md.tmpl",
      "product:lib/capy-review-pass.js",
      "product:lib/checks.ts",
      "product:lib/gate-diff/git.ts",
      "product:lib/headless-artifacts.ts",
      "product:lib/pregate/config.ts",
      "product:lib/pregate/index.ts",
      "product:lib/result-codes-release.ts",
      "product:lib/review-brief.ts",
      "product:lib/review-collect.ts",
      "product:lib/review-depth.ts",
      "product:lib/review-ledger.ts",
      "product:lib/review-risk.ts",
      "product:lib/review-scope.ts",
      "product:lib/sealed-guard.ts",
      "product:lib/sealed-join.ts",
      "product:lib/ship-preflight.ts",
      "product:lib/ship-receipt-depth.ts",
      "product:lib/ship-receipt.ts",
      "metadata:package.json",
      "product:retro/SKILL.md",
      "product:retro/SKILL.md.tmpl",
      "product:scripts/psychographic-signals.ts",
      "product:setup",
      "product:ship/DRIVER.md",
      "product:ship/DRIVER.md.tmpl"
    ],
    "merge_commits": 1,
    "range_diff": "1:  1b53e50c =  1:  1b53e50c fix(ship): verify re-derives each merged row by index (GST-541)\n 2:  5391c13e =  2:  5391c13e fix(ship): verify fails closed on a missing output, a forged merged copy and uncollected rows (GST-541 review)\n 3:  29ba2981 =  3:  29ba2981 fix(ship): a missing recorded output file is dirty even with no findings (GST-541 fix-check)\n 4:  3449fb16 =  4:  3449fb16 fix(ship): a reply collect refused as no review keeps its NOT_REVIEWED row (Rule 25 with #3701)\n 5:  56ed6e32 =  5:  56ed6e32 fix(ship): only a reply refused for its tree skips verify's count check (GST-541 fix-check)\n 6:  50dc73cd =  6:  50dc73cd fix(ship): verify re-derives a tree refusal from the reply before it skips the count check or voids an output (GST-541 fix-check 2)\n 7:  b30df5c9 =  7:  b30df5c9 fix(ship): an output with no readable recorded file is dirty even with no ids (GST-541 fix-check 3)\n 8:  f4820120 =  8:  f4820120 fix(ship): verify accepts an output as a review only when its reply names the render's tree (GST-541 red team)\n 9:  5d2ba4f6 =  9:  5d2ba4f6 fix(review-ledger): judge binding compares real paths, so a run reached through a symlink verifies clean",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "80a2eb808922aceffb72d1510ad5f317f37f5d95"
    ]
  }
}

What changed

A merged.jsonl edited after collect (a CRITICAL lowered to INFORMATIONAL) verified clean at main; verify now re-derives the row and reports it dirty

A merged.jsonl edited after collect (a CRITICAL lowered to INFORMATIONAL) verified clean at main; verify now re-derives the row and reports it dirty.

Text version

Before (main c830c9b):

$ gstack-review-dispatch verify --ledger review-ledger.jsonl   # merged.jsonl edited: CRITICAL blocker lowered to INFORMATIONAL, judged INFORMATIONAL
BRIEF specialist/testing MATCH rendered=8245632758fa sent=8245632758fa
OUTPUT specialist/testing MATCH sha=6f9db5a6a0a4 findings=2
JUDGE - OK dropped=[] downgraded=[] added=0 promoted=0 folded=0
VERIFY: clean briefs=1 outputs=1 voided=0

After:

$ gstack-review-dispatch verify --ledger review-ledger.jsonl   # the same edited merged.jsonl, judged INFORMATIONAL
BRIEF specialist/testing MATCH rendered=8245632758fa sent=8245632758fa
OUTPUT specialist/testing MISMATCH sha=6f9db5a6a0a4 findings=2 merged_line_differs=["specialist/testing#1"]
JUDGE - MISMATCH dropped=[] downgraded=[] added=0 promoted=0 folded=0 merged_line_differs=["specialist/testing#1"]
VERIFY: dirty briefs=1 outputs=1 voided=0

Why

GST-541: "a forged row can rewrite a finding's label or text and still verify clean." Verify is the check that proves no reviewer's blocker was dropped on the way to the judged set, but it only compared output hashes and line counts. Now it re-reads each reader's unchanged reply and checks every merged row against it, so lowering a blocker in merged.jsonl, or editing the ledger's output event to hide one, makes verify dirty.

Blast radius

Only verify in lib/review-ledger.ts changes; collect, judge and the CLI output format are untouched, and a /ship run whose files nobody edited verifies exactly as before (the remote gate ran 3,582 selected tests at 5d2ba4f and 5,968 after the last main merge, all with 0 failures). The stricter rules can only turn clean into dirty. An output with no readable recorded file, or a finding count that no longer matches its ids, is now dirty. The CLI always records the file, and a reply refused for naming the wrong checkout (#3701) still verifies NOT_REVIEWED and is voided by a re-sent review, which the new test covers.

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Rule 19: merge current main into #3717 once to clear the #3701 conflict “You have a written Rule 19 grant from me: merge current main into the branch once (no rebase, no force-push), resolve the conflict keeping both sides' intent, and rerun the affected tests” (GStack Minder (GSTA-36)) approved one main merge into gst-541-verify-binding none
2026-11-02 Rule 19: merge main 0c84f4e into #3717 once, then plan steps 1-5 “one plain `git merge 0c84f4e…`, then the plan you described, then a fresh READY. No rebase and no force-push.” (GStack Minder (GSTA-36)) approved one main merge at 0c84f4e, rebind and targeted money rerun none
2026-11-02 R51: one scoped cross-family fix-check after round 2 (f482012, 5d2ba4f) “do it. That's one scoped cross-family fix-check under rule 23, read-only, on the touched hunks of f482012 and 5d2ba4f only. Anything it finds ships as an open note in the PR body and READY, with no further rounds.” (GStack Minder (GSTA-36)) approved one read-only fix-check on the touched hunks of f482012 and 5d2ba4f none
2026-11-02 Rule 19: one merge of main 3d99c22 (post-train-87) into #3717 “Rule 19 grant: one merge of main at 3d99c22 (v1.92.76.0, post-train-87) into #3717, with the resolution you prepared. Push it as an ordinary merge commit: no rebase, no force-push.” (GStack Minder (GSTA-36)) approved one main merge at 3d99c22 with the prepared lib/review-ledger.ts resolution none
2026-11-02 Rule 27: cross-family trail review at 3fefd1f “Run it once, read-only, at 3fefd1f. Send READY at the same pin if it's clean or below the floor; anything at the floor comes to me before any edit. Cap: $10 more for this step.” (GStack Minder (GSTA-36)) approved one read-only cross-family trail review none

Source: gstack-approvals record for gst-541-verify-binding (display only; not an approval citation).

Summary

Verify re-derives each merged row by index from the unchanged reply (merged_line_differs), and treats a missing or unrecorded output file, a judgment on a copy of merged.jsonl, merged rows collect never wrote, and a finding count that differs from the recorded ids as dirty. Main's #3701 merged in once under a Rule 19 grant; the only conflict was the test file's imports, and both sides were kept. Three cross-family fix-checks after the merge each found a way to hide a blocker by editing the ledger's output event (review: false, a forged tree_ok: false plus a re-sent review, and a dropped file). Each one has a failing-first test, and verify now re-checks a wrong-tree refusal against the reply's own REVIEWED_TREE line instead of trusting the event's fields.

Main moved again (0c84f4e, v1.92.66.0) and was merged in once more under a second Rule 19 grant; the only conflict was the review-brief import line, resolved to main's line. gstack 1.92.65 then required full review depth for this money-path file. That review found two more defects, each fixed with a failing-first test: verify still trusted the output event's editable tree_ok when it accepted an output as a review (now re-derived from the unchanged reply everywhere), and the judge binding compared path strings, so a clean run reached through a symlinked run directory verified dirty (now compared by real path).

A third Rule 19 merge brought in main 3d99c22 (v1.92.76.0) with #3845. The only conflict was one doc comment in lib/review-ledger.ts, where #3845's ledgerBlockers block met this PR's reviewed() comment; both were kept. A scoped cross-family review (google/gemini-4-argon) of that splice came back clean, and the receipt was carried from 5d2ba4f.

Test Coverage

All new code paths have test coverage. test/review-dispatch.test.ts adds two tests: the forged-merged-row cases (each verified clean at main c830c9b), and the edited-output-event cases plus a genuine wrong-tree reply that stays NOT_REVIEWED and is then voided by a re-sent review. Regression proof: the output-event test failed at 721539c, 56ed6e3 and 50dc73c (one new case each) and passes at b30df5c. After the second merge, the same test gained a refused-output-edited-to-accepted case (failed at 781b626) and a clean run collected and judged through a symlinked run directory (failed at f482012); both hold at 5d2ba4f.

Tests ran: remote gate 3582 (0 failed, tree 80a2eb808922)
Tests ran: review-dispatch, review-pass, review-targeted 119 (0 failed)

Pre-Landing Review

Pass 1 (specialist, targeted, adversarial) found 5 blocking items, all fixed before the merge. After the merge, the cross-family fix-check on the NOT_REVIEWED edit (openai/gpt-6.1-sol, then google/gemini-4-argon after OpenAI's filter refused the third round) found one blocker per round in three rounds, each fixed with a failing-first test. The fourth round at b30df5c found nothing, and the targeted money reader (classes=money, from the ledger path) returned NO FINDINGS at b30df5c. After the second main merge, the full-depth review at 781b626 (batched specialist and red team) found one blocker, fixed in f482012. The Step 11 voices at f482012 (adversarial, outside voice on google/gemini-4-argon, targeted money) found one more, fixed in 5d2ba4f, plus two notes listed below. One scoped cross-family fix-check (google/gemini-4-argon, granted by GStack Minder) on the touched hunks of both fixes and the targeted money reader both returned NO FINDINGS at 5d2ba4f.

REVIEW_LOOP: passes=2 blocking_found=9 deferred=1 noted=3 fixed=11 scope=frozen fix_checks=6 dispatches=17
Gate edits: none detected (GATE_SCAN tagged=0)
Outside review: cross-family fix-checks by openai/gpt-6.1-sol and google/gemini-4-argon; final verdict FIXCHECK: blocking=0 informational=0 at 5d2ba4f.

Deferred findings

Blocking findings in code this PR did not change (review scope: frozen); filed as issues and not closed by this PR.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL lib/review-ledger.ts verify depends on the installed parseFindings version, so a parser change can move a count
  • INFORMATIONAL lib/review-ledger.ts a refusal retry that overwrites its output path stays dirty (also at main)
  • INFORMATIONAL lib/review-ledger.ts the collect API without an output file now fails verify with output_file_unrecorded (the CLI always records one)
  • INFORMATIONAL docs/review-policy.md an actor who rewrites both a reply file and its ledger event's hashes still verifies clean; nothing outside the ledger anchors a reply (the same gap as Deferred review finding: lib/review-ledger.ts:314 — deleting a whole output event with its merged rows verifies clean (n #3719)

Issues

Refs #3701

Documentation

Status: current. The read-only re-audit at 50dc73c found no corrections needed, and no files were edited.

Scope: committed diff 2d1b55d..50dc73c on gst-541-verify-binding (lib/review-ledger.ts, test/review-dispatch.test.ts, docs/review-policy.md, changelog.d/gst-541-verify-binding.md). Nothing was staged, unstaged or untracked. Docs that describe gstack-review-dispatch verify were found by grep: docs/review-policy.md, ship/DRIVER.md(.tmpl), ship/sections/adversarial.md(.tmpl), capy/skill/gstack/SKILL.md.

Documentation health:

  • docs/review-policy.md: current. Item 5 describes the per-row binding (merged_line_differs), output_file_missing, judge_merged_not_collected, merged_rows_not_collected, the merged_count_differs count check, the wrong-tree exemption re-derived from the reply, and the known gap for a deleted output event.
  • changelog.d/gst-541-verify-binding.md: current (reviewed only)
  • ship/DRIVER.md, ship/DRIVER.md.tmpl: current
  • ship/sections/adversarial.md.tmpl: current
  • capy/skill/gstack/SKILL.md: current

Documentation coverage:

  • verify per-row binding and count check: reference yes (docs/review-policy.md), how-to no, tutorial no, explanation partial (the rationale is inline in item 5). These are internal gate checks, so reference coverage is enough.

Debt: docs/review-policy.md is reachable only through other docs, not from README.md or CLAUDE.md (true before this PR). Deleting a whole output event still verifies clean; this is documented as known and tracked in #3719.

Diagram drift: none.

Test plan

garrytan and others added 3 commits October 31, 2026 18:05
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…opy and uncollected rows (GST-541 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ngs (GST-541 fix-check)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 9 commits October 31, 2026 18:44
…D row (Rule 25 with #3701)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	test/review-dispatch.test.ts
…ck (GST-541 fix-check)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…skips the count check or voids an output (GST-541 fix-check 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…h no ids (GST-541 fix-check 3)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…verify-binding

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	test/review-dispatch.test.ts
…ames the render's tree (GST-541 red team)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ed through a symlink verifies clean

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…verify-binding

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

# Conflicts:
#	lib/review-ledger.ts
@github-actions github-actions Bot changed the title fix(ship): verify re-derives each merged finding from the reader's output (GST-541) v1.92.82.0 fix(ship): verify re-derives each merged finding from the reader's output (GST-541) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit 26539fb into main Nov 2, 2026
45 checks passed
garrytan added a commit that referenced this pull request Nov 2, 2026
…7, after #3717)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot added a commit that referenced this pull request Nov 2, 2026
…side gate and risk reviews (GST-987) (#3869)

* fix(review-ledger): a finding's Severity field sets its label, body severity words never raise it (GST-976)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-ledger): Severity counts only in field position, locus-first and emoji-led labels lead, an inline field floors the next (GST-976 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-ledger): linear lead-label prefix, all-caps leads before a space, fields after a parenthesis or without a colon at the line start (GST-976 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-ledger): a lead's file:line has no runaway backtracking and may be a range; a mid-line Severity field must close its clause (GST-976 review)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-ledger): a field at the line's start needs no closing clause; mid-line fields accept : / and → after the label (GST-976 fix-check)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: changelog fragment and review-policy collect step for GST-976

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-ledger): a Severity field's label chain (High/Critical) takes its strongest label; mid-line fields keep the clause-closing set (GST-976 scoped check)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review-ledger): never weaker than main invariant over pinned inputs, fixtures and generated field shapes; a multi-label Severity field counts as none, lowercase fields keep their label (GST-976)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: GST-976 re-audit, multi-label and lowercase Severity fields

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: native FIXABLE raises only on gate and risk review classes (GST-987)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: collect records fixable_raises:false so a later re-derive uses the same class (GST-987)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: GST-987 review fixes: history/floor reasons and FIXABLE-only fields keep v2; manifest must name this ledger

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: GST-987 round-2 fixes: FIXABLE relaxes only beside Blocks: no; raw FIXABLE heading; unreadable manifest keeps v2

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: GST-987 fix-check: items under a FIXABLE heading need Blocks: no; Blocks: no-op is not Blocks: no; wrong-tree collect with an unreadable manifest

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs: GST-987 docs audit: depth section notes the native FIXABLE exception

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: a paragraph under a numbered finding heading joins it, so its fields attach (gstack-evals #149, GST-987)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: verify re-derives native labels with the collect's class (GST-987, after #3717)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: #149 join stops at a labeled or located paragraph and after the fields (GST-987)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test: GST-987 #149 sibling shapes as named never-weaker invariant fixtures

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* chore: drop the released GST-976 changelog fragment carried by the stack

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant