Expand description
Web viewer, architecture diagram, and snap-bitmap recipe
(SPEC-SCC-VIEWER): human-readable HTML over the live store, a
deterministic Mermaid/SVG diagram from the L1 architecture layer, and
the repo-map text plus pinned Pillow recipe behind scc snap.
The viewer reuses httpd.rs routing and the loopback gate; the diagram
reuses the export_ccg L1 filter; the snap recipe carries the same map
text the CLI prints. One IR, three surfaces.
Structs§
- Diagram
Edge - Diagram model + Mermaid/SVG rendering live in the engine
(
scc_engine::diagram) so every transport renders the same bytes. This module re-exports the engine implementation; the CLI only parses args and prints. One architectural relationship between diagram nodes. - Diagram
Model - Diagram model + Mermaid/SVG rendering live in the engine
(
scc_engine::diagram) so every transport renders the same bytes. This module re-exports the engine implementation; the CLI only parses args and prints. L1 architecture nodes plus capped edges, sorted for byte-determinism. - Diagram
Node - Diagram model + Mermaid/SVG rendering live in the engine
(
scc_engine::diagram) so every transport renders the same bytes. This module re-exports the engine implementation; the CLI only parses args and prints. One architecture-layer entity in the diagram.
Constants§
Functions§
- build_
diagram_ model - Build the diagram model from the live store. Same L1 filter as
export_ccg; edges limited to architectural predicates between known nodes, capped per node after sorting so output is deterministic. - component_
detail_ page - Component detail page; None when the id is unknown.
- components_
page - Component list page.
- diagram_
page - Diagram page: inline SVG plus copyable Mermaid source.
- flow_
detail_ page - Flow detail page; None when the id is unknown.
- flows_
page - Flow list page.
- is_
viewer_ path - Viewer route predicate: exact pages plus
/components/<id>,/flows/<id>, and/searchwith query string. - map_
text - The repo-map text behind
scc snap: overview line plus component lines plus surface symbol names. Same text the CLI prints; the PNG recipe renders exactly these bytes. - overview_
page - Overview page from live store reads.
- page
- Minimal page shell: no framework, no build step, loopback only.
- render_
mermaid - Mermaid flowchart: gitdiagram-shaped output, SCC-derived content.
- render_
svg - Dependency-free SVG: naive grid layout (spec-acknowledged limit), boxes plus lines plus labels, no JS.
- search_
page - Lexical search page reusing the store FTS path.
- serve_
viewer - Serve one viewer route: (status, HTML body). Query strings honored on
/search?q=; unknown ids yield 404. - snap_
recipe - Pinned Pillow recipe rendering
map_textbytes to PNG. Grid: 8px cols and 16px rows on a 1568px canvas (196 chars per row), height padded to a multiple of 28px (vision patch alignment). - token_
estimate - Honesty line: text tokens (chars divided by 4) versus PNG image tokens (Anthropic pixel formula at the snapped canvas size).