Skip to content

v1.93.4.0 fix(review-ledger): a finding's own Severity field sets its label, not severity words in its text (GST-976) - #3867

Merged
capy-ai[bot] merged 10 commits into
mainfrom
gst-976-severity-field-first
Nov 2, 2026
Merged

capy-ai[bot] merged 10 commits into
mainfrom
gst-976-severity-field-first

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3867,
  "head": "f017177ee919512715dd5916b99476e40a4c0338",
  "version": "1.92.75.0",
  "base": "main",
  "session_kind": "unattended",
  "head_tree": "4270ffbefce88de877ebbe3d24c846b481a4f582",
  "product_patch_id": "06ca049f3ead1a5acc2dfed1ed8cc74a4760ed07",
  "gstack_version": "1.92.71.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 55,
    "rules": "551486253e156572",
    "base": "1022f4fc51a4771e3838ce6bbf7c19b7e94e67fe",
    "registry": "1022f4fc51a4771e3838ce6bbf7c19b7e94e67fe",
    "gate_scan": {
      "tagged": 0,
      "head": "f017177ee919512715dd5916b99476e40a4c0338"
    },
    "reasons": [
      "risk:money",
      "runtime=55"
    ],
    "risk": [
      "money"
    ]
  },
  "pregate": "requires-remote cleared @4270ffbefce8 (1 checks, current for f017177ee919)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41452896337",
    "pregate.json/remote_gate: remote-gate tree=4270ffbefce8 tests=6022"
  ],
  "docs": {
    "status": "updated",
    "scope": "docs/review-policy.md collect step; changelog.d/gst-976-severity-field-first.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 15,
    "deferred": 0,
    "noted": 3,
    "fixed": 15,
    "scope": "in-diff",
    "fix_checks": 3
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder (GSTA-36)",
    "date": "2026-11-02",
    "via": "GSTA-36",
    "reason": "GSTA-36 2026-11-02: one scoped fix-check on c950a49..f3810d4 (rule 23), cap 1; GSTA-36 2026-11-02: one single-reader scoped check on the post-fix-check repair hunk, cap 3",
    "fix_check": {
      "head": "c9e3cd9bf185512dd0ff53dde082080b1bea812e",
      "findings": 1
    }
  },
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "c82addff6fb60fa0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "06ca049f3ead1a5acc2dfed1ed8cc74a4760ed07",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

What changed

/ship's finding collector (parseFindings in lib/review-ledger.ts) now reads a finding's severity from its own Severity field. A severity word in the finding's text no longer raises it. Before: in gstack-evals #143 the outside voice marked six findings Blocks: no, and the "P0" in #1, #2 and #4 (the plan's phase name) collected as P0, so the judge refused the downgrade (JUDGMENT_REJECTED) and the receipt needed accepted_by. After: those three collect at their stated Medium/Low.

  • A field stating one label decides. A field stating more than one ("High/Critical", "Low → Medium", two fields) counts as none, so the line's strongest label applies, as on main.
  • A label leading the line (CRITICAL:, [P0], - High:, 1. api.ts:10 CRITICAL:, a label heading) stays the floor. Blocks: yes is still CRITICAL. The native voice's FIXABLE still collects as CRITICAL (normalizer v2; FIXABLE moves to GST-987).
  • Lines with no Severity field collect as before (S1).
  • New permanent test test/review-ledger-invariant.test.ts: never weaker than main. Over every input the review-dispatch and prose-voice-floor tests pass, every reader fixture and 1,440 generated field shapes (1,815 findings), no label ranks below main's unless the finding's field states exactly one label, and such a finding collects at that label unless a lead, a label heading, Blocks: yes or native FIXABLE raises it. It fails at b3ddd6c (262 violations) and f3810d4 (31).

Why

GST-976 (GSTA-167): a token in a finding's text overrode the reader's verdict and made verify dirty on a docs-only /ship.

Blast radius

lib/review-ledger.ts parseFindings only (collect and verify). Free replay of main vs this head over 80 stored reader outputs (302 findings) and 334 merged lines: 3 findings go from blocking to non-blocking (#143's P0s) and 0 the other way. The same invariant over the stored private outputs: 0 violations over 635 findings.

Pins changed

  • test/review-dispatch.test.ts:335: a body "nothing CRITICAL" under Severity: High now collects High (Captain ruling A: the field decides).
  • test/review-dispatch.test.ts:606: Severity: Low (not High) now collects Low (Captain ruling A).
  • The leading-label guard keeps :428 (CRITICAL: x.ts:4 … (pass 1 had Severity: Low)) and :522 (- High: …\nSeverity: Medium) unchanged.

Approvals

  • GSTA-36 2026-11-02: one scoped fix-check on c950a49..f3810d4 (rule 23), cap $21.
  • GSTA-36 2026-11-02: one single-reader scoped check on the post-fix-check repair hunk, cap $23.
  • GSTA-36 2026-11-02: B+ (slash-range repair, invariant test, one single reader), cap $25.

Review notes (open, below the floor)

  • GST-993: main's LOCUS regex is quadratic on long dash runs (3.4 s at 64,000 characters, same on main). Not fixed here.
  • Long _ or 1. runs cost 142–373 ms in the lead regex (less than LOCUS on the same lines).
  • A spaced en-dash range (x.ts:3 – 5 CRITICAL:) still hides a lead label (same as before).
  • A line starting Severity: Low in pass 1, P0 now collects Low.
  • A line starting with a lowercase severity word (severity high means …) now collects a phantom finding at rank 3.
  • The native voice's lowercase Severity: fixable collects rank 0, not CRITICAL (main dropped the line).

#3717 trial merge (head 5d2ba4f): the only conflict is #3717 vs main's #3845 ledgerBlockers block, not these hunks; resolved by keeping both. #3717's verify tests use JSON findings and a no-field Blocks: yes line, so they keep their meaning. Under #3717, verify re-derives labels, so a ledger collected before this change with a field-plus-body-token finding would report merged_line_differs.

Open in Capy

Review-loop exception: accepted by GStack Minder (GSTA-36) 2026-11-02 via GSTA-36: GSTA-36 2026-11-02: one scoped fix-check on c950a49..f3810d4 (rule 23), cap 1; GSTA-36 2026-11-02: one single-reader scoped check on the post-fix-check repair hunk, cap 3 (fix-check at c9e3cd9, 1 finding)

garrytan and others added 9 commits November 2, 2026 12:15
…everity words never raise it (GST-976)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…st 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>
… 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>
…d 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>
…se; 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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…kes 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>
…uts, 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>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title fix(review-ledger): a finding's own Severity field sets its label, not severity words in its text (GST-976) v1.93.4.0 fix(review-ledger): a finding's own Severity field sets its label, not severity words in its text (GST-976) Nov 2, 2026
@capy-ai
capy-ai Bot merged commit a2d7a6f into main Nov 2, 2026
45 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