Skip to content

feat(diagrams): add mechanism diagrams to deep panels and docs - #25

Merged
saagpatel merged 3 commits into
mainfrom
feat/mechanism-diagrams
Sep 3, 2026
Merged

feat(diagrams): add mechanism diagrams to deep panels and docs#25
saagpatel merged 3 commits into
mainfrom
feat/mechanism-diagrams

Conversation

@saagpatel

Copy link
Copy Markdown
Owner

Mechanism diagrams

Six data-driven diagrams of how the Operator OS works, rendered from one model each into the scene deep panels (Spine, Hub, Safety, Coda) and into committed SVG files plus a generated docs/mechanisms.md.

  • Every count and clock time on a diagram is computed from src/data/dataset.json, the closed vocabularies, or the architecture manifest.
  • Each diagram wears the weakest assurance level of the claims it depicts, taken from public/architecture-manifest-v1.json.
  • Placement is declared on the model; SceneFrame mounts the figures, so no scene file changed.

Tests that fail if a diagram lies

  • src/diagrams/registry.test.ts: claims resolve in the manifest, the badge is the weakest claim, placement matches the scene's declared claims, wide and phone layouts print identical labels, and no label clips or overlaps at the phone label floor.
  • src/diagrams/facts.test.ts: golden facts pinned against the dataset, vocabularies, seed, and vite.config.ts.
  • src/diagrams/render.test.ts: the app and the docs export print the same labels; committed SVG files and docs/mechanisms.md equal a fresh render byte for byte; the SVG palette equals the stylesheet tokens.
  • src/lib/contrast.test.ts: raised-panel text pairs clear AA.
  • e2e: figures present with accessible names, axe clean with the deep panel open at 320px and 1440px.
  • CI: pnpm diagrams then git diff --exit-code -- public/diagrams docs/mechanisms.md.

Also

  • The Spine schema inspector's scrollable JSON blocks are now keyboard-focusable with a role and a name (axe scrollable-region-focusable, found by the new e2e pass).
  • JSON imports carry with { type: "json" } so node scripts/render-diagrams.ts runs under plain Node.

Verified locally: typecheck, 205 unit tests, 60 e2e tests, build, guard scan, byte-identical regeneration.

Six data-driven diagrams (closure pipeline, handoff lease and receipt
chain, approval airlock, freshness state machine, spine row shapes,
guard layers) rendered from one model each into the scene deep panels
and into generated SVG files plus docs/mechanisms.md. Every printed
figure derives from the dataset, the closed vocabularies, or the
manifest; each diagram wears the weakest assurance level of the claims
it depicts.

Tests bind diagram claims to the manifest, pin the printed facts,
prove the app and the docs print identical labels, check phone layouts
at the label floor, and fail if a committed file drifts from a fresh
render. CI regenerates and diffs the files. The Spine schema inspector
gains keyboard focus and a name for its scrollable JSON blocks.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T14:36:34.067573Z 059c59a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread src/diagrams/render.test.ts Fixed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 059c59ad59

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/diagrams/MechanismFigure.tsx Outdated
Comment thread scripts/render-diagrams.ts
operator-os-explainer added 2 commits September 2, 2026 07:36
CodeQL js/double-escaping: sequential replaceAll calls could unescape
an ampersand twice. A single regex pass over the known entities cannot.
useVizScale gains an opt-in minWideWidth: below that container width the
compact variant is used even on a desktop viewport. The mechanism figures
use it at 960px and cap the compact layout at 480px, so tablet columns no
longer render the wide layout with sub-floor labels.

The diagram generator now removes every SVG it does not regenerate, and
the render test asserts the directory holds exactly one file per diagram
and ground, so a renamed or removed diagram cannot leave an orphan that
the byte-for-byte check would bless.
@saagpatel
saagpatel merged commit 2ea1540 into main Sep 3, 2026
6 checks passed
@saagpatel
saagpatel deleted the feat/mechanism-diagrams branch September 3, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants