Spec: The archify console — GitFactory's surfaces rebuilt on archify's viewer model¶
- ID: 013-archify-console
- Status: shipped
- Owner: @bamr87
- Created: 2026-09-02
- Roadmap link: docs/ROADMAP.md § Maps — the "in-app Map surfaces" box (the companion spec named by specs/010 § 2 and ADR-034); the operator's 2026-09-02 request to rebuild the repo so the GitFactory framework lives inside archify's UI/UX design
- Golden-rules compliance: confirmed against CLAUDE.md § Golden rules; rule-relevant deviations: none (the frontend stays static and imports nothing from
vendor/; the compiler, the IR compiler's output, the registry, and the schema are untouched)
1. Problem & Motivation¶
Specs 010 and 011 made archify the renderer of GitFactory's exported maps and the source of the app's tokens, but the app itself still does not look or behave like the instrument those maps come from. Four gaps remain, all visible to a first-time visitor of the Pages deployment. (1) No archify map is reachable from inside the app: the eight delivered maps under app/public/maps/ are served but never linked or embedded, so the shop window shows a React Flow editor and never the evidence-grade picture the project exists to produce. (2) The Fleet tab's Observe mode is still a second, read-only React Flow renderer of the same graph the architecture IR already describes — two renderers of one idea, the exact duplication ADR-034 set out to end. (3) The Build tab is a three-column editor with two permanent side panels, which is the shape archify's DESIGN.md names as the anti-pattern ("progressive disclosure over permanent chrome", "don't create another permanent panel when the Semantic Passport, Node Finder, or existing canvas can carry the capability"); the palette is a permanent list and the Inspector a permanent column, so the canvas is never dominant. (4) The tabs share colours but not archify's chrome grammar — no toolbar buttons, header row, diagram panel, cards, chips, or kbd hints — so a reader moving from a delivered map into the app changes visual language at the door. This spec closes all four with one in-app map surface fed by the same pure IR compiler the delivered maps use, archify's reader model (Node Finder, Semantic Passport, legend, guided views, zoom, evidence beacons) as the app's interaction model on every graph surface, the chrome grammar as React primitives on every tab, and the delivered maps embedded where a reader would look for them.
2. Origin & Background¶
- Backlog items claimed: BL-20260902-01 (the in-app map surface), BL-20260902-02 (the console shell and the Build tab's reorganisation), BL-20260902-03 (delivered maps reachable in-app), BL-20260828-13 (archify's recipe components as
app/src/ui/primitives) — all moved to## Claimedannotatedclaimed-by:specs/013-archify-console. - Builds on: specs/010 (the pure
toWorkflowIR/toArchitectureIRcompiler, the vendored renderer's geometry,gen-mapsandmaps:check), specs/011 (the seven semantic tokens, radii, motion, light theme,vocabulary.ts'smachineTone), ADR-019 (per-view toolbars and theMenuprimitive), ADR-032 (the tokenless demo every surface is verified in), ADR-034 (archify is the renderer and the design language, not the UI framework — this spec keeps that boundary: the in-app surface is GitFactory's own view of the IR; the delivered HTML stays the canonical artifact). - Source of truth for the visual grammar:
vendor/archify/DESIGN.md(components: toolbar-button, diagram-panel, search-field, evidence-beacon, chips, cards, Semantic Passport, Verified Source Beacon, Authored Reachability) and the viewer chrome invendor/archify/assets/template.html(toolbar, header-row, diagram-container, node-finder, focus-chip/passport, diagram-nav, cards).
3. Goals¶
- G1: One in-app map surface renders archify IR — workflow and architecture — as inline SVG in the Evidence Console vocabulary, live from the same pure IR compiler the delivered maps use, so every assembly line on the canvas and every observed fleet has an archify-shaped map with no pre-rendering step.
- G2: Archify's reader model is the app's interaction model on every graph surface, including the authoring canvas: Node Finder (
/), Semantic Passport (focus → one proof surface; Escape closes), legend, guided views, zoom, and evidence beacons; the palette becomes a finder and the Inspector becomes a passport. - G3: Archify's chrome grammar is the app's shell — toolbar buttons, header row, diagram panel, cards, chips,
kbd, eyebrow — as React primitives inapp/src/ui/, applied to every tab, with the viewer's theme toggle andTshortcut in the top bar. - G4: The delivered maps are reachable from the app: embedded as figures in Docs through a Markdown directive, and linked from the Build and Fleet map surfaces when a delivered map exists for the same source.
4. Non-Goals¶
- NG1: No in-browser execution of archify's renderers (ADR-034 plan decision D-1 stands);
MapViewis GitFactory's own React view of the IR JSON, not a port ofrender-workflow.mjs. Route Probe, Reach Share Cards, exports, presentation mode, story playback, and the Semantic Lens are not reimplemented — they are reached by opening the delivered map, which the surfaces link to. - NG2: No change to
compile.ts, to the IR compiler's emitted JSON (the delivered maps stay byte-identical undermaps:checkapart from the new manifest), to the machine registry, or to the blueprint schema. - NG3: No new runtime dependency and no external font download.
- NG4: The React Flow authoring canvas is not retired — archify has no editing model; only the read-only fleet canvas is.
- NG5: No per-panel information-architecture rewrite of Monitor, Content, Prompts, or Settings beyond adopting the grammar (header, panel, cards, chips); their data and controls stay where they are.
5. User Stories¶
- As a maintainer, I want to flip the Build tab from the editing floor to a map of each assembly line, so that I can read a line the way a reviewer of the delivered map would — lanes, main path, the bot guard the compiler really emits — without leaving the app.
- As a fleet operator, I want Observe to draw a repo's workflows as the same architecture map archify delivers, with live run status on each node, so that the picture I explain to a colleague is the picture the app shows.
- As a reader of the Docs tab, I want the delivered maps embedded as figures beside the prose, so that "What is GitFactory?" is answered with the evidence-grade picture, in my theme.
- As an author on the canvas, I want to press
/to find a machine and click a machine to open one passport with its properties, relationships, and compiled capabilities, so that the canvas stays dominant and the details come to me only when I ask. - As a daytime user, I want the viewer's theme toggle in the app's toolbar with the same
Tshortcut, so that the app and the map answer the same key.
6. Functional Requirements¶
- FR-1: A pure module
app/src/map/layout.tsexportslayoutWorkflow(ir: WorkflowIR)andlayoutArchitecture(ir: ArchitectureIR), each returning aMapGeometry(width,height, positionedlanes/boundaries,nodeswithx/y/w/h/type/label/sublabel,edgeswith an SVG path, role, variant, and label anchor, and themainPath), computed from archify's own geometry constants (workflow: lane x 40 / y 52 / width 640 / height 104 / gap 20 / title 30, columns[88, 220, 300, 430, 500, 625], node 92 × 52; architecture: the IR'slayoutgrid) so the in-app map and the delivered map share one coordinate frame; edge routes are orthogonal with endpoint sides derived from relative position; output is deterministic and the module performs no I/O. - FR-2:
app/src/map/MapView.tsxrenders aMapGeometryas inline SVG: nodes carryc-<componentType>classes (fill/stroke from the seven tokens) with a text label and sublabel, lanes and boundaries are drawn with labels (exception lanes styled as archify'sc-security-group), edges have arrowheads and role/variant styling (main path emphasised, security variant dashed and rose,dashedvariant dashed), a legend lists only the kinds present using the IR's legend labels, and optional beacons (a text-labelled capsule at a node's upper-right, e.g.ok/run/fail/⚠) are supplied by the host. - FR-3:
MapViewcarries archify's reader model: clicking a node or pressing Enter/Space on a focused node opens the Passport;/opens the Finder (a floating search over node labels and stable ids with arrow-key navigation, Enter focuses the result); Escape closes the finder, then the passport; guided views frommeta.viewsrender as chips that keep the chapter's nodes strong while the rest recede; a bottom-right nav offers zoom out / reset (100%) / zoom in and Find;prefers-reduced-motiondisables transitions; both themes are token-driven with no colour literal outsidetheme.css. - FR-4: The Passport (
app/src/map/Passport.tsx) is one floating proof surface for the focused node: eyebrow, label, kind chip in the node's tone, stable id in<code>, sublabel, Authored Reachability as two count-bearing buttons (Upstream n/Downstream n) that highlight the reachable subgraph over authored edges in Repository Violet / Proof Green with a receipt (nodes · links · max hops), plus host-provided sections (describe(nodeId) → PassportSection[]: facts as label/value rows, chips, an action button, or free React content) so each surface adds its own evidence; it closes on ×, Escape, or outside activation and adds no permanent chrome. - FR-5: The Build tab gains a
Floor | Mapmode toggle in its toolbar. Map mode renders oneMapViewper assembly line (assemblyLines()→toWorkflowIR()computed live and memoised on the blueprint) with a line chip selector when there is more than one, telemetry LEDs as beacons when polling is on, and a machine passport carrying the machine's blurb, configured dials, diagnostics, compiled capabilities (fromdescribeWorkflow), and an Edit on the floor action that selects the node and returns to Floor mode; a collapsed+N morenode's passport lists its members. Floor mode: the palette becomes a Machine Finder — a floating panel toggled by/or the toolbar's+ Machinebutton, docked open when the canvas is empty, with search and tone-grouped machines (click adds, drag still works) — and the Inspector becomes the Passport — floating over the canvas, opened by selection, closed by × or Escape (which deselects), carrying the same properties, diagnostics, capabilities, connections, and monitor content as today; nothing selected shows no panel, and the blueprint's own metadata (name, target repo, description, overview, compile status) opens as a Blueprint passport from the toolbar title. - FR-6: Fleet Observe renders
MapViewovertoArchitectureIR(fleet, { cap })withcapcovering every workflow (an in-app map has no 12-node story budget, so nothing collapses), LED beacons from the observe store'sstatusByPath(text-labelled), a workflow passport carrying triggers, agent runner/model, sinks, kill-switch gate, cross-repo targets, and the last run link, and an Open delivered map ↗ action when the manifest lists a map for that repo (the demo repos).canvas/FleetCanvas.tsx,canvas/WorkflowNode.tsx,fleet/layout.ts, and their styles are deleted. - FR-7: Delivered maps in-app:
gen-mapswritesapp/public/maps/manifest.json(slug, diagram type, source, hash — sorted, byte-stable, covered bymaps:check), a puredeliveredMapFor(manifest, { source })resolves a slug, andapp/src/map/DiagramFrame.tsxembeds a delivered map as<iframe src="<base>maps/<slug>.html?embed=1[&theme=dark|light]" loading="lazy">with a caption and an open-in-new-tab link, passing the pinned theme from Settings (system preference passes nothing so the map's own detection decides — parity by construction). The Docs Markdown parser gains a block directive::map <slug> [caption](one line, its own paragraph) rendered as aDiagramFrame; a slug that is not in the manifest renders a plain "map not delivered" note, never a broken frame;_docs/what-is-gitfactory.mdand_docs/machines-and-belts.mdembed the gitorio maps. - FR-8: Shell grammar:
app/src/ui/exportsPageHeader(pulse dot + headline + subtitle),Panel(diagram-panel:--r-panel, one-pixel border, tonal ground),Cards/Card(card-dot tone + title + body),Chip,Kbd,Eyebrow,SearchField, andBeacon; the top bar becomes archify's toolbar row (pulse-dot logo, tabs as chips with a non-colour active cue, connection, power, and a three-state theme toggle button that cycles system → dark → light with theTshortcut outside text fields); every non-Build tab opens with aPageHeaderinside a centred container and keeps its content in panels;.btnadopts the toolbar-button recipe (mask ground, one-pixel border,--r-control, mono body, 150 ms response, cyan focus ring); the rules this spec touches use the semantic token names, never the transitional aliases. - FR-9: The demo tour's Build and Fleet steps describe Map mode and the Observe map, and the tour still walks the seven tabs by keyboard.
7. Non-Functional Requirements¶
- NFR-STATIC-1: Nothing under
vendor/is imported byapp/src/**; the initial production JS bundle grows by at most 40 kB raw — the map surfaces (viewer, passport, finder, Map mode, Observe map) may ship as a lazily loaded chunk that the floor's first paint never pays for; nofetchis added for the manifest (it is a build-time JSON import) (golden rule #1). - NFR-PURE-1:
layout.tsanddeliveredMapForperform no I/O and read no globals; both are covered by vitest invariant tests (golden rule #3). - NFR-A11Y-1: Every map interaction is reachable by keyboard (
/, Escape, Enter/Space on nodes, arrow keys in the finder, Tab through nav and passport controls), focus is visible, node state is conveyed by text (beacon labels, passport kind chips), and text contrast holds in both themes at DESIGN.md's sizes. - NFR-PERF-1: IR and geometry are memoised on the blueprint / fleet identity; Map mode does no work while Floor mode is active; no new polling.
- NFR-SEC-1: Labels from untrusted fleet YAML and blueprint text reach the SVG only as React text nodes (no
dangerouslySetInnerHTML); the delivered-map iframe loads only same-origin static files the build produced, and the::mapdirective accepts a slug that must exist in the committed manifest (no arbitrary URL) (golden rule #9). - NFR-DESIGN-1: No colour literal outside
theme.css(theme.test.tsstays the gate); the seven tones remain the only meaning-bearing hues (DESIGN.md's Semantic Color Rule); motion stays inside--motionand is off underprefers-reduced-motion.
8. Blueprint & Schema Impact¶
None. Blueprint encoding, the registry, and schema/blueprint.schema.json are untouched; the registry↔schema and registry↔vocabulary drift guards stay green.
9. Compiler & Workflow Impact¶
None to compile.ts or to any emitted factory--*.yml. ir.ts gains an exported fleetComponentId(repoSlug, workflowSlug) helper (the id it already computes inline, so the delivered architecture IR JSON is byte-identical) and nothing else changes in the IR. gen-maps gains the manifest; the CI diagram-gate loops glob *.workflow.json / *.architecture.json, so the manifest is not fed to the validator. No upstream claude-code-action inputs are involved.
10. UI Impact¶
New: app/src/map/{layout,MapView,Passport,Finder,DiagramFrame,manifest}.ts(x) + map.css; app/src/ui/{primitives.tsx,ui.css}. Changed: App.tsx (top bar, theme toggle, T), BuildToolbar.tsx (mode toggle, + Machine, blueprint passport), Palette.tsx → floating finder, Inspector.tsx → passport body, FactoryCanvas.tsx (workspace as the floating panels' container), FleetView.tsx (Observe → MapView), DocsView.tsx + docs/markdown.ts (::map), MonitorPanel/ContentPanel/PromptStudio/SettingsPanel/FleetOpsPanel (PageHeader + panels), theme.css (toolbar-button recipe, chips, tabs, workspace), the four panel stylesheets (alias retirement in touched rules), demo/tour.ts. Deleted: canvas/FleetCanvas.tsx, canvas/WorkflowNode.tsx, canvas/fleetview.css (merged), fleet/layout.ts. A11y per NFR-A11Y-1; design tokens per NFR-DESIGN-1.
11. Security Impact¶
No new tool grants, permissions: deltas, secrets, or network calls. Untrusted content paths: fleet workflow names/triggers and blueprint config values are rendered as text nodes in SVG and HTML; the Docs directive resolves only manifest slugs to same-origin files; iframes carry title and loading="lazy" and load nothing external (the delivered maps had their Google Fonts link stripped by specs/010). The PAT handling is untouched; the theme toggle persists a validated enum only. Fork-PR behaviour unchanged (golden rules #7, #9).
12. Acceptance Criteria¶
- AC-1: Given the dogfood blueprints' lines and the three demo fleets, when laid out twice, then the geometries are deep-equal; every node lies inside
width × height; no two nodes in the same lane overlap; every edge references two existing nodes; main-path edges carryrole: 'main'; the workflow frame is 680 px wide (archify's). - AC-2: Given a workflow IR rendered in jsdom, then there is one
g.map-node.c-<type>per IR node with its label text and one legend entry per kind present; pressing/opens the finder, typing filters results, Enter opens the passport showing the node's label and id, and Escape closes it. - AC-3: Given the example blueprint in Map mode, then one map renders per assembly line; opening a machine's passport shows its compiled capabilities and Edit on the floor selects that node in the store and switches the mode to Floor; in Floor mode
/opens the Machine Finder and clicking a machine there adds it to the canvas; selecting a node opens the passport and Escape deselects it. - AC-4: Given the demo client observing
acme/storefront, then the Observe map has one node per workflow (nomorenode), beacons reflectstatusByPathby text, the passport of an agent workflow names its runner and sinks, and the delivered-map action resolves tomaps/demo--acme--storefront.html. - AC-5: Given a doc containing
::map gitorio-factory-1 The dogfood line, then an iframe renders whosesrcends withmaps/gitorio-factory-1.html?embed=1(plus&theme=lightwhen the theme preference islight) with the caption; given::map not-a-map, then a "not delivered" note renders and no iframe. - AC-6:
npm run mapsthennpm run maps:checkexits 0 withmanifest.jsonpresent; hand-editing the manifest makesmaps:checkexit non-zero; the eight delivered HTML/JSON files are byte-identical to before this spec. - AC-7:
theme.test.ts(no literal outsidetheme.css),npm test,npm run lint,npm run typecheck,npm run build,python3 tools/spec_validator.py,python3 tools/backlog_lint.py, andpython3 tools/unwrap-prose.py --checkare all green; the JS bundle delta is within NFR-STATIC-1 and reported in the PR. - AC-8: Given the demo in Chromium, when the seven tabs are opened in dark and in light, Map mode and the Observe map are opened,
/and a node click are used, andTis pressed, then every surface renders with no console errors and screenshots are attached to the PR.
13. Risks & Open Questions¶
- R-1: Two views of one IR could drift (the in-app SVG vs the delivered HTML). Mitigated: both consume the same IR from the same compiler, the geometry constants are archify's own and asserted in tests, the delivered maps are linked from every surface, and NG1 keeps
MapViewa subset rather than a rival. - R-2: Turning the palette and Inspector into floating panels changes an authoring habit. Mitigated: the finder docks open on an empty canvas,
/and+ Machineare one keystroke/click away, drag-to-add still works, and the passport carries every field the Inspector had. - R-3: Large live fleets (30+ workflows) make a tall four-column architecture map. Mitigated: the map scrolls inside its panel and zooms; the finder finds any node by name; per-district maps remain BL-20260828-08.
- R-4:
iframeembeds of 700 kB maps inside Docs cost bandwidth on Pages. Mitigated:loading="lazy", at most one or two figures per doc, and the frame renders only when the manifest lists the slug.
14. Out of Scope / Follow-ups¶
- Route Probe, Reach Share Cards, exports, presentation mode, story playback and the Semantic Lens in-app (NG1) — open the delivered map.
- Sequence / lifecycle / dataflow maps (BL-20260828-04), the Cartographer line (BL-20260828-05), deploy-time
compare(BL-20260828-06), per-district fleet maps (BL-20260828-08). - Retiring the remaining transitional aliases in untouched rules (BL-20260828-12).