Gate the Pi front door bootstrap on resume - #770
Closed
clkao wants to merge 3 commits into
Closed
Conversation
Pi-dispatched ensigns missed the stage report on real dispatches because
skill="ensign" is discoverable, not auto-loaded, and the dispatch body
carried no stage-report format. build.go step 8 now emits a
### Stage Report format block (the ## Stage Report: {stage} heading +
DONE/SKIPPED/FAILED/Summary structure, sourced from
ensign-shared-core.md) conditional on host=="pi", and the Pi firstActionBlock
is narrowed from the full ensign discipline overclaim to the stage-report
format template only (the ensign skill supplies the rest).
AC-2: a fixture test in internal/dispatch builds an artifact with a
non-self-describing checklist for host=pi and asserts the body carries
## Stage Report:, - DONE:, - SKIPPED:, - FAILED:, ### Summary; the same
test asserts host=claude and host=codex do NOT carry the embedded block.
AC-1/AC-3: a non-self-describing live-lane variant in internal/ensigncycle
dispatches a Pi worker with a checklist equal to a real entity's acceptance
criteria (no skill-path, heading, or format hints) and asserts the worker
still writes a complete ## Stage Report: implementation with a clean
state-checkout commit. An offline build guard asserts the body carries the
protocol while the checklist stdin carries no format hint. Reverting the
body embed makes the Pi fixture and the offline guard RED (claude/codex stay
green) — the tautology the existing self-describing lanes could not close.
Registry: register the pi-non-self-describing-dispatch runtime proof and its
pi/non-self-describing-smoke fixture.
…oor-smoke step AC-1 (a Pi-dispatched ensign writes a complete stage report on a real, non-self-describing dispatch) was only proven offline / by the adversarial revert; no CI step's -run filter selected TestLivePiNonSelfDescribingDispatch (the front-door-smoke step ran TestLivePiFrontDoorSmoke, the common-journeys step ran ^TestLiveCommon). Extend the front-door-smoke step's -run to 'TestLivePiFrontDoorSmoke|TestLivePiNonSelfDescribingDispatch' so AC-1 is auto-proven in CI on every pi-live cadence and PR, reusing the shared front- door fixture infra. CI-wiring only — no test or production code changed.
clkao
changed the base branch from
spacedock-ensign/embed-stage-report-protocol-in-dispatch
to
main
August 27, 2026 06:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
spacedock pi --resumere-loaded the Spacedock first-officer contract as a fresh start because the Pi front door appendspiBootstrapPrompt("Use $spacedock:first-officer for this whole Pi session.") unconditionally — zerocontainsResumegate, unlike the Claude/Codex front door (frontdoor.go:428,447) which suppresses its bootstrap prompt on--resume/-r/--continue/-c. A resume carries its own session intent and the FO contract survives in the system prompt viaresources_discover, so re-injecting the prompt tells the resumed session to load the contract as if starting fresh.Stacked on #764 (embed-stage-report-protocol-in-dispatch); merge #764 first.
What changed
internal/cli/pi.go: wrapped thelaunchPrompt(piBootstrapPrompt, fd)append inif !containsResume(fd.passthrough), reusing the sharedcontainsResumehelper atfrontdoor.go:553(the same one Claude/Codex use) — no new token set. Covers--resume,--resume=<id>,-r,--continue,-c.internal/cli/pi_frontdoor_test.go(new):TestPiResumeSuppressesBootstrapPrompt— table-driven, asserts each resume token suppressespiBootstrapPromptfrom the argv and non-resume passthrough (--model, a task string) keeps it as the last argv token.No extension change (
.pi/extensions/spacedock.ts): theFO_BOOTSTRAP_TEXTinjection is transient (Pi'scontexthook deep-copies, non-destructive) andsession_startfiresreason: "startup"on CLI launch so it can't detect CLI resume anyway.Evidence
go test ./internal/cli/ -run TestPiResumeSuppressesBootstrapPrompt -v— 7/7 subtests PASS (5 resume tokens suppress, 2 non-resume keep the prompt).git diff --numstatshows onlypi.go(9/1) +pi_frontdoor_test.go(70/0);.pi/extensions/spacedock.tsabsent (pi.go-only).TestVersionAmbiguousMarkersExitZerofails identically on main (pre-existingPI_CODING_AGENTenv marker).Residual (out of scope, follow-up): Pi's
--session <path|id>flag is a resume form not covered by the sharedcontainsResumetoken set.4av