Skip to content

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 GithubClient seam; 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/v1 lanes as the interchange contract + design readiness), BL-20260902-12 (the hub as a fleet source, deep links, demo hub) — all moved to ## Claimed annotated claimed-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 at bamr87/bamr87@d58a26c: .github/scripts/dash-gen/harness.py + test_harness.py (the reference computation and its invariants), _data/fleet.yml harness: (thresholds), _data/harness_health.yml and 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.yml inventory 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.yml from 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/v1 lane 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.ts emission, the registry, or the blueprint schema; the lane compiler is a pure consumer of assemblyLines() and compile() 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/v1 lane 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.ts ports dash-gen harness: typed signals (ActionsUsage, FleetTriage, IssuePipeline, TokenRotation — the fields the hub's generator reads), a HarnessConfig whose defaults are the hub's (completion_rate_min_pct 80, effectiveness_min_pct 70, stale_data_days 3, pass_rate_floor_pct 75, waste_ceiling_pct 30, cost_spike_multiplier 3.0, cost_spike_min_runs 3, cost_spike_min_avg_min 5.0, standing_failures_max 30, credential_grace_days 15), parseHarnessConfig(fleetYml), buildScorecard, evaluateTripWires, and harnessHealth(signals, config, now) returning the hub's output shape (generated_at, sources with present/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 trips stale-data, never throws.
  • FR-2: Golden parity fixtures: the hub's committed _data/fleet.yml harness: block, its four signal files (reduced to the fields the generator reads, the workflows list intact), and its _data/harness_health.yml are committed under app/src/harness/fixtures/hub/ with their source commit recorded; harnessHealth() over them at the committed generated_at reproduces the committed scorecard and trip wires exactly, and every invariant of the hub's test_harness.py is ported.
  • FR-3: A live adapter app/src/harness/signals.ts maps Fleet Ops snapshots (the metrics rollup and per-workflow metrics, run status, roster) into ActionsUsage (totals: success_rate_pct, effectiveness_pct, total_min, waste_min, waste_hours; per-workflow repo/workflow/path/avg_min/runs/success/external) and FleetTriage (failing_workflows, repos_red), stamped with the scan time, so the same scorecard and wires run over a live scan; issue_pipeline and token_rotation are absent in live mode and report as missing exactly as the hub's generator would.
  • FR-4: A hub source: app/src/state/hub.ts holds a persisted hubSlug (default bamr87/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.yml through the connected GithubClient (one getFile per 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 / total trip wires with a danger tone when any are tripped, completion rate with its floor, effectiveness with its floor, standing failures), the snapshot line (generated_at and every input with its age or "missing"), the Trip wires table (badge TRIPPED/armed, code id, summary, up to eight detail rows), the Scorecard table (code metric, value, better ↑/↓/→, threshold or —, status or —; breach rows tinted), and How it runs — illustrated: the hub's five diagrams as DiagramFrame-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/v1 bridge app/src/harness/lanes.ts: toFleetLanes(blueprint, compiled) compiles every assembly line to a lane (id = the line's slug, kind from the line's machines by a fixed table — mention for a comment trigger, content for a Docs-Gardener-style content line, triage for issue-triggered labelling/commenting, review for PR-triggered, maintenance for scheduled agents with sinks, fanout for cross-repo/dispatch senders, other otherwise; harness = claude-code-action when an agent is present, engine otherwise; 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_KEY for agent lines and FLEET_TOKEN when 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 committed fleet.manifest.yml for every factory--* 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's fleet.manifest.yml is fetched with the fleet; an ImportedWorkflow gains an optional lane), 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 (a promptRef), Sensors (checks, gate.verified_fix, processor.evidence), Loop (maxTurns set, a rate.limiter or gate.budget, a bot guard where loop-prone), Memory (processor.ledger or committed state paths), Permissions (computed permissions: minimal, no merge grant on agent lines, a gate.enablement switch), Observability (a deployable factory--*.yml that 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/name sets the hub source and ?tab=harness opens 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 hub acme/hub whose _data/*.yml follow 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.md explaining the six layers in GitFactory's terms with ::map embeds, and the session blog draft.

7. Non-Functional Requirements

  • NFR-PURE-1: health.ts, signals.ts, lanes.ts, and readiness.ts perform no I/O and read no globals; all are covered by vitest invariant tests (golden rule #3).
  • NFR-STATIC-1: No new runtime dependency (yaml is 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/name and 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, when harnessHealth() runs, then the scorecard values, directions, thresholds, statuses, the six wire ids, their tripped states, summaries, detail rows, and tripped_count equal the committed harness_health.yml.
  • AC-2: Given the ported invariants (all wires reported when quiet, missing input trips stale-data without 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_pct and effectiveness_pct equal the cockpit's fleet rollup, the cost-spike wire lists the demo's runaway workflow, and issue_pipeline/token_rotation report 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 one TRIPPED badge, the scorecard lists nine metrics with the hub's directions, the snapshot line names four inputs, and "Open on the hub ↗" points at https://acme.github.io/hub/harness/.
  • AC-5: Given gitorio's own .factory/*.blueprint.json, when compiled to lanes, then for every factory--* lane in the committed fleet.manifest.yml a 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 --check green; bundle delta within NFR-STATIC-1; a Chromium pass on the demo covers the Harness tab in both schemes with zero console errors and zero api.github.com requests.

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/v1 kinds are judgement calls in wtd 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.yml on deploy (today the lanes are exported for copy; wtd fleet adopt remains the writer).
  • specs/012's adoption, contract diagnostics, and direct-commit deploys.
  • Rendering the hub's dataflow, lifecycle, and sequence diagrams in-app (layout.ts covers workflow and architecture; BL-20260828-04).