Skip to content

Live-runner boot preamble hardening — anchor prompts, discovery marker, wire broad-search classifier#490

Open
clkao wants to merge 3 commits into
mainfrom
spacedock-ensign/live-runner-boot-preamble-hardening
Open

Live-runner boot preamble hardening — anchor prompts, discovery marker, wire broad-search classifier#490
clkao wants to merge 3 commits into
mainfrom
spacedock-ensign/live-runner-boot-preamble-hardening

Conversation

@clkao

@clkao clkao commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Anchors the 8 non-boot-subject shared-scenario drive prompts on the absolute fixture root (workflowRoot) instead of Workflow directory: ., so a stray boot-phase cd cannot erase the FO's orientation.
  • Adds the commissioned-by: spacedock@1 discovery marker to the 8 fixture READMEs that lacked it, eliminating the deterministic --boot --identify false-negative (Spike-proven: 8/10 fixtures false-negatived before, 0/10 after; zero-discovery fixture stays deliberately markerless).
  • Wires the existing detectBroadSearchAtBoot detector into claudeLiveRunner.run's failure path via a new classifyBootPreambleFailure (wrong-root first, then broad-search), so a contract-file find / hunt at boot reds fast and legibly instead of an opaque 60s stall.

Fixes the boot-preamble nondeterminism class logged in the entity's 16-instance ledger (PR #488: 5/5 sonnet-lane attempts failed, 7 distinct scenarios, 0 passes, all upstream of the scenarios' actual subject matter).

Test plan

  • go build/go vet/go test/go test -race, with and without -tags live — all green (Pi live-test failures reproduced identically on main with the same fake-HOME setup — pre-existing, environment-only, unrelated to this diff)
  • TestSharedScenarioFixturesAreDiscoverable (10/10 subtests), TestZeroDiscoverFixtureStaysUndiscoverable, TestClassifyBootPreambleFailure* (3/3) — all pass
  • Detached adversarial audit on a throwaway checkout: mutated out the AC-1 marker and the AC-2 broad-search branch separately — both offline tests correctly red on the mutation (confirmed teeth, not tautologies)
  • AC-3 (live-measured): sonnet claude-live lane on the 5 non-boot-subject shared scenarios, ≥3 attempts, plus 1 CI-E2E-OPUS attempt, classified against the PR Claude final-message extractor returns the first result event, not the terminal one #488 baseline — needs maintainer environment approval on CI-E2E / CI-E2E-OPUS to run

🤖 Generated with Claude Code

…file hunts, and discovery false-negatives

Implements the three fixes from the live-runner boot-preamble-hardening
ideation (A/B/C):

- Fix A: thread the absolute fixture root into the 8 non-boot-subject
  drive prompts (gate, rejection, escalation, merge-hook, filing,
  merge-triage, smallest-mechanism, keep-moving) so a stray boot cd
  cannot erase the FO's anchor. The three boot-subject scenarios
  (default-headless gate drive, shallow-boot, zero-discover) are left
  unaided on purpose.
- Fix B: add the `commissioned-by: spacedock@1` discovery marker to the
  8 fixture READMEs that lacked it (gate, rejection, escalation,
  merge-hook, shallow-boot, merge-triage, keep-moving, gate-stop) so
  `status --boot --identify` resolves them deterministically instead of
  false-negativing on the FO's nondeterministic boot-path choice. The
  zero-discovery fixture stays markerless on purpose. gateStopReadme/
  gateStopEntity moved into the shared (non-live-tagged) fixtures file
  so the offline discovery test can build every fixture without a model.
- Fix C: wire the existing detectBroadSearchAtBoot detector into
  claudeLiveRunner.run's failure path via a new classifyBootPreambleFailure
  classifier (wrong-root wander first, then broad-search), so a
  contract-file find-hunt reds fast and legibly instead of surfacing as
  an opaque 60s stall. The detector's error text is generalized off its
  zero-discover-specific phrasing to cover both boot shapes.

Adds offline coverage for both value ACs: boot_discovery_test.go (AC-1,
every fixture discoverable, zero-discovery fixture stays undiscoverable)
and boot_preamble_classify_test.go (AC-2, a find-hunt stream classifies
as a broad-search diagnosis, wrong-root takes priority, a clean boot
passes).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…lass

Cycle-1 validation measured AC-1/AC-2 as fully proven live (wrong-root
wander and discovery false-negatives never recurred across 4 live
attempts) but AC-3 unmet: fix C classifies a boot-preamble contract-file
hunt fast and legibly, but by design does not prevent it, and the class
persisted at 33% (8/24) on the sonnet lane, concentrated in `filing`
(0/3 pass). This is exactly the condition the ideation-stage Proposed
approach flagged as the trigger for its explicitly deferred
boot-preamble-retry lever.

Adds that lever: claudeLiveRunner.run now retries a launch whose stream
classifies as a boot-preamble fumble (classifyBootPreambleFailure) with
a fresh launchAttempt, up to bootPreambleMaxAttempts (3) total, before
failing the scenario. The retry decision is a pure, offline-testable
policy (shouldRetryBootPreamble) that fires ONLY on a classified
preamble fumble — never a generic stall or a downstream scenario
assertion, so a genuine scenario regression is never silently re-run
away. Boot-subject scenarios (isBootSubjectScenario; shallow-boot is
the only one reachable through this runner) opt out and get exactly one
attempt, since a boot-preamble retry would mask the very lean-boot
discipline regression such a scenario exists to catch — the captain
confirmed 2026-07-08 that shallow-boot's own contract-file-hunt red is
a genuine finding, not a detector bug.

The per-attempt launch is extracted into launchAttempt, archiving each
attempt's stream under its own attempt-numbered filename so a persisted
failure's full retry history stays inspectable; the canonical
claude-stream.jsonl always reflects the last attempt.

Offline coverage: boot_preamble_retry_test.go proves the policy retries
up to budget, never retries a clean boot, and opts shallow-boot out.

Also applies cycle-1's two requested prose corrections to the entity
body (AC-3's scenario count 5->8, AC-1's fixture count 9->10) and
qualifies the Test Plan's opt-out-must-stay-green line to reflect the
captain-confirmed shallow-boot finding — entity edits, not code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
clkao pushed a commit that referenced this pull request Jul 9, 2026
Boot-preamble-retry lever implemented (commit 949fa2d, PR #490) plus
the two requested prose corrections and the Test Plan opt-out-green
reword, closing out cycle-1's REJECTED-on-AC-3 feedback.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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