Pi firstActionBlock loads the ensign skill before the dispatch file - #776
Merged
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.
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).
Rewrite the Pi firstActionBlock to direct the worker to load the ensign discipline BEFORE reading the dispatch file, mirroring Claude's Skill(skill="spacedock:ensign") and Codex's $spacedock:ensign bootstrap. The worker is told to run /skill:ensign (Pi's skill-invoke slash command) or fall back to reading skills/ensign/SKILL.md and its references/, then read the dispatch file for the stage-specific assignment. This drops the false claim that the dispatch file itself contains the ensign discipline entry points (the skill is in available_skills but the worker must be told to load it). Also revert the comment-only piSpawnSkill loader-version pin from the prior (wrong-scope) commit; piSpawnSkill="ensign" is unchanged. Add offline guard TestPiFirstActionInvokesEnsignSkill asserting the firstActionBlock contains a skill-load instruction (/skill:ensign or skills/ensign/SKILL.md), does not carry the false claim, and loads the skill before the read-dispatch-file instruction. Update two sibling tests whose body assertions referenced the old firstActionBlock phrase.
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.
Pi-dispatched ensigns didn't load the ensign skill — the Pi
firstActionBlocktold the worker to read the dispatch file and treat IT as the contract, never invoking the skill (unlike Claude'sSkill(...)and Codex's$spacedock:ensign; then). The skill sat inavailable_skillsunused. This fixes it the same way Claude and Codex do: the firstActionBlock now directs the worker to load the ensign skill first.(An earlier approach embedded the stage-report format in the artifact body — that duplicated the contract and was removed; this is the folded single PR: embed-removal + the skill-load fix.)
What changed
internal/dispatch/build.go: rewrote the PifirstActionBlock(host=="pi"branch) to direct the worker to run/skill:ensign(Pi's skill-invoke slash command) or readskills/ensign/SKILL.md+ itsreferences/to load the ensign discipline (stage-report format, polling, worktree ownership, completion protocol), then read the dispatch file for the stage-specific assignment. The false claim "This file contains the shared ensign discipline entry points" is dropped.piSpawnSkill="ensign"unchanged.internal/dispatch/build_stage_report_protocol_test.go(new):TestPiFirstActionInvokesEnsignSkill— asserts the firstActionBlock contains a skill-load instruction, the false claim is absent, and skill-load precedes read-dispatch.internal/ensigncycle/pi_nonself_describing_live_test.go(new,//go:build live):TestLivePiNonSelfDescribingDispatch— the proof: a Pi worker with a bare checklist (no format hints) loads the skill and writes a complete## Stage Report:.internal/ensigncycle/pi_nonself_describing_build_test.go(new): offline helpers + the smoke workflow fixture the live lane uses..github/workflows/runtime-live-e2e.yml: thepi-livefront-door-smoke step's-runfilter selectsTestLivePiNonSelfDescribingDispatch.docs/runtime-live-ci-registry.md: registered thepi-non-self-describing-dispatchruntime proof.Evidence
TestPiFirstActionInvokesEnsignSkillPASS (skill-load present, false claim absent, ordering correct), plain and -race.go test ./internal/dispatch/ ./internal/ensigncycle/green;-racegreen; live-tagged build compiles; gofmt/vet clean.TestLivePiNonSelfDescribingDispatchruns in CI pi-live (auth-blocked locally) — the test this fix greens: a bare-checklist Pi worker loads the skill and writes a complete stage report.TestVersionAmbiguousMarkersExitZero,PI_CODING_AGENTenv marker).t4 + ntn