Skip to main content

Module viewer

Module viewer 

Source
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§

DiagramEdge
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.
DiagramModel
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.
DiagramNode
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§

MAX_DIAGRAM_NODES
MAX_EDGES_PER_NODE

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 /search with 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_text bytes 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).