The repo is a uv workspace with two Python packages (sdk/, backend/),
a Next.js app (frontend/), and supporting directories. Every Python file
below has a one-line purpose annotation. Every locked decision in
ARCHITECTURE_SECTION_1.md is reflected in placement.
meta-harness/ # Repo root (uv workspace)
├── README.md # Setup + 60s pitch + prereq list
├── LICENSE
├── .gitignore
├── pyproject.toml # uv workspace: members = [sdk, backend]
├── ARCHITECTURE_SECTION_1.md # Reference: locked architecture
├── relay_metaharness_v7.md # Reference: v7 canonical build doc
├── relay_v7_appendix_a_worktrees.md # Reference: concurrent branches
├── relay_v7_appendix_b_metaharness_internals.md # Reference: Stanford repo deep-dive
├── relay_v7_appendix_c_inner_loop.md # Reference: 5-phase coding agent
│
├── docs/ # Phase-0 execution artifacts
│ ├── PROJECT_LAYOUT.md # ← this file
│ ├── INTERFACES.md # All cross-component contracts
│ ├── BUILD_ORDER.md # Topological build steps + DoD
│ └── DEFINITION_OF_DONE.md # Demo arc as acceptance test
│
├── sdk/ # User library: pip install meta_harness
│ ├── pyproject.toml # name="meta_harness"; library only, no CLI
│ └── meta_harness/ # ⚠ snake_case = import name
│ ├── __init__.py # Public API re-exports
│ ├── wrap_graph.py # Instrument an existing LangGraph for Meta-Harness
│ ├── trace.py # @trace_run decorator for generic agent loops
│ └── types.py # Shared dataclasses (TraceEvent, RunInfo)
│
├── backend/ # FastAPI + LangGraph implementation
│ ├── pyproject.toml # depends on meta_harness; console_script: meta-harness
│ ├── app/
│ │ ├── __init__.py
│ │ ├── main.py # FastAPI app entry; mounts api routers; lifecycle hooks
│ │ ├── cli.py # `meta-harness` CLI (typer): loop / init / run / fork
│ │ ├── streaming.py # In-process SSE channel registry
│ │ ├── meta_harness/ # ⚠ INTERNAL namespace (app.meta_harness ≠ sdk's meta_harness)
│ │ │ ├── __init__.py
│ │ │ ├── contracts.py # Versioned candidate/evaluation/evidence/refinement models
│ │ │ ├── artifacts.py # Atomic and content-addressed artifact storage
│ │ │ ├── candidates.py # Immutable candidate materialization, policy checks, loading
│ │ │ ├── evaluator.py # Shared search/holdout evaluator and telemetry aggregation
│ │ │ ├── providers.py # Anthropic/Google normalized model providers, quotas, pricing
│ │ │ ├── runtime.py # Task runtime adapter registry
│ │ │ ├── execution.py # Fixed-graph and future recursive backend boundary
│ │ │ ├── ledger.py # Append-only evidence and lifecycle transitions
│ │ │ ├── refinements.py # Versioned apply/reject/rollback records
│ │ │ ├── reports.py # Finalization and paired regression reports
│ │ │ ├── experiments.py # Deterministic bundles and repeated-run confidence summaries
│ │ │ ├── outer.py # Baseline → population search → archive/frontier selection
│ │ │ ├── inner.py # Orient → plan → act → verify → submit
│ │ │ ├── state.py # LangGraph state compatibility schemas
│ │ │ ├── proposer.py # Run-scoped mock/Claude proposal generation
│ │ │ ├── harness.py # CodingAgentHarness + telemetry + 11 override hooks
│ │ │ ├── tools.py # 6 fixed inner-loop tools
│ │ │ ├── sandbox.py # Trusted-local process/workspace isolation
│ │ │ ├── frontier.py # Pareto frontier with unknown-metric handling
│ │ │ ├── memory.py # Scoped evidence-ranked Postgres patterns
│ │ │ ├── persistence.py # AsyncPostgresSaver connection pool
│ │ │ ├── branches.py # Concurrent branches + durable projections
│ │ │ └── runs.py # Run filesystem lifecycle
│ │ └── api/ # HTTP transport layer
│ │ ├── __init__.py
│ │ ├── runs.py # POST /runs, GET /runs, GET /runs/{id}
│ │ ├── checkpoints.py # GET /runs/{id}/checkpoints
│ │ ├── forks.py # POST /runs/{id}/fork ; POST .../branches/{thread_id}/cancel
│ │ ├── memory.py # Scoped memory list/search
│ │ ├── refinements.py # Refinement propose/apply/reject/rollback
│ │ └── events.py # GET /runs/{id}/stream (SSE)
│ └── tests/ # pytest suite: test_outer/inner/proposer/tools/sandbox/frontier/memory/branches
│
├── frontend/ # Next.js 16 dashboard (localhost:3000)
│ ├── package.json
│ ├── next.config.js
│ ├── tsconfig.json
│ ├── tailwind.config.ts
│ ├── app/
│ │ ├── layout.tsx
│ │ ├── page.tsx # Landing (run list + "new run" button)
│ │ └── runs/[run_id]/page.tsx # Dashboard (run detail) — the demo screen
│ ├── components/
│ │ ├── StateGraph.tsx # ReactFlow outer-graph viz (live nodes lighting up)
│ │ ├── TrajectoryTree.tsx # D3 candidate trajectory tree (forks branch)
│ │ ├── DiffViewer.tsx # Monaco unified-diff viewer (agents/<n>.py vs parent)
│ │ ├── ScoreChart.tsx # Score + Pareto frontier
│ │ ├── MemoryPanel.tsx # Cross-run memory sidebar
│ │ └── ForkModal.tsx # Right-click checkpoint → fork modal
│ └── lib/
│ ├── api.ts # REST client (typed)
│ └── sse.ts # SSE EventSource wrapper
│
├── skills/ # SKILL.md files (--append-system-prompt'd into claude spawn)
│ └── meta-harness-coding-agent/
│ └── SKILL.md # Proposer workflow for the coding-agent domain
│
├── eval/ # Frozen eval set + scorer
│ ├── score.py # Wraps pytest; returns {accuracy, per_task, tokens}
│ ├── tasks/ # 5 search-set tasks; each = task.json + workspace/
│ │ ├── task-001-fix-typo/ # workspace/{calculator.py, tests/test_calculator.py}, task.json
│ │ ├── task-002-add-function/ # Same shape: task.json + workspace/{stats.py, tests/...}
│ │ ├── task-003-refactor/
│ │ ├── task-004-handle-error/
│ │ └── task-005-implement-spec/ # geometry/ package per README spec
│ └── holdout/ # 2 tasks the proposer never sees (--holdout flag)
│ ├── task-006-…/
│ └── task-007-…/
│
└── infra/
└── docker-compose.yml # postgres:16 on localhost:5432 + persistent volume
-
Two directories named
meta_harness. They live in different scopes and are NOT the same package.sdk/meta_harness/— installable Python package; import pathmeta_harness. This is what users get frompip install meta_harness.backend/app/meta_harness/— backend's internal orchestration namespace; import pathapp.meta_harness. This is private to the FastAPI app.- Both directories must be snake_case to match their respective
import names. Hyphenated
meta-harness/is a Python import error.
-
claude_wrapper.py-shaped code lives atbackend/app/meta_harness/proposer.py. Not insdk/. Not as a top-level orchestration script. The proposer is the body of the outer state machine'sproposenode, so its module sits adjacent toouter.py. If proposer code drifts tosdk/or to a sibling ofbackend/, that's the same architectural error from Correction 1 coming back through file layout. -
The
meta-harness(hyphenated) CLI tool comes frombackend/pyproject.toml's[project.scripts]entrymeta-harness = "app.cli:main". The SDK package intentionally has no CLI to avoid a circular SDK↔backend dependency. Users who want only the librarypip install meta_harness; users who want the CLIpip install -e ./backend(or both via the workspace install). -
Reference docs (relay_metaharness_v7.md and the three appendices plus ARCHITECTURE_SECTION_1.md) live at the repo root, not in
docs/. Phase-0 execution artifacts (this file, INTERFACES.md, BUILD_ORDER.md, DEFINITION_OF_DONE.md) live indocs/. -
Demo entrypoints (running locally):
docker compose -f infra/docker-compose.yml up -d postgresuvicorn app.main:app --reload --port 8000(inbackend/)npm run dev(infrontend/, serves on:3000)meta-harness loop --domain coding-agentto start a run from the CLI