fix: pre-landing review fixes

Review army + red team findings, all verified before applying:
- ship-docsync E2E now asserts run_in_background === false on the
  captured dispatch (red team CRITICAL: phrase pins prove text exists,
  this proves the model obeys it — verified passing live).
- Structural scanner test: any generated file with an Agent-dispatch
  imperative (or bare '(foreground)' prose, the #2440 inert shape) must
  carry the flag or hold a reasoned exemption — the 4th-recurrence net
  the hand-enumerated pin list can't provide.
- Parent push reconciliation models reality: the parent shares the repo,
  so a non-fast-forward that hit the subagent hits the parent identically
  — fetch + ahead/behind check first, push only when the rejection was
  transient; dispatch prompt promise softened to 'the parent will handle
  it'.
- Recovered commits from a dead subagent are vetted docs-only
  (git show --stat, never VERSION/package.json) before any push.
- Deadline pacing named: ~3 minutes between checks, wall clock not polls.
- Greptile UNAVAILABLE recording narrowed to the PR body (Step 20's
  schema carries no triage field).
- document-release contract gains the echo-failure tie-breaker: prompt
  claims spawned + no echo → fail fast with the dispatch contract's
  failure shape instead of reproducing the #2733 prose-STOP; contract
  anti-injection and NEVER-relax clauses pinned in tests.
- 'Claude Code v2.1.198' extracted to CC_BACKGROUND_DEFAULT_SINCE and
  interpolated at all resolver sites (byte-identical output).
- CHANGELOG: entry-boundary blank line restored; worst-case-wait row
  scoped to the backgrounded path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-09-01 21:16:00 +00:00
co-authored by Claude Fable 5
parent d200cc226e
commit a54f742179
16 changed files with 91 additions and 38 deletions
+4
View File
@@ -263,6 +263,10 @@ describeE2E('Ship doc-sync dispatch E2E (gate)', () => {
// THE regression assert: the /document-release subagent was dispatched.
expect(dispatchIdx).toBeGreaterThanOrEqual(0);
// v1.79: the dispatch must carry the explicit foreground flag — the
// whole #497/#2440 class is "prose said foreground, the call didn't".
// Phrase pins prove the text exists; this proves the model obeys it.
expect((calls[dispatchIdx].input as any)?.run_in_background).toBe(false);
// Sequencing: dispatch happens BEFORE PR creation (when a create was attempted).
if (prCreateIdx >= 0) expect(dispatchIdx).toBeLessThan(prCreateIdx);
// 'timeout' is acceptable ONLY because the dispatch assert above is