Architecture
HAR is a layered CLI and MCP control plane:
CLI adapters MCP adapters \ / core orchestration | harness contract and I/O | generic utilitiesLayers
Section titled “Layers”| Layer | Responsibility |
|---|---|
src/cli, src/mcp |
Parse and validate boundaries, call core, format results |
src/core |
Init/maintain orchestration, execution service, slots, runs, validation, Mission Control sync |
src/harness |
Canonical .har/ contract, manifests, stages, templates, drift, generator |
src/llm |
Optional Claude authoring agent for --auto |
src/utils |
Generic filesystem, shell, logging, path, and validation helpers |
packages/schemas |
Shared Zod schemas used by CLI and Mission Control |
src/templates |
Generated harness profiles, agent workflows, and stage templates |
control |
Local Next.js Mission Control dashboard |
Dependency direction runs downward. Core never imports CLI or MCP, and harness code never imports core. Adapters stay thin so CLI and MCP execute the same behavior.
Public execution seam
Section titled “Public execution seam”RunService exposes launch, stage execution, verification, completion, teardown,
and status. A StageExecutor is injected; the current implementation executes local
project scripts. This is the seam for a future remote executor without changing the
stage contract.
Source of truth
Section titled “Source of truth”Canonical Zod schemas define stage kinds, artifacts, results, run records, slot registry entries, validation records, and Mission Control payloads. Const arrays drive TypeScript, input validation, MCP JSON Schema, and tests.
Open extension points
Section titled “Open extension points”- project-owned scripts can implement any stack or workflow;
stages.jsoncan register any generic operation;- stage templates add optional bundles without hardcoding APIs;
- profiles provide different starting runtime models;
- executor injection allows local or remote execution.
HAR intentionally avoids a broad plugin registry until a concrete second implementation requires one.
Mission Control data flow
Section titled “Mission Control data flow”CLI/MCP execution stores local run JSON and slot registries. har control sync
normalizes and posts repository metadata, runs, and slot status to Mission Control.
The dashboard derives repository health, worktrees, validation pipelines, change
batches, artifacts, and trends from that synchronized evidence.
