Historical architecture baseline. Current source preserves the two-graph shape but supersedes mutable name-based candidates with immutable candidate bundles, a shared evaluator, explicit research/autonomous modes, evidence ledgers, and durable branch projections. Use the deep research brief and current tests when this document conflicts with implementation.
Meta-Harness runs entirely on a local laptop. The system is two LangGraph
state machines (outer + inner, both checkpointed) plus a streaming web
dashboard. The proposer is not a separate tier — it runs as the body of
the outer machine's propose node.
┌──────────────────────────────────────────────────────────────────────┐
│ OUTER STATE MACHINE (LangGraph StateGraph) │
│ Nodes: propose → validate → benchmark → update_frontier │
│ │
│ The `propose` node spawns a Claude Code subprocess via │
│ claude_wrapper.py, awaits its exit, and parses the resulting │
│ filesystem writes (a new agents/<n>.py + pending_eval.json). │
│ The subprocess receives the SKILL.md via --append-system-prompt │
│ and reads ~82 files/iter from the run directory using │
│ Read/Glob/Grep/Bash. The subprocess is invoked from inside the │
│ graph, not alongside it — this is what makes checkpointing, │
│ time-travel, and concurrent branches compose cleanly. │
│ │
│ Checkpointer: AsyncPostgresSaver. Every transition = checkpoint. │
│ Memory: cross-thread PostgresStore (patterns persist across runs). │
│ Time-travel: get_state_history + update_state + invoke(None,cfg). │
│ Concurrency: asyncio.create_task per branch (Appendix A). │
└──────────────────────────────────────────────────────────────────────┘
│ benchmark spawns subgraph per candidate
▼
┌──────────────────────────────────────────────────────────────────────┐
│ INNER STATE MACHINE (LangGraph StateGraph, sandboxed subgraph) │
│ 5-phase coding agent — orient → plan → act → verify → submit │
│ (Appendix C). 6 fixed tools (read_file, apply_patch, write_file, │
│ run_bash, grep_search, task_complete), 11 override points. │
│ Each candidate compiles into the same shape; only the │
│ prompts/methods/values change. │
└──────────────────────────────────────────────────────────────────────┘
│ traces, scores, file diffs streamed
▼
┌──────────────────────────────────────────────────────────────────────┐
│ DASHBOARD (Next.js 16) │
│ • Outer state graph viz (ReactFlow): live nodes lighting up │
│ • Candidate trajectory tree (D3): branching for forks │
│ • Code diff viewer (Monaco / unified-diff): live agents/<n>.py │
│ diffs vs parent │
│ • Score chart + Pareto frontier (accuracy × tokens) │
│ • Memory panel (cross-run patterns) │
│ • Right-click checkpoint → fork modal → resume │
└──────────────────────────────────────────────────────────────────────┘
proposenode — spawns a Claude Code subprocess (claude_wrapper.py) with--append-system-prompt $(cat skills/<domain>/SKILL.md),--dangerously-skip-permissions,--disable-slash-commands, an empty--plugin-dir, and--output-format stream-json. The subprocess writes one run-scoped proposal pluspending_eval.json; the runtime copies and hashes those bytes intocandidates/{candidate_id}/source/harness.pybefore any validation or evaluation. Session metadata records measured/unknown usage, files, cost, exit status, and authorization profile underruns/{run-id}/proposer-sessions/iter-{N}/.- Outer machine — evaluates an explicit baseline and candidate populations, writes the archive/frontier and compact summary, appends evidence/lifecycle events, and checkpoints each node when persistence is enabled.
- Inner machine — writes raw per-attempt traces under immutable candidate IDs; the evaluator stores content-addressed copies and links every result to the candidate manifest, task hash, model, evaluator, runtime, and sandbox policy.
- Dashboard — consumes REST/SSE and checkpoint history through FastAPI and shows candidate IDs, provenance, metric status, failures, and artifact links.
- Monorepo with top-level dirs
backend/(FastAPI + LangGraph),frontend/(Next.js 16),sdk/(themeta_harnessPython package +wrap_graph()/@trace_run),skills/(SKILL.md files),eval/(5 coding tasks + holdout),docs/,infra/(docker-compose). - Postgres via local
docker compose up -d postgres. LangGraph'sAsyncPostgresSaver+PostgresStoreare first-class. - AsyncPostgresSaver only (sync version deadlocks under concurrent branches per Appendix A).
- Project name = "Meta-Harness" (project), Python package =
meta_harness(snake_case), CLI =meta-harness(hyphenated). Stanford's framework is referred to as "Stanford's reference framework" — never conflate. - Proposer implementation:
claudeCLI subprocess (Phase 1.1 resolved). Matches Stanford'sclaude_wrapper.pypattern verbatim. Each spawn uses--dangerously-skip-permissions(unrestricted filesystem access on the run directory),--disable-slash-commandsand an empty--plugin-dir(hermeticity),--append-system-prompt(SKILL.md injection),--output-format stream-json(structured logging). Tool bundle:Read, Glob, Grep, Edit, Write, Bash(TOOLS_BASH per Appendix B §B.3) —Bashis required for the SKILL.md workflow's "Prototype" step. The proposer-session log schema is therefore drop-in compatible with Stanford'ssession.json. Demo-machine prerequisite: Claude Code (theclaudeCLI) installed locally; not a runtime concern, but a setup step in the README and BUILD_ORDER's prereq item. Direct Anthropic API proposer is explicitly out of scope. - The inner loop is the Appendix C 5-phase coding agent. There is no alternative inner-loop implementation in scope.
- Two LangGraph state machines, both checkpointed. The inner machine is itself a subgraph compiled per candidate (sandboxed; "secure" property).
- Local-only deployment. No Clerk, Vercel, Vultr,
relay.dev. Dashboard onlocalhost:3000; backend onlocalhost:8000; Postgres onlocalhost:5432.
- Multi-tenant: single-user, single Postgres instance.
- Auth: none.
- Worker queue: FastAPI BackgroundTasks +
asyncio.create_taskper branch (per Appendix A); no Celery, no Redis broker. - Docker per task: process isolation only (Appendix C §C.6.3); honest about the limit in user-facing docs.
- Cloud anything.
- Alternative inner-loop implementations (no Stanford text-classification backup; coding agent only).
- Direct Anthropic API proposer (we use the
claudeCLI subprocess exclusively).