fix: pre-landing review round — 8 auto-fixes + 8 accepted findings hardened

The ship review army (4 specialists + red-team + checklist, 29 findings)
produced 8 mechanical auto-fixes and 11 decisions; the accepted set:

- win32 slug parity completed: lib/bin-context.ts gains the remote-first
  outermost walk + degraded-cache self-heal the bash side got this wave —
  the two implementations now agree on the stray-marker live-bug shape,
  pinned by shared fixtures (multi-specialist 9/10 finding).
- probe honors the plan's bounded-read decision: 256KB prefix, extraction
  semantics mirrored from parseTranscriptJsonl so probe/prepare can never
  diverge on the same file (>1MB transcript test).
- policy normalize parity: bash normalize() now matches canonicalizeRemote
  on .git/-trailing and uppercase-.GIT shapes (7-shape corpus pinned two
  ways) — a deny for those shapes could previously slip the transcript gate.
- session-update reclaim is TOCTOU-safe (atomic mv-aside on both branches).
- settings-hook: unparseable settings.json errors instead of being replaced
  with {}; ensure-event keys on (event, source) so matcher changes update
  in place — never zero or two registrations.
- dot-only slug guard at both parse sites (hostile 'url = ..' can't escape
  projects/); enqueue tmp-file janitor (1h TTL, inside the drain lock);
  brain-sync .migrating never clobbered; drop-queue/status count .migrating;
  snapshot -o warning correct + surfaced in diff mode; version-bump test
  order-dependence removed; uninstall clears the advance stamp.

Deferred with record: slug heal-probe cost sentinel (P3 TODO), FF_OK
conflation (noted, misdiagnosis-only).

270 pass / 0 fail across the 10 touched suites.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-17 13:20:20 -07:00
co-authored by Claude Fable 5
parent 9fecf0f16f
commit b7d44c45b4
18 changed files with 648 additions and 76 deletions
+12 -5
View File
@@ -356,9 +356,14 @@ export async function handleSnapshot(
// `-o` only means something to the two modes that PRODUCE an image. Passed
// alone it used to be silently ignored: exit 0, no file, no explanation —
// which reads as "the screenshot feature is broken" rather than "you forgot a
// flag", and cost a real debugging session before anyone noticed.
if (opts.outputPath && !opts.annotate && !opts.heatmap) {
output.push(`[warning] -o/--output was ignored: it names the file for an annotated screenshot, so it needs -a/--annotate (or -C/--cursor-interactive). For a plain screenshot use: browse screenshot ${opts.outputPath}`);
// flag", and cost a real debugging session before anyone noticed. Kept as a
// variable so the diff-mode returns below (which bypass `output`) can carry
// it too — diff mode must not regress to the silent-ignore behavior.
const outputIgnoredWarning = (opts.outputPath && !opts.annotate && !opts.heatmap)
? `[warning] -o/--output was ignored: it names the output file for an annotated (-a/--annotate) or heatmap (-H/--heatmap) screenshot. For a plain screenshot use: browse screenshot ${opts.outputPath}`
: '';
if (outputIgnoredWarning) {
output.push(outputIgnoredWarning);
}
// ─── Annotated screenshot (-a) ────────────────────────────
@@ -615,7 +620,8 @@ export async function handleSnapshot(
const lastSnapshot = session.getLastSnapshot();
if (!lastSnapshot) {
session.setLastSnapshot(snapshotText);
return snapshotText + '\n\n(no previous snapshot to diff against — this snapshot stored as baseline)';
return snapshotText + '\n\n(no previous snapshot to diff against — this snapshot stored as baseline)'
+ (outputIgnoredWarning ? '\n' + outputIgnoredWarning : '');
}
const changes = Diff.diffLines(lastSnapshot, snapshotText);
@@ -630,7 +636,8 @@ export async function handleSnapshot(
}
session.setLastSnapshot(snapshotText);
return stripLoneSurrogates(diffOutput.join('\n'));
return stripLoneSurrogates(diffOutput.join('\n')
+ (outputIgnoredWarning ? '\n' + outputIgnoredWarning : ''));
}
// Store for future diffs