Skip to content

Pi firstActionBlock loads the ensign skill before the dispatch file - #776

Merged
clkao merged 5 commits into
mainfrom
spacedock-ensign/pi-spawn-skill-name-resolution
Aug 28, 2026
Merged

Pi firstActionBlock loads the ensign skill before the dispatch file#776
clkao merged 5 commits into
mainfrom
spacedock-ensign/pi-spawn-skill-name-resolution

Conversation

@clkao

@clkao clkao commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Pi-dispatched ensigns didn't load the ensign skill — the Pi firstActionBlock told the worker to read the dispatch file and treat IT as the contract, never invoking the skill (unlike Claude's Skill(...) and Codex's $spacedock:ensign; then). The skill sat in available_skills unused. 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 Pi firstActionBlock (host=="pi" branch) to direct the worker to run /skill:ensign (Pi's skill-invoke slash command) or read skills/ensign/SKILL.md + its references/ 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: the pi-live front-door-smoke step's -run filter selects TestLivePiNonSelfDescribingDispatch.
  • docs/runtime-live-ci-registry.md: registered the pi-non-self-describing-dispatch runtime proof.

Evidence

  • TestPiFirstActionInvokesEnsignSkill PASS (skill-load present, false claim absent, ordering correct), plain and -race.
  • go test ./internal/dispatch/ ./internal/ensigncycle/ green; -race green; live-tagged build compiles; gofmt/vet clean.
  • The live lane TestLivePiNonSelfDescribingDispatch runs 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.
  • One pre-existing unrelated failure (TestVersionAmbiguousMarkersExitZero, PI_CODING_AGENT env marker).

t4 + ntn

clkao added 4 commits August 26, 2026 09:16
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.
@clkao
clkao merged commit 7420d0a into main Aug 28, 2026
16 of 18 checks passed
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