feat: team memory — ledger merge/blame/query, attribution, per-author trust (substrate-v2 P2)#27
Merged
CodeWithJuber merged 1 commit intoJul 7, 2026
Conversation
… trust (substrate-v2 P2) The PCM ledger becomes shared memory (docs/plans/substrate-v2/02): - forge ledger merge <path>: semilattice merge of any other ledger tree (teammate checkout, worktree, backup) — idempotent, order-independent, conflict-free; identical knowledge minted independently converges to one claim with every author kept in its provenance log. On-disk convergence is the P2 acceptance gate and is tested (A<-B then B<-A then C in the opposite order are canonically identical) - forge ledger blame <id>: the accountability view — every mint, oracle outcome, and retraction with authors, plus earned per-author trust (17:36's audit trail made a command) - forge ledger query "<text>": Eq. 3 retrieval over live claims - attribution: every claim, evidence record, and tombstone carries the git identity (FORGE_AUTHOR override, cached per process, best-effort) - per-author trust u(author) in [0.5, 1]: Beta-smoothed oracle track record of the claims an author minted — bootstrap 1.0 (never punish the new teammate), floor 0.5 (never silence anyone), self-confirmation excluded (C12); val() accepts a trust map to weight evidence by its appender - forge doctor: checks the union-merge driver is present and the ledger's normal form 274/274 tests, biome + tsc clean, two-teammate flow smoke-tested live. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fc2MvWJbQ1cyNQ76ymv4hs
CodeWithJuber
marked this pull request as ready for review
July 7, 2026 16:38
This was referenced Jul 7, 2026
Merged
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.
What & why
Phase P2 of the substrate-v2 plan (#24; P1 = #25/#26): the PCM ledger becomes team memory. Spec:
docs/plans/substrate-v2/02-team-memory.md.forge ledger merge <path>— the conflict-free semilattice merge of any other on-disk ledger (a teammate's checkout, a worktree, a backup). Idempotent and order-independent by the CRDT property; identical knowledge minted independently by two people converges to one claim with every author preserved in its provenance log. The P2 acceptance gate from the plan — on-disk cross-merge convergence (A←B, then B←A, then a third replica merging in the opposite order, all canonically identical) — is a test.forge ledger blame <id>— the accountability view: every mint (all authors via the provenance log), every oracle outcome, every retraction, plainvalvs trust-weightedval, and each participant's earned trust. This is the paper's 17:36 audit-trail obligation made a command.forge ledger query "<text>"— Eq. 3 retrieval (α·rel + β·rec + γ·val) over live claims, the first read-path surface on the ledger.gitAuthor()insrc/util.js:FORGE_AUTHORenv override →git config→""; cached per process; best-effort by design).authorTrust()computesu(author) ∈ [0.5, 1]from the oracle track record of the claims an author minted: Beta-smoothed so a no-history teammate starts at 1.0 (never punish the newcomer), floored at 0.5 (never silence anyone), and an author's own evidence on their own claims is excluded (the C12 self-preference discipline).val()accepts a trust map so a repeatedly-contradicted author's evidence moves confidence less.forge doctor— two new checks: the union-merge driver is present in.gitattributes(a populated ledger without it will conflict on the first concurrent append) and the ledger passes normal-form verification.Smoke-tested live: two "teammates" with separate repos each learned the same fact plus one unique fact; after
forge ledger merge, the shared fact is one claim with both mints in provenance, blame shows both authors with earned trust, and doctor flags the missing merge driver in the un-inited repo.Checklist
npm testpasses (274/274 — new: on-disk cross-merge convergence, blame view, authorTrust bootstrap/floor/self-exclusion, trust-weightedval)npm run checkpasses on changed filesauthorTrust,mergeDirs,blame,gitAuthorexercised via bridge attribution)feat:)CHANGELOG.mdupdated under## [Unreleased]02-team-memory.md§2–§3 (CLI surface, attribution, trust weighting)Risk & rollback
valparameter; attribution fields ride in append-only logs (never in claim ids), so existing ledgers stay validExtra checks (tick if applicable)
npm run typecheckpassesmergerefuses missing paths;blamerequires a ≥2-char prefix)🤖 Generated with Claude Code
https://claude.ai/code/session_01Fc2MvWJbQ1cyNQ76ymv4hs
Generated by Claude Code