Spec: Harness parity — the hub's six-layer harness as GitFactory's design model, monitoring surface, and interchange contract¶
- ID: 014-harness-parity
- Status: shipped
- Owner: @bamr87
- Created: 2026-09-02
- Roadmap link: docs/ROADMAP.md § Fleet (the hub integration track, after specs/013's console); the operator's 2026-09-02 request that GitFactory match the hub's
/harness/page in style, function, and harnesses, be the fleet's harness design/model/deployment tool, and be tightly integrated with the bamr87 monorepo that presents and monitors it on Jekyll - Golden-rules compliance: confirmed against CLAUDE.md § Golden rules; rule-relevant deviations: none (the frontend stays static; the hub is read through the existing
GithubClientseam; no compiler emission changes; hub content is data, never instructions)
1. Problem & Motivation¶
The bamr87 hub (bamr87/bamr87, published at bamr87.github.io/bamr87) already runs the fleet's control plane: a daily fleet-pulse.yml loop gathers every fleet signal into committed _data/*.yml files, dash-gen harness computes a six-layer harness health — a scorecard of nine metrics and six trip wires, thresholds declared in _data/fleet.yml harness: — into _data/harness_health.yml, and the Jekyll page /harness/ renders it (a KPI strip, the trip-wire panel with every wire armed or tripped, the scorecard table, and five archify diagrams of how the loops run). Every fleet repo, gitorio included, also carries a fleet.manifest.yml in the shared fleet/v1 vocabulary (wtd's spec): lanes with a kind, a harness runtime, triggers, a kill switch, tokens, and guardrails. GitFactory, meanwhile, designs and compiles harnesses — assembly lines that become factory--*.yml — and its Fleet Ops cockpit scans repos live, but it knows nothing of the hub's scorecard, trip wires, thresholds, lanes, or diagrams: a harness built here and a harness inventoried there render as two unrelated things, the numbers are computed twice by two engines, and there is no link in either direction. The operator's intent is explicit — GitFactory is the harness design/model/deployment tool; the hub presents and monitors on Jekyll — so the two must share one model. This spec makes the hub's harness model GitFactory's own: the same health computation (proven against the hub's committed output), the same page anatomy, the same lane vocabulary as the interchange contract, and the hub as a first-class fleet source with links both ways.
2. Origin & Background¶
- Backlog items claimed: BL-20260902-09 (harness health engine + live adapter), BL-20260902-10 (the Harness tab with the hub's anatomy), BL-20260902-11 (
fleet/v1lanes as the interchange contract + design readiness), BL-20260902-12 (the hub as a fleet source, deep links, demo hub) — all moved to## Claimedannotatedclaimed-by:specs/014-harness-parity. - Builds on: specs/013 (the console:
MapView,DiagramFrame, primitives, the Fleet tab's Observe map), specs/009 (the demo client seam every hub read rides), ADR-020/021 (Fleet Ops facts/metrics — the live signals the adapter maps), and the hub's own artefacts atbamr87/bamr87@d58a26c:.github/scripts/dash-gen/harness.py+test_harness.py(the reference computation and its invariants),_data/fleet.ymlharness:(thresholds),_data/harness_health.ymland its four inputs (the golden fixtures),pages/_dash/harness.md(the page anatomy),docs/HARNESS.md(the six layers and the production-readiness checklist),fleet.manifest.yml(the lane vocabulary),diagrams/*.json(the five archify diagrams). - Reconciles specs/012 (draft): its FR-1 named a
_data/harness_registry.ymlinventory that the hub does not commit; the files the hub really commits are the ones above, and this spec's hub source reads them. specs/012's adoption, contract-diagnostics, and direct-commit deploy requirements are untouched and remain that spec's.
3. Goals¶
- G1 Same numbers. GitFactory computes the hub's harness health — the nine-metric scorecard and the six trip wires — with the hub's rules, thresholds, and output shape, from the hub's committed signals when the hub is the fleet source and from live Fleet Ops scans otherwise; a golden test reproduces the hub's committed
harness_health.ymlfrom its committed inputs. - G2 Same page. A Harness tab renders the hub's
/harness/anatomy — KPI strip, snapshot and inputs line, trip-wire table with armed/TRIPPED badges, scorecard table with value/better/threshold/status, and the illustrated section — so a harness reads the same on the hub and in GitFactory. - G3 Same harnesses. The
fleet/v1lane is the interchange contract: a blueprint compiles to lanes, a repo's manifest parses to lanes, one Harness card renders a lane identically on the floor, in Fleet Observe, and in the Harness tab, and each assembly line carries a six-layer design readiness mirroring the hub's production-readiness checklist. - G4 Tight integration. The hub is a first-class fleet source with one setting, a user-driven fetch of its committed signals, deep links in both directions, and a fixture hub in the demo so all of it lives on Pages.
4. Non-Goals¶
- NG1: No writes to the hub. Its generators, thresholds, and pages stay canonical; GitFactory reads. The monorepo counterpart — its
/harness/page linking to GitFactory and embedding GitFactory's maps — is filed as a follow-up for that repository. - NG2: No pixel replication of Bootstrap or the zer0-mistakes skin. "Render the same" means the same anatomy, vocabulary, thresholds, statuses, numbers, and diagrams, expressed in the Evidence Console tokens the operator chose in specs/011 and 013; the hub's brand appears only as a brand chip on links to it (DESIGN.md's brand-mark rule).
- NG3: No new polling. The hub fetch is user-driven and one file per signal; the live adapter reuses Fleet Ops' existing scan.
- NG4: No changes to
compile.tsemission, the registry, or the blueprint schema; the lane compiler is a pure consumer ofassemblyLines()andcompile()output. - NG5: No replacement of Fleet Ops' own audit/metrics engines; the adapter maps their results into the hub's signal shapes.
5. User Stories¶
- As the fleet operator, I want GitFactory's Harness tab to show the same tripped wires and scorecard the hub shows this morning, so that the design tool and the monitoring site never disagree about the fleet's health.
- As the fleet operator, I want a harness I design in GitFactory to appear as a
fleet/v1lane with the same kind, runtime, triggers, switch, tokens, and guardrails the hub's inventory would record, so that the hub can present what GitFactory deploys. - As a maintainer of any fleet repo, I want to observe my repo in GitFactory and see each workflow's lane card and the six-layer readiness of my lines, so that I can tell which harness layer is missing before the hub's trip wires tell me.
- As a visitor of the Pages demo, I want the Harness tab to work on the fictional fleet, so that I can understand the six-layer model without a token.
6. Functional Requirements¶
- FR-1: A pure module
app/src/harness/health.tsportsdash-gen harness: typed signals (ActionsUsage,FleetTriage,IssuePipeline,TokenRotation— the fields the hub's generator reads), aHarnessConfigwhose defaults are the hub's (completion_rate_min_pct80,effectiveness_min_pct70,stale_data_days3,pass_rate_floor_pct75,waste_ceiling_pct30,cost_spike_multiplier3.0,cost_spike_min_runs3,cost_spike_min_avg_min5.0,standing_failures_max30,credential_grace_days15),parseHarnessConfig(fleetYml),buildScorecard,evaluateTripWires, andharnessHealth(signals, config, now)returning the hub's output shape (generated_at,sourceswithpresent/age_days,scorecard,trip_wires,tripped_count,note) with the same metric keys, directions, statuses, wire ids, summaries, and detail rows; every input is optional and a missing or malformed signal nulls its metrics and tripsstale-data, never throws. - FR-2: Golden parity fixtures: the hub's committed
_data/fleet.ymlharness:block, its four signal files (reduced to the fields the generator reads, theworkflowslist intact), and its_data/harness_health.ymlare committed underapp/src/harness/fixtures/hub/with their source commit recorded;harnessHealth()over them at the committedgenerated_atreproduces the committed scorecard and trip wires exactly, and every invariant of the hub'stest_harness.pyis ported. - FR-3: A live adapter
app/src/harness/signals.tsmaps Fleet Ops snapshots (the metrics rollup and per-workflow metrics, run status, roster) intoActionsUsage(totals:success_rate_pct,effectiveness_pct,total_min,waste_min,waste_hours; per-workflowrepo/workflow/path/avg_min/runs/success/external) andFleetTriage(failing_workflows,repos_red), stamped with the scan time, so the same scorecard and wires run over a live scan;issue_pipelineandtoken_rotationare absent in live mode and report as missing exactly as the hub's generator would. - FR-4: A hub source:
app/src/state/hub.tsholds a persistedhubSlug(defaultbamr87/bamr87, editable in Settings and on the Harness tab),refresh()fetches_data/fleet.yml,_data/harness_health.yml,_data/actions_usage.yml,_data/fleet_triage.yml,_data/issue_pipeline.yml,_data/token_rotation.ymlthrough the connectedGithubClient(onegetFileper signal, user-driven, a missing file degrades that signal), parses them tolerantly, and exposes the committed health, the thresholds, the hub identity (hub.repo,schedule), and a recomputed health; a divergence between the committed and recomputed scorecard is surfaced as a parity note, never hidden. - FR-5: A Harness tab (
app/src/panels/HarnessPanel.tsx, nav after Fleet) with the hub page's anatomy in order: header (🧬 Harness, the "Agent = Model + Harness" line, the source and thresholds sentence), a source switch (Hub · committed | Live · Fleet Ops scan), the KPI strip (tripped / totaltrip wires with a danger tone when any are tripped, completion rate with its floor, effectiveness with its floor, standing failures), the snapshot line (generated_atand every input with its age or "missing"), the Trip wires table (badgeTRIPPED/armed,codeid, summary, up to eight detail rows), the Scorecard table (codemetric, value, better ↑/↓/→, threshold or —, status or —; breach rows tinted), and How it runs — illustrated: the hub's five diagrams asDiagramFrame-style embeds from the hub's Pages URL when the source is a real hub and GitFactory's delivered maps in the demo. - FR-6: The
fleet/v1bridgeapp/src/harness/lanes.ts:toFleetLanes(blueprint, compiled)compiles every assembly line to a lane (id= the line's slug,kindfrom the line's machines by a fixed table —mentionfor a comment trigger,contentfor a Docs-Gardener-style content line,triagefor issue-triggered labelling/commenting,reviewfor PR-triggered,maintenancefor scheduled agents with sinks,fanoutfor cross-repo/dispatch senders,otherotherwise;harness=claude-code-actionwhen an agent is present,engineotherwise;implementation=.github/workflows/<filename>;description= the line name;triggers= schedule with cron, dispatch, and an event list;switch= the enablement gate's variable or null;uses_tokens=CLAUDE_CODE_OAUTH_TOKEN+ANTHROPIC_API_KEYfor agent lines andFLEET_TOKENwhen a cross-repo sink exists;guardrails.never_merges= no merge sink,guardrails.opens_pull_requests= an open-PR sink exists);parseFleetManifest(yaml)reads any repo's manifest tolerantly; a parity test asserts that gitorio's own blueprints compile to lanes matching the committedfleet.manifest.ymlfor everyfactory--*lane (id, harness, implementation, switch, guardrails, token set). - FR-7: A
HarnessCard(app/src/harness/HarnessCard.tsx) renders one lane — kind chip, harness chip, triggers, switch beacon (armed/disarmed/none when the variable state is known, "switch" otherwise), tokens, guardrails as text badges — and is the one rendering used by the Blueprint passport's Lanes section, Fleet Observe's workflow passport (the observed repo'sfleet.manifest.ymlis fetched with the fleet; anImportedWorkflowgains an optionallane), and the Harness tab's Lanes section. - FR-8: Design readiness
app/src/harness/readiness.ts: per assembly line, the six layers with evidence and a status (ok/warn/missing) — Guides (apromptRef), Sensors (checks,gate.verified_fix,processor.evidence), Loop (maxTurnsset, arate.limiterorgate.budget, a bot guard where loop-prone), Memory (processor.ledgeror committed state paths), Permissions (computedpermissions:minimal, no merge grant on agent lines, agate.enablementswitch), Observability (a deployablefactory--*.ymlthat telemetry can poll) — plus the hub's twelve-row production-readiness checklist evaluated for the blueprint; rendered on the Harness tab as Design readiness in the hub's checklist table form. - FR-9: Deep links and demo:
?hub=owner/namesets the hub source and?tab=harnessopens the tab; every Harness section carries Open on the hub ↗ to the hub's Pages URL derived from the slug (https://<owner>.github.io/<repo>/harness/,/triage/,/actions/) with a brand chip; the demo client serves a fixture hubacme/hubwhose_data/*.ymlfollow the hub's shapes with one deliberately tripped wire; the demo tour gains a Harness step; Settings gains the hub field. - FR-10: Docs:
docs/ARCHITECTURE.md§ 7g (the harness model and the hub contract),docs/ROADMAP.md(Fleet track),README.md,CLAUDE.md(metaphor table gains Harness · Lane · Trip wire; current state), ADR-036, a new_docs/the-harness.mdexplaining the six layers in GitFactory's terms with::mapembeds, and the session blog draft.
7. Non-Functional Requirements¶
- NFR-PURE-1:
health.ts,signals.ts,lanes.ts, andreadiness.tsperform no I/O and read no globals; all are covered by vitest invariant tests (golden rule #3). - NFR-STATIC-1: No new runtime dependency (
yamlis already a dependency); the Harness tab ships as a lazy chunk; the initial JS bundle grows by at most 12 kB raw (golden rule #1). - NFR-SEC-1: Hub YAML is data, never instructions: nothing fetched from a hub can widen a tool grant, alter a prompt, or change compiler behaviour; thresholds affect display only; values render as text nodes; the hub slug is validated as
owner/nameand Pages URLs are built only from it (golden rule #9). - NFR-PERF-1: No background polling is added; a hub refresh is six file reads on demand; live health reuses the existing scan results (ARCHITECTURE § rate limits).
- NFR-A11Y-1: Wire and metric states carry text badges (
TRIPPED/armed,ok/warn/unknown), tables have headers, the source switch and hub field are keyboard-operable. - NFR-COMPAT-1: With no hub configured and no scan, the Harness tab renders an honest empty state and every existing surface behaves as before; blueprint encoding is unchanged.
8. Blueprint & Schema Impact¶
None to the schema or encoding. ImportedWorkflow gains an optional lane (parsed from the observed repo's fleet.manifest.yml), additive.
9. Compiler & Workflow Impact¶
None to compile.ts or any emitted factory--*.yml. toFleetLanes and readiness consume assemblyLines() and compile() output (including describeWorkflow facts) read-only. No upstream claude-code-action inputs involved.
10. UI Impact¶
New: app/src/harness/{health,signals,lanes,readiness}.ts (+ tests, fixtures), HarnessCard.tsx, app/src/panels/HarnessPanel.tsx + harness.css, app/src/state/hub.ts. Changed: App.tsx (tab, lazy chunk, deep links), state/ui.ts (harness view), SettingsPanel.tsx (hub field), panels/Inspector.tsx (Blueprint passport Lanes section), canvas/ObserveMap.tsx + fleet/import.ts (manifest fetch, lane in the passport), demo/{fixtures,client,tour}.ts (fixture hub, tour step), _docs/the-harness.md. Design-token compliant (specs/011); a11y per NFR-A11Y-1.
11. Security Impact¶
No new tool grants, permissions: deltas, secrets, or writes. The hub's YAML is attacker-influenceable in principle (any fleet repo's manifest, any hub the user names), so every value is rendered as text, numeric fields are coerced and bounded, the slug is validated before any URL is built, and nothing parsed reaches a prompt or a grant. Fork-PR behaviour unchanged (golden rules #7, #9).
12. Acceptance Criteria¶
- AC-1: Given the hub fixtures at their committed
generated_at, whenharnessHealth()runs, then the scorecard values, directions, thresholds, statuses, the six wire ids, their tripped states, summaries, detail rows, andtripped_countequal the committedharness_health.yml. - AC-2: Given the ported invariants (all wires reported when quiet, missing input trips
stale-datawithout crashing, an old snapshot trips it, the rotation ledger's weekly slack, median-not-mean cost spikes, the absolute cost floor, external/low-run exclusion, pass-rate and waste wires, the standing-failures boundary, credential grace boundary, scorecard thresholds and cost per verified run), then all pass. - AC-3: Given the demo fleet scanned in Fleet Ops, when the live adapter runs, then
completion_rate_pctandeffectiveness_pctequal the cockpit's fleet rollup, the cost-spike wire lists the demo's runaway workflow, andissue_pipeline/token_rotationreport missing. - AC-4: Given the demo hub, when the Harness tab opens, then the KPI strip shows
tripped / 6, the trip-wire table lists all six wires with oneTRIPPEDbadge, the scorecard lists nine metrics with the hub's directions, the snapshot line names four inputs, and "Open on the hub ↗" points athttps://acme.github.io/hub/harness/. - AC-5: Given gitorio's own
.factory/*.blueprint.json, when compiled to lanes, then for everyfactory--*lane in the committedfleet.manifest.ymla lane with the same id, harness, implementation, switch,never_merges,opens_pull_requests, and token set exists. - AC-6: Given the dogfood blueprint, when readiness runs, then the content line reports Guides ok (promptRef), Loop ok (rate limiter + max turns), Permissions ok (enablement switch, no merge), and the deterministic no-agent line reports Guides not applicable; the checklist renders twelve rows.
- AC-7:
npm test,npm run lint,npm run typecheck,npm run build,npm run maps:check,python3 tools/spec_validator.py,python3 tools/backlog_lint.py,python3 tools/unwrap-prose.py --checkgreen; bundle delta within NFR-STATIC-1; a Chromium pass on the demo covers the Harness tab in both schemes with zero console errors and zeroapi.github.comrequests.
13. Risks & Open Questions¶
- R-1: The hub's generator changes shape after this port. Mitigated: the fixtures record their source commit; the parity note on the Harness tab surfaces any divergence between the committed and recomputed health in production; a monthly re-fixture is a follow-up.
- R-2:
fleet/v1kinds are judgement calls inwtd fleet adopt. Mitigated: the kind table is explicit and tested against gitorio's committed manifest; divergences on other repos are display-only. - R-3: Live health from a partial roster reads as fleet health. Mitigated: the live source names its roster size and window in the snapshot line and never claims to be the hub's number.
14. Out of Scope / Follow-ups¶
- The monorepo counterpart:
/harness/linking to GitFactory (?hub=bamr87/bamr87&tab=harness) and embedding GitFactory's delivered maps; recording GitFactory-built lanes in the hub's inventory. - Writing
fleet.manifest.ymlon deploy (today the lanes are exported for copy;wtd fleet adoptremains the writer). - specs/012's adoption, contract diagnostics, and direct-commit deploys.
- Rendering the hub's
dataflow,lifecycle, andsequencediagrams in-app (layout.tscovers workflow and architecture; BL-20260828-04).