feat: formal-synthesis paper gap closure — knowledge router, consensus verify, radar, ledger sync, deja, dash v2#67
Merged
CodeWithJuber merged 2 commits intoJul 17, 2026
Conversation
The formal-synthesis crosswalk (rows 5/6/12/14) and its README §11 binding paragraph cited hooks this repo no longer ships (docs-guard.sh, session-context.sh, intent-router.sh). Rewritten to the real bindings — cortex.sh -> src/gate.js stopGate (Stop), src/session.js rehydrationBlock (SessionStart), src/intent.js exemplar k-NN (UserPromptSubmit) — with kit-only names marked by a kit: prefix so the claude-e2e-kit binding stays distinguishable from forgekit's. New checkCrosswalk reconciler in src/docs_check.js (registered as the "crosswalk" dimension): every non-kit: .js/.sh file token in crosswalk.json's forgekit column must exist in src/, global/guards/, or hooks/; corrupt JSON errors, a missing crosswalk.json (npm installs without research/) is a no-op. ARCHITECTURE.md docs-check paragraph and CHANGELOG [Unreleased] updated in the same change; tests cover pass, stale-binding, kit:-optout, corrupt, and missing cases. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_017Ebv4QDTqzPzgApBW2KUsU
… in ledger/route/doctor/cost New src/fmt.js (zero runtime deps): supportsColor with the standard FORCE_COLOR > NO_COLOR > TERM=dumb > isTTY precedence, paint(text, role) mapping semantic roles (ok/warn/err/accent/dim) to brand.json dark-palette tokens — 24-bit SGR when COLORTERM declares truecolor, portable 16-color fallback otherwise (the statusline.sh degradation pattern) — plus a visible-width-aware table() and a bar(v01) confidence meter. With color off, paint is the identity, so piped output never carries an escape byte. Adopted in cli.js: doctor status icons + verdict, ledger stats val triage, ledger blame val meter + confirm/contradict evidence, ledger query score meters, cortex confidence meters, route model pick + complexity meter, cost footnotes, and the --verbose title line. All four terminal env reads (NO_COLOR, FORCE_COLOR, TERM, COLORTERM) are registered with docs_check.envVarsRead and documented in README.md + docs/GUIDE.md. Tests: test/fmt.test.js covers the precedence table, truecolor hex emission from brand.json, bar clamping, ANSI-aware table alignment, and an end-to-end CLI spawn proving FORCE_COLOR=1 colors piped output while NO_COLOR strips it. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_017Ebv4QDTqzPzgApBW2KUsU
CodeWithJuber
marked this pull request as ready for review
July 17, 2026 03:04
12 tasks
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
Closes the verified gaps between the newest research paper (
research/formal-synthesis/— "A Formal Theory of the Cognitive Substrate for Coding Agents") and whatsrc/actually implements, plus the two priority tracks: UI/UX and cross-session memory.Landed so far (more commits arriving — this PR is being built incrementally by a multi-agent workflow):
docs(research): crosswalk bindings reconciled with the real cortex-hook system (staledocs-guard.sh/session-context.sh/intent-router.shreferences replaced) + a newcrosswalkdocs-check reconciler that fails CI when a crosswalk binding names a file that doesn't exist.feat(fmt): zero-dep color-aware CLI formatting (src/fmt.js— FORCE_COLOR > NO_COLOR > TTY precedence, brand-token painting, aligned tables, confidence bars) adopted inledger/cortex/route/doctor/cost.Queued in this PR (one conventional commit each):
feat(know): A7 knowledge-router — totalroute(fact) → storage home(paper Theorem T6)feat(precommit): commit-level gate rung — the paper's missing middle of the turn ⊂ commit ⊂ PR gate latticefeat(update):--to <version>pin/downgradefeat(verify): multi-lens consensus (noisy-OR + cross-family gate, Theorem-D residual reporting)feat(radar): dependency-currency rings computed from evidence (paper invariant I4), recorded as ledger claimsfeat(ledger):sync— CRDT push/pull over a git ref or directory,--personalrecall portabilityfeat(deja): session summary claims + similar-task lookup — anti-repetition across sessions/machinesfeat(dash): v2 — live refresh, history trends, radar/memory/gate/timeline panelsfeat(report): self-contained HTML report emitchore(hooks): web session-start install hook + final docs sweepChecklist
npm testpasses (727 tests at current tip)npm run checkpasses (Biome — 6 pre-existing warnings unchanged)feat:/fix:/docs:…)CHANGELOG.mdupdated under## [Unreleased]forge substrate,forge impact, router/gate, or MCP substrate toolsRisk & rollback
FORGE_COMMIT_GATE=0,FORGE_RADAR=0,FORGE_DEJA=0) and no ledger schema changes were made (no new ORACLES/KINDS rows), so cross-version ledger merges stay clean.Extra checks (tick if applicable)
npm run typecheckpasses🤖 Generated with Claude Code
https://claude.ai/code/session_017Ebv4QDTqzPzgApBW2KUsU
Generated by Claude Code