build(contract): machine-readable decisions contract + zero-token plan-time surface#6154
Merged
Merged
Conversation
…n-time surface
Agents keep re-proposing settled build-system/CI/release config — the merge
queue was floated three times, bump-at-merge proposed and retracted twice,
auto-rebase and --adopt-head repeatedly suggested against scar tissue. Each
re-proposal burns a planning cycle and risks re-installing a fixed bug.
Ship the settled decisions as data plus a plan-time read surface so the next
agent sees them before touching fleet/CI config:
- .agents/contract.toml: schema-versioned, layered (generic `default` layer any
Shipyard+tartci+self-hosted repo inherits, plus a `pulp` overlay for warm-dir
ODR, the Debug macOS lane, the CMakeLists VERSION-line collision, no paid
runners). Public-safe: issue numbers, env-var names, and file paths only — no
emails, chat topology, or private host names. Each guard is constrained to the
declared fleet/CI config surface so the read surface can never fire on a
non-config path.
- tools/scripts/decisions_contract.py: the one agent-neutral checker both Claude
and Codex call. validate (exit 0/2), surface (advisory, exit 0, prints only
the rows a changed fleet/CI path triggers), list. Noninteractive, --json,
stable exit codes, no Shipyard/gh/network.
- hooks/scripts/decisions-contract-{hint,pointer}.sh: agent-neutral hook scripts
resolving the repo root via `git rev-parse` (not CLAUDE_PLUGIN_ROOT), wired for
Claude (hooks/hooks.json PostToolUse) and Codex (.codex/hooks.json
SessionStart + PostToolUse). Defense-in-depth only — advisory, never blocking
(Codex PreToolUse cannot hard-block); the boundary is the CLI validate gate +
CI required checks. Clean no-op for external contributors: a change touching no
guarded config path, or a checkout without the contract file, prints nothing
and exits 0.
- AGENTS.md + CLAUDE.md name .agents/contract.toml and the checker directly, so
Codex (which reads AGENTS.md, not "read CLAUDE.md") gets the pointer too.
- test/cmake/quality_tests.cmake: decisions-contract-validate (asserts the
shipped file is always schema-valid) and decisions-contract-selftest.
test_decisions_contract.py asserts the file parses + is schema-valid, the
surface returns the expected rows for guarded paths and is a silent no-op for
non-fleet paths, a malformed contract fails validate with exit 2, the hint hook
is a clean no-op without a fleet path and surfaces via both TOOL_INPUT and stdin,
and both AGENTS.md and CLAUDE.md carry the pointer.
Diff coverage (required)Diff coverage threshold: 75% (required). diff-cover reportDiff: origin/main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. See coverage.md for the current represented surface, how to interpret this number, and the full Phase 1 → Phase 3 roadmap. Per-tier diff coverage (#566 Phase 2)
All touched tiers meet their per-tier floors. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
# Conflicts: # .claude-plugin/marketplace.json # .claude-plugin/plugin.json # test/cmake/quality_tests.cmake
# Conflicts: # CLAUDE.md
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 19, 2026
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.
Agents keep re-proposing settled build-system/CI/release config — the merge
queue was floated three times, bump-at-merge proposed and retracted twice,
auto-rebase and --adopt-head repeatedly suggested against scar tissue. Each
re-proposal burns a planning cycle and risks re-installing a fixed bug.
Ship the settled decisions as data plus a plan-time read surface so the next
agent sees them before touching fleet/CI config:
defaultlayer anyShipyard+tartci+self-hosted repo inherits, plus a
pulpoverlay for warm-dirODR, the Debug macOS lane, the CMakeLists VERSION-line collision, no paid
runners). Public-safe: issue numbers, env-var names, and file paths only — no
emails, chat topology, or private host names. Each guard is constrained to the
declared fleet/CI config surface so the read surface can never fire on a
non-config path.
and Codex call. validate (exit 0/2), surface (advisory, exit 0, prints only
the rows a changed fleet/CI path triggers), list. Noninteractive, --json,
stable exit codes, no Shipyard/gh/network.
resolving the repo root via
git rev-parse(not CLAUDE_PLUGIN_ROOT), wired forClaude (hooks/hooks.json PostToolUse) and Codex (.codex/hooks.json
SessionStart + PostToolUse). Defense-in-depth only — advisory, never blocking
(Codex PreToolUse cannot hard-block); the boundary is the CLI validate gate +
CI required checks. Clean no-op for external contributors: a change touching no
guarded config path, or a checkout without the contract file, prints nothing
and exits 0.
Codex (which reads AGENTS.md, not "read CLAUDE.md") gets the pointer too.
shipped file is always schema-valid) and decisions-contract-selftest.
test_decisions_contract.py asserts the file parses + is schema-valid, the
surface returns the expected rows for guarded paths and is a silent no-op for
non-fleet paths, a malformed contract fails validate with exit 2, the hint hook
is a clean no-op without a fleet path and surfaces via both TOOL_INPUT and stdin,
and both AGENTS.md and CLAUDE.md carry the pointer.
Summary by cubic
Adds a machine-readable decisions contract and an agent-neutral plan-time surface to stop re-proposals of settled build/CI/release config. Ships a single CLI, advisory hooks for Claude and Codex, CI tests, and clear doc pointers.
Written for commit 09bbdae. Summary will update on new commits.
🔎 Provenance
claudem3SL/Volumes/Workshop/Code/pulp-worktrees/bw-decisions-contracte135c3c1-8355-4030-aa59-05f60adaf16cResume
Jump to this tab
Relaunch (any agent)
Restore URL — https://claude.ai/code/session_018qWM833UhHu4DFu5fXcFnF
stamped 2026-07-16 17:55 UTC