Skip to content

Architecture

HAR is a layered CLI and MCP control plane:

CLI adapters MCP adapters
\ /
core orchestration
|
harness contract and I/O
|
generic utilities
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.

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.

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.

  • project-owned scripts can implement any stack or workflow;
  • stages.json can 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.

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.