Architecture

June 15, 2026 · View on GitHub

A bird's-eye view of how agent-harness-generator is wired. The detail lives in docs/adrs/; this is the layered map.

The three-layer model

┌──────────────────────────────────────────────────────────────────┐
│ Layer 3 — User-facing surface                                    │
│                                                                  │
│   create-agent-harness (CLI)   examples/quickstart               │
│   harness CLI subcommands       examples/federation              │
│   .claude-plugin/plugin.json    .codex/skills/*                  │
└──────────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────┐
│ Layer 2 — Adapter + Application layer                            │
│                                                                  │
│   @metaharness/host-claude-code   @metaharness/host-codex                    │
│   @metaharness/host-pi-dev        @metaharness/host-hermes                   │
│   @metaharness/host-openclaw      @metaharness/host-rvm                      │
│                                                                  │
│   @metaharness/sdk                @metaharness/vertical-base                 │
│                             @metaharness/vertical-trading              │
└──────────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────────┐
│ Layer 1 — Kernel                                                 │
│                                                                  │
│   crates/kernel       (Rust core: claims, hooks, intel, mcp,     │
│                        memory, routing, witness, federation)     │
│   crates/kernel-wasm  (wasm-bindgen target)                      │
│   crates/kernel-napi  (NAPI-RS target)                           │
│   @metaharness/kernel       (TS loader + bridge)                       │
└──────────────────────────────────────────────────────────────────┘

Constraint: nothing in Layer 1 imports from Layers 2 or 3. The kernel is portable. ADR-002 owns this boundary.

Release pipeline

The release flow composes 6 primitives + 1 orchestrator (per ADR-019):

   scripts/release.mjs (iter 33)

        ├──▶ 1. scripts/version-bump.mjs           (iter 29)
        │       atomic semver bump across 15 sources

        ├──▶ 2. scripts/preflight.mjs              (iter 14)
        │       every gate publish.yml would run, locally

        ├──▶ 3. scripts/marketplace-entry.mjs      (iter 27)
        │       regenerate IPFS-pinnable plugin JSON

        ├──▶ 4. scripts/publish-dryrun.mjs         (iter 20)
        │       npm publish --dry-run × every package

        ├──▶ 5. git commit + tag                   (iter 33)
        │       only after all gates pass

        └──▶ 6. scripts/release-notes.mjs          (iter 36)
                CHANGELOG → dist/release-notes-v{X}.md
                for `gh release create`

           server-side: .github/workflows/publish.yml runs the same
           gates + GCP-WIF + actual npm publish + Pinata IPFS pin

release.mjs refuses to run with a dirty working tree, no git mutation until all gates pass, --dry-run for safe inspection.

Validation surface

Three commands at different cadence levels:

CommandWhenWall timeWhat it does
harness validate <path> --skip-gcpPer-scaffolded-harness<1sdoctor + witness verify + path-guard + mcp + (optional) GCP secret check
node scripts/healthcheck.mjsPer-commit / per-PR<1s6 read-only structural checks across the meta-repo
node scripts/preflight.mjsPre-release~30sEvery publish.yml gate, including cargo test, wasm-pack build, full vitest
node scripts/release.mjs <bump>Release~60sComposes all primitives + tags

CI matrix

`.github/workflows/ci.yml$ \text{runs} \text{a} 16-\text{job} \text{matrix} \text{on} \text{every} \text{push}:

\text{Job}\text{OS} \times \text{N}\text{What}
\text{Rust}3 \text{OS}$cargo fmt --check, clippy -D warnings, cargo test, cargo doc -D warnings`
WASM3 OSwasm-pack build + `wasm-tools validate$ + 500 \text{KB} \text{size} \text{budget}
\text{Node}3 \text{OS} \times 2 \text{Node}$npm run build+npm test` + path-guard + healthcheck
pack+install3 OSBatch-install every tarball (catches missing files, broken bins)
Bench (smoke)1Memory retrieval bench (packages/bench)
CI passed1Final aggregator for branch protection

Plus .github/workflows/security.yml runs cargo-audit, cargo-deny, npm-audit, codeql, and audit-deps-aggregate (iter 38).

Test contract enforcement

ConcernTest fileIter
End-to-end scaffold → validate__tests__/e2e-scaffold-validate.test.ts23, 30
MCP dispatch protocol__tests__/mcp-dispatch-integration.test.ts34
Witness shape gate__tests__/witness-tamper.test.ts37
Federation handshakeexamples/federation/ + tests9, 40
Plugin schema__tests__/claude-marketplace-plugin.test.ts24
Codex skills schema__tests__/codex-skills.test.ts22
Marketplace entry shape__tests__/marketplace-entry.test.ts27
Workflows structural__tests__/workflows.test.ts30
Pack content invariants__tests__/pack-contents.test.ts25
Cross-platform paths__tests__/path-handling.test.ts16
Version bump atomicity__tests__/version-bump.test.ts29
Release orchestration__tests__/release.test.ts33
Release notes extraction__tests__/release-notes.test.ts36
ADR doc hygiene__tests__/adr-index.test.ts35
Examples runnability__tests__/examples-*.test.ts32, 40
Healthcheck contract__tests__/healthcheck.test.ts42
Audit aggregate__tests__/audit-deps.test.ts38

Key references

  • ADRs: docs/adrs/INDEX.md — start there, then read the linked ADRs in order.
  • Release runbook: docs/RELEASE.md — the user-facing flow.
  • Quickstart: examples/quickstart/quickstart.mjs — fastest path to "is this working on my machine?".
  • CHANGELOG: chronological list of every iter's changes.