# Let Old Context Fade # Book: Context From First Principles # Chapter URL: https://programmer.ie/books/context/12-chapter/ # Prose fingerprint (sha256, normalized): 8436af811f52181128814d31702d69f6b89fef05980e7f5315dae6d770cb592b # 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. Here is an illustrative scenario. A long session crosses its compaction threshold mid-investigation. The agent is halfway through a dependency migration: three approaches tried, one rejected for a subtle version conflict, the current attempt half-applied. The compactor fires because tokens crossed a number, and replaces 40,000 tokens of working history with a 2,000-token summary. The summary records that an approach was rejected without recording which version conflict killed it. Six turns later the agent, unable to see the conflict, retries it. The failure in the illustration is a preservation failure, not evidence that age-based fading is inherently unsafe. The one-shot transformation discarded a version conflict the task still required. Chapter 11 defined how to test such a failure against frozen preservation obligations, representation floors and independent survival evaluation. An intermediate representation might have retained the conflict, but it might also have lost it. The number of stages is not evidence of fidelity. This chapter asks whether choosing among separately evaluated representations gives the runtime more useful control than an abrupt full-to-compact transition. If one content object has several representations that satisfy different fidelity levels above its floor, can the runtime choose among them under changing conditions better than by one abrupt full-to-compact transition? The question matters because the cliff fuses two decisions that deserve separation: what may change form, and which form is resident now. Content, representations and what is resident The unit this chapter needs is a content object, called an episode when it is a bounded span of activity. It is not one proposition. An incident report carries many claims, relations, statuses and provenance, and each carries its own preservation obligations. A content object can have several representations, such as the full text, a dense rewrite, a compact form, a structured record or an anchor. Each shares a source lineage and the declared obligations, and each has a token cost and measured survival properties. CONTENT OBJECT / EPISODE (source lineage, preservation obligations) ├── representation R0 ├── representation R1 ├── representation R2 └── representation R3 Three distinctions follow: content identity ≠ representation identity representation choice ≠ admission choice stored representation ≠ active representation An episode can remain admitted while its selected representation changes, and Chapter 10 may remove it from a later request altogether. The selected representation consumes input capacity when rendered into a model invocation; stored alternatives do not consume that invocation’s context window merely by existing. They still incur generation, validation, storage and possible retrieval costs, which belong in the management ledger. Chapter 12 concerns the active representation. Chapter 13 owns external references, and Chapter 14 owns retrieval or re-admission of richer content from outside. Legality, selection and application Chapter 7 derives retention policy from item properties, environment capabilities and task-relative state. This chapter takes the policy outcome as input: the set of representations that satisfy the applicable preservation obligations. That gives three different things: LEGAL which representations satisfy the current obligations? DESIRED which legal representation best fits the computation and budget? APPLIED which representation is actually rendered, given timing? legal ≠ desired ≠ applied A representation is legal for a stated task and policy state only when its independently checked contents satisfy every currently applicable preservation obligation. Legality is therefore a predicate over obligations and a representation, not a rank or a token threshold. A PIN-governed obligation forbids reducing an admitted item below its declared fidelity floor; the permitted form might be verbatim text, exact typed fields or a structured constraint (Chapter 11). Multiple different representations can meet the same floor, and two equally sized representations may preserve different required facts. A producer’s claim that a representation meets the floor is evidence to check, not proof of legality. Pressure, age and cache state may influence selection and timing, but cannot relax a preservation obligation. For accounting, define pressure against an explicitly named budget and scope: for example, projected admitted input tokens divided by the runtime’s usable input budget for the invocation. That projection must say whether it includes standing material, whether counts are declared or estimated, and what reservations have already been deducted. There is no provider-independent pressure ratio, and a value above one signals a policy-budget problem rather than permission to choose an illegal representation: pressure changes necessity ≠ pressure changes permission cache benefit cannot legalise an illegal representation semantic necessity may justify cache loss Cache economics (Chapter 9) can move when a legal transition is applied. It cannot make an illegal one permissible, and where provider semantics and telemetry support it, first-divergence and reuse effects are recorded and otherwise marked unobserved. Delay must never violate hard capacity or a preservation obligation. Age is not permission, freshness or relevance Chapter 10 said old does not mean discardable, and here old does not mean low fidelity. A six-month-old constraint may require exact representation while a five-minute-old log tolerates reduction. Age is elapsed time or turns since observation. Freshness, which Chapter 20 owns, concerns whether a claim still matches current state, and an old rule can remain valid while a one-minute-old deployment state can be stale: age ≠ freshness ≠ relevance Age may prove a useful scheduling input or predictor, and that is a hypothesis to test, not a law. It grants no transformation permission. The fixtures manipulate known future requirement directly, old-and-needed, old-and-not-needed, recent-and-needed and recent-and-complete, using a declared task relation and no scalar relevance score, which would be Chapter 7’s importance error again. Fidelity is not a scalar The obvious picture is a ladder from full text down to an anchor. But Chapter 11 showed preservation is multidimensional: exact fields, identifiers, constraint force, rationale, status, provenance and relations. A 300-token structured record can preserve an identifier and provenance better than a 1,000-token prose summary that keeps the narrative. Neither dominates the other. So representations are not necessarily totally ordered, and fewer tokens do not imply fewer preserved obligations, or more tokens more of them. Two different dominance relations are needed, and both require a fixed set of evaluated obligations. A representation preservation-dominates another if it passes every preservation check the other passes and at least one additional check. This produces a partial order of measured survival, not a guarantee about untested information; the reader-facing idea of a “tier” simplifies it. A representation is dominated as an operating point only relative to a specified cost vector and requirement set: another meets at least the same required obligations, costs no more on every compared dimension, and is strictly better on at least one dimension. Generation expense, resident tokens, latency, storage and cache effects may conflict, so two points can be incomparable. A richer representation need not be operationally better when its extra fidelity costs more. Three terms mark boundaries. An anchor is a compact resident representation containing enough verified identity and task-relevant substance to serve the obligations assigned to it; it is not inherently the smallest legal representation and has no fixed schema. A pointer identifies content that must be resolved from outside active context, so it does not itself establish that the content can be recovered. An anchor can include a pointer, but its locally usable substance distinguishes it from a pointer-only entry. Removing even the anchor from active context is pruning (Chapter 10); replacing resident content with an external reference introduces Chapter 13’s recovery obligations. There is no empty representation tier in this chapter. Generation cadence and selection The pattern this chapter tests separates two events that simple systems fuse: creating representations, and choosing which to show: generating representations ≠ selecting a representation The proposed design separates the cadence of generation from the cadence of selection. Where precomputed legal alternatives exist, selection can run on each invocation without a new generative compaction call. Generation need not always be slower: new evidence, source changes, corrections, invalidated preservation checks or policy changes may require an immediate replacement set. The invariant worth testing is narrower: choosing an existing representation does not silently regenerate it, and every regeneration produces new representation identity, lineage and validation evidence. Magic Context’s architecture document describes an implementation with a related separation. Its historian emits each history compartment with four detail tiers, an importance score, facts and events at generation time. A deterministic renderer then picks one tier per compartment from its age, importance and the current budget, with no model call. Raw messages persist so that an expansion tool can restore originals, and re-tiering happens only on defined fold boundaries so that replay is stable for caching. This chapter derived its principle first and reads the implementation against it. They correspond in the generation and render separation and deterministic selection. They differ in what this chapter refuses to adopt: a fixed count of four tiers, an importance score as the driver, and re-tiering only at fold boundaries. Deterministic selection introduces no new generative transformation at selection time, but reproducibility of the choice does not establish fidelity. A selector can repeatedly choose a defective representation, so independent obligation checks must precede its admission. Retaining raw source permits possible recovery, not demonstrated reversibility: source identity, access, version and a successful fidelity check are required. Regenerating representations at every turn also incurs repeated transformation and validation costs, though it is recursive compaction only if a generated representation becomes an input to its successor. Generating afresh from the frozen original is repeated source-grounded compaction, with a different error path. regenerate-then-select-every-turn = repeated compaction under another name What representations contain Representations defined only by token count repeat Chapter 11’s ratio fallacy. Each is specified by the obligations it satisfies, and by measured survival, not by its label. A generator calling a form “dense” is not evidence that it dominates one it called “compact.” Not every content object uses every representation: some admit only exact forms, some full and compact and nothing between, and a representation should exist only where it creates a useful operating point. A structured canonical record rendered deterministically into detailed, compact and anchor views can protect exact fields and provenance by construction, at the price of an intermediate representation that may be wrong and of relations that fields capture poorly. Independent prose representations keep narrative at the price of contradiction risk. When several representations of the same source coexist, they can disagree, and that failure has a location of its own, representation-to-representation inconsistency, distinct from source-to-representation error. It matters even when one is rendered at a time, because promotion and demotion can change what appears true across turns. Some proposed reductions are fixture hypotheses, not default decay rules: narrative detail might be removable before outcomes, identifiers might require longer preservation, rationale might outlast raw search traces, and subsystem names might matter longer than line numbers. Each is conditional on the declared task and fidelity obligations. A line number may be decisive evidence, a failed command may encode the necessary precondition, and a narrative may carry causal structure that a terse status loses. The fixtures should vary one preservation dimension where feasible, record what else changes in the representation, and test obligation survival before asking whether downstream behaviour changes. Selection dynamics Demotion selects a lower-detail legal representation and promotion a higher-detail one. Promotion is representation selection when the richer form is already stored in the runtime, and it is retrieval, owned by Chapter 14, when it has to be fetched from outside. A deterministic selector needs a reproducible snapshot of the legal alternatives, available input budget, active representation, declared task relation, relevant transition costs and any observed cache state. Age may be included as a scheduling feature, but it cannot waive obligations. The same snapshot and policy version must yield the same desired choice; the trace also records whether that choice was applied and why it might have been delayed. Reproducibility is measured separately from legality and task success. Hysteresis, with different promotion and demotion thresholds, is a candidate response to observed oscillation, not a presumed requirement. Any comparison against continuously rewriting content must include generation, verification and cache costs, not just the tokens rendered. Chapter 12 has its own accounting: generating several representations, storing them, validating them, checking cross-representation consistency, running the scheduler, transition cost, regeneration and promotion. Active resident cost and total management cost are reported separately. A system that stores 4,000 tokens of variants and renders 500 does not have equal cost to one that stores 500. How many representations earn a place The chapter starts from no plugin’s tier count. A representation survives only if it creates an operating point its neighbours do not, judged over a preservation vector and a cost vector (active tokens, generation cost, latency, storage, reuse effect). One that is dominated as an operating point should be merged away. Survival per token is at most descriptive, and never a ranking, since a ratio can reward a representation that preserves ten narrative facts over one that preserves a critical prohibition. Excess fidelity is measured against a fixture-specific oracle, which represents hindsight for a frozen fixture and never a production minimum. The evidence Source Evidence type Verified fact Chapter uses Does not establish Magic Context architecture Implementation Four tiers plus an importance score, facts and events per compartment; a deterministic renderer choosing from age, importance and budget with no model call; raw persistence and expansion; re-tiering only at hard fold boundaries A related generation and render separation, compared with the derived model Effectiveness; that four tiers or importance scoring are right HyMem (preprint, 2026) Preprint Separates planning from execution in isolated functional layers, with a memory module holding structured summaries; reports gains on GAIA and Browsecomp-plus with one model That organisation by function is different from gradation by fidelity That either layering helps in general Learning Agent-Compatible Context Management (preprint, 2026) Preprint A learned external manager reports that agents with higher baseline performance benefit from higher-fidelity context, and lower-performing agents from more aggressive compression That the best representation policy may depend on the consuming model A causal law; anything about the book’s design Proposed experiments Nothing here has been run. The unit of analysis is the trajectory fixture, and stochastic repeats of one fixture are not independent examples. Ecological gate. Before a large experiment, describe real traces: how long objects stay active, how much admitted context has more than one plausible representation, how often budget pressure would require demotion, how often later promotion would be useful, how often one-shot compaction currently occurs, and which obligation types appear. That estimates opportunity without presupposing the answer, and if almost nothing benefits from multiple representations the machinery may not earn itself: mechanism can work ≠ opportunity is common enough to justify it Experiment A: the representation set. Do multiple explicit representations create useful preservation and cost operating points that flat compaction does not? Conditions: the raw source, one flat compaction, representations each generated from the frozen source, representations cascaded from one another, a structured record with deterministic views only if it is a genuinely different mechanism, and a fixture-specific oracle. Obligations, floors, statuses, provenance requirements and hidden probes are frozen before any generator runs, and no generator sees the probes. Behavioural comparisons match the active resident budget, while generation, storage and management costs are reported separately. Every representation is independently evaluated for exact-field, identifier, constraint-force, rationale, status, provenance and relation survival, unsupported additions and actual tokens. A higher-named representation that fails to preservation-dominate a lower one is a possible result, and so are cross-representation contradictions. Experiment B: the selection schedule. Given a fixed, independently evaluated representation set, does a deterministic policy choose among eligible representations efficiently over a changing trajectory? Every schedule receives the same representations, obligations, known task state and budget information; none sees hidden future probes except the oracle. Conditions are full-while-feasible, age-only, pressure-only, obligation-aware pressure policy and a hindsight oracle. When a baseline would exceed capacity, the experiment records its infeasibility rather than silently granting it extra budget. Age-only tests a deliberately naive heuristic, not every possible use of age. Log policy version, desired and applied choices, available budget, transition timing and any provider/model settings. Classify failures against independently checked ground truth: a representation failure means a stored form does not preserve an obligation it was claimed to preserve; a legality-enforcement failure means the scheduler admits a form known to violate a currently applicable obligation; a future-demand selection failure means a legal present choice proves insufficient for a later hidden task; and a timing failure means application differs from the recorded desired choice in a consequential way. These categories can overlap, so report contributing failures rather than forcing each outcome into exactly one bin: representation failure ≠ legality failure ≠ selection failure ≠ timing failure Measures, kept separate. Report preservation checks by obligation type, cross-representation contradictions and unsupported additions; active input occupancy by count provenance; and total management expenditure, including generation, validation, storage, regeneration, switching and recovery attempts. Behavioural measures include task success, constraint violations and unsupported claims, evaluated against the same fixtures across conditions. Scheduling measures include reproducibility, number of promotions and demotions, infeasible budget decisions, and violations of checked legal obligations. Where caching is available, distinguish structural first-divergence estimates from provider-reported reuse; otherwise mark reuse unobserved, not zero. Outcomes that count. Flat compaction matches tiered rendering at equal active budgets. Only two representations earn a place. Tiers cost more to create than they save. Cross-representation contradictions are frequent. Age-only matches the policy-aware schedule. Survival improves without behavioural benefit. Any of these narrows or removes the machinery, and the chapter shrinks accordingly. What a later builder would need to hand the compiler Nothing in this chapter is a component. If the experiments support generating before selecting, a later stage that builds candidates would have to give the compiler of Chapter 23 the legal representation set for each content object with each representation’s cost, the preservation constraints that define legality, and the lineage that says which representations are alternatives to one another. The compiler would choose among them and would not generate one. Inspect this in the Context Viewer The viewer scene for this chapter follows one episode across four representations — full text, dense rewrite, compact record, anchor — with only one resident at a time. Open the scene and change which form is resident while watching what stays stored. What to examine: which obligations each form was checked against, and which policy moved the resident form. Representation and residency vary separately; age drives neither transition. Representation and residency vary separately; policy, not age, drives each transition. Constructed illustration. Open the residency scene in the Context Viewer Residency is the boundary An anchor with semantic content resident in the window is Chapter 12. A pointer whose useful content lives elsewhere is Chapter 13. Fading live history is not memory, since durable cross-session influence belongs to the Memory book. Freshness stays with Chapter 20 and authority with Chapter 19: an old representation is not a false one, and a compact rule does not gain or lose standing by its size. What remains in the window after representations have done their work is the resident remainder: exact-floor obligations, active detailed content, compact views of the recent past and anchors of the older past. It still costs capacity and reuse stability. The next move is departure: Progressive fidelity still consumes window space. The next move is to take information out of the window entirely. References cortexkit. “Magic Context.” Context plugin, MIT, verified September 2026. Implementation facts only. https://github.com/cortexkit/magic-context cortexkit. “Magic Context ARCHITECTURE.md.” Primary source, verified September 2026. Four detail tiers per compartment; deterministic renderer from age, importance and budget; raw retention and expansion; re-tiering on hard folds only. https://github.com/cortexkit/magic-context/blob/master/ARCHITECTURE.md Wang, X., Xiao, J., Cui, S., et al. “HyMem: Hierarchical Context Management for Long-Horizon Agents via Information Isolation.” Preprint, arXiv:2608.15703, August 2026. https://arxiv.org/abs/2608.15703 Yi, L., Lei, R., Yao, L., et al. “Learning Agent-Compatible Context Management for Long-Horizon Tasks.” Preprint, arXiv:2605.30785, May 2026. https://arxiv.org/abs/2605.30785