Check decision records before an agent push lands
Agents forgot decision blocks or wrote them wrong, and the origin found out only after the push, through hooks that only some clients have. Now the origin checks every new commit of an agent push before the task branch moves, and explains any problem in the push output, which every git client shows. Human pushes are forwarded unchecked, as before.
2 decisions
A decision record here could not be read. Line 10: expected "name: value" under rejected.
Every agent commit carries at least one decision block or the trailer Decision: none.
Why
- Without it the origin cannot tell a forgotten record from a commit that decides nothing
- An explicit none is itself information for the reviewer
Derive decision ids from the commit hash and block position, make task come from the branch, and let supersedes name a decision as <full commit hash>#<block number>.
Why
- Writing a ULID needed the refs_decision_id tool, which ties the format to MCP
- Pushed task-branch commits never change, so an id derived from the hash is stable
- Agents can name a decision to supersede from git log alone
Assumes
- Task branches stay non-force-pushable
Touches
decision.ts
20 files changed · +445 −143
README.md+2 −2
apps/backend/decisions.ts+75 −18
apps/backend/git.ts+101 −9
apps/backend/index.ts+12 −11
apps/backend/mcp.ts+1 −8
apps/backend/sessions.ts+3 −2
apps/backend/test/admit.test.ts+75 −0
apps/backend/test/push.test.ts+25 −1
apps/backend/test/pushes.test.ts+3 −5
apps/cli/refs.mjs+1 −1
apps/frontend/components/commit-reasoning.tsx+2 −2
apps/frontend/routes/llms-txt.ts+5 −7
apps/frontend/routes/pull-layout.tsx+1 −1
apps/frontend/routes/pull-reasoning.tsx+1 −1
apps/frontend/routes/repo-commits.tsx+1 −1
docs/ref-protocol.md+32 −19
packages/protocol/decision.ts+51 −18
packages/protocol/test/decision.test.ts+52 −20
packages/protocol/test/wire.test.ts+1 −7
packages/protocol/wire.ts+1 −10