Files
Garry TanandClaude Fable 5 14062504d9 fix(review): final-wave red-team batch — queue-aware worker probe, no cwd fallbacks post-v127, config-set anchor normalization, honest abort detection
The critical: the facts-backstop live-worker probe was queue-blind. The
durable facts-absorb job goes to queue 'default', but readWorkers().length
counted a worker on ANY queue (e.g. `gbrain jobs work --queue shell`) as
proof the job would be drained — parking it forever AND skipping the
in-process fallback, silently reintroducing the #2108 loss. The probe now
requires a worker on the job's own queue (FACTS_ABSORB_QUEUE constant so
submit + probe can't drift) and memoizes for 5s so readWorkers()'s
synchronous per-entry `ps` exec stops running inside every remote put_page.

Also in this batch:
- No cwd fallbacks post-migration-v127: the extract + backlinks job
  handlers fell back to dir='.' (worker-daemon cwd, typically / under
  launchd) on a NULL anchor; doctor's image_assets fell back to
  process.cwd(); autopilot-cycle passed job.data.repoPath / the config
  anchor unvalidated. All four now fail loudly (doctor: WARN check) via
  requireAbsoluteStoredPath, mirroring the sync handler.
- `gbrain config set sync.repo_path .` re-seeded a relative anchor around
  ingress normalization — now resolved absolute at set time (empty
  refused); isAnchorOwnedSyncPath no longer realpath-resolves a relative
  stored anchor against cwd (returns no-match).
- requireAbsoluteStoredPath's remediation hint is parameterized per
  storage context (sources.local_path → per-source sync repoint; job
  payloads → cancel + resubmit; default unchanged).
- Honest abort detection in the facts queue worker: /abort/i message
  sniffing matched Postgres's routine 'current transaction is aborted' —
  now err.name === 'AbortError' || signal.aborted only.
- runImport's #2114 anchor decision (kept/seeded/repointed) now rides the
  JSON summary + return shape instead of stderr only.
- TODOS: five follow-ups filed (orphaned-queue doctor check, wrapper-script
  scan, facts-absorb retention/PROTECTED posture, migration-version CI guard).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-08 23:59:51 -07:00
..