v0.1.98
Two agents scoped to separate repos that share no filesystem can now hand each other a change proposal or review verdict as digest-sealed JSON and verify/apply/list it fail-closed via cw ledger on both the CLI and MCP.
- Capability: A new
cw ledgerverb lets two agents scoped to two separate repos — running as two separate sessions that share no filesystem — hand each other a change proposal or a review verdict as verifiable data, not chat.cw ledger propose/reviewprint a self-contained JSON entry sealed with a sha256 content digest;cw ledger verifyandcw ledger list --dir <d>check them fail-closed (a tampered, malformed, or unreadable entry exits non-zero), socw ledger verify <file> && open-prcan never proceed on a lie. The exchange rides on any shared git host — GitHub or a self-hosted Gitea — because the kernel holds no git logic: writing iscw ledger propose > ledger/<id>.jsonplus your owngit add/commit/push.--diris repeatable, socw ledger list --dir a --dir b …union-verifies several mirror directories (e.g. a GitHub clone plus Gitea mirrors in other regions) into ONE fail-closed inbox for redundancy/reachability. Every verb is on both the CLI and MCP (cw_ledger_propose|review|verify|list), so an agent can mint and check entries in-process. - Implementation: New zero-dependency kernel module
src/ledger.ts(onlynode:crypto):buildLedgerProposal/buildLedgerReviewseal an entry with a digest over the key-sorted canonical JSON of every field exceptid/digest; theidis content-addressed (ldg-+ the first 16 hex of the digest) and bound to the content —verifyLedgerEntryrequiresid === deriveId(digest)and fails closed withledger-id-mismatchotherwise, so a spoofed or absent id cannot slip a forgery through the union's id-keyed de-duplication.unionLedgerEntries(dirs)de-dupes verified entries by that content-addressed id and setsallOk:falseif any entry in any mirror fails. CLI handlersrc/cli/handlers/ledger.tsdispatchespropose|review|verify|list(verify reads--file/stdin; a single--dirkeeps byte-identical single-directory output, 2+ take the union shape — POLA); MCP routes the fourcw_ledger_*tools through the same core (mcp/tool-call.ts+tool-definitions.ts), registeredpayloadIdentical:false(the entries are non-deterministic mints / directory reads). git stays entirely in userland. Man pagesdocs/cross-agent-ledger.7.md+ operator runbookdocs/handoff-setup.md(GitHub-vs-Gitea trade-off), design notedocs/designs/handoff-ledger.md. - Tests: New
ledger-verify-smokeproves the propose/review round-trip; that a content-tampered entry, non-JSON bytes, a truncated entry, a forged-id and an id-less entry each exit 1 with the matching fail-closed code;--file+ stdin transports; the git-transport inbox; the multi-mirror union (dedup across mirrors, single---dirPOLA shape, a tampered mirror failing the whole batch, and a spoofed-id forgery unable to mask a legit entry). The two id-binding defects were found by an adversarial review of the union and fixed before merge. Verified end-to-end against a real private GitHub handoff repo (propose → push → list→allOk:true).build,check,parity:check,index:check,gen:manifests --check,dist:check,parity-doc-sync-smoke,mcp-tool-call-coverage-smokeall green. - Risk: Low.
cw ledgeris a brand-new opt-in verb; no existing output, flag, exit code, or file layout changed (a single--diris byte-identical to a plain single-directory listing, andcw handoff— an unrelated run/task ownership-transfer primitive — is untouched). Zero new runtime dependencies. The id-binding check is a fail-closed hardening. Thecw:result/--jsonmachine surfaces, signing, and the multi-agent red line are unchanged.
Provenance & audit
- Reviewed commit:
c54b492485d7 - Independent reviewer verdict (committed):
.cw-release/review-c54b492485d7032c370c0ec6ce046029c505a141.verdict - Full diff:
v0.1.97...v0.1.98 - npm (provenance-attested):
cool-workflow@0.1.98
Released through the gated flow: deterministic gate → independent release-reviewer (verdict above) → provenance-attested npm publish.