Repository navigation
Description
Summary
Adopt Harness² principles across the ecosystem so that our AI coding agents improve their own harness — prompts, guardrails, skills, tool guidance, scripts, and memory — through execution evidence, while model weights remain fixed.
Today, harness improvements are manual: when an agent skips tests, misuses a tool, or drifts from a spec, a human edits prompts or workflow files. This epic introduces a closed loop where the system:
- records a baseline run,
- proposes structured harness edits,
- probes candidates in a sandbox,
- compares behavior against the baseline,
- composes and applies only proven edits,
- persists reusable lessons for future tasks.
The end state is a self-evolving harness: the more the platform is used, the better its surrounding system becomes, without retraining models.
Motivation
Harness² (Google Research / Northwestern, Oct 2026) demonstrates two levels of recursion:
- Task-level recursion — propose → probe → compose, using behavioral contrast rather than ground-truth labels.
- Harness-level recursion — persist meta-knowledge about when an edit helps, so future tasks benefit.
Reported results include +11.5 points on WorkBuddy-Bench (GLM-5, 64.2 → 75.7), +4.5 on JobBench, and +11.8 partial pass rate on the LAB legal benchmark. These are external, benchmark-specific results and are not guarantees for our workloads. We will define our own success metrics (see below).
Our repos already cover the necessary surfaces, but they operate as separate tools. This epic connects them into one improvement loop.
Component mapping
| Harness² role | Repo | Responsibility in this epic |
|---|---|---|
| Editable harness (guardrails, system prompt, workflow) | code-copilot-team |
Hosts the propose–probe–compose loop; spec workflow and safety rails are the primary editable artifacts. |
| Experience library (harness-level recursion) | memkernel |
Stores proposed/accepted/rejected edits, evidence, confidence, scope; supports dedupe, promotion, expiry, retrieval. |
| Skills / tool guidance | wiki-studio |
Generates and lints human-readable skill/tool pages from accepted edits, with review and rollback. |
| Editor / composer (reasoning) | rlm-studio |
Produces structured candidate patches and composes proven, non-conflicting edits. |
| Probe sandbox | haa |
Isolated, resource-limited candidate execution and behavioral-contrast reporting. |
Target architecture (data flow)
Workstreams
Tracked by per-repo issues:
- #TBD —
code-copilot-team: Harness²-style propose–probe–compose loop for workflow/guardrail refinement - #TBD —
memkernel: Harness² experience-library schema and consolidate/promote workflow - #TBD —
wiki-studio: Generate and lint skill/tool-guidance pages from approved edits - #TBD —
rlm-studio: Editor and composer agents with structured patch schema - #TBD —
haa: Sandboxed probe runner and behavioral-contrast report
Phased plan
Phase 0 — Foundations (before any automated loop)
- Define the structured harness patch schema shared by
rlm-studio,code-copilot-team, andhaa. - Define the trace schema (tool calls, commands, errors, test results, artifacts) in
haa. - Define the experience record schema in
memkernel. - Agree on the first target task: one spec-driven coding task in
code-copilot-teamwith a deterministic success signal (tests/build). - Document the human review gate and rollback procedure.
Phase 1 — Proof of concept (manual-trigger, human-approved)
- Baseline trace captured for the target task.
- Editor proposes exactly one general + one domain-specific candidate edit.
- HAA probes both candidates in isolation and emits a contrast report.
- Composer merges the proven candidate; no auto-apply.
- Lesson written to
memkernel; skill page proposed inwiki-studio. - Demo: full loop on one real task, start to finish.
Phase 2 — Experience loop (cross-task learning)
- Retrieval of relevant lessons before proposing edits.
- Promotion/expiry rules tuned on real data.
- Measure transfer: lessons learned on task type A improve task type B.
- Compare against a frozen baseline harness over N tasks.
Phase 3 — Efficiency and scale (only if Phase 2 shows real gains)
- Recursion budget controls (k candidates, max rounds) with cost accounting.
- Difficulty-aware budget allocation.
- Experience dedupe/merging and retrieval optimization.
- Optional scheduled/CI-triggered improvement runs on designated repos.
Cross-cutting requirements
- No model-weight training. All adaptation is runtime, via files and execution evidence.
- Human review by default. Auto-apply is opt-in per repo and per component, and never for safety rails without explicit sign-off.
- Evidence trail. Every applied edit links to a trace, a contrast report, and a review decision.
- Rollback. Every applied edit is reversible via versioned harness files.
- Cost visibility. Candidate generation, probing, and composition are metered; every loop run reports its inference/compute cost.
- Isolation. Candidate probes never touch the main workspace or production credentials.
- Security. Harness edits cannot weaken sandboxing, secret handling, or approval gates.
Success metrics
Measured against a frozen baseline harness, on a fixed internal task set:
- Task success rate (tests/build/spec compliance) — target: measurable improvement, minimum sample size agreed before Phase 2.
- Regression rate on previously passing tasks — target: no statistically significant increase.
- Human edit-acceptance rate for proposed harness patches — target: majority accepted after Phase 2 tuning.
- Median loop cost per accepted edit — tracked, with a ceiling agreed in Phase 3.
- Transfer signal: gain on held-out task types not used during improvement.
External benchmark numbers from the Harness² paper are context only; they are not our acceptance criteria.
Risks and mitigations
| Risk | Mitigation |
|---|---|
| Overfitting to a single repo/task | Held-out task set; transfer measurement in Phase 2. |
| Inference cost growth from recursion | Budget caps, k=1 default, cost reporting per run. |
| Harness drift / silent regressions | Behavioral contrast + full regression suite + human review + rollback. |
| Prompt/guidance bloat over time | memkernel expiry and dedupe; wiki-studio linting. |
| Weakened guardrails | Safety-rail edits excluded from auto-apply; explicit review required. |
| Cross-repo schema churn | Schema versioning in Phase 0; shared contract tests. |
Out of scope
- Model fine-tuning or weight updates.
- Fully autonomous merging of arbitrary code changes.
- Replacing existing safety rails or spec-driven workflows.
- Guaranteeing benchmark-level gains on our workloads.
Open questions
- Which component is edited first: guardrails, workflow instructions, or tool guidance?
- Where does the canonical patch schema live —
rlm-studio, a shared package, or a newharness-contractsrepo? - What is the default review surface: PR-based, a CLI approval step, or a dashboard in
code-copilot-team? - How long should rejected-edit lessons be retained?
- Do we want one improvement loop per repo, or a single orchestrator coordinating all five?
Definition of done (epic)
- All five per-repo issues closed or explicitly descoped.
- Phase 1 demo runs end-to-end on a real task with human approval.
- Phase 2 shows a measurable, non-regressive improvement over the frozen baseline on the internal task set.
- Every applied harness edit is traceable, reviewable, and reversible.
-
memkernelholds a usable experience library with promotion/expiry working. -
wiki-studioskill/tool pages stay in sync with accepted edits. - Documentation covers architecture, schemas, cost model, and runbook.
Activity