Skip to content

spec: route every session through the entrypoint before it acts on the workflow - #29

Merged
yuema137 merged 5 commits into
mainfrom
docs/entrypoint-bootstrap
Sep 10, 2026
Merged

yuema137 merged 5 commits into
mainfrom
docs/entrypoint-bootstrap

Conversation

@yuema137

Copy link
Copy Markdown
Owner

Closes #25.

The failure this answers

An agent read the three long prompts, did not recheck the entrypoint, and told its operator that a combined step/PR document violated Structured Coding. Rule 2 and workflow §3 say the opposite — a one-PR step is expanded in place. The rule was present, required reading, and byte-identical in source and package. What was missing was the recheck, so this PR is about routing, not about restating the rule that was misread.

Five commits

  1. SKILL.md — rule 5 extends from "resume after compaction" to any new, replacing, or delegated session, stated as a session boundary and explicitly not a per-turn reread. The phase table gains two sentences: it is the required resource list (so nobody assembles one from whichever prompt names a kickoff mentions), and before asserting compliance, read the rule you are citing in this session. specification_sha256 updated deliberately — the check refused the change until it was.
  2. continuity.py — both SessionStart branches name the installed SKILL.md by absolute path. The unbound branch already resolved the skill directory for its activate line and the recovery branch already listed prompt paths, so this is a path the handler was computing anyway: no new state, event, or registration. An installation missing SKILL.md omits the sentence rather than printing a path the agent cannot open.
  3. verify_skillSKILL.md, agent-workflow.md and adaptation.md join the required set for every preset, so doctor no longer passes an install that is missing the files the entrypoint requires (and, after commit 2, missing the file a hook now names).
  4. docs/content.{en,zh-CN}.json — all three copyable kickoffs read the entrypoint first, so a user with no hooks still hands the agent the route. The execution kickoff naming only the two prompts was Require complete phase-aware onboarding before agents claim workflow compliance #25's complaint verbatim. Example paths also move off the stale docs/plan/ onto .structured-coding/plans/. Edited in the generated source, which Require complete phase-aware onboarding before agents claim workflow compliance #25 asks for by name.
  5. Unplanned, found by an install probe — the recovery message claimed the entrypoint "comes first" while the path actually sat fourth, behind the three bound documents (documents + rules, with the insert going into rules). An agent trusting that ordering looks in the wrong place. Fixed; the test had only asserted it preceded the prompts, so it now asserts against the bound design document too.

One item declined, not silently

Issue #25 item 3 asks for a recorded onboarding READY state. Item 4 of the same issue says a checkbox or file hash cannot prove the model received the content — which rules out the mechanism item 3 needs. A helper printing READY would assert exactly what it cannot observe. The honest subset is "these files exist, are readable, and match the installed version", which is commit 3. The operator agreed to close #25 on that basis.

verify_skill compares against this repository's source, so it answers for a clone-based install; it is not validation of an arbitrary distributed copy, and doctor does not claim to be.

Evidence

Probed on a real claude-code install into a temporary project:

  • unbound SessionStart names <project>/.claude/skills/structured-coding/SKILL.md — the installed copy, not this checkout
  • recovery SessionStart lists it first, ahead of design.md
  • --check-hooks with SKILL.md removed: Installed skill lacks this preset version; restored: healthy
  • tests run against a relocated copy of the skill, so a hardcoded development path fails; reverting each source change fails its tests (4, 3 and 2 assertions respectively)

Ran 171 tests ... OK (skipped=1). All five --check validations PASS. Packages at codex 23 / claude-code 22 files.

Not observed: a real host delivering these messages under an authenticated turn. SessionStart delivery on both hosts was measured in the continuity work; what is new here is message content, exercised through the installed runtime directly.

Nothing here blocks anything — a missed recheck cannot refuse work.

🤖 Generated with Claude Code

yuema137 and others added 5 commits September 10, 2026 18:43
…efore citing it

An agent using this skill read the three long prompts, did not recheck the
entrypoint, and then told its operator that a combined step/PR document
violated Structured Coding. Rule 2 and workflow section 3 say the opposite:
a one-PR step is expanded in place. The rule was present, required reading,
and byte-identical in the source and the distributed package. What was
missing was the recheck.

Two additions, both aimed at that failure rather than at restating the rule
it got wrong:

Rule 5 already required re-reading the PR design and execution rules after
compaction. It now covers the other ways a session arrives at work it did
not plan: a new session, one replacing another, or a delegated agent. The
trigger is stated as a session boundary and explicitly not something to
repeat every turn, because a rule that asks for the whole library on each
turn is a rule agents work around.

The phase table gains two sentences. The first says the table is the
required resource list, so nobody assembles one from whichever prompt names
a kickoff message happened to mention -- the incident's session had the
prompts and only the prompts. The second says that before asserting
compliance or non-compliance, read the rule being cited in this session,
because the routing rules are not in the long prompts and recall from an
earlier session is not evidence.

The specification baseline in translations.json is updated deliberately for
the changed SKILL.md; the check refused the change until it was, which is
the point of pinning it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The prose rule added in the previous commit only helps a session that
reads the entrypoint. This commit is the mechanism for the case that
motivated the issue: a session that arrives at work it did not plan, and
has no reason to know where the routing table lives.

Both SessionStart branches now name the installed SKILL.md by absolute
path. The unbound message already resolved the skill directory to build
its activate invocation, and the recovery message already listed the two
prompt paths, so this is a path the handler was computing anyway rather
than new state, a new event, or a new registration. In the recovery list
the entrypoint goes first, because a recovering session is precisely the
one that reads the prompts and skips the routing rules the prompts do not
contain.

The entrypoint is resolved, not assumed: an installation missing SKILL.md
omits the sentence instead of printing a path that would 404 for the
agent, and the handler still returns its advisory message. Tests cover a
relocated copy of the skill, so a message that hardcoded the development
checkout would fail, and reverting the source fails all four assertions.

references/continuity.md gains a row saying what this does and does not
establish, in the same voice as the rows around it: naming the entrypoint
is not delivering it, and reaching a session is not reading.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
verify_skill checked the preset runtimes and interfaces. It did not check
SKILL.md, agent-workflow.md or adaptation.md, so an installation could
pass doctor while missing the files the entrypoint requires -- and, after
the previous commit, while a hook was naming a SKILL.md that is not there.

All three are now required for every preset, which makes doctor's existing
sentence about registration and runtime files cover them with no new
wording. Each removed file fails the same check a removed runtime fails,
and restoring them all reports healthy again.

The limit of this check is unchanged and worth stating: it compares the
installation against this repository's source, so it answers for a
clone-based install. It is not validation of an arbitrary distributed
copy, and doctor does not claim to be.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The execution kickoff named Implementation Working Rules and TEST / CI /
GATE and nothing else. That is issue #25's complaint stated exactly: a
session can follow the prominent prompt names, report compliance, and
never expose which routing material it missed. The incident's session had
those two prompts and only those two.

All three kickoff messages now read the entrypoint first and load what its
phase row lists, so a user with no hooks installed still hands the agent
the route. promptNote says what that establishes: the phase table is the
required list, so the agent need not reconstruct one from whichever names
a message mentions -- and asking is still not evidence it read them.
Tutorial step 4 gains the same recheck the entrypoint's rule 5 now states.

The example paths move from docs/plan/ to .structured-coding/plans/, which
has been the convention since v0.1.2 and which the kickoff text had not
caught up with.

Edited in docs/content.{en,zh-CN}.json, the generated source, rather than
in the READMEs they produce -- an omission issue #25 calls out by name.
Regenerated README, TUTORIAL, both HTML pages and both packages; mirror
and presentation hashes refreshed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A real install probe caught this: the message claimed the entrypoint
"comes first", but the path was inserted at the head of the rules list and
the reported list is documents followed by rules, so it appeared fourth,
after the three bound documents. The claim and the list disagreed, which
is the specific kind of wrong this hook must not be -- an agent that
trusts the ordering statement looks in the wrong place.

The entrypoint now leads the whole list, matching both the statement and
the reason for listing it at all. The test asserted only that it precedes
the prompts, which is why the suite stayed green through the defect; it
now asserts it precedes the bound design document too.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yuema137
yuema137 merged commit 9f8ac13 into main Sep 10, 2026
4 checks passed
@yuema137
yuema137 deleted the docs/entrypoint-bootstrap branch September 10, 2026 22:59
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.

Require complete phase-aware onboarding before agents claim workflow compliance

1 participant