Skip to content

Embed the stage-report protocol in the dispatch artifact - #764

Closed
clkao wants to merge 3 commits into
mainfrom
spacedock-ensign/embed-stage-report-protocol-in-dispatch
Closed

Embed the stage-report protocol in the dispatch artifact#764
clkao wants to merge 3 commits into
mainfrom
spacedock-ensign/embed-stage-report-protocol-in-dispatch

Conversation

@clkao

@clkao clkao commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Pi-dispatched ensigns missed the required ## Stage Report section on real dispatches because dispatch build's artifact body omitted the stage-report protocol while its ## First action block falsely claimed it carried it. Claude auto-loads via Skill() and Codex has a load-bearing $spacedock:ensign; then bootstrap edge; Pi had neither, so 3/4 workers wrote summaries in their result messages instead of stage reports in the entity files. This embeds the protocol in the Pi artifact body and narrows the false claim.

What changed

  • internal/dispatch/build.go: new stageReportFormatBlock() emits the ## Stage Report: {stage} + DONE/SKIPPED/FAILED/Summary template (sourced from ensign-shared-core.md); step 8a appends it conditionally on host == "pi"; the Pi firstActionBlock overclaim ("shared ensign discipline entry points (stage-report format, polling, worktree ownership, and completion protocol)") is narrowed to the stage-report format template (the ensign skill supplies the rest).
  • internal/dispatch/build_stage_report_protocol_test.go (new): TestBuildPiArtifactCarriesStageReportProtocol (AC-2 — pi body carries the tokens; claude/codex do not) + TestBuildPiFirstActionNarrowedToStageReportFormat.
  • internal/ensigncycle/pi_nonself_describing_build_test.go (new): TestPiNonSelfDescribingDispatchBuildBodyCarriesProtocol offline guard (asserts the body carries the protocol while the checklist stdin carries no format hint).
  • internal/ensigncycle/pi_nonself_describing_live_test.go (new, //go:build live): TestLivePiNonSelfDescribingDispatch (AC-1/AC-3 — a non-self-describing dispatch writes a complete stage report).
  • docs/runtime-live-ci-registry.md: registered the pi-non-self-describing-dispatch runtime proof.

Evidence

  • AC-2: TestBuildPiArtifactCarriesStageReportProtocol — pi body carries ## Stage Report:/- DONE:/- SKIPPED:/- FAILED:/### Summary; claude/codex do not. go test ./internal/dispatch/... ok (26.7s).
  • AC-3: adversarial revert — removing the if host == "pi" embed makes the pi subtest + the ensigncycle build guard FAIL (claude/codex stay green); restored, both pass.
  • AC-1: the live lane compiles under -tags live and its build guard passed; the live dispatch was auth-blocked locally (no Pi API key in the sandbox) — deferred to CI on this PR.
  • go test ./internal/dispatch/... ./internal/ensigncycle/... ok; gofmt -l clean; go vet clean; race clean.

t4

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.
@clkao
clkao force-pushed the spacedock-ensign/embed-stage-report-protocol-in-dispatch branch from 90694e6 to 430ab47 Compare August 26, 2026 16:16
…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.
Drop the Pi-only stageReportFormatBlock() embed and its step-8a
conditional from the dispatch body. The body no longer carries the
stage-report protocol template; a stacked follow-up layer rewrites the
Pi firstActionBlock to invoke the ensign skill instead.

Remove the body-presence assertions that depended on the embed:
- TestBuildPiArtifactCarriesStageReportProtocol (internal/dispatch)
- TestPiNonSelfDescribingDispatchBuildBodyCarriesProtocol (internal/ensigncycle)

Keep TestBuildPiFirstActionNarrowedToStageReportFormat (overclaim
gone), the live lane (TestLivePiNonSelfDescribingDispatch), and the
CI wiring. The live lane will fail in pi-live until the follow-up
layer rewrites firstActionBlock to invoke the skill — that is the
point (the lane proves the fix).
@clkao

clkao commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #774 — folded together. #774's branch contains the embed-removal rework + the firstActionBlock skill-load fix as one change.

@clkao clkao closed this Aug 27, 2026
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