docs: Substrate v2 plan — complete the whitepaper via the Proof-Carrying Memory protocol#24
Merged
CodeWithJuber merged 1 commit intoJul 7, 2026
Conversation
…ing Memory protocol Nine specs (docs/plans/substrate-v2/00-08) closing every remaining gap between the cognitive-substrate whitepaper and the shipped code, plus the owner-named pains (cost, reuse, team memory, incomplete context, generated-UI quality): - 01 PCM protocol: content-addressed claims, Beta-posterior confidence from independent oracles only, Eq. 3 retrieval, ilm->fahm->hikma layering - 02 team memory: git-native CRDT ledger (set-union semilattice merge) - 03 reuse cache: proof-carrying artifact cache (MinHash/LSH near-match, atlas revalidation, outcome-driven demotion) - 04 context assembly: token-budget knapsack + set-cover completeness gate - 05 cost model: measured-vs-target composition toward ~90%, P8 harness - 06 faculties/mechanisms: AST-tier atlas + mandatory gate, imagination dry-run (test set cover + worktree sandbox), oracle cascade, M3 partition planning, M4 CUSUM drift, M5 footprint metric, M6 checkpoint cadence, outcome-calibrated routing - 07 UI quality gate: design fingerprints, slop-distance + conformance - 08 forge dash: local dashboard over the ledger and metrics ADR-0005 (selective optional deps with stdlib fallbacks, supersedes 0001's blanket rule), ADR-0006 (PCM as the one store), ROADMAP P1-P8, CHANGELOG. Docs only; no runtime changes (222/222 tests green). 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 15:37
This was referenced Jul 7, 2026
Merged
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
ForgeKit v0.4 implements roughly half of the committed cognitive-substrate whitepaper. This PR adds the complete implementation plan for the rest — nine specs under
docs/plans/substrate-v2/+ two ADRs — closing every remaining paper gap (validity-anchored memory, outcome-validated learning, imagination, doom-loop diagnosis, M3–M6) and the project-owner pains the paper only gestures at: ~90 % cost target, reuse of already-generated code, team/shared memory, incomplete context, and generic AI-template UI.One idea unifies it: the Proof-Carrying Memory (PCM) protocol (
01-pcm-protocol.md, ADR-0006). Every stored unit — lesson, fact, cached artifact, graph edge, design fingerprint, diagnosis — is a content-addressed claim carrying provenance and evidence; confidence is a decayed Beta posterior moved only by independent oracles (tests, typecheck, CI, human accept/revert — never the model's self-assessment, per paper C12); retrieval implements the paper's Eq. 3 (α·rel + β·rec + γ·val). On top of it:02): git-native CRDT ledger — set-union semilattice merge, so teammates' memories converge with zero conflicts and no server.03): verified code served with its proof (MinHash/LSH near-match, atlas revalidation, outcome-driven demotion) — one teammate's verified work is everyone's cache hit.04): token-budget knapsack selection + a set-cover completeness gate that computes the missing-knowledge set instead of letting the agent assume (upgrades M2's questions from pattern-matched to derived).05): the honest composition toward ~90 % — routing's measured 62 % × cache × context × gate — with the P8 harness that replaces targets with measurements.06): AST-tier atlas + mandatory impact gate, imagination dry-run (impacted-test set cover + worktree sandbox), external-oracle cascade, M3 partition planning, M4 CUSUM drift control, M5 footprint/MDL metric, M6 optimal-stopping checkpoint cadence, outcome-calibrated routing.07): anti-template system — deterministic design-fingerprint extraction (OKLCH palette, spacing/type scale recovery), slop-distance vs. project-conformance scoring, uicheck v2 constraint checks, machine-readable taste profiles.forge dash(08): local zero-infra dashboard over the ledger, cost stages, cache, and blast radius.ADR-0005 relaxes the zero-dep rule to selective optional deps with stdlib fallbacks (supersedes ADR-0001's blanket rule, per owner decision);
ROADMAP.mdnow carries the dependency-ordered P1–P8 phases with acceptance gates; CHANGELOG updated.Docs only — no runtime behavior changes.
Checklist
npm testpasses (222/222 locally)npm run check— no JS/JSON touched (docs only)docs:)CHANGELOG.mdupdated under## [Unreleased]Risk & rollback
Extra checks (tick if applicable)
npm run typecheck— unaffected (no source changes)🤖 Generated with Claude Code
https://claude.ai/code/session_01Fc2MvWJbQ1cyNQ76ymv4hs
Generated by Claude Code