diff --git a/.github/workflows/reusable-quality-gate.yml b/.github/workflows/reusable-quality-gate.yml
index 836a1c93..66ffa464 100644
--- a/.github/workflows/reusable-quality-gate.yml
+++ b/.github/workflows/reusable-quality-gate.yml
@@ -35,4 +35,6 @@ jobs:
- run: node src/cli.js docs check
- name: Claim registry and research copies are current
run: node scripts/claims-status.mjs --check
+ - name: Diagram sources match their verified renders
+ run: node scripts/diagrams.mjs check
- run: npm pack --dry-run
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index e5c00617..8a3a214c 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -40,10 +40,14 @@ jobs:
mkdir -p _site/status
cp landing/index.html _site/index.html
cp landing/app.js _site/app.js
+ cp -R landing/media _site/media
cp public/index.html _site/status/index.html
# Brand assets referenced by absolute URL from both pages (favicon,
# apple-touch-icon, 1200x630 og card). Served from the Pages root.
- cp docs/assets/og.png docs/assets/favicon.svg docs/assets/apple-touch-icon.png _site/
+ cp docs/assets/og.jpg docs/assets/favicon.svg docs/assets/apple-touch-icon.png _site/
+ # Interactive diagrams (/diagrams/): rendered from docs/diagrams/src by the pinned
+ # Archify commit; a file whose sha256 differs from its validated receipt is refused.
+ node scripts/diagrams.mjs site _site/diagrams
- name: Setup Pages
uses: actions/configure-pages@v6
- name: Upload artifact
diff --git a/.gitignore b/.gitignore
index a7448fe1..5d30f3df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -22,3 +22,6 @@ __pycache__/
# Generated status page — built fresh at deploy (scripts/build-pages.mjs)
public/
+
+# Build caches: the pinned Archify checkout (scripts/diagrams.mjs), the Pages API cache
+.cache/
diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md
index 2201642d..6f9166f3 100644
--- a/ARCHITECTURE.md
+++ b/ARCHITECTURE.md
@@ -43,24 +43,9 @@ You author the substrate once. `forge sync` compiles that source into each tool'
native config. The four layers are how the brain is expressed; the compiler is how it
is delivered.
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart TD
- S["source/ rules.json · substrate.json · mcp.json"] -->|"forge sync content-hash + DO-NOT-EDIT headers"| N["native configs CLAUDE.md · AGENTS.md · .cursor · .gemini · .aider · …"]
- S -. configures .-> L
- subgraph L["the four layers"]
- direction LR
- T["tools model-invoked skills"]
- C["crew isolated sub-agents"]
- G["guards (enforced) deterministic hooks"]
- M["mcp atlas + substrate server"]
- end
- K["local events cortex · recall · reuse · diagnose"] --> LG[("PCM ledger .forge/ledger/")]
- O["independent oracles tests · CI · human accept/revert"] -->|"move confidence"| LG
- LG <-->|"git union-merge, conflict-free"| TM["teammate ledgers"]
- classDef accent fill:#f26430,stroke:#f26430,color:#171310;
- class G accent;
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/system.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/system.html): pan, zoom, search, and trace any node.
The four layers, brand-named and emitted cross-tool:
@@ -88,28 +73,9 @@ checks and returns a single verdict. It composes the individually-callable stage
(`preflight`, `route`, `atlas`, `impact`, `reuse`, `context`, `scope`, `lean`,
`anchor`, `verify`) into one pre-action contract.
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart TD
- RE["referenced entities"] --> INTAKE
- subgraph INTAKE["intake"]
- direction LR
- PF["preflight assumption gap"] --> RT["route cheapest tier"]
- end
- INTAKE --> ANALYSIS
- subgraph ANALYSIS["analysis"]
- direction LR
- AT["atlas code graph"] --> IM["impact blast radius"] --> PT["predict failing tests"] --> RU["reuse cache hit?"]
- end
- ANALYSIS --> SAFETY
- subgraph SAFETY["safety + fit"]
- direction LR
- CX["context completeness gate"] --> SC["scope coupled files"] --> ME["memory recall + lessons"] --> MN["minimality lean footprint"] --> GA["goal-anchor drift check"]
- end
- SAFETY --> VD["verdict"]
- classDef accent fill:#f26430,stroke:#f26430,color:#171310;
- class VD accent;
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/pre-action-gate.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/pre-action-gate.html): pan, zoom, search, and trace any node.
**blast radius** — the set of files an edit is predicted to impact, read from the code
graph. `forge impact` computes it; the pipeline surfaces it before the model touches
@@ -146,23 +112,9 @@ claims into `.forge/ledger/`. Because a claim's bytes are a pure function of
`(kind, body, scope)`, every replica computes the same identity — so teammate ledgers
fold together over plain git with no conflicts.
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart LR
- subgraph EV["local events"]
- direction TB
- E1["recall / remember"]
- E2["cortex lesson"]
- E3["reuse mint"]
- E4["diagnose"]
- end
- EV -->|"content-addressed claims"| LG[(".forge/ledger")]
- O["independent oracles tests · CI · human accept/revert"] -->|"append evidence move confidence"| LG
- TM["teammate ledgers"] <-->|"git union-merge conflict-free"| LG
- LG --> RV["merged read view recall list · lesson inject · brain index"]
- classDef accent fill:#f26430,stroke:#f26430,color:#171310;
- class LG accent;
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/ledger-flow.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/ledger-flow.html): pan, zoom, search, and trace any node.
Mechanically: evidence and tombstones are append-only, hash-deduped logs; confidence
(`val`) is a decayed Beta posterior moved only by oracles; merge is a join-semilattice
@@ -175,6 +127,12 @@ query | ratify | retract | merge | import` (`--personal` for the per-user ledger
Decision recorded in
[`docs/adr/0006-proof-carrying-memory.md`](docs/adr/0006-proof-carrying-memory.md).
+A claim's life, from mint to tombstone:
+
+[](https://codewithjuber.github.io/forgekit/diagrams/claim-lifecycle.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/claim-lifecycle.html): pan, zoom, search, and trace any node.
+
## 4. The reuse / context loop
`forge reuse` is a proof-carrying code cache. A generated artifact is only served again
@@ -182,19 +140,9 @@ when its evidence still holds — the confidence is above the floor _and_ its at
dependencies still resolve. Otherwise it falls through to generation and mints a fresh
claim on the way back.
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart LR
- SP["spec"] --> FP["fingerprint MinHash + LSH"]
- FP --> LD["match ladder exact → near → adapt → miss"]
- LD --> GT{"confidence ≥ floor AND deps resolve?"}
- GT -->|"yes"| SV["serve (proof holds)"]
- GT -->|"miss"| GN["generate"]
- GN -->|"mint claim"| MT[(".forge/ledger")]
- MT -.->|"available next time"| FP
- classDef accent fill:#f26430,stroke:#f26430,color:#171310;
- class SV accent;
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/reuse-cache.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/reuse-cache.html): pan, zoom, search, and trace any node.
The completeness gate on the retrieval side is `forge context ""`: it pins the
required-knowledge set for the edit (`R(edit)`), downgrades items along a compression ladder
@@ -217,6 +165,12 @@ only if the checks fire independently. The same check repeated at another point
pre-commit, CI on the same diff) is nested, so the residual is `(1−p)(1−c_max)` (formal
synthesis §5.3, corrected 2026-09-21).
+Where those deterministic checks run in one Claude Code session:
+
+[](https://codewithjuber.github.io/forgekit/diagrams/hook-sequence.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/hook-sequence.html): pan, zoom, search, and trace any node.
+
**The completion gate (Stop, `src/gate.js`).** The only Stop-path guard that may answer:
`completion-gate.sh` runs synchronously (the lesson-mining `cortex.sh stop` stays
detached and can never block). The changed set is **session-scoped**: files from commits
@@ -386,6 +340,12 @@ and the residual stays `(1−p)(1−c_max)`. This rung adds catches only where i
Stop hook could not — edits made after the turn ended, a host or session where the Stop
hook never ran, or a session whose one Stop block was already spent.
+Plain `forge verify`, end to end:
+
+[](https://codewithjuber.github.io/forgekit/diagrams/verify-pipeline.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/verify-pipeline.html): pan, zoom, search, and trace any node.
+
**Deep verification (`src/consensus.js`, `forge verify --deep`).** Where plain `verify`
asks one oracle (the tests) plus one heuristic, this runs a table of independent lenses
and aggregates them with the same noisy-OR risk score `lessons.js` uses, behind a
@@ -677,21 +637,21 @@ from the tree it describes.
```mermaid
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
flowchart LR
- test["test 134 files"]
+ test["test 135 files"]
src["src 120 files"]
landing["landing 61 files"]
research["research 37 files"]
bench["bench 6 files"]
global["global 5 files"]
- scripts["scripts 3 files"]
+ scripts["scripts 5 files"]
docs["docs 1 file"]
examples["examples 1 file"]
- test -- 284 --> src
+ test -- 286 --> src
bench -- 12 --> src
+ scripts -- 5 --> src
examples -- 4 --> src
- scripts -- 3 --> src
+ test -- 4 --> scripts
test -- 3 --> global
- test -- 3 --> scripts
test -- 2 --> bench
src --> global
```
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dbaa02d7..4e230459 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,42 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
+### Fixed
+
+- **Build caches under `.cache/` stay out of the import graph.** `forge impact`, `forge scope`
+ and the generated repository map walked into `.cache/`, so a fetched tool checkout (such as
+ the pinned Archify under `.cache/archify/`) showed up as hundreds of project files.
+- **The landing page's hero says ten native targets.** It still said nine after OpenClaw joined
+ the grid.
+
+### Added
+
+- **Every diagram is now rendered by [Archify](https://github.com/tt-a1i/archify) from a typed
+ source.** Thirteen Archify diagrams replace the fifteen hand-written Mermaid diagrams in
+ README, ARCHITECTURE, ONBOARDING, GUIDE, the substrate docs and the docs site.
+ - The sources are architecture, workflow, sequence, dataflow and lifecycle schemas in
+ `docs/diagrams/src/`, each validated at Archify's showcase quality bar.
+ - The docs embed a dual-theme SVG that links to an interactive page on the Pages site
+ (`/diagrams/`). There you can pan, zoom, search and trace a node's dependencies.
+ - `scripts/diagrams.mjs` pins Archify by commit. The Pages build refuses to publish a
+ rendered page whose sha256 differs from its validated receipt.
+ - `node scripts/diagrams.mjs check`, now in the CI quality gate, fails when a source
+ changed without a re-render. `forge docs check` rejects new hand-written Mermaid
+ diagrams.
+ - The generated repository map stays Mermaid, because it is laid out from the live import
+ graph.
+
+ See `docs/diagrams/README.md`.
+- **Illustrations for the docs site and the landing page, and a new social card.**
+ - Seven docs-site pages open with an illustration.
+ - The landing page's evidence band has a background image, veiled so its text keeps at
+ least 5.4:1 contrast. It falls back to a flat color when the reader asks for more
+ contrast.
+ - The link-preview card is now `og.jpg` (284 KB), rendered from `docs/assets/og.svg` by
+ `scripts/og-card.mjs`. The script refuses to write the card if any line of text overlaps
+ the art or leaves the crop-safe area, or if the file exceeds link-preview size limits.
+ The previous `og.png` was 1.3 MB, over the size many preview scrapers accept.
+
## [1.6.0] - 2026-09-26
### Security
diff --git a/ONBOARDING.md b/ONBOARDING.md
index e3b60335..9ceded82 100644
--- a/ONBOARDING.md
+++ b/ONBOARDING.md
@@ -11,18 +11,9 @@ Windsurf, Zed, Continue, and OpenClaw at once. Author it once; every tool reads
This page is the fast path: install, configure a repo, do a task, and watch the ledger
start paying off on day two.
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart TD
- I["forge init"] --> Cfg["your tools configured from one source"]
- Cfg --> Work["you work as usual"]
- Work --> Gate["substrate checks each task: ask first? · which model? · what breaks?"]
- Gate --> Edit["agent edits, with guardrails"]
- Edit --> Learn["cortex learns from corrections"]
- Learn -.->|next task is smarter| Work
- classDef accent fill:#f26430,stroke:#f26430,color:#171310;
- class Gate accent;
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/onboarding-loop.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/onboarding-loop.html): pan, zoom, search, and trace any node.
## 1. Install (once)
diff --git a/README.md b/README.md
index b863c5ae..dad9bf9f 100644
--- a/README.md
+++ b/README.md
@@ -132,17 +132,9 @@ Forgekit supplies an external reliability layer:
Forgekit runs a deterministic substrate before work, lets the external coding agent act,
and records evidence from tests, CI, or explicit human correction afterwards.
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart TD
- T["Task"] --> G["Pre-action substrate"]
- G -->|"Missing information"| Q["Clarify first"]
- Q --> T
- G -->|"Enough information"| A["External coding agent acts"]
- A --> V["Tests, CI, or human outcome"]
- V --> M["Evidence-weighted memory"]
- M -.-> G
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/core-loop.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/core-loop.html): pan, zoom, search, and trace any node.
Only independent oracles (tests, CI, a human accept/revert) move a memory's confidence —
so a wrong lesson decays out instead of ossifying. Full design:
diff --git a/docs/GUIDE.md b/docs/GUIDE.md
index a11c1d56..0d4cfe60 100644
--- a/docs/GUIDE.md
+++ b/docs/GUIDE.md
@@ -70,16 +70,9 @@ substrate** (`forge substrate` — the pre-action check). The full argument is t
The daily loop — every outcome an oracle observes lands in the team ledger, and the
ledger informs the next task:
-```mermaid
-%%{init: {'theme':'base','themeVariables':{'primaryColor':'#201a15','primaryTextColor':'#f2ede7','primaryBorderColor':'#372c22','lineColor':'#f26430','secondaryColor':'#272019','tertiaryColor':'#171310','edgeLabelBackground':'#201a15','clusterBkg':'#171310','clusterBorder':'#4a3b2e','fontFamily':'ui-sans-serif, system-ui, sans-serif','fontSize':'14px'},'flowchart':{'curve':'basis','padding':10,'nodeSpacing':36,'rankSpacing':44}}}%%
-flowchart LR
- W["work — substrate pre-checks, then edit"] --> O["oracles — forge verify · imagine --run · CI · human accept/revert"]
- O -->|"outcomes move claim val"| L[("team ledger .forge/ledger/")]
- L <-->|"git + forge ledger merge"| T["teammates' ledgers"]
- L -->|"lessons · facts · reuse hits"| W
- classDef accent fill:#f26430,stroke:#f26430,color:#171310;
- class L accent;
-```
+[](https://codewithjuber.github.io/forgekit/diagrams/team-loop.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/team-loop.html): pan, zoom, search, and trace any node.
```bash
cd your-project
@@ -677,6 +670,10 @@ The independent check: runs the real test suite and flags edited symbols that ar
the codebase (possible hallucinations). This is what turns "the model says it's done"
into "the tests say it's done."
+[](https://codewithjuber.github.io/forgekit/diagrams/verify-pipeline.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/verify-pipeline.html): pan, zoom, search, and trace any node.
+
```console
$ forge verify
Forge verify
diff --git a/docs/UNIVERSAL_ROUTING.md b/docs/UNIVERSAL_ROUTING.md
index 6e5e7d0b..c4a123c1 100644
--- a/docs/UNIVERSAL_ROUTING.md
+++ b/docs/UNIVERSAL_ROUTING.md
@@ -12,6 +12,12 @@ The router code names no vendor, model, tier or threshold, and a test enforces t
>
> The shipped prior is a useful initialization, not a guarantee about your workload. The universal router is a separately versioned component from the old tiered router whose 62.1% saving was refuted (`research/empirical-refutation/`); neither result transfers to the other.
+How a recommendation is chosen, run and learned from:
+
+[](https://codewithjuber.github.io/forgekit/diagrams/router-cascade.html)
+
+[Open the interactive diagram](https://codewithjuber.github.io/forgekit/diagrams/router-cascade.html): pan, zoom, search, and trace any node.
+
## The model
**1. Who solves what: multidimensional item response theory.**
diff --git a/docs/assets/README.md b/docs/assets/README.md
new file mode 100644
index 00000000..f354efcd
--- /dev/null
+++ b/docs/assets/README.md
@@ -0,0 +1,29 @@
+# Brand and image assets
+
+| File | Used by | How it is made |
+| --- | --- | --- |
+| `favicon.svg`, `apple-touch-icon.png` | Every page of the Pages site; the Pages build serves them from the site root. | Vector mark |
+| `hero-light.svg`, `hero-dark.svg` | The README hero, one per GitHub theme. | Vector |
+| `og.svg` | The source of the social card: wordmark, headline and subline over `og-background.webp`. | Edited by hand |
+| `og-background.webp` | The card's art: a girih lattice and khatam star on the right, leaving the left side empty for type. | Generated art, 2400×1260 |
+| `og.jpg` | `og:image` and `twitter:image` on the landing and status pages. | `node scripts/og-card.mjs`. Never edit it directly. |
+
+To change the card, edit `og.svg` and run `node scripts/og-card.mjs`. The script uses the
+headless Chrome from the pinned Archify checkout (see `docs/diagrams/README.md`) and needs
+the network once, to fetch the Inter and JetBrains Mono web fonts. It refuses to write the
+card if a font did not load, if any line of text crosses into the art (x > 610 of 1200) or
+out of the crop-safe margins, or if the JPEG exceeds the roughly 300 KB that link-preview
+scrapers accept. `--check` measures the layout without writing anything.
+
+The other generated art lives next to the page that uses it:
+
+- `landing/media/evidence-bg.webp`: the landing page's evidence band. A 55% veil keeps its
+ text at 5.4:1 contrast or better, and it is dropped under `prefers-contrast: more`.
+- `mintlify/images/illustrations/*.webp`: the opening illustrations of seven docs-site
+ pages.
+
+All of this art was generated for this project in September 2026 as text-free geometric
+illustration in the brand palette (`brand.json`). It contains no sacred script. It
+illustrates ideas; it is not data. The diagrams are rendered from typed sources in
+[`docs/diagrams`](../diagrams/README.md), and every number the site states comes from the
+reports in the repository.
diff --git a/docs/assets/og-background.webp b/docs/assets/og-background.webp
new file mode 100644
index 00000000..1be4ccb4
Binary files /dev/null and b/docs/assets/og-background.webp differ
diff --git a/docs/assets/og.jpg b/docs/assets/og.jpg
new file mode 100644
index 00000000..7de849c4
Binary files /dev/null and b/docs/assets/og.jpg differ
diff --git a/docs/assets/og.png b/docs/assets/og.png
deleted file mode 100644
index bd21401d..00000000
Binary files a/docs/assets/og.png and /dev/null differ
diff --git a/docs/assets/og.svg b/docs/assets/og.svg
index 93761ae2..5b218306 100644
--- a/docs/assets/og.svg
+++ b/docs/assets/og.svg
@@ -1,9 +1,8 @@
-