← Harness Engineering From First Principles

Reproducibility and Fair Comparisons

Freeze manifests and fixtures, vary one mechanism, repeat where needed and report uncertainty.

Project 01’s correction stream binds its candidate to a manifest: SHA-256 digests of 33 source, test and documentation files, combined into one hash. Its risk register then warns that this binding is weaker than it looks: “A working-tree hash is not a frozen accepted baseline; Git line-ending normalization can also change working-tree byte hashes on checkout” (HARNESS-PROJECT-01-FIX-01/REMAINING-RISKS.md §5; OBSERVED as a documented risk). This repository shows the effect directly. The original chapter briefs were committed with CRLF line endings, and the drafted chapters were written with LF. The same front matter therefore produced different byte digests until line endings were normalized, which this book’s own validation work had to account for (HARNESS-BOOK-WRITE-04 VALIDATION.md; OBSERVED).

The Project 01 fixture is immune to this, by design. Its admission normalizes CRLF to LF, rejects lone carriage returns and byte-order marks, and hashes the admitted bytes, not the bytes on disk (OFFLINE-IMPLEMENTATION-CONTRACT.md §2). One part of the system was engineered for reproducibility and the part next to it was not. That is the normal state of affairs, and it is the starting point for this chapter. Reproducibility is not a property a system has. It is a set of specific claims, each true or false, about specific artifacts. A comparison is fair only if the claims it depends on are true for both arms.

Evidence status. Draft manuscript. No checkpoint. The manifest and line-ending observations are OBSERVED in repository records. Project 01 is REJECTED (REVIEW-02) and has no accepted baseline; its manifests bind a rejected candidate. Statistical methods are DOCUMENTED via R05’s sources. The worked significance example uses hypothetical data, with every calculation shown. The reproducibility audit and comparison protocol are PROPOSED. EXPERIMENT PENDING.

18.1 Four reproducibility claims

“Reproducible” is used for at least four different claims. They need different evidence, and a system can satisfy one while failing another.

  1. Artifact reproducibility. The same bytes can be recovered: code, fixture, configuration and dependency lock. Evidence: content digests over a canonical representation, plus a committed revision. The line-ending problem is a failure of this level.
  2. Execution reproducibility. A recorded run can be re-checked deterministically. Replaying it against its recorded inputs gives the same derived trace and verdicts. Evidence: replay. R05 is precise about its reach. Replay compares captured tool inputs and outputs, sequence identities and normalization invariants “without resampling the provider”, and “establishes those trace properties only” (R05-EVALUATION.md, interventions section).
  3. Statistical reproducibility. Running the stochastic system again produces outcomes from a compatible distribution. Evidence: repeated runs with interval estimates. Bit-for-bit reruns are not available for hosted models. Matching seed, settings and fingerprint “did not guarantee identical responses” in the documented OpenAI setting (R05-C07; DOCUMENTED, historical provider scope).
  4. Conclusion reproducibility. An independent team, following the registered protocol, reaches the same conclusion. Evidence: a protocol complete enough to follow, and ideally an actual independent replication. This book has none yet.

These are related evidence claims, not a strict dependency ladder. Recoverable artifacts support a close replication; a fresh implementation may independently reproduce a conclusion without replaying the original bytes. Perfect artifact identity alone says nothing about whether a 4-point improvement will reappear.

18.2 Freezing: canonical identity, not file bytes

A manifest records the identity of everything a run depends on. Chapter 3 listed its contents. This chapter is about how identity is computed, because that is where the line-ending failure lives.

Canonicalize before hashing. A digest is a claim about bytes. If two logically identical artifacts can have different bytes (line endings, key order in JSON, trailing whitespace, Unicode normalization), then either canonicalize before hashing or declare that the digest identifies a representation and not the artifact. Project 01 does both, in different places. Its fixture hash is computed over normalized, admitted text with a defined row format (offline contract §2). Its evidence bundles carry a canonical-content digest and a byte digest of the serialized file (lab README: “a canonical content digest, byte-digest sidecar and a separate parent completion receipt”). The source manifest uses working-tree bytes, which is the documented weakness.

Bind to a revision. A digest of an uncommitted working tree identifies a moment, not a version. REVIEW-02’s last correction item is explicit. “After independent acceptance, commit the exact accepted source and fixture identity and regenerate the … manifest. Do not use the current rejected manifest as an accepted-baseline substitute” (§10, item 7). Freezing therefore has an order: accept, commit, regenerate the manifest from the commit, then compare.

Pin what can be pinned, and record what cannot. The Pi package version (the candidate pins exact 1.6.0) and the dependency lock can be pinned. The provider’s model snapshot often cannot. Record whatever identity the provider exposes, record the date, and treat drift between runs as a known confound to be balanced by interleaving (§18.4), not as solved.

18.3 Vary one mechanism, and know when that is not enough

An ablation removes or disables one mechanism to examine its contribution. It is the simplest fair comparison, and the book’s studies use it throughout: Chapter 5’s truncated-digest arm, Chapter 6’s disabled guard, Chapter 12’s identity and isolation ablations, Chapter 16’s checker-only and reviewer-only arms.

One-at-a-time ablation has a known limitation. It measures a component’s contribution in the presence of all the others, and contributions are not always additive. R03 records that in the Agentic Harness Engineering study a prompt-only swap regressed performance and that “components non-additive” (R03-HARNESS-RESEARCH.md R03-C06; DOCUMENTED via R03). R03’s interpretation is that “interactions prevent adding isolated gains together”. When mechanisms are suspected to interact, the design must include the combinations. A factorial design deliberately varies several declared factors and estimates registered main effects and interactions; it is not an uncontrolled bundle. Multiplicity and the primary contrast still belong in the registration. R05’s 2×2 candidate for Repo Scout does exactly this. Instrumentation on or off is crossed with an evidence mechanism on or off, so that the interaction can be estimated rather than assumed away (R05, interventions section; PROPOSED).

A further discipline concerns which configuration is being compared. R03 reads Harness-Bench as useful for choosing an entire model–harness configuration, and says it “cannot isolate a single hook’s causal contribution, because native defaults deliberately travel together” (R03, method comparison). Comparing two whole products is a legitimate question. It is a different question from “what does mechanism X contribute?”, and the book’s studies are almost all of the second kind.

18.4 What makes a comparison fair

A controlled comparison aims to identify effects of registered factors, with uncertainty and residual confounds reported. Five conditions do most of the work; they reduce bias without proving every hidden difference absent.

Same tasks, paired. Each task is run under both arms, and analysis compares arms within a task. Pairing controls between-task difficulty in that contrast; it does not remove within-task variation or shared provider effects.

Matched budgets. Both arms receive the same total budget, under the same admission rule (Chapter 17). A treatment that makes more model calls or delegates to more agents must not get extra budget to do so. This is the budget illusion from Chapter 1, and it is mandatory from Project 08.

Balanced order and time. Run A and B interleaved, in randomized or block-balanced order, so that provider drift, rate limits and time-of-day effects fall on both. R03’s proposed pilot calls for randomized AB/BA ordering within task and repetition, isolated working state, and interleaved conditions to reduce provider drift (R03, proposed pilot budget; PROPOSED).

Intention-to-run. Every attempted run is counted, including failures, timeouts and infrastructure errors. Exclusions follow rules frozen before any outcome is seen, and they apply to whole paired blocks, never to one arm’s bad run (Chapter 3; R03 invalid-run rules).

Development separate from confirmation. Any choice informed by looking at outcomes, such as prompt tweaks, thresholds or task selection, happens on development tasks. Confirmation uses a frozen, held-out set. R03’s reading of AHE warns that “a campaign’s selected peak is an optimization result”, and that selecting and testing on the same task family “risks optimistic estimation” (R03, method comparison). R05 adds that registering the analysis before outcomes separates confirmatory from exploratory work (R05-C06, after Nosek et al.; DOCUMENTED).

18.5 Uncertainty: the unit of analysis decides the answer

Few tasks, few repetitions and a stochastic system make uncertainty the central reporting problem. R05’s sources supply three rules, each DOCUMENTED within its source’s scope. Point estimates from few runs mislead, so report intervals (R05-C03, after Agarwal et al.). Repetitions within one dataset are not independent datasets (R05-C04, after Demšar). And resource limits are a legitimate justification for sample size if the inferential limits are stated (R05-C05, after Lakens).

The second rule has consequences large enough to show with numbers. The example below uses hypothetical data. Every probability is an exact binomial calculation, shown so that it can be checked.

Setup. Twelve tasks, each run three times under arm A and three times under arm B. Each A run is paired with a B run of the same task and repetition index. That gives 36 labelled pairs, not 36 independent task draws. Index matching is bookkeeping unless a registered blocking design gives the index a common condition. In each pair, both arms succeed, both fail, or exactly one succeeds: a discordant pair. For the task-level calculation below, assume the twelve tasks were sampled independently and task signs are independent with probability one-half under the null. Shared repositories, task families, provider outages or temporal batches can violate that assumption and require higher-level clustering or blocking.

Data (hypothetical). There are 11 discordant pairs: 10 favour B and 1 favours A. The 10 B-favouring pairs come from only four tasks (3, 3, 2 and 2 pairs). The single A-favouring pair comes from one task. The remaining seven tasks have no discordant pairs.

Analysis 1: pairs treated as independent (wrong unit). Under the null hypothesis of no difference, each discordant pair is equally likely to favour either arm, so the count favouring A is Binomial(11, ½). The probability of a split at least as extreme as 10:1, in either direction, is

2 × P(X ≤ 1) = 2 × [C(11,0) + C(11,1)] / 2¹¹ = 2 × (1 + 11) / 2048 = 24 / 2048 ≈ 0.0117.

That looks like strong evidence for B.

Analysis 2: independent tasks as the unit (under the stated assumptions). Summarize each task by which arm won more of its discordant pairs. Four tasks favour B, one favours A, and seven are ties. A sign test discards the ties, leaving n = 5, with the count favouring A distributed as Binomial(5, ½):

2 × P(X ≤ 1) = 2 × [C(5,0) + C(5,1)] / 2⁵ = 2 × (1 + 5) / 32 = 12 / 32 = 0.375.

That is not statistically significant under this task-level sign test. The direction is four tasks to one, but only five non-tied task signs inform this test, so uncertainty is substantial. The data have not demonstrated improvement; they have not demonstrated equivalence either. An interval concentrated within a predeclared practical margin could support equivalence. An interval spanning meaningful harm and benefit would instead indicate insufficient precision. A large p-value alone distinguishes neither case.

The data are identical. The conclusion depends entirely on the unit of analysis, and Analysis 1 is wrong. Repeated runs of one task share that task’s difficulty and any quirk that happens to suit arm B. They are correlated, and treating them as independent inflates confidence by counting one task’s peculiarity three times. This is the Demšar point (R05-C04), made concrete. It is also the reason Chapter 3 fixed “task- instance/run pair, grouped by fixture and task” as Project 01’s experimental unit, and why R03 states that “thirty-six pairs from twelve tasks are not thirty-six independent task draws”.

The sign test in Analysis 2 is deliberately crude. A study would register a fuller method, such as a task-level bootstrap or a mixed model. R05 discusses stratified bootstrap after Agarwal et al. The point of the example does not depend on the choice: the unit must be the task (or the repository), and it must be registered before the data arrive. Two further reporting rules follow. Report the discordant pairs by task, so that readers can see the clustering. And never describe a non-significant result as showing equivalence. An equivalence claim needs a pre-registered margin and enough precision to exclude differences larger than that margin (Chapter 3; R05 interventions section).

18.6 Worked example: registering and analysing the instrumentation comparison

Project 01’s first comparison (Chapter 3 §3.7) holds the task-facing interface fixed and compares arm A (common minimal accounting) with arm B (adding raw-event capture). Here is how the rules of this chapter apply to it, end to end. Nothing here has been run.

  1. Freeze. After independent acceptance, which has not happened: commit the candidate, regenerate the manifest from the commit, and record the Pi pin, the dependency lock, the fixture digest (normalized, so immune to checkout settings), the oracle digest, the provider and model identity, the price record and the date.
  2. Register. Primary endpoint and unit (task-grouped), the analysis method, the overhead tolerance for H3 (Chapter 4), exclusion rules (whole paired blocks only, arm-blind), the stopping rule, and the admission rule for budgets (Chapter 17).
  3. Qualify offline. Show byte-identical model-visible requests between A and B at every turn (H1), and collector detection with no false alarms (H2). Both are deterministic, so no live runs are needed yet.
  4. Run. Development tasks first, used to estimate cost and variance and excluded from analysis. Then the held-out tasks, interleaved AB and BA per task and repetition.
  5. Analyse. At the task level, as in §18.5. Report every discordant pair by task, every exclusion with its reason, every failed and infrastructure-labelled run, and the full spend in both arms.
  6. Interpret. The comparison’s claim is narrow: whether rich tracing changes outcomes or cost beyond the registered tolerance, for this fixture, model and date. It is not a claim about tracing in general.

The order matters more than any single step. Step 3 can falsify the study’s premise cheaply. If A and B send different bytes to the model, the comparison is not a comparison of tracing, and it should not proceed to paid runs.

18.7 Study: a reproducibility audit

This chapter’s own experiment is cheap and deterministic. It is PROPOSED; EXPERIMENT PENDING.

  • Research question. Which of the book’s identity claims survive a fresh checkout under different environment settings?
  • Hypothesis. Canonicalized identities (the fixture digest, canonical bundle digests) are invariant across checkouts. Working-tree byte manifests are not.
  • Alternative hypothesis. Canonicalized identities also vary, which would mean the canonicalization is incomplete. Or byte manifests turn out to be stable, which would mean the documented risk does not materialize in this repository’s configuration.
  • Independent variable. Checkout configuration: line-ending conversion on or off, a different clone path, and a different operating system where available.
  • Dependent variables. Fixture digest, canonical bundle digest, byte digests, source-manifest combined hash, and replay verdicts on stored bundles.
  • Controls. The same commit; no source edits between checkouts.
  • Fixture. The committed repository, once a Project 01 candidate is accepted and committed. Until then, the audit can run only on historical committed bundles, and must say so.
  • Evaluation. Exact comparison of digests and verdicts across checkouts.
  • Failure criteria. Any variation in a canonicalized identity, or any replay verdict that changes with checkout configuration.
  • Threats. Hidden environment differences, such as tool versions, affect replay. Record those versions in the audit itself.
  • Status. Not started.

18.8 What a comparison report must contain

A reader cannot check a comparison they cannot reconstruct. That makes the report itself part of the method, and its contents follow from the failures listed in this chapter. A report that omits any of the items below leaves at least one of those failures undetectable. The list is PROPOSED as the book’s reporting standard for every study it registers.

Identity.

  • The commit and the manifest digest, regenerated from the commit.
  • The fixture digest, computed canonically.
  • The oracle digest.
  • The Pi pin and the dependency lock.
  • The provider and model identity as exposed, with the date range of the runs and the price record used for any monetary figure.

Design.

  • The registered hypothesis, alternative hypothesis and primary endpoint.
  • The unit of analysis.
  • The arms, and the registered factors, their levels, main-effect contrasts and any interaction contrasts between them.
  • The budget admission rule (Chapter 17), with each arm’s total ceiling.
  • The order of execution.
  • Exclusion rules and the stopping rule, each with the date it was registered.

Accounting.

  • Every attempted run, by arm, with its stop reason, its two-dimensional outcome (Chapter 15) and its spend.
  • Unknown usage marked as unknown.
  • Infrastructure-labelled failures listed, not dropped.
  • Every exclusion, with its rule and the paired block it removed.

Results.

  • The primary endpoint at the registered unit, with an interval or exact test.
  • The discordant pairs by task.
  • Any secondary endpoints, labelled as such.
  • Any exploratory analysis, explicitly labelled as not registered.

Limits.

  • What the comparison cannot show: other models, other tasks, other dates, equivalence without a margin.
  • Every deviation from the registration, with its reason.

Two alternatives to this standard are common, and both are worth naming because each has a real attraction.

Headline-only reporting (one success rate per arm) is short and readable, and it hides exactly the information needed to detect the wrong-unit error of §18.5 and the silent exclusions of §18.4.

Full raw-data release without a registered analysis is maximally transparent. It leaves the conclusion to each reader’s choice of analysis, which reintroduces the garden of forking paths that registration exists to close.

The standard above takes the middle course. One analysis is registered and reported, and the raw records stay available, so that any other analysis can be run and labelled as exploratory.

18.9 Failure modes

  • Byte identity mistaken for artifact identity. Hashes of un-canonicalized files. Defence: canonicalize, or label the digest as representation-specific.
  • Working tree as baseline. Manifests of uncommitted files. Defence: accept, commit, then regenerate.
  • Bundled treatments. Two mechanisms changed at once. Defence: one-at-a-time ablation, or a factorial design when interaction is suspected.
  • Unequal budgets. More calls for the treatment. Defence: matched totals under the same admission rule.
  • Wrong unit. Repetitions counted as independent tasks. Defence: task-level analysis, registered in advance (§18.5).
  • Selected peak. Configuration chosen on the evaluation set. Defence: development and held-out separation.
  • Nonsignificance read as equivalence. Defence: a registered margin and precision, or no equivalence claim.
  • Silent exclusions. Defence: intention-to-run, with every exclusion reported.

18.10 What you can build and test now

  • Compute your fixture and evidence digests over a canonical form, then check out the repository again with line-ending conversion toggled, and compare (§18.7).
  • Write a task-level analysis script and run it on the §18.5 hypothetical data. Confirm 0.0117 at the pair level against 0.375 at the task level.
  • Write the registration document for your next comparison before writing its runner.

18.11 What remains unverified

  • Every comparison in this book. None has run.
  • Project 01 has no accepted, committed baseline (REVIEW-02: REJECT).
  • How much provider drift exists across days for the models this book will use (UNKNOWN), and whether interleaving is enough to balance it.
  • The appropriate analysis method beyond the illustrative sign test. To be registered per study, with R05.

EXPERIMENT PENDING. No reproducibility audit or comparative study has been run.

Capstone connection. Every capstone’s claimed results depend on this chapter’s conditions. The economic-orchestration capstone depends on them most directly, because cost-quality comparisons across local, free and paid models are exactly where unequal budgets, drift and the wrong unit of analysis produce convincing but false conclusions.

Part III has built a single agent’s structured, evaluated and honestly measured run. Part IV adds more agents. The first question is not how they cooperate but what one agent may hand to another: what a delegated task carries, what authority and budget travel with it, and what comes back. Chapter 19 takes up delegation.

Previous: Chapter 17: Failures, Budgets, and Timeouts.

Next: Chapter 19: Delegation Without Unbounded Autonomy.