# Did It Reach the Model? # Book: Context From First Principles # Chapter URL: https://programmer.ie/books/context/25-chapter/ # Prose fingerprint (sha256, normalized): c093451546bc76f0cad308662c02b568a80eb3f1efb1c389942d3718d602c1ad # Snapshot generated at build time by Hugo. This is the complete rendered prose # of the chapter; it is not a transcript of the source file. The experiment was planned carefully. Eight synthetic tasks, each built around a fact that could not be inferred from the task text alone. Each task ran under three conditions: no supplied context, a matched distractor of the same size and shape, and the exact minimal context the task needed. One model, decoding fixed, every run in its own session, deterministic graders. The question was modest: if correct context is delivered through the live runtime, does behaviour change? Twenty-four runs were planned and twenty-four executed. None yielded a valid observation of the assigned context condition. Every run reported zero observed context records because the recording component produced none. For the intended injection conditions, that leaves delivery unverified. For the no-context controls, it leaves absence unverified: an observer that did not record the request cannot distinguish a request with no experimental block from a request it never saw. 24 executed ≠ 24 valid observations absence of observed context ≠ evidence of absent context no observation ≠ observed zero Two setup gaps compounded. The injector had not been deployed to the location from which the runtime loaded plugins, and the installed observer was an older build that captured nothing under this wave’s configuration. The preflight checked package identities, file digests and expected files, not whether the configured host actually loaded the injector, invoked the hooks and wrote a record for a live request. Those static checks passed while the experiment’s observation path remained unqualified. The scores were identical across all three conditions. That equality cannot be interpreted as evidence that supplied context had no effect: no run established the treatment it purported to receive. The missing observation records do not, on their own, prove that injection never happened in every run; the separate deployment investigation identified the setup faults. The behavioural equality neither diagnoses those faults nor repairs the failed manipulation check. These runs remain execution records, not valid observations for the intended context-effect comparison. Book result — instrumentation failure. A first behavioural wave planned 24 runs, executed 24, and produced no valid behavioural observation: every run reported zero observed context records, and all 24 failed the transport check. The result is inconclusive about context and informative about the measurement chain. The evidence register lists it as Instrumentation failure. Assignment is not delivery The lesson is basic experimental validity applied to runtime instrumentation: Before asking whether context changed behaviour, establish that the intended context condition actually occurred, at the boundary the experiment claims. intended treatment ≠ executed treatment ≠ observed treatment treatment assignment ≠ treatment delivery Transport reconciliation is a manipulation check at a named boundary: was the assigned experimental material observed there in the expected form? Behavioural grading evaluates an outcome, not the treatment’s delivery. When the manipulation check fails, a comparison by intended condition cannot answer whether delivered context caused an outcome difference. It can still document what was executed and why the intended comparison was invalid. Structural evidence checks the compiled artifact (Chapter 24); transport evidence checks its appearance at the instrumented boundary; behavioural evidence tests effects conditional on a valid intervention (Chapter 26). None substitutes for the others. Where the boundary is The chapter’s claim has to be defined narrowly, and the word transport is defined here as follows: Transport evidence is a boundary-relative claim: reconciliation shows that the expected transport block appears with the required content and multiplicity in an observed host-context record. Session and model attribution require additional evidence, and no host-boundary receipt by itself establishes provider-wire delivery or model use. A run-level transport receipt is stronger when three separate things hold: payload reconciliation + session attribution + model attribution The pure reconciliation function checks payload correspondence and a host-observed model comparison when model identifiers are available; it does not enforce session identity. Session pairing is performed by the surrounding harness and must be assessed separately. The combined claim is stronger than a plugin-loaded check but weaker than proof that the provider received the same serialised request. The artifact crosses several boundaries, and evidence at one boundary transfers to the next only when the intervening transformation is independently observed or otherwise validated: flowchart TD C["Compiler: ContextBundle"] --> R["Renderer: rendered text (A)"] R --> E["Envelope: transport block (B)"] E --> I["Injector: host model context"] I --> O["Observer: observed system block (C)<br/>THE INSTRUMENTED BOUNDARY"] O --> P["Host to provider translation<br/>provider request: not observed"] P --> M["Model: not observed"] For the OpenCode results reported here, the instrument observes a host model-context event, not the provider request. Host translation, serialisation, provider-added material, tokenisation, truncation, caching and routing remain outside that observation. This is a defined limit of the evidence, not proof that a downstream alteration occurred. The later Pi scripted-provider check names a different observation point and must not be used to upgrade the earlier OpenCode claims: host model-context observation ≠ provider-wire capture evidence at boundary N ≠ evidence at boundary N+1 An adapter, and an observer that does not mutate The runtime adapter behind the frozen results in this chapter was written for OpenCode, targeting the second major version of its plugin interface as it stood in September 2026. A later Pi adapter applies the same separation at a different host boundary; it is described below and is not qualified by these earlier results. The OpenCode adapter does two separate things, and both are off unless explicitly enabled. Injection appends one block, read from a named file, to the system material the runtime has assembled. It builds the new system array first and assigns it once, so an error cannot leave it half written. Its outcomes are a small state machine: Outcome Runtime context modified? Meaning injected Yes, one block appended The block was added no-op, identical No An exactly equal block was already present failed, conflict No A different runtime block was present; a loud error, not a second copy error, block file No The named block could not be loaded or lacked its markers error, unsupported shape No The system material was not the expected array not attempted No The injector was never called The last row is a composition-level state, not an outcome emitted by the injection hook. When compilation refuses, the caller produces no transport block and does not attempt injection; this must remain distinguishable from an attempted injection that failed. A no-op means an identical block was already present and does not demonstrate that this call inserted it. Equality is exact against one system-array entry, while the conflict check recognises a block carrying the opening marker. The tested idempotence contract is therefore about not appending a second block; it is not a general guarantee against marker collisions or mutations by other hooks. Observation copies the host-exposed model-context event to a local record without modifying that event. The record includes session and agent identifiers, requested and observed provider and model, system material, messages, exposed tool definitions, sequence and timing fields. Tests establish that the observer preserves the event’s structure during capture, including after injection. They do not establish zero timing overhead, durable record completeness, isolation from other plugins or identity with the eventual provider request. Ordering is part of the measurement. The injection hook is registered before the observer’s, in code, so the observer sees the post-injection context, and a combined test pins that order and its consequence: with injection enabled the record holds the marker once, and with it disabled the record equals the untouched context. If the observer ran first it would see no marker although injection happened later: instrument order ≠ irrelevant implementation detail How independent is the observer? The observer reads the host event rather than treating the injector’s success report as the measurement. That separates two code paths, but not their failure domains: both live in the same package and process, depend on the same hook framework, and observe the same mutable host event at different hook positions. A shared loading or registration failure can make both disappear. Accordingly, agreement between their records is useful host-boundary evidence but not an externally independent confirmation of provider delivery: separate code path ≠ separate failure domain read-only observer ≠ externally independent observer It is a measurement made inside the host, and the failed wave shows why that matters: an observer that is not live is silent, and silence is ambiguous. Its sequence number survives restarts, and each number is reserved before its record is appended, so a crash leaves a gap and never a reused number. That gives ordering. It does not give completeness: monotonic sequence ≠ complete observation Three artifacts, and what “unchanged” means What it is Made by A. the render the bundle as text the compiler’s renderer B. the transport block A wrapped in an envelope carrying the compiler and its version, request, policy, bundle identity and hash, an estimated size and a unique marker the adapter C. the observed system block what the observer read back from the model context the observer A is not equal to B, by design. What can be claimed is: A is embedded unchanged inside B B was injected exactly once C contains B exactly once A is recovered from B by reading between two fixed delimiter lines, and the envelope adds metadata around the render without altering it. The equality is exact string equality on JavaScript strings, hashed as UTF-8 text where hashes are recorded. It is not raw-byte equality across serialisation boundaries, so the strongest honest wording is the exact text observed at the instrumented boundary. If a render happened to contain the end delimiter, extraction would yield a prefix and reconciliation would fail rather than pass. Identities are kept apart: bundle identity ≠ render identity ≠ transport identity ≠ delivery identity Delivery identity is defined by boundary, and nothing here captures a provider-request identity. Reconciliation The reconciler is a pure function: it neither reads files nor invokes a model. Given the compiler record, render, transport block, injection trace, observer record and requested model, it checks specified equalities and multiplicities and returns a receipt with accumulated failures. Passing means no violation of those implemented predicates was detected; it does not establish the predicates that were not implemented, such as independent session pairing, provider-wire fidelity or the correctness of copied compiler metadata. The distinctions in the following table therefore define the exact perimeter of a passing receipt: Recomputed or compared exactly Merely compared with copied metadata Not checked by the function block equals the observed block, exactly once; recovered render equals emitted render; marker occurrence count across observed system text; growth of exactly one system block; requested model against observed model envelope bundle identity, bundle hash, request and policy against the compiler’s record session identity; the compiler version and size fields in the envelope The envelope’s bundle hash is compared with the compiler’s recorded hash, not independently recomputed from recovered render text. Agreement between those two fields can therefore preserve a shared mistake; the separate exact-render comparison is the check that detects changed rendered content. Mutation probes exercise both successes and known gaps. Changes to request identity, policy version, repeated or missing blocks, render content, delimiter handling and injection outcome fail the implemented checks. By contrast, a session mismatch, a consistently altered compiler-version field, an altered size field and an absent requested-model identity can pass the pure function. The missing-model case records an unobserved attribution rather than inventing one; it should not be described as positive model attribution. The harness owns session pairing, so a pure-function PASS alone is not a full run-level transport receipt. metadata matches ≠ payload matches marker present ≠ artifact intact The marker is unique per run only if the harness supplies a fresh identifier, since the code validates its characters and does not check uniqueness, and its occurrences are counted across system material only. It proves this run’s block appeared and how many times. The full render comparison proves the artifact is intact, which is why both exist. Session, run and request are different identities, and a correctly matched block in another session does not validate this run’s assignment. The harness pairs injection and observer records by session, currently selecting the latest records, but it does not enforce session pairing when the hook session is unknown. With multiple requests or concurrent events, recency alone also needs a demonstrated correspondence to the intended invocation; the second wave’s multi-request case is a reason to retain per-request identities and receipts. The requested-model comparison uses the host-observed model field and is not provider attestation: requested model = observed host model ≠ independent provider attestation Negative controls need live instruments An empty observation could mean no request occurred, the observer was disabled or not loaded, the hook did not fire, a write failed, the wrong path was inspected or a record was lost: empty observation ≠ observed absence A negative transport condition needs positive evidence that the observer ran for the intended request, within the attributed session, plus a verified absence of experimental blocks in the observed material. The expected value is zero matching blocks in a valid capture, not zero capture records. The same instrument and attribution rules must apply to no-context, distractor and oracle conditions, or comparisons inherit asymmetric measurement failures. The second wave provides that negative control for its recorded configuration, not for every later host or adapter revision. Inspect this in the Context Viewer The viewer scene for this chapter places the two outcomes side by side on fixture data: a verified case where render, transport block and observed text reconcile, and a failed case where observer liveness was never established. Open the scene and check what each case licenses. What to examine: which boundaries were observed in each case, where the failed case stops, and why the failed case is inconclusive rather than negative. The verified case establishes hook-boundary equivalence only; neither case says anything about provider-wire delivery or model internals. The historical waves themselves are book results recorded in the research register and are not reproduced here. Reconciliation at the observed host boundary only; a dead instrument proves nothing about delivery. Constructed illustration of the distinction. Open the delivery comparison in the Context Viewer Static identity is not liveness The failed wave stopped at the first of several separate claims, and a pass at one is not a pass at the next: Layer What passing shows What it does not show installed the package resolves at the expected identity that it loads loaded the host started it and setup ran that hooks fire registered the hooks are attached in the intended order that a request passed through them injected on one live request the block was added once that anyone saw it observed the observer produced a read-only record of the host context that it holds the block, or that the observer is externally independent reconciled the block is in the record exactly once, unchanged, with the marker once the right session, provider-wire identity, model use attributed the requested model is the observed host model that behaviour changed behavioural the action moved (Chapter 26) A later verified layer implies some earlier events, and an earlier pass never establishes a later one. A load check confirms the first three without inference. A smoke test makes one live request and confirms the next several. Static identity, a fact that would be true of a working system, is not evidence that it is working: installed ≠ loaded ≠ executed ≠ observed Qualification versus per-run validation A qualification asks whether the apparatus can work. Run-level validation asks whether it did on this run: qualification ≠ per-run evidence A canary that passed last week says the path worked last week. The experiment’s harness has a per-run transport check, and it is the check that flagged all 24 runs. It also has a preflight that checks two canary documents (a marker canary and a compiled-bundle canary) against the scheduled model. Those two answer different questions, one isolating the injection-and-observation mechanism and the other testing composition from compilation through to observation, and the second does not make the first redundant until one is shown to subsume the other’s failure surface. But the preflight enforces the canary checks only when their paths are supplied. Without them the static checks run as they did before, and supplying both is a rule for future waves and not something the code forces. A second wave was later run behind those gates, and it is described below. The live qualification The chain was run end to end on the smallest case that exercises every step. A one-item synthetic bundle was compiled, rendered, wrapped with a fresh marker, injected into one live session and read back by the observer, and the model’s reply was ignored. Book result — live compile-to-observe qualification. On one trivial synthetic request the chain passed. The compilation succeeded, the runtime reported that it injected, and the number of system blocks went from four to five. The observer recorded the request as its first record in the same session as the injection record, with the marker exactly once. The requested model equalled the observed model. The compiler’s render was present unchanged in the injected block and the block was present unchanged in the observed context. The evidence register lists it as Live compile-to-observe qualification. What it established is delivery to the instrumented host model-context boundary on that case, and the perimeter is tight. It is one bundle of one item, one request, one model, one host version and one compiler and adapter revision, and the adapter and compiler have since changed, so it is historical evidence for that combination and not a qualification of the current code. The size in the block is the compiler’s word-based estimate. The observer’s capture holds the full model context and stays private, and only its digest is registered, which allows the owner to check the local original and no one else. No provider request was captured and no behavioural claim follows: one successful live qualification ≠ transport reliability estimate historical evidence ≠ current qualification It shows the path can work. It does not give a failure rate, or reliability across sessions, models, host versions, concurrency, restarts or large bundles. Earlier probes used a different, since-replaced arrangement of separate plugins and a fixed marker with no compiler. Two are kept, in this order. In the first, two live calls produced valid captures with the marker never present, and a dry run without inference showed that the runtime package had no loadable plugin entrypoint, so the host skipped it silently: installed and not loaded. After that was repaired the second probe passed all its gates, with the block added once, the marker observed once and the injection registered before the observer. They show the runtime mechanism and no more, and they are not counted with the compiled-bundle qualification. The second wave The wave that opened this chapter was repeated behind the gates. Across eight fixtures and three assigned conditions, all 24 runs passed the reported per-run host-boundary reconciliation. In the no-context arm, valid observer records showed no experimental block; in the distractor and oracle arms, the intended block appeared once per observed model request. One distractor run generated two requests, so the validation unit was revised from one record per run to exact correspondence per request. The reader digest was checked before the first call and both canaries were required. Two earlier launches failed on harness faults and were excluded before any valid run. These are observations for the recorded configuration; the revised matcher should not be retroactively credited to the first failed wave. This is transport evidence at the host boundary for that configuration and no more. The blocks were authored from fixture truth and rendered by the frozen pipeline, so it is not a compile-to-observe test, and session pairing still belonged to the harness. The compiler pin changed partway through the wave in the package files only. The behavioural result belongs to Chapter 26. What has and has not been run Item Status Adapter test suite (injection outcomes, observer non-interference, hook order, sequence recovery, composition, reconciliation) Automated, run Reconciler mutation probe Run: fails closed on eight mutations; passes on session, version, size and absent-model changes Recorded live results Instrumentation failure; two earlier marker probes; the compile-to-observe qualification; the second wave, 24 of 24 reconciled Injection idempotence and collision, hook-order reversal Tests exist for idempotence and conflict; reversal proposed Load and smoke checks Scripts exist; not run here No-context live negative control Recorded in the second wave (eight runs, one configuration); a control on the current configuration is proposed Repeated and restart qualification Proposed Session enforcement in the reconciler Proposed Nothing proposed is evidence. What would weaken the claims. The injection claim weakens if an identical retry duplicates the block, a malformed block mutates context or an error leaves partial state. Non-interference weakens if enabling the observer changes the context passed on. The reconciliation claim weakens if a missing-observer or duplicate-marker case passes. The pure reconciler does not enforce session identity, and the mutation probe confirms that a session mismatch can pass it, so session pairing belongs to the surrounding harness. Whether session identity should be part of reconciliation or an explicit separate attribution check is an open design choice, and either can be legitimate. What the word “reconciled” should not do is imply session correctness it does not check. The liveness gate weakens if inference can run after a canary fails, which the optional-argument design allows. The negative-control claim weakens if absence is ever inferred from an empty file. Changing the host: a thin Pi adapter The compiler does not need an agent framework to decide membership or render a bundle. The host-specific work begins after that decision: putting the render into the next computation and observing what the host assembled. A thin adapter lets us change that part while preserving the compiler’s contract. The Pi adapter uses a named structured prompt section. At the turn’s preparation hook it compiles explicit inputs, validates the returned bundle and places the unchanged render inside its transport block. It sets that block as a section of Pi’s prompt options, preserving the other sections and tool declarations. A separate observer copies the later transcript that includes system messages. Injection and raw capture are independent opt-ins. The choice of hook matters. Pi applies a whole-prompt replacement after this transcript hook, so the earlier observer cannot establish what such a replacement contains. A structured section makes the adapter’s contribution part of the transcript itself. This follows the host’s assembly contract; it says nothing about whether a prompt section is more useful to a model. The adapter’s check runs a real Pi session with a scripted provider standing in for the external model. It compares the observer’s effective system text with what that provider received, then checks the intended block’s bytes, singularity, session and model attribution. Its negative control introduces a later whole-prompt override and requires the provider comparison to detect a difference that hook reconciliation alone cannot exclude. The extension composition therefore needs its own provider-boundary qualification. This is an implementation check, not a frozen result about real-model delivery or behaviour. The Pi capture names its own boundary and format. It does not pose as an OpenCode record, and the earlier OpenCode results remain evidence for their original configuration. Changing hosts changes the adapter and the qualification work; it does not change what a successful compilation proves. The question in the title The title deliberately asks more than the OpenCode instrument directly sees. It establishes, on the qualified runs, an intact transport block at an attributed host-context observation point. It does not capture the provider-wire request or internal model consumption. The later Pi scripted-provider check exercises an additional host-to-provider comparison in a controlled test, not an observed commercial-provider receipt. To interpret a behavioural comparison, each assigned condition needs its own valid boundary receipt and outcome record, with any remaining downstream uncertainty stated rather than silently converted into certainty. compiled ≠ delivered ≠ used ≠ helpful Now, and only now, can we ask whether changing the delivered context changed behaviour. That is Chapter 26. References Pi project. Pi source repository. First-party code and extension documentation, checked October 2026. The new adapter is grounded in its pinned installed SDK declarations; exact pins and the scripted-session check are recorded with the adapter source. Project Context Pi. First-party local source package: compiler-core import, structured prompt-section injection, separate observer, reconciliation and real-SDK tests with a scripted provider. Implementation check only; no real-model or provider-wire qualification is claimed. Project Context OpenCode. Source repository, Apache-2.0, first-party code by this book’s author. The injection and observation mechanisms, the composition layer (envelope, reconciliation) and the load-check and smoke scripts. https://github.com/ernanhughes/project-context-opencode Project Context evidence register (companion repository, evidence/README.md). Consumed here: Instrumentation failure, Live compile-to-observe qualification and Earlier runtime qualifications. Transport evidence and one inconclusive behavioural wave; no behavioural claim.