Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
1e4a85e
fix(ship): base merges, adjacent base edits, test-only and audit-requ…
garrytan Oct 31, 2026
b0db283
ship driver: trim two phrases for headroom with #3662
garrytan Oct 31, 2026
8659bac
Merge remote-tracking branch 'origin/main' into gst-407-ship-rereview…
garrytan Oct 31, 2026
28353fa
ship driver: keep the Next steps heading phrase the handoff check rea…
garrytan Oct 31, 2026
fa48f02
test: regenerate ship goldens
garrytan Oct 31, 2026
ccdc462
fix: pre-landing review fixes
garrytan Oct 31, 2026
d25fd4a
Merge remote-tracking branch 'origin/main' into gst-407-ship-rereview…
garrytan Oct 31, 2026
37cfb48
fix: pass-2 review fixes
garrytan Oct 31, 2026
f6d6e23
fix: Step 11 review fixes; a version-only stamp_files edit after revi…
garrytan Oct 31, 2026
e70da9b
fix: no test edit skips review; guard packet writes; exclusive attemp…
garrytan Oct 31, 2026
41f6df0
fix: attempt prints gstack's install command; carry checks the produc…
garrytan Oct 31, 2026
b6a2d22
fix: oversized packets take the full loop; exact --docs-requested mat…
garrytan Oct 31, 2026
6e928ef
docs(unattended): carry's scoped-review refusal and what it keeps
garrytan Oct 31, 2026
a7ac53c
docs: carry's scoped-review route in ship-policy, review-policy and t…
garrytan Oct 31, 2026
a1ea723
test(windows): curate ship-rereview-triggers out of the Windows lane …
garrytan Oct 31, 2026
4cc747c
Merge remote-tracking branch 'origin/main' into gst-407-ship-rereview…
garrytan Oct 31, 2026
e682fa6
fix(review-log): record a notes-only /ship pass clean; name the cause…
garrytan Oct 31, 2026
10221c7
fix(receipt): carry and write handle PRs with thousands of files; tre…
garrytan Oct 31, 2026
a057def
fix(ship): preflight routes RECEIPT_CARRY_SCOPED_REVIEW to the scoped…
garrytan Oct 31, 2026
ae38884
docs(ship): Step 1.4 and Step 16 route the scoped-review refusal and …
garrytan Oct 31, 2026
c56c006
fix: /ship review pass 1: notes-only floor, scoped carry order, named…
garrytan Oct 31, 2026
b9ab328
test: pin the Step 16 --docs-requested route with its --docs-result
garrytan Oct 31, 2026
0a0ccdc
fix: a claimed clean review row with a logger-stamped open gate findi…
garrytan Oct 31, 2026
1b9111b
fix: Step 11 findings: gate rows from --findings are stamped, one ope…
garrytan Oct 31, 2026
c076c69
fix: Step 11 round 2: stamped-open gates win over status and disposit…
garrytan Oct 31, 2026
9df9c6c
fix: carry dry run offers the scoped route last; patch-id diff under …
garrytan Oct 31, 2026
04a0cee
fix: a claimed clean review row with any unresolved non-gate CRITICAL…
garrytan Oct 31, 2026
4ab7380
docs: carry dry-run scoped route, patch-id directory, tree-receipt re…
garrytan Oct 31, 2026
a0d4978
fix(ship): Step 3 names merge conflicts in its STOP sentence again (s…
garrytan Oct 31, 2026
1c625e9
fix(tree-receipt): keep the gated-to-current diff at the file helper …
garrytan Oct 31, 2026
f30a520
test(carry): large-diff fixture sets core.longpaths so Git for Window…
garrytan Oct 31, 2026
6a0938a
fix(review): a stale local base branch yields to its origin twin in g…
garrytan Oct 31, 2026
c5e04a7
fix(ship): Step 11 saves the targeted record and the receipt writes c…
garrytan Oct 31, 2026
0d4846c
changelog: GST-464 and GST-462
garrytan Oct 31, 2026
86b279f
fix(review): pass 1: ahead and diverged labels, diff-scope needs shar…
garrytan Oct 31, 2026
3727317
fix: pass-2 review fixes for base twin, prSized stop and targeted record
garrytan Oct 31, 2026
cd3d033
fix: origin's tracking base wins whenever related; prSized lower bound
garrytan Oct 31, 2026
fe0f86f
changelog: the tracking-ref claim holds while the tracking branch exists
garrytan Oct 31, 2026
ebabb59
test: repin the two ship section briefs under no-loss replay GST-464
garrytan Oct 31, 2026
edd4bdd
ship: keep Step 9's PASS_HEAD sentence whole; repin review-army under…
garrytan Oct 31, 2026
b10e2db
Merge remote-tracking branch 'origin/main' into gst-407-ship-rereview…
garrytan Oct 31, 2026
b6a5bd1
fix: restore bin/gstack-ship-receipt after the main merge
garrytan Oct 31, 2026
d7eea9e
Merge remote-tracking branch 'origin/gst-407-ship-rereview-triggers' …
garrytan Oct 31, 2026
76126ce
Merge remote-tracking branch 'origin/gst-430-notes-only-pass' into gs…
garrytan Oct 31, 2026
ef818d7
review-collect: narrow the consumer scan and give it one 300 s deadli…
garrytan Oct 31, 2026
cf82ee8
review-collect: keep the consumer scan deadline under the 180 s plan …
garrytan Oct 31, 2026
bc2d2f3
review-collect: plain paths under --literal-pathspecs; whole-millisec…
garrytan Oct 31, 2026
25b4d9b
review-collect: whole-tree grep for non-UTF-8 names, no argument spre…
garrytan Oct 31, 2026
4c77097
review-collect: cap the consumer grep output at 256 MB across calls; …
garrytan Oct 31, 2026
d1eb3d0
review-collect: read a missing spawn status as null (Bun 1.4.2 return…
garrytan Oct 31, 2026
bf9590c
test: review-collect whole-tree helper reads a null status as -1 (typ…
garrytan Oct 31, 2026
40ff8e2
review-bots: /review and /ship triage every configured review bot, no…
garrytan Oct 31, 2026
b2fac69
fix: pre-landing review fixes (gh before 2.48 pages without --slurp; …
garrytan Oct 31, 2026
49f10d0
fix: drop the review-bot fence test that could not fail (the tool-fen…
garrytan Oct 31, 2026
3eaa832
fix: Step 11 review fixes (record by comment id so a filename never r…
garrytan Oct 31, 2026
946024b
fix: pass-2 review fixes (record refuses * paths, colliding ids and a…
garrytan Oct 31, 2026
3d795e1
review: classify the PR type and always check repo conventions (#356)
garrytan Oct 31, 2026
342365e
review-bots: allowlist the record placeholders and match Step 10's id…
garrytan Oct 31, 2026
b9777a1
docs: review-bot triage covers every configured bot (#3122)
garrytan Oct 31, 2026
a3de697
test: the PR-type test also pins the compose, Terraform and README/CH…
garrytan Oct 31, 2026
4f05f56
test: follow the review-bot rename in the remote free tier's three reds
garrytan Oct 31, 2026
28c92b4
test: keep the cross-skill judge's rubric to one renamed bullet
garrytan Oct 31, 2026
04a4566
changelog: H1 fragment passes prose lint
garrytan Oct 31, 2026
5d5fdc7
changelog: name the H1 fragment after its branch; TODOS drops #356
garrytan Oct 31, 2026
64f4268
docs: /review's PR type step in docs/skills.md (#356)
garrytan Oct 31, 2026
745c05b
ship-policy: review_exclude_paths key and loadPolicyAt (GST-508)
garrytan Oct 31, 2026
c978f00
review: apply the base policy's review_exclude_paths and the reviewer…
garrytan Oct 31, 2026
b4b88df
receipt: bind review_exclude in write, carry and the queue (GST-508)
garrytan Oct 31, 2026
a7b8714
docs, tests and changelog for review_exclude_paths (GST-508)
garrytan Oct 31, 2026
3fe4d8c
fix: pre-landing review fixes (binary by bytes, links kept, untracked…
garrytan Oct 31, 2026
a8d4be5
fix: keep binary files at code paths under review_exclude_paths
garrytan Oct 31, 2026
7e22668
docs: name the reasons that keep a binary file under review_exclude_p…
garrytan Oct 31, 2026
31fb896
fix: keep every review_exclude_paths candidate when the gate scan is …
garrytan Oct 31, 2026
ba8cc57
test: keep the NUL fixture clear of the sync-spawn tripwire
garrytan Oct 31, 2026
9e9ebf1
changelog: split the ceiling sentence
garrytan Oct 31, 2026
c7717d8
fix: keep a live binary file whose bytes cannot be read; tests render…
garrytan Oct 31, 2026
40c5b12
test(review-exclude): explicit +x for the census script; skip the chm…
garrytan Oct 31, 2026
ef2760f
refactor: move loadPolicyAt to lib/ship-policy-at.ts so lib/ship-poli…
garrytan Nov 1, 2026
d067785
Merge origin/main (5b7b095) into gsta224-review-bots
garrytan Nov 1, 2026
b2c644c
fix: refuse a base that contains HEAD; skip a self-pointing origin/HE…
garrytan Nov 1, 2026
b516a05
chore: regenerate gstack-doctor-components.sh for BASE_CONTAINS_HEAD
garrytan Nov 1, 2026
bca0317
fix: land resumes a merged merge-only PR instead of refusing BASE_CON…
garrytan Nov 1, 2026
52a6c33
docs: changelog fragment for GST-774
garrytan Nov 1, 2026
0eb4748
docs: troubleshooting names diff-scope base_contains_head and the sel…
garrytan Nov 1, 2026
c204be9
Merge remote-tracking branch 'origin/main' into gst-508-review-exclud…
garrytan Nov 1, 2026
b3fcb10
test: repin the reviewer briefs to GST-508's no-loss-tested bytes
garrytan Nov 1, 2026
995e442
Merge remote-tracking branch 'origin/main' into gst-508-review-exclud…
garrytan Nov 1, 2026
8220760
fix: GST-774 review round 1 — merged resume depth, aliased and detach…
garrytan Nov 1, 2026
0c58cc3
Merge remote-tracking branch 'origin/main' into gst-464-receipt-targe…
garrytan Nov 1, 2026
fa97c18
ship: Step 20 says a metrics row, keeping DRIVER.md at 12 KB after th…
garrytan Nov 1, 2026
66c4f68
test: ship-parts resend case leaves room for the first phase-3 part a…
garrytan Nov 1, 2026
aa217ca
Merge remote-tracking branch 'origin/main' into gst-464-receipt-targe…
garrytan Nov 1, 2026
0701f61
Merge origin/main (589ff24) into gsta224-h1-review-pr-type
garrytan Nov 1, 2026
60f7afd
fix: /ship delivers review/checklist.md in two parts so checklist v1 …
garrytan Nov 1, 2026
cc39233
changelog: drop the GST-407 and GST-430 fragments, already released o…
garrytan Nov 2, 2026
9ab5591
Merge commit 'dd9834d44d2650818cb6d8e17c57f795cb56bf98' into gst-464-…
garrytan Nov 2, 2026
883cb16
wave review-53cfb5bfe011: merge #3705 (9ab559120b37)
garrytan Jan 1, 2000
a7f5a04
Merge commit '995e442521516c707125ecce388c698aad0ff432' into HEAD
garrytan Nov 2, 2026
191e706
wave review-53cfb5bfe011: merge #3745 (bf9590c863dd)
garrytan Jan 1, 2000
766c0e6
Merge commit 'd06778528e6dd85a9a7b5bc74dfff4a85abe933e' into HEAD
garrytan Nov 2, 2026
aa6649e
Merge commit '60f7afd756c4ffcea6cf0070d4dc30ed3c825086' into HEAD
garrytan Nov 2, 2026
7450175
Merge commit '82207609aad66ba9a12ff59306bad14af60445f6' into HEAD
garrytan Nov 2, 2026
0ebc9bf
wave review-53cfb5bfe011: lib/ship-policy.ts back to 800 lines (modul…
garrytan Nov 2, 2026
c423539
wave review-53cfb5bfe011: /ship pass 1 fixes
garrytan Nov 2, 2026
e4043dc
wave review-53cfb5bfe011: /ship pass 2 fixes
garrytan Nov 2, 2026
077604a
Merge main 3d99c224972 into wave/review-53cfb5bfe011 (rule 19 grant)
garrytan Nov 2, 2026
557e5c4
fix: merge follow-ups for main 3d99c22: origin/* stays qualified in d…
garrytan Nov 2, 2026
d7ad64e
fix(review): receipt write gate-scans whenever the base declares revi…
garrytan Nov 2, 2026
6a9e34a
test: the docs-only receipt digest test keeps its gate scan out of th…
garrytan Nov 2, 2026
0319046
Merge main fc292e22f (v1.93.7.0, train 90) into wave/review-53cfb5bfe…
garrytan Nov 2, 2026
176db3f
fix(merge fc292e22f): tentative REVIEW_EXCLUDE_KEY_VERSION, classify …
garrytan Nov 2, 2026
f0ce234
Merge main 68410828f (v1.93.17.0, train 92) into wave/review-53cfb5bf…
garrytan Nov 2, 2026
2e0e65d
test(merge 68410828f): GST-967's brief-body pin carries the wave's GS…
garrytan Nov 2, 2026
f6a7eba
wip(review): R65 review scales to risk (GSTA-258 build C): lean singl…
garrytan Nov 3, 2026
5497c18
wip(review): receipt platform depth, outside-voice diff file and slic…
garrytan Nov 3, 2026
df75f70
GSTA-258 C: pin old-panel tests to review.panel all, outside voice re…
garrytan Nov 3, 2026
de04a78
GSTA-258 C: GST-1129 spend-binding lines class money, --declare-risk …
garrytan Nov 3, 2026
aae15e2
Merge origin/main (6f1dfd5b, #3852 squashed as 14d7414a) into gsta258…
garrytan Nov 3, 2026
889b99b
review: default review.panel all, one-reader shape opt-in (GSTA-258 b…
garrytan Nov 3, 2026
47962b3
test: type the platform receipt fixture list (typecheck:test ratchet)
garrytan Nov 3, 2026
16ec68c
test: ship-control-flow expects the platform NEXT in the repeat decision
garrytan Nov 3, 2026
f00ae61
review: platform evidence only from an approving or commenting review…
garrytan Nov 3, 2026
6865485
review: REVIEW_POLICY_KEY_VERSION to the next minor (main took 1.94.1…
garrytan Nov 3, 2026
6e7fc84
review: Step 11 fixes: results scripts keep secret, spend-cap and pai…
garrytan Nov 3, 2026
7d24281
Merge origin/main 5f705f367 into gsta258-c-review-depth (pre-READY ba…
garrytan Nov 3, 2026
8497f51
docs: ship-policy names the review key and the receipt's review_depth…
garrytan Nov 3, 2026
bfffc9f
Revert "docs: ship-policy names the review key and the receipt's revi…
garrytan Nov 3, 2026
8a1f2c0
Merge main f6d6215f4 into gsta258-c-review-depth (rule 19 grant, GSTA…
garrytan Nov 3, 2026
d67b8d3
Merge main bf2bcf14b into gsta258-c-review-depth (rule 19 grant, GSTA…
garrytan Nov 3, 2026
8bdc632
Merge main 1ccab0d8 into gsta258-c-review-depth (rule 19 grant, GSTA-…
garrytan Nov 3, 2026
0c68200
v1.94.30.0 stamp: merge main ade35bc81356 into #3920 (land)
garrytan Nov 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## [1.94.30.0] - 2026-11-03

**/ship sends more diffs to full review: spend-binding code, eval scorers, a repo's own risk paths and docs that print secrets now count as risk, and a lane can declare a class the matchers miss (GSTA-258 build C).** Today's reviewer panel stays the default. The one-reader shape for non-risk code ships as an opt-in (`review.panel risk`) because its no-loss replay didn't pass: with only the diff and no repository, the reader found 2 of 68 non-risk blockers, so the replay is being redone with readers working in a checkout. A repo with platform review on can skip /ship's readers on plain docs.

### Added
- **A `review` key in `.gstack/ship-policy.json`**, read from the base branch only (needs `min_gstack_version` at the release that adds it): `panel` (`all` by default, today's panel; `risk` or `off` opt in to one reader), `reader_model` (`lane` by default), `platform` (`off` by default) and `risk_paths` (globs of code paths that count as risk class `policy`).
- **`gstack-review-plan` prints `REVIEW_MODE:`** and, under `review.platform on`, `PLATFORM_REVIEW:`. `DISPATCH:` lines name the reader's `model=` and `classes=`. New flags: `--fix-checks <n>` and `--pr <n>`.
- **The platform depth.** Under `review.platform on`, a docs or tests diff with no numeric, results or prereg claims, whose PR carries capy-ai[bot]'s review at the exact head, plans `NEXT: platform` with a planned `SKIP:` for every reader. Step 11.5 accepts it, and `gstack-ship-receipt write --platform-review <id>` records `review_depth: platform` with that review's id and head. It never applies to runtime code, and never where platform review is off.
- **New risk classes**: `eval` (scorer, judge and grader paths) and `policy` (`review.risk_paths`). A docs line that can print a credential (an `Authorization:` header, a bearer value, a key-shaped literal, `mcp get`) is security risk (gbrain#8417).
- **The receipt records `review_depth.mode`** (lean, panel or platform).
- **Declared risk classes** (GST-1129). `gstack-review-plan --declare-risk <classes>` and `gstack-ship-receipt write --declare-risk <classes>` add classes the matchers missed. A declaration only raises the depth, the plan prints `RISK_DECLARED:`, and the receipt keeps `review_depth.declared` beside `review_depth.detected`.
- **Code that reserves, binds, leases or settles spend is money** (GST-1129): `bindCheck(ledger, …)`, `reserveSpend` or `bindCap` in a code file now plans full depth. gstack-evals#170 got its full review only because an unrelated `UBICLOUD_API_KEY` line was in the diff.

### Changed
- **Opt-in one-reader review** (`review.panel risk`): non-risk code gets one native adversarial reader at the lane's reasoning, carrying the code checklists and the Red Team checklist, and risk class keeps the full panel. One fix-check follows a fixed blocker. It isn't the default until its no-loss replay passes.
- **Fewer false risk triggers** (harness-evals#231): committed `*.sqlite` and other binary data files count as data, never code; JSON, YAML and other config files are judged by their path, so a `lease_usd` value no longer means money; analysis scripts under `docs/`, `results/` or `benchmarks/` are judged by their path.
- The outside voice reads its diff from a file the brief names with its sha256, instead of a diff pasted into the prompt. Past 2,000,000 bytes it reads a path-scoped slice whose brief lists the files it left out, instead of stopping the pass.

## [1.94.29.0] - 2026-11-03

**Every part of gstack now has to earn its place.** Garry, 2026-11-02: "Also work this principle of only include it if it is beneficial and good into gstack". A new skill, step, instruction, check or default needs evidence that it helps on frontier models, or a reason, an owner and a dated plan to measure it. The first inventory reads untested almost everywhere: one part, `/investigate`, has a fair no-effect result (a CUT-CANDIDATE, measured on Opus 5.5 only), 3 have a fair test under way, 14 more have one proposed, and 5 safety guards stay on their stated reason.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.94.29.0
1.94.30.0
2 changes: 1 addition & 1 deletion agents-digest/gstack-AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# gstack digest v1.94.29.0 — regenerate/re-copy after upgrading gstack
# gstack digest v1.94.30.0 — regenerate/re-copy after upgrading gstack

Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed
for agent hosts without a full skill install. The full skills add workflows,
Expand Down
36 changes: 24 additions & 12 deletions bin/gstack-review-dispatch
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
* lib/review-pass.ts (the staged manifest) and lib/capy-review-pass.js (the Capy program that runs it).
*/
import { spawnSync } from 'node:child_process';
import { createHash } from 'node:crypto';
import * as fs from 'node:fs';
import * as path from 'node:path';
import { EXIT, exitTableHelp } from '../lib/headless-artifacts';
import { BRIEF_ROLES, BriefError, briefFile, checkReviewedTree, checkoutRoot, checkoutTree, promptHash, renderBrief, sectionTexts, withWorkspace, type BriefRole, type Slots, type TreeCheck } from '../lib/review-brief';
import { BRIEF_ROLES, BriefError, briefFile, checkReviewedTree, checkoutRoot, checkoutTree, promptHash, renderBrief, sectionTexts, sliceDiff, sliceNote, withWorkspace, type BriefRole, type Slots, type TreeCheck } from '../lib/review-brief';
import { cleanMarkers, collect, fixableRaises, mayBeUnavailable, parseFindings, readJsonl, readLedger, readerKey, recordJudgment, recordSent, appendEvent, verify, type JudgedLine, type MergedLine, type VerifyRow } from '../lib/review-ledger';
import { buildManifest, chunkCount, chunkOf, manifestPath, markReader, readManifest, renderStage, writeManifest, STAGES, type Extra, type Manifest, type PassReader, type ReaderState, type Stage } from '../lib/review-pass';
import type { Dispatch } from '../lib/review-depth';
Expand Down Expand Up @@ -108,8 +109,9 @@ function render(): number {
const diffBase = flag('--diff-base');
const checklist = flag('--checklist') ?? (role === 'red-team' ? path.join(ROOT, 'review/specialists/red-team.md') : role === 'targeted' ? path.join(ROOT, 'review/specialists/targeted.md') : role === 'specialist' && name ? path.join(ROOT, 'review/specialists', `${name}.md`) : undefined);
if (checklist && (role === 'specialist' || role === 'red-team' || role === 'targeted') && !fs.existsSync(checklist)) throw new BriefError(`checklist not found: ${checklist}`);
const brief = role === 'targeted' ? readFile(checklist, 'targeted brief') : undefined;
if (role === 'targeted') {
const merged = role === 'adversarial-native' && !!flag('--classes');
const brief = role === 'targeted' || merged ? readFile(merged ? path.join(ROOT, 'review/specialists/targeted.md') : checklist, 'targeted brief') : undefined;
if (role === 'targeted' || merged) {
const base = resolveBaseBranch(process.cwd(), flag('--base'));
const mb = mergeBaseWith(base);
const full = diffBase ? spawnSync('git', ['rev-parse', '--verify', '--quiet', `${diffBase}^{commit}`], { encoding: 'utf8', timeout: 30_000 }).stdout?.trim() : undefined;
Expand All @@ -127,11 +129,19 @@ function render(): number {
if (over) { process.stderr.write(over.line + '\n'); return over.exit; }
if (role === 'outside-voice') diff = branchDiff(diffBase, { exclude: flag('--exclude'), keep: keepItems });
}
let diffFile: Slots = {};
if (diff !== undefined) {
fs.mkdirSync(out, { recursive: true, mode: 0o700 });
const f = path.join(path.resolve(out), 'outside-voice.diff');
const s = sliceDiff(diff, REVIEW_DIFF_MAX_BYTES);
fs.writeFileSync(f, s.text, { mode: 0o600 });
diffFile = { diff_file: f, diff_bytes: String(s.bytes), diff_sha256: createHash('sha256').update(s.text).digest('hex'), ...(s.sliced ? { diff_slice: sliceNote(s, REVIEW_DIFF_MAX_BYTES) } : {}) };
}
const slots: Slots = {
name, diff_base: diffBase, exclude: flag('--exclude'), stack: flag('--stack'), test_fw: flag('--test-fw'),
learnings: readFile(flag('--learnings-file'), 'learnings'), checklist, checklists: checklists?.join(','),
findings: readFile(flag('--findings-file'), 'findings'), specialists: flag('--specialists'), diff,
classes: flag('--classes'), brief,
findings: readFile(flag('--findings-file'), 'findings'), specialists: flag('--specialists'), ...diffFile,
classes: flag('--classes'), brief, ...(merged ? { checklist: path.join(ROOT, 'review/specialists/targeted.md') } : {}),
...(flag('--disclosure') ? { disclosure: flag('--disclosure'), policy_exclude: policyItems.map(quote).join(' ') || undefined, keep: keepItems.map(quote).join(' ') || undefined } : {}),
fix_list: readFile(flag('--fix-list'), 'fix list'), hunks: readFile(flag('--hunks'), 'hunks'), tests: readFile(flag('--tests'), 'tests'), callers: readFile(flag('--callers'), 'callers'),
};
Expand All @@ -144,8 +154,8 @@ function render(): number {
fs.writeFileSync(file, text, { mode: 0o600 });
const ledger = flag('--ledger') ?? path.join(out, 'review-ledger.jsonl');
const sha = promptHash(text);
const targeted = brief === undefined ? {} : { classes: parseClassList(flag('--classes')!), rules: TARGETED_RULES, brief_sha: targetedBriefSha(checklist), diff_base: diffBase ?? null, ...(diffBase ? targetedRead(process.cwd(), diffBase) : { patch_id: 'none', head: null }) };
appendEvent(ledger, { event: 'rendered', reader: readerKey(role, name), role, name: name ?? null, file, sha256: sha, bytes: Buffer.byteLength(text), workdir, tree, ...targeted, ...(disclosureDigest(flag('--disclosure')) ? { exclude: disclosureDigest(flag('--disclosure')) } : {}) });
const targeted = brief === undefined ? {} : { classes: parseClassList(flag('--classes')!), rules: TARGETED_RULES, brief_sha: targetedBriefSha(merged ? path.join(ROOT, 'review/specialists/targeted.md') : checklist), diff_base: diffBase ?? null, ...(diffBase ? targetedRead(process.cwd(), diffBase) : { patch_id: 'none', head: null }) };
appendEvent(ledger, { event: 'rendered', reader: readerKey(role, name), role, name: name ?? null, file, sha256: sha, bytes: Buffer.byteLength(text), workdir, tree, ...targeted, ...(diffFile.diff_file ? { payload: { file: diffFile.diff_file, sha256: diffFile.diff_sha256 } } : {}), ...(disclosureDigest(flag('--disclosure')) ? { exclude: disclosureDigest(flag('--disclosure')) } : {}) });
process.stdout.write(`BRIEF: reader=${readerKey(role, name)} sha256=${sha} bytes=${Buffer.byteLength(text)} file=${file}\n`);
return EXIT.ok;
}
Expand Down Expand Up @@ -178,7 +188,7 @@ function ceiling(context: string, base: string, outDir: string, readers: Readonl
const at = r.diff_base ?? diffBase;
const d = selectionOf(at, r.exclude, r.keep);
if (!d.ok) return { exit: EXIT.fail, line: unreadableLine(context, r.reader, d, at, base, outDir) };
if (d.bytes > REVIEW_DIFF_MAX_BYTES) return { exit: EXIT.refused, line: tooLargeLine(context, r.reader, d, ceilingContext(process.cwd(), base, known)).line };
if (d.bytes > REVIEW_DIFF_MAX_BYTES && r.reader !== 'outside-voice') return { exit: EXIT.refused, line: tooLargeLine(context, r.reader, d, ceilingContext(process.cwd(), base, known)).line };
}
return null;
}
Expand Down Expand Up @@ -329,19 +339,21 @@ function program(): number {
* collected, and it was rendered on a committed diff (uncommitted never proves what was read). `head` names the commit it read:
* a later commit does not undo the read, and gstack-ship-receipt write binds the record only while that commit's product patch is
* the receipt's (GST-986: Step 11 fixes after the read printed status=failed findings=0 for a completed reader).
* R65's merged reader (an adversarial-native brief rendered with --classes) is a targeted dispatch too (design C7).
*/
function targetedRecord(ledger: string, rows: VerifyRow[]): { classes: string[]; rules: string; brief_sha: string; status: 'done' | 'failed'; findings: number; raised_by: string; head: string | null } | null {
const events = readLedger(ledger);
const render = events.filter(e => e.event === 'rendered' && e.reader === 'targeted').at(-1);
const render = events.filter(e => e.event === 'rendered' && (e.reader === 'targeted' || (e.reader === 'adversarial-native' && typeof e.brief_sha === 'string'))).at(-1);
if (!render) return null;
const label = rows.filter(r => r.kind === 'BRIEF' && r.reader.split('@')[0] === 'targeted').at(-1)?.reader;
const key = String(render.reader);
const label = rows.filter(r => r.kind === 'BRIEF' && r.reader.split('@')[0] === key).at(-1)?.reader;
const brief = rows.filter(r => r.kind === 'BRIEF' && r.reader === label).at(-1);
const output = rows.filter(r => r.kind === 'OUTPUT' && r.reader === label).at(-1);
const head = typeof render.head === 'string' && /^[0-9a-f]{40,64}$/.test(render.head) ? render.head : null;
const committed = typeof render.patch_id === 'string' && !['uncommitted', 'none'].includes(render.patch_id) && head !== null;
const done = brief?.status === 'MATCH' && output?.status === 'MATCH' && committed;
const ids = events.filter(e => e.event === 'output' && e.reader === 'targeted').at(-1)?.ids;
return { classes: (render.classes as string[]) ?? [], rules: String(render.rules), brief_sha: String(render.brief_sha), status: done ? 'done' : 'failed', findings: Array.isArray(ids) ? ids.length : 0, raised_by: 'targeted', head };
const ids = events.filter(e => e.event === 'output' && e.reader === key).at(-1)?.ids;
return { classes: (render.classes as string[]) ?? [], rules: String(render.rules), brief_sha: String(render.brief_sha), status: done ? 'done' : 'failed', findings: Array.isArray(ids) ? ids.length : 0, raised_by: key, head };
}

/**
Expand Down
Loading
Loading