Audit-grade diagrams — sky doc --diagram

Goal: every diagram Sky emits is a real, submittable SOC2 / ISO 27001 artefact, not a source-tree picture. The unfair advantage: a Sky app is update : Msg -> Model -> (Model, Cmd Msg) — pure, total, exhaustively matched — so the whole behaviour is STATICALLY decidable. The compiler can enumerate every user action, every branch, every effect, every reachable state, and every follow-up message. No external tool can do this for a normal codebase.

The problem with the current suite

components maps the SOURCE TREE (module × generic capability): half its rows are TEA plumbing (Msg, Subs, View.*), and "Database"/"External HTTP" never name the store or the service. wire and journey already extract real API + action facts, but as flat tables, and with no trust boundaries, data classification, or named external systems — the three things an auditor actually scores.

The behaviour graph (the foundation every diagram reads)

One shared analysis over the HIR builds a directed multigraph:

This is complete and provable: it is every Msg × update branch plus every view-emitted action, with dead actions and unreachable states falling out for free.

Statically-derived overlays (the compiler's advantage)

The suite — each artefact maps to a named control

--diagramArtefactMaps to
flow (replaces journey)Data-flow diagram: actor → page → action → effect/RPC → store/external, in trust-boundary lanes, confidential flows markedSOC2 CC3 (risk/DFD), CC6 (logical access); ISO A.8 (classification), A.13 (comms security)
components (reworked)C4 container / system-architecture diagram: the ~4 real containers (browser client, SSR backend, PostgreSQL, each external system) + trust zones + protocols; source modules collapse to an appendixSOC2 system description; ISO A.14 (secure architecture)
wire (enhanced)API + authentication call-paths: method, path, auth requirement (CSRF-exempt flagged), guard, request/response shapes, effects, storeSOC2 CC6/CC7; ISO A.9 (access control), A.14
telemetry (enhanced)Audit-logging & monitoring surface: what the app logs / meters / tracesSOC2 CC7 (monitoring); ISO A.12.4 (logging)
callpath (build the planned one)Per-endpoint end-to-end trace: entry → CSRF/guard → handler → effects → storeSOC2 CC6; ISO A.14

Companion evidence tables (not diagrams)

Build order

  1. Behaviour-graph analysis (analyze_flow over the HIR): the three new edge types (view→Msg, navigation, continuation) on top of the existing per-branch effect/read/write extraction. Plus the flow renderer (SVG + puml + md). Replaces journey.
  2. Compliance overlays: trust boundaries + data classification + named external systems; rework components into the C4 container view.
  3. callpath + the machine-readable JSON export (so the graph can drive external audit tooling) + the two evidence tables.

Every renderer reads the ONE behaviour graph, so the artefacts stay consistent.

Locked decisions (2026-09-15)

The bar: a user runs one command and submits the output to a SOC2 / ISO 27001 auditor unchanged. So: