Harness Engineering From First Principles
Book II in the Pi Agents series: thirty planned chapters and ten cumulative experiments in harness engineering.
This is Book II in the Pi Agents series, following Pi Agents: Building on the Coding Agent.
An agent’s result depends on more than the model. The surrounding software decides which information reaches the model, how tools execute, which effects are permitted, which state survives interruption and how completion is judged. This book proposes an experimental investigation of those decisions.
With model, task, environment and budget held constant, what does each harness mechanism actually improve?
The planned implementation is a small TypeScript host around Pi, extended through ten cumulative projects. Pi remains the execution substrate. The host, effect boundary and independent evaluator have separate responsibilities; their exact integration contracts require verification.
Current state
All thirty chapters are complete technical draft manuscripts. The whole-book independent audit, HARNESS-BOOK-REVIEW-04 (23 November 2026), returned CONDITIONAL — CORRECTIONS REQUIRED, with no publication acceptance. Earlier reviews and design-level corrections remain recorded; FIX-04’s author responses require targeted independent verification. All chapters remain drafts and appear only in draft preview.
The manuscript presents methods, proposed contracts and a falsifiable research programme. It does not establish measured harness benefits, qualified security boundaries or demonstrated savings. Project 01 remains REJECTED under its latest completed engineering review; its passing test history is not acceptance. Live studies and the later projects remain EXPERIMENT PENDING. Gate A and Gate C remain pending.
Six parts
- Part I — The Harness as an Experimental Object
- Part II — Information and Continuity
- Part III — Structured Execution and Verification
- Part IV — Coordination and Experience
- Part V — Adaptive Harness Engineering
- Part VI — Integration and Boundaries
Ten planned applications
Repo Scout; Reliable Editor; Evidence Researcher; Crashproof Worker; Permissioned Operator; Issue-to-Patch; Book Quality Lab; Investigation Team; Experience-Aware Agent; Adaptive Harness Lab.
Each project needs a fixed baseline, a named intervention, an independent outcome check, a failure experiment and a retained result report. Negative and inconclusive findings remain part of the book.
Reading the evidence
A trace records activity; completion needs an independent check. Recoverable task state needs a defined contract beyond conversation history. Permission policy needs an enforcing boundary. A proposed improvement earns promotion through independent evaluation and the required human decision.
Every empirical statement in draft chapters carries two labels. The evidence category says what backs it: Established (primary documentation or prior research, cited with revision), Implemented (inspected code plus passing tests, with commands and checkout recorded), or Experimentally demonstrated (reproducible measurements from this book’s projects, with model, fixture, budget, seeds, and independent outcome). The provenance says where the claim stands: DOCUMENTED, OBSERVED, PROPOSED, or UNKNOWN. Published results establish what their authors report; they are never this book’s experimental demonstration. Anything not yet run is marked EXPERIMENT PENDING.
Reading the drafts
Chapters 01–30 develop the same harness from first principles, with
concrete examples, failure cases, illustrative contracts and pending study
designs. REVIEW-04 covers the complete manuscript; new correction text
is not automatically approved by that earlier review. Proposed interfaces
are labelled and are not runnable integration claims. Research, review,
correction and reporting records live under docs/research/; their scope
and dates distinguish historical evidence from current readiness.
The final manuscript will include versioned integration notes, schemas, fixtures, evaluation rubrics, a threat model, reproducibility records, references and a glossary. Those appendices are planned and have not been drafted.
Chapters
What Is a Harness and What Is Not?
Map a task through the proposed layers and identify which component owns each decision.
From Pi Agents to a Controlled Host
Locate each required host decision before choosing an integration seam; record unsupported seams.
The Run Contract and Baseline
Register the fixture, model, configuration, budget and independent acceptance oracle before a run.
A Trace Is Not an Outcome
Compare baseline and instrumented runs; verify answers against repository fixtures and preserve raw events.
Tool Schemas as Cognitive Interfaces
Hold task and model fixed while varying tool interfaces; count invalid actions and recovery attempts.
Reliable Editing and Stale Preconditions
Change a file after an edit is proposed and check that stale preconditions prevent application.
Context as a Bounded Resource
Compare context selection strategies at fixed budgets and check retention of task-critical facts.
Evidence Selection, Provenance, and Compaction
Compare full, selected and compacted context; check source support and detect missing or stale evidence.
Sessions Versus Durable Task State
Separate conversation history from durable task state and inspect what each can reconstruct after interruption.
Checkpoints, Retries, and Ambiguous Effects
Inject faults around intent, execution, acknowledgement and settlement; reconcile uncertain effects before completion.
Capability Is Not Authority
Identify the enforcing boundary for each capability and test refusal outside model instructions.
Isolation, Approvals, and Trust Boundaries
Test path escapes, junctions, unexpected commands and expired approvals on a qualified Windows environment.
Plans, Workflows, and the Agent Loop
Compare free-form execution with named workflow gates while retaining the Pi agent loop.
Typed Transitions and Deterministic Gates
Require a reproduced failure and verified passing patch before entering the review state.
Evaluation: Outcome, Process, and Evidence
Separate deterministic checks, model judgments and human review; document disagreement.
Independent Review and Bounded Repair
Preserve the original chapter and factual invariants; independently review bounded repair candidates.
Failures, Budgets, and Timeouts
Exercise timeout, retry exhaustion and cancellation; record incomplete work without reporting success.
Reproducibility and Fair Comparisons
Freeze manifests and fixtures, vary one mechanism, repeat where needed and report uncertainty.
Delegation Without Unbounded Autonomy
Give delegated tasks explicit scopes, acceptance checks and budget shares; test scope violations.
Merging Parallel Work and Resolving Disagreement
Compare one, two and four agents at matched total budgets; inject conflicting findings and edits.
Experience: Traces, Outcomes, Skills, and Cases
Distinguish traces, verified outcomes, reusable procedures and cases before indexing history.
Selecting Relevant History
Compare no history, relevant history and irrelevant history using independently checked outcomes.
Temporal Integrity and Contamination
Enforce event-time eligibility and held-out partitions; deliberately attempt contamination.
When Many Agents Are Worse Than One
Measure verified completion, duplication, conflict and total spend across budget-matched team sizes.
The ECK: Policy Selection Above the Agent Loop
Specify ECK inputs, permitted policy outputs and independent checks; keep effect authority outside its control.
Predict, Test, Promote, or Revert
Register predictions, evaluate candidates on held-out tasks and rehearse rejection and rollback.
Multi-Model Routing Without Benchmark Leakage
Freeze routing rules before held-out evaluation and account for all model calls and selection costs.
The Economics of Reliability
Report cost per independently verified completion, including failed runs and human review effort.
A Harness Behind Mission Control: Interfaces and Evidence
Define versioned initiation, observation, approval and outcome interfaces; validate duplicated and stale requests.
Lessons, Negative Results, and an Open Research Agenda
Trace each conclusion to retained evidence; distinguish measured findings, proposals and open questions.