← Harness Engineering From First Principles

Temporal Integrity and Contamination

Enforce event-time eligibility and held-out partitions; deliberately attempt contamination.

A maintenance run starts at 09:00 with a failing retry test, a repository snapshot and a procedure selected from yesterday’s work. At 09:20, a reviewer discovers that the procedure’s validation test never exercised permanent failures. At 10:00, an analyst replays the 09:00 decision. Which procedure should the replay show? The one available at 09:00. Which procedure should a new run select at 10:00? Not the invalidated one. Which result should today’s report describe as trustworthy? That requires a fresh judgment of the affected evidence, not either timestamp alone.

These are three different questions: historical explanation, present eligibility and current assessment. A memory system that answers them with one query for the latest row will get at least one wrong. A system that answers them with immutable old rows alone can preserve history while continuing to recommend something now known to be unsafe.

Chapter 21 supplied immutable versions and required-use dependency checks. Chapter 22 sealed development against confirmation and specified grouping before splitting. This chapter derives the temporal protocol joining them. The objective is not to make history favourable. It is to make every decision explainable using the information that was legitimately available, and every present claim answerable to what has since become known.

Evidence status. Provisional technical draft. The tombstone and eligibility demonstration D23-TOMBSTONE-01 is implemented and executed (examples/pi-harness-lab/src/tombstone.ts; test/tombstone.test.ts, 10/10 pass, plus the integrated retrieve→tombstone→re-retrieve→audit scenario): tombstone-gated selection, restart-persistent suppression, forged/cross-task/conflict refusal, fail-closed corrupt journals, audit of retained-vs-usable records, and reindex without resurrection. R06-C09 is an OBSERVED, pinned static-inspection finding about a particular Writer retrieval path, not a claim about every Writer service. The E23 deterministic fault catalogue is partially executed (as-of cutoff, tombstone suppression, audit, reindex, race-free single-writer behaviour); the registry-epoch, fork and live-model parts, and the full §23.6–§23.8 study, remain PROPOSED and EXPERIMENT PENDING. No secure erasure is claimed. Project 01 remains REJECTED; Gate A and Gate C remain pending.

23.1 A timestamp names a fact only when its meaning is declared

An event can happen before a system knows that it happened. A test process finishes at 09:04, its result reaches the host at 09:07, the host validates the runner identity at 09:08, and the store admits an outcome record at 09:09. A selector at 09:05 cannot use that outcome. A database field called time leaves the question unanswered because all four times are reasonable values for it.

Use Chapter 21’s meanings consistently. observedAt describes the reported event. knownAt is the host-attested availability of a required component. acceptedAt is the registry admission of a complete record version. availableAt is the derived maximum over acceptance and all required dependency availability. A record’s author-supplied creation time is provenance, not permission to appear in an earlier decision.

The simple baseline is a frozen file of eligible records with one admission cutoff. For a study with no changing history, that is often sufficient. There is no reason to begin with a temporal database. Freeze the file, verify its contents and digest, and give every arm the same snapshot. The richer protocol becomes useful when records arrive late, standing changes or the study asks what a historical system could have done.

Clocks do not prove causality. If two hosts disagree about wall time, use the authoritative registry sequence and explicit admission receipts to establish ordering. Keep timestamps for interpretation and latency, but do not resolve a conflicting update by whichever machine claims the later second. A host that cannot establish whether a required record preceded the cutoff must refuse that use as unknown. Guessing silently converts uncertain chronology into favourable evidence.

23.2 Two questions require two resolution modes

Historical resolution asks for the state visible before a declared cutoff. Restrict the registry to the available prefix first, then resolve each lineage and its required-use dependency closure inside that prefix. Keep pinned version references so the old reasoning can be reconstructed. Do not select today’s head and move its timestamp backward. Do not hide an earlier admissible version merely because a later version now exists.

Current admission asks whether a record may support new work. Resolve the candidate and every required dependency against a consistent present registry revision. A pinned successful outcome is not sufficient if its current lineage head rejects the claim on which the candidate relies. Chapter 21’s A → B → C rule propagates ineligibility through the chain. Mere historical citation is different from a required verification link: a lesson can cite a rejected patch as a counterexample without depending on its success.

Both modes return a receipt containing the requested use, cutoff or registry revision, selected immutable IDs, dependency decisions and refusal reasons. The receipt is itself immutable evidence of a decision; it is not a certificate that the source will remain eligible forever. If the registry advances between checking and admitting a live decision, repeat the check or use an atomic admission binding to the checked revision. An asynchronous cache must not quietly outlive adverse review.

Historical resolution is not historical endorsement. A replay may show that yesterday’s selector followed yesterday’s policy correctly, while today’s evaluation finds the chosen procedure defective. Report both. Otherwise the book would reward a system for faithfully repeating an old mistake, or condemn an old decision for failing to use future knowledge.

23.3 Availability follows dependencies, not just records

Suppose a case was admitted at day 4, its supporting trace at day 3, its task verdict at day 5 and its independent execution review at day 7. If the proposed use requires all of them, availability is day 7 or later, including the admission of the final version containing them. Taking the minimum would borrow future information; taking the maximum is a deliberate conservative rule. Earlier partial versions may support narrower uses, such as audit of a tool observation, under their own explicit standing.

Every derived record carries the complete source-task closure. A procedure extracted from a lesson does not erase the lesson’s source. A case assembled by a deterministic host does not erase the model-generated patch inside it. A route preference estimated from five experiments depends on those experiments even if the resulting preference is a short sentence. This is why temporal eligibility cannot stop at the top-level row.

The closure is an evidence graph in the ordinary sense of linked records. Its existence does not establish that a graph database is required. An indexed table and explicit traversal can enforce the same rule. The E21b representation question remains pending: compare correctness, attribution completeness and cost on identical records and queries before claiming a storage representation improves the harness.

Failure behaviour must be uniform. Missing nodes, cycles, unavailable receipts and unresolved identity all deny the dependent use. Retain the request and error so the refusal can be investigated. A temporary registry outage should not trigger retrieval from an old unqualified cache. A declared fallback may use no history or a separately admitted static procedure, with the changed execution recorded. Availability of service is valuable; it cannot be manufactured by pretending missing evidence exists.

23.4 Contamination is a path through the whole development process

Exact answer retrieval is the easiest leak to see. A more subtle leak is a developer reading a failed confirmation example, changing a ranking weight and then reporting a new confirmation score on the same examples. The future answer never appears in a model prompt, but it has shaped the policy that constructs the prompt. The boundary must therefore include people, model selection, tools, derived summaries and experiment analysis.

Chapter 22’s custodian groups tasks using frozen exact, near-duplicate and answer-template methods. Developers calibrate those methods on development labels only. The custodian can inspect prospective confirmation artifacts to apply the frozen construction procedure, but cannot feed solution details back to candidate development. A construction role and a model optimization role held by the same exposed operator break that separation. Changing the operator’s title does not remove what they have learned.

Separate three cohorts when they answer different questions. Development supports construction and tuning. Development-validation tests whether a frozen candidate procedure works on independent tasks before it becomes eligible. Final confirmation estimates the frozen system’s performance without further selection. Admission-validation is not the final exam. Using the same pool for both promotion and a final generalization claim turns confirmation into another optimization round.

Public data introduce an additional unknown. A fresh task ID does not prove the underlying answer was absent from training. Private variants, random mappings, chronological cutoffs and source-answer redaction can challenge particular contamination explanations. They cannot establish complete knowledge of an opaque model’s training history. State which path each control tests, rather than use the word uncontaminated as an unqualified property of a benchmark.

23.5 A decision receipt is the smallest useful temporal interface

The proposed interface below is a host contract, not a Pi API. Pi continues to execute the admitted episode. The receipt binds what the host selected before it constructed that episode’s context.

// Specified here; as-of selection and tombstone suppression executed in
// D23-TOMBSTONE-01. No registry-epoch store or live integration; not a Pi export.
interface HistoryDecisionBase {
  mode: "historical" | "current";
  requestedUse: string; // registered use ID
  cutoff: string;
  registryRevision: string;
  splitManifestDigest: string;
  groupingManifestDigest: string;
  policyDigest: string;
  selectedVersionIds: string[];
  requiredDependencyHeads: string[];
}
type HistoryDecision = HistoryDecisionBase & (
  | { decision: "ALLOW"; renderState: "BOUND";
      renderedContextDigest: string; reasonRefs: string[] }
  | { decision: "DENY" | "UNKNOWN"; renderState: "NOT_RENDERED";
      renderedContextDigest?: never; reasonRefs: [string, ...string[]] }
  | { decision: "DENY" | "UNKNOWN"; renderState: "BOUND";
      renderedContextDigest: string; reasonRefs: [string, ...string[]] }
);

An ALLOW receipt requires a nonempty digest of the actual complete projection, including labels and transformations, before model dispatch. DENY/UNKNOWN before rendering records explicit reasons and no rendered context; a refusal after rendering retains its binding. Validate the tagged alternatives at runtime. An ALLOW receipt without the binding is incomplete and fails the five-binding audit in §23.6.

The context digest matters because correct selection can still be rendered incorrectly. A selector might choose a failed case and a renderer omit its failure label. It might exclude a future record but a cached summary still contain that record’s conclusion. Bind the actual projection to the selection, including labels and any redaction transformation. Record what entered the request boundary where the pinned runtime permits it; do not infer complete visibility from an event name alone.

The authority boundary is the host’s admission and evidence service, not the model reading this receipt. The model can be told that a record is negative advice, but enforcement cannot depend on that instruction. Stored procedures still pass current tool, budget and effect gates. A temporal receipt grants no new file access, no approval and no right to reactivate an invalidated policy.

23.6 Worked example: one review changes three kinds of answer

The following timeline is didactic. A validation outcome A1 supports procedure B1, and B1 supports case C1’s recommendation. Assume all required components and host admissions are available at the displayed times. Its suppression half — a tombstoned record stays unusable across restart and reindex while the audit keeps the decision — is executed (D23-TOMBSTONE-01); the transitive A→B→C invalidation propagation it describes remains proposed (Chapter 21 §21.3 scope).

Time New observation Historical query before 09:00 Current positive reuse
08:00 A1 accepted with task PASS and execution ACCEPTED A1 may support B1 and C1 if their own admission precedes cutoff Eligible within the validated scope
09:20 A2 adverse review rejects A1’s claimed coverage No change to the earlier prefix B1 and C1 immediately ineligible for that required use
09:25 Invalidation decisions appended for B1 and C1 Still not visible before 09:00 Refusal remains; decisions explain it
11:00 B2 passes fresh development-validation using a corrected procedure Not visible before 09:00 B2 may become eligible under new scoped evidence

At 10:00 an analyst requests the original 09:00 context. The host returns the historical versions and marks the receipt historical. It does not attach A2 as though the old agent saw it. The same analyst asks to launch a new maintenance run with C1’s recipe. Current admission traverses C1, B1 and A’s current head, finds A2 and refuses. The fact that B1’s frozen standing field still says eligible is not an escape from the recursive gate.

Now suppose A2 concerns only a latency measurement, while B1’s claimed use depends exclusively on a separately verified correctness result. Automatic rejection of every use would be too broad. Retaining this specific use requires an explicit non-reliance decision with scoped evidence, not an informal assurance that the review was unrelated. The safe default while that relationship is unresolved is refusal.

The current assessment of the old experiment is a third output. Its report adds an adverse-evidence note and may withdraw a performance conclusion. That new report version points to the old observations and new review. Neither a corrected report nor B2 changes the bytes of the original run. Reproducibility preserves the record of what happened; correction changes what we are justified in concluding from it.

A receipt can explain an old decision without authorizing a new one

Suppose the 09:00 run’s receipt pins B1 and registry revision 40. At 09:20 the adverse review is admitted at revision 41. An attacker submits the old receipt to a current launch endpoint, hoping that a matching digest will bypass dependency resolution. The host refuses: the receipt describes an earlier decision, and the requested new use requires current admission. Authentication of an old receipt does not turn it into a permanent bearer capability. Approval binding from Chapter 12 applies to the new operation independently of history selection.

The reverse attack is to submit a revision-41 receipt as proof of the 09:00 context. The cutoff and registry identity expose the mismatch. The reconstruction must locate the earlier receipt or rebuild the earlier prefix from retained records. If those records were not retained, the answer is that the old context cannot be reconstructed. A system should not synthesize a plausible historical context and call it observed evidence.

A useful temporal audit therefore checks five bindings: the query’s mode, the cutoff’s ordering authority, the selected versions, the required-use dependency closure and the exact rendered projection. Each can be correct while another is wrong. The selector may choose the right records but render a stale cached body. The renderer may show correct bytes from a record whose dependency is now rejected. Testing the whole chain prevents a successful hash comparison from being mistaken for complete eligibility.

Retention and redaction change what can be proved

Keeping every historical context forever is neither a necessary design goal nor an assumed permission. The host needs a declared retention and access policy for raw observations, derived records and public evidence. Some artifacts may contain proprietary source or personal information. An audit requirement does not itself authorize broader disclosure. For this book’s proposed studies, synthetic fixtures make complete controlled retention practical without implying an unrestricted production archive is appropriate.

If a required artifact is withdrawn or deleted, retain an admissible tombstone containing its identity and the permitted reason record where policy allows. A digest without recoverable content cannot establish the semantic claim that content supported. Historical queries should report the missing dependency and the limits of reconstruction. Current reuse must fail closed when its required evidence can no longer be resolved. Do not replace the missing source with a model-written summary and preserve the earlier verified label.

Public reports can expose selected evidence and redacted diagnostics while protected raw material remains under narrower access. Bind the published projection to its transformation version and source references. Redaction can remove the very field needed to reproduce a judgment; describe that limitation rather than promise fully public reproducibility. Verification by an authorized reviewer and independent public reproduction are different assurance claims.

Ordering, removal and non-reliance records

The proposed study uses one authoritative registry writer, not a multi-host consensus protocol. Other hosts are authenticated clients. Each admission attestation binds registryId, writer/fencing epoch, sequence, previous/prefix digest, run-admission cutoff sequence/digest, issuer and authenticated receipt reference. Ordering is checked against that trusted prefix: late evidence cannot gain earlier availability by backdating its event clock. ISO timestamps explain observations; they do not resolve competing registry histories. Authentication and writer-epoch fencing are qualification prerequisites, not properties of a plain hash.

Two different digests at the same registry/epoch/sequence, a missing cutoff receipt, an unfenced writer or incomparable host histories yield UNKNOWN ordering and refuse affected use. Halt the affected study claims until the trusted registry owner reconciles the fork; do not choose the newest clock or a favourable branch. E23 must add independently expected cases for clock skew, duplicate sequence/fork and missing cutoff attestation, with a legitimate delayed-event control. These are additional catalogue cases, not executions included in the earlier illustrative twelve-case count.

The minimal tombstone is specified here and its eligibility half is executed (D23-TOMBSTONE-01: file-backed journal, issuer authentication, cross-task refusal, idempotent/conflicting re-issue handling, fail-closed loads, reindex without resurrection). The registry-transaction and non-reliance-decision machinery below remains proposed:

// Specified here; eligibility half executed in D23-TOMBSTONE-01
// (single-writer file journal, not the transactional registry below).
interface Tombstone {
  tombstoneId: string;
  subjectVersionId: string; // opaque/digest form only if retention policy permits
  reason: "retention-expiry" | "policy-required-removal" | "corrupt-or-unavailable";
  retentionPolicyDigest: string;
  effectiveAt: string;
  knownAt: string;
  issuerId: string;
  decisionReceiptRef: string;
}
interface NonRelianceDecision {
  decisionId: string;
  dependentVersionId: string;
  dependencyVersionId: string;
  adverseHeadId: string;
  requestedUseIds: string[];
  unaffectedClaimAspectIds: string[];
  registryRevision: string;
  evidenceRefs: string[];
  evaluatorId: string;
  policyDigest: string;
  knownAt: string;
}

A designated retention authority resolves preservation/removal conflicts under a predeclared policy; neither the model nor researcher may retain prohibited content merely for reproducibility. Retain only the permitted minimal decision/identity, protect sensitive reasons, and report evidence no longer recoverable. Historical reconstruction is UNKNOWN where content or ordering is missing; known rejection/quarantine makes the requested use DENY. Both refuse current action, and neither alone proves task FAIL. E23 must include expiry, required-removal and missing-tombstone controls.

A scope-authorized evaluator, procedurally separate from the proposer, issues NonRelianceDecision on independent evidence. Bind it to the exact dependent, rejected dependency head, use/aspect, policy and checked registry revision; a label such as unrelated is insufficient. Restoring affected standing requires a new dependent version citing this decision, not editing the old one. Recheck after any relevant head/revision change; a stale exception cannot bypass transitive refusal. E23 must pair an evidenced unrelated-aspect allowance with an invalid same-aspect exception and a stale-decision refusal. No record above is implemented or tested.

23.7 Deliberate contamination should be detectable for a stated reason

A useful negative control has a known prohibited path and an independently observable expected response. Insert a synthetic day-12 outcome into a day-10 candidate set. The temporal filter must refuse it. Present a renamed task sharing a development answer template as a novel confirmation family. The grouping check must connect or quarantine it. Corrupt a retrieval log so it claims an excluded record was shown. The audit must flag the contradiction. The first and third controls are executed (D22-RETRIEVAL-01: future/held-out/canary refusals with independent audit flags, plus a clean negative control); grouping validation, novel-family quarantine and live-model canary emission remain proposed.

Keep the controls separate from effectiveness scores. A deliberately contaminated arm can test instrumentation, but a high score from that arm is not evidence for experience selection. A synthetic canary emitted in the output supports exposure; its absence does not prove the model never saw it. A refusal before rendering and a model ignoring a rendered record are different outcomes and need different observations.

The controls also need false-alarm cases. A valid earlier negative case should remain eligible as labelled advice. An unrelated adverse review should not invalidate a claim after explicit non-reliance is established. An updated record that preserves the pinned claim can remain usable when the policy permits it. A detector that rejects everything has perfect prohibited-record rejection and no useful selection capability.

Use synthetic data rather than secrets. The point is to demonstrate a specific control boundary, not to risk real leakage in order to prove that leakage would be harmful. Raw observations of these controls remain separate from normalized audit decisions and any aggregate evaluation.

23.8 E23: temporal and contamination qualification

Research question: does the selection boundary preserve the declared knowledge state and deny contaminated or invalid dependencies? The primary hypothesis is zero prohibited selections in a finite, pre-authored deterministic fault catalogue while all registered legitimate controls receive their expected decisions. The plausible alternative is a bypass through late availability, stale head caching, derived records or grouping.

Arms are a frozen-snapshot baseline, the proposed temporal/dependency resolver, and a deliberately weakened timestamp-only resolver. The last is diagnostic, not an effectiveness candidate. Independent variables are fault class and resolution mode. Dependent variables are expected versus actual decisions, per-class false alarms, selected/rendered IDs, dependency coverage and audit completeness. Use versioned synthetic ledgers, explicit grouping manifests and sealed expected decisions authored before the implementation under test is inspected.

The deterministic phase uses no model calls and a registered query/time budget; there is no stochastic performance claim to support with repeated copies of the same query. Count the finite case catalogue and coverage of each fault class. Any forbidden selection or incorrect expected control fails that contract case. Passing means only that the tested cases held, not that arbitrary contamination has been excluded.

A later live extension compares prior-only history with no history on a sealed corpus at matched total cost. Its primary endpoint is verified completion under both task and execution criteria. Register independent task/repository groups, repetitions, cost ceilings, exclusion rules, practical margin and cluster-aware interval method before access. Chronological replay and prospective live evaluation answer different questions and must not be pooled as independent replications.

Threats include incomplete dependency declarations, clock ambiguity, operator exposure, weak grouping validation and correlated evaluator errors. A failed integrity gate invalidates the corresponding benefit claim even when its output score looks excellent. A negative live result may mean history is not useful at this cost, rather than the temporal filter is unnecessary. The deterministic phase is partially executed (as-of cutoff, tombstone suppression, audit, reindex, race-free single-writer operation); the epoch/fork/race-schedule catalogue and the live extension remain EXPERIMENT PENDING.

A compact fault catalogue with explicit denominators

A proposed deterministic catalogue can cross three resolution faults with two query modes and two dependency depths. For example, use late availability, adverse supersession and missing evidence; historical versus current queries; and direct versus two-hop dependencies. That gives 3 × 2 × 2 = 12 cases before positive controls. These are hypothetical design counts, not twelve executions. Expected answers must account for the cutoff: a late review can be excluded historically while still blocking a present use.

Add explicit cases for authentic old receipts at new endpoints, changed rendering, unknown ingestion time, benign supersession and documented non-reliance. Count each expected refusal and each expected allowance. Report a matrix by class, including false alarms and unexercised cases, rather than one aggregate success percentage. A class with no cases has no measured coverage even if every other row passes.

The catalogue should include a race schedule: evaluate revision 40, admit an adverse dependency at revision 41, then attempt current launch using the earlier decision. The expected response is revalidation or refusal, never admission based solely on the stale receipt. This checks the boundary between a pure resolver and the stateful host that consumes its answer. It is precisely where a correct standalone query can fail to produce a correct system.

23.9 Implementation boundary and unresolved work

The implementation specification is deliberately small: a version-aware registry reader, required-use traversal, protected decision receipts, group/split membership checks and a renderer bound to those decisions. D23-TOMBSTONE-01 plus D22-RETRIEVAL-01 execute the as-of cutoff, suppression, audit and reindex checks on the frozen fixture; they do not implement the versioned registry with epochs, the fork/race handling, or the group/split validator. Reuse the storage and evaluation contracts from Chapters 4, 15 and 21. Do not build a second history engine merely to place timestamps beside existing rows. Ask the Writer adapter owner whether these semantics can be supplied and which fields are absent.

R06-C09 found no as-of boundary on the inspected lesson query. That static observation motivates a qualification question; it does not authorize assuming today’s entire ecosystem lacks temporal support. The existing code must be pinned and tested through the proposed interface before integration. No such test has run for this chapter.

Temporal integrity protects a comparison from information it should not have had. It does not make an expensive architecture worthwhile. A team can use perfectly eligible evidence, respect every timestamp and still perform worse than one agent. Chapter 24 asks how to recognize that result without explaining it away as a failure to coordinate enthusiastically enough.

Previous: Chapter 22: Selecting Relevant History.

Next: Chapter 24: When Many Agents Are Worse Than One.