refactor: share workflow contracts across harnesses#116
Draft
tbrownio wants to merge 2 commits into
Draft
Conversation
Claude agent shims now stop and report the missing path when a role contract is unreachable, matching the Codex TOML behavior. The two workflow contracts past ~300 lines (do, excalidraw-pr-diagrams) gain a Contents section so a partial reader can route to the right section. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
What: Centralizes workflow semantics, delegated-role instructions, and
workflow-owned formats/assets into shared references, with thin Claude and
Codex adapters around them. It also moves Codex workflow discovery to
.agents/skills, adds project custom-agent definitions under.codex/agents,removes obsolete leaf-role skills, and makes consumer/user sync union-safe.
A follow-up hardening pass makes every Claude agent shim fail closed on a
missing role contract and adds a Contents section to the two workflow
contracts past ~300 lines.
Why: Workflow and role behavior was duplicated across harness-specific
files, allowing fixes to drift and exposing internal Codex leaf roles as
user-facing skills. The hardening pass addresses the two recurring caveats of
the pointer-based (progressive-disclosure) pattern documented in Anthropic's
skill-authoring guidance and practitioner reports: an agent that improvises
when its referenced contract is unreachable, and partial reads of long
referenced files (Anthropic recommends a table of contents past ~300 lines).
The Codex TOMLs already failed closed; the Claude shims now match.
How: Shared contracts now live under
references/workflows/andreferences/agents/; adapters retain only invocation, dispatch, and lifecyclebehavior. A repository check validates pointers, metadata, discovery,
repo-agnostic content, legacy tombstones, idempotence, and preservation of
consumer-local content. All six Claude agent shims append the same
fail-closed sentence used by the Codex agent TOMLs;
do.mdandexcalidraw-pr-diagrams.mdgain## Contentssections.Done means: Claude and interactive Codex workflows execute the same shared
semantic contracts, both discovery layouts work, personal union-space entries
survive repeated syncs, and the existing Claude-rooted daemon remains
regression-green.
Visual overview
Visual overview: none — this is a repository-only Markdown, discovery, and sync
refactor with no rendered user interface.
Verification
on pass 2 with zero Must Fix or Should Fix findings.
bash scripts/check-skill-contracts.sh— passed, including disposableconsumer/user sync, idempotence, union-space preservation, discovery, and
normalized-root refusal. Re-run after the fail-closed/TOC hardening commit:
passed.
bash scripts/check-dispatch-survival.sh— passed.shellcheck scripts/sync.sh scripts/sync-user.sh scripts/check-skill-contracts.sh— passed.
pnpm typecheck && pnpm build && pnpm testfromdaemon/— passed:325 tests passed, 1 integration test skipped.
git diff --check— passed.Residual risks
used by interactive Codex environments, but this PR does not qualify
unattended Codex CLI child spawning.
no native Codex daemon gate, version watcher, provisioning, migration, or
activation changes.
🤖 Generated with Claude Code