Skip to content

review collect: a 'Finding N' lead keeps its own Severity and Blocks lines (GST-1657) - #4089

Merged
capy-ai[bot] merged 4 commits into
mainfrom
gst-1657-finding-heading
Nov 6, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
gst-1657-finding-heading

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4089,
  "head": "debf73a0250eed9bd9d7939f2a656857006afd86",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "ledger": {
      "pass": 194,
      "fail": 0,
      "skip": 0
    },
    "tests": {
      "pass": 1614,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "tests",
      "run": 42265852962,
      "attempt": 1,
      "tree": "5d0cf1c88a695d3c7a8a649bda7f892cdd619b1b"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "5d0cf1c88a695d3c7a8a649bda7f892cdd619b1b",
  "product_patch_id": "51062e250fc131fea0b48d768f1d0cb895fb5cf6",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 28,
    "rules": "70895942bb8a8ee2",
    "base": "9ceec3f05e4a960d023b3140d6f7a28ed06662d5",
    "registry": "9ceec3f05e4a960d023b3140d6f7a28ed06662d5",
    "gate_scan": {
      "tagged": 0,
      "head": "debf73a0250eed9bd9d7939f2a656857006afd86"
    },
    "reasons": [
      "risk:money",
      "runtime=28"
    ],
    "risk": [
      "money"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @5d0cf1c88a69 (7 checks, current for debf73a0250e)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42265852962/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=5d0cf1c88a69 tests=36005 skipped=92 runs=42265852962/1 profiles=ci-reuse/free-tests heads=debf73a0250e verified=2026-11-06T18:02:46.824Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md (branch diff main...HEAD)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 7,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "ledgers_read": 6,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "30e6bce187be0d59",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "51062e250fc131fea0b48d768f1d0cb895fb5cf6",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

What changed

The captured #248 native output: the Finding 1 fields no longer split off a phantom record, so the finding collects Medium with Blocks: no instead of CRITICAL

The captured #248 native output: the Finding 1 fields no longer split off a phantom record, so the finding collects Medium with Blocks: no instead of CRITICAL.

Before/after as text: The captured #248 native output: the Finding 1 fields no longer split off a phantom record, so the finding collects Medium with Blocks: no instead of CRITICAL
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 parseFindings(adversarial-native) on the captured #248 native output:
+  #1 Medium    Blocks: no stated=yes  Finding 1 (FIXABLE): a re-run session's sink copy mixes the new trial.
+  #2 Low       Blocks: no stated=yes  Finding 2 (INVESTIGATE): the sink copy runs only once, at the end of `
-  #1 CRITICAL  Blocks: no stated=no   Finding 1 (FIXABLE): a re-run session's sink copy mixes the new trial.
-  #2 Medium    Blocks: no stated=yes  The fix: in `copyToSink`, or in run.ts before the copy, `rmSync` each 
-  #3 Low       Blocks: no stated=yes  Finding 2 (INVESTIGATE): the sink copy runs only once, at the end of `
 

The review collector now treats a native finding lead that names its number (**Finding 1 (FIXABLE): …**, ### Finding 1 …) as a numbered finding heading, the way it already treated **1. …** (GST-1031). Its body stays on the finding until its Severity and Blocks lines come, so those lines land on the finding they belong to. A line right under a numbered heading that carries its Severity and Blocks fields, with no other label and no file:line, joins the heading at the stronger label instead of starting a phantom record. Two review fixes narrow that join: a located line there stays a finding of its own, and a heading that names CRITICAL or P0 itself keeps its blocker.

Why

gstack-evals #248 (GEVA-358, p2/adversarial-native#1) blocked /ship until someone granted a review-loop exception by hand. The native reader wrote **Finding 1 (FIXABLE): …**, a numbered repro and two more paragraphs, then Severity: Medium and Blocks: no on their own lines. Because that lead was not a numbered heading, the body reset the open finding, the fields started a phantom Medium record and the finding itself collected CRITICAL from FIXABLE. Now it collects Medium with no blocker, as its reader wrote.

Blast radius

parseFindings in lib/review-ledger.ts runs in every /ship and /review collect. The fact that makes this safe is a replay that ran: GST-1628's no-loss script over its 296 captured outputs gives 0 label diffs (only the 3 new test/fixtures/review-ledger/gst-1657/* fixtures move), and an extended replay over 585 distinct captured outputs moves only 3 outputs, all this shape, with no CRITICAL a reader rated as blocking lost. Both replays give identical results before and after the two review fixes (evidence: handoffs/GST-1657/ in the GStack Minder drive). FIXABLE still raises to CRITICAL when the finding states Blocks: yes, states a Severity with no Blocks: no on a raising class (GST-987), or states no fields. Inline fields after a blank line keep GST-1406's rule.

Approvals

No approvals recorded for branch gst-1657-finding-heading.

Summary

A native finding led by **Finding N (…)** lost its own Severity and Blocks lines to a phantom record, so it collected CRITICAL and blocked /ship. The lead now counts as a numbered heading, the fields stay on their finding, and the review fixes keep a located line and a reader-stated CRITICAL heading out of the new join. Refs GST-1657.

Test Coverage

[+] lib/review-ledger.ts
  NUMBERED_HEAD: Finding N bold lead [★★★] ; ### Finding N [★★★] ; legacy numbered [★★★]
  inline-field join: joins at stronger label [★★★] ; Blocks: yes CRITICAL [★★★] ; Severity-only raise [★★★] ; foreign-label line no lower [★★★] ; next heading splits [★★★] ; [GAP] afterGap guard
[+] flow: #248 collect→judge→blockers [★★★] ; judge lowering with reason [★★★]
COVERAGE 9/10 (90%) value 9/10 (90%)

Coverage: 90% value-weighted (90% including 0 weakly covered paths), from the Step 7 audit at 3088586 (audit-only, no tests generated).
Test value: 0 tests written, 1 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered (weak = ★, gate-failing or unrated). The review fixes then extended test/review-native-finding-heading.test.ts with two negative controls: a located line under a Finding N lead stays its own record and judge refuses lowering the lead (fails on 3088586, passes after 3134e1f), and a heading that names CRITICAL keeps its blocker when an unrelated Blocks: no line follows directly.
Remaining gap: the afterGap guard (a field line after a blank line under a bare heading) has no test; value card: protects=the join applies only to the line directly under its heading; fails_when=the !afterGap guard is dropped; why_new=no blank-line case; seam=none; no_claim=other lead spellings.
Tests ran: ledger 194
Tests ran: tests 1614 (test files, carried from CI run 42265852962/1 at tree 5d0cf1c88a69)

Pre-Landing Review

Pre-Landing Review: 9 issues — 2 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 7 noted

  • [AUTO-FIXED] lib/review-ledger.ts:241 (p1/red-team#1, INFORMATIONAL) a located labeled line directly under a Finding N lead folded into it with its own fields, and judge() then accepted lowering the lead → the join refuses a file:line, as the blank-line branch does; negative control added (3134e1f). QA reproduced it before the fix and passes after.
  • [AUTO-FIXED] lib/review-ledger.ts:241 (v1/outside-voice#3, CRITICAL, Blocks: yes) under a heading that names CRITICAL, a directly following unrelated paragraph's Blocks: no joined it and ledgerBlockers() stopped counting the blocker → the no-gap join skips a heading whose own text names CRITICAL or P0, matching main; control added (f5ad0d1).
  • Noted: fc1/fix-check#1 (INFORMATIONAL) the LOCUS guard fails closed when a finding's own field line cites a file:line (a false blocker, never a lost one).
  • Folded phantoms: v1/outside-voice#1 and refactor: reorganize codebase into modular structure #2 (the reader's fenced repro) and v1/adversarial-native#1 and refactor: reorganize codebase into modular structure #2 (its opening summary and scope note) fold into outside-voice#3.

REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=7 fixed=2 scope=frozen ledgers_read=6 fix_checks=1 dispatches=8

Gate edits: none detected (4 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Outside review: completed by openai/gpt-6.1-sol (host subagent, certified configuration); it found one blocker, now fixed. The native adversarial reader (claude-opus-5-5) found three Low notes and nothing blocking. Targeted money reader: NO FINDINGS at 3134e1f and at f5ad0d1.

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:240 An inline field line under a Finding N heading keeps the stronger (CRITICAL) label instead of the stated Severity; fails closed (GST-1406), lead judgment lowers it.
  • INFORMATIONAL lib/review-ledger.ts:60 NUMBERED_HEAD matches only '**Finding N' / '### Finding N'; variants (lowercase, 'docs: add README and CLAUDE.md #1', unbolded) still split as on main. INVESTIGATE: a shape rule needs a human call (AGENTS.md: no spelling per paid failure).
  • INFORMATIONAL lib/review-ledger.ts:241 An unbolded 'Finding 2: … Severity: High. Blocks: no.' line directly under a Finding 1 heading joins it; wrong attribution, no blocker lost.
  • INFORMATIONAL lib/review-ledger.ts:243 The LOCUS guard also splits a field line that names the heading's own file:line, leaving the FIXABLE heading CRITICAL with no fields (a false blocker, never a lost one).
  • INFORMATIONAL lib/review-ledger.ts:244 The CRITICAL/P0 heading guard scans every label word in the heading text, so 'Critical section …' or 'P0 pilot …' in a FIXABLE heading blocks the join and leaves a false blocker.
  • INFORMATIONAL lib/review-ledger.ts:232 A 'Finding N (CRITICAL)' heading with separate Severity: Low / Blocks: no lines collects Low through the META branch, and after a blank line an inline field line keeps CRITICAL with Blocks: no; both predate this diff, so the documented guard holds only for the no-gap inline shape.

Exploratory QA

Functional surface: parseFindings and judge on synthetic reader outputs, smoke only (no plan bound). Run 1 at 3088586: capture 002 reproduced red-team#1 (product defect), so the verdict was fail. Revalidation at 3134e1f passed 3 of 3. The final revalidation at f5ad0d1 passed 4 of 4, including the outside-voice#3 shape. The blank-line variants keep main's GST-1406 behavior and are not changed here. Evidence: qa/functional, qa/functional-r2 and qa/functional-r3 in the run directory.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped (evals: none affected; lib/review-ledger.ts is the collector, not a prompt or judge).

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Verification Results

No Step 8.1 obligations (no plan bound): 0 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The authored docs already match the GST-1657 parser change.

Scope: the committed diff main...HEAD on gst-1657-finding-heading (7 files: lib/review-ledger.ts, docs/review-policy.md, a changelog.d fragment, a test and fixtures). The working tree was clean.

Documentation health:

  • docs/review-policy.md: Current (the branch already describes the Finding N lead, the field line that joins the heading, and the CRITICAL/P0 exception)
  • changelog.d/gst-1657-finding-lead-fields.md: Current (matches the code)

Coverage debt: none found. No other authored doc describes the numbered-heading rule. Diagram drift: none.

Test plan

  • bun --no-env-file test --timeout=30000 over the 13 review-ledger test files (incl. test/review-native-finding-heading.test.ts): 194 pass, 0 fail
  • bun run test (free suite): carried from Free Tests run 42265852962/1 at debf73a (tree 5d0cf1c88a69), green; macos-named-regressions cleared from the same run
  • No-loss replay (GST-1628 script, 296 captured outputs + 3 fixtures): label diffs only in test/fixtures/review-ledger/gst-1657/*; identical before and after the review fixes
  • Extended replay (585 distinct captured outputs + 3 fixtures): 3 outputs move, all this shape; identical before and after the review fixes
  • bun run typecheck, test/module-size-ratchet.test.ts, check-conflict-markers: pass

Open in Capy

…lines (GST-1657)

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

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 6, 2026 17:23
A located line right under a 'Finding N' lead is another finding, not that lead's fields: the inline-field join now refuses a file:line, as the blank-line branch does, so judge() cannot lower the lead with a second finding's Blocks: no (red-team#1, GST-1657).

Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A heading that names CRITICAL or P0 itself keeps its blocker: the no-gap inline-field join no longer attaches another paragraph's Blocks: no to it, so ledgerBlockers() still counts it, as on main (outside-voice#3, GST-1657).

Review-Finding: v1/outside-voice#3 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ng guards

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit be173d5 into main Nov 6, 2026
64 checks passed
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