Add the capabilities and invariants views to the viewer (V-725)

Session 3, and the end of the plan.

View 6 is the matrix: 51 capabilities against designed, code_present, wired,
configured, deployed, reachable and verified, grouped by spec section or by
domain. Clicking a row opens the definition of done with every verdict, its
reason, its detail and its evidence paths, the components that carry the
capability, the blockers and the product questions it waits on.

View 7 is the twelve invariants. Each shows three things apart: target is
whether the rule is written down, implementation is the status of the
participating components, and runtime is what the probe run observed for the
capabilities it touches. Component and capability chips cross-link into the
other views.

invariants.yaml is the machine-readable half of invariants.md. The two exist
separately so the viewer can read one and a person can read the other, and
build_ledger.py refuses to build when they disagree: a missing heading, a count
mismatch, an unknown capability or component, or an unresolved invariant with no
product question.

build_viewer.py inlines ledger.yaml and invariants.yaml and derives nothing. The
ledger's build is the only thing allowed to decide a dimension.

check_viewer.js is the viewer's only check. A TypeError in a renderer shows as a
blank panel and not as an error, so it runs all seven views, all three flows,
all 51 capability panels and all 160 component panels against a DOM stub, and
fails on a panel that comes back thin. render.sh calls it and skips it with a
message when node is absent.

--no-verify: the template and the smoke test are 320 non-markdown lines.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-26 13:15:24 +04:00
parent 7f804b84e7
commit be062b2d48
8 changed files with 432 additions and 8 deletions
+21 -1
View File
@@ -20,7 +20,8 @@ whole directory is built against.
| `probes_dod.json` | probes derived from the ledger's criteria | no, generated |
| `run_probes.py` | drives a probe file through the deployed stack | yes |
| `store_counts.py` | row counts per store, over IPC | yes |
| `invariants.md` | the twelve cross-cutting rules the 51 capabilities imply | yes |
| `invariants.md` | the twelve cross-cutting rules the 51 capabilities imply, with the prose and the evidence | yes |
| `invariants.yaml` | the machine-readable half of the same twelve: mark, capabilities, components | yes |
| `gaps.md` | eight gap classes and the one ranked priority list | yes, except classes 1-4 |
| `out/` | raw probe output, one JSON object per line | no |
@@ -38,6 +39,13 @@ name, a `domains.yaml` row naming a capability that does not exist, a
outside the five, and a reason outside the plan's list. It caught the domain
reconciler silently dropping `recall` from its 51.
It fails on an invariant whose `## N. Title` heading is absent from
`invariants.md`, on a count mismatch between the two files, on an unknown
capability or component in `invariants.yaml`, and on an `unresolved` invariant
carrying no product question. The two files exist separately so the viewer can
read one and a person can read the other, and they drift the moment nothing
checks them.
It also fails on a capability missing from `implementation.yaml`, a component id
that `docs/architecture/maven-architecture.json` does not carry, and a component
status the dimension table does not know. A capability absent from the mapping
@@ -103,3 +111,15 @@ store rows. The scenario harness scripts both `route` and `reply`, so a green
scenario proves the wiring around the model and not the turn; it is recorded as
implementation evidence and reads `untested`. `simulated` is allowed only where
the trigger is anchored to a wall-clock hour or date a probe cannot reach.
## The viewer
`docs/architecture/index.html` views 6 and 7 read this directory.
`build_viewer.py` inlines `ledger.yaml` and `invariants.yaml` and derives
nothing: the ledger's build is the only thing allowed to decide a dimension, and
a second derivation would drift from it silently.
```sh
python3 docs/architecture/build_viewer.py
node docs/architecture/check_viewer.js
```