{
 "paper": "total-recall",
 "a": "8.0",
 "b": "8.1",
 "summary": "From v8.0 (12 Oct) to v8.1 (12 Oct): 8,328 words to 9,850 words, 4,353 words in new or rewritten paragraphs and 2,831 taken out, 165 paragraphs changed.",
 "note": {
  "title": "Erase and quarantine, temporary sessions, an adapter contract, worked example",
  "kind": "revision",
  "body": "## Summary\n\nAbout 1,500 words added and a large share rewritten.\n\n- \"Forgetting: the tombstone\" is replaced by a section on erasing and quarantining entries.\n- New sections on when a turn is captured, sessions that are never kept, and a contract for adapters to each kind of window controller.\n- Marker merging now has a budget for the owner's own words.\n- \"Getting it back\" gains a range read, and a rule that every marker resolves.\n- The one-page design summary becomes a walk through one span, start to finish, and a worked example of a record and its marker is added as an appendix.\n- \"Who owns the window\" becomes \"who controls the window\".",
  "source": "change note"
 },
 "paragraphs_changed": 165,
 "changes": [
  {
   "section": "Abstract",
   "old": "But an agent reads only what fits in its context window, and when the window fills, something has to leave. Today a model usually writes a summary of the old part and throws the old part away. The summary becomes the only copy, and it keeps the gist while dropping exactly what a long job needs: the exact strings, the cause of a failure, the attempt that did not work, the owner's own words. The agent also often does not own its window: a provider's tool or API decides when to compact, and writes the summary itself.",
   "new": "But an agent reads only what fits in its context window, and when the window fills, something has to leave. Usually a model writes a summary of the old part, and from then on the summary is all the model reads of it. The full history may still sit in a log, but nothing in the window says what is there or how to reach it, and the summary keeps the gist while dropping what a long job needs: the exact strings, the cause of a failure, the attempt that did not work, the owner's own words. Often the agent does not even control its window: a provider's tool or API decides when to compact and writes the summary itself.",
   "marked": "But an agent reads only what fits in its context window, and when the window fills, something has to leave. [-Today-] {+Usually+} a model [-usually-] writes a summary of the old [-part-] {+part,+} and [-throws-] {+from then on+} the [-old part away.-] {+summary is all the model reads of it.+} The {+full history may still sit in a log, but nothing in the window says what is there or how to reach it, and the+} summary [-becomes the only copy, and it-] keeps the gist while dropping [-exactly-] what a long job needs: the exact strings, the cause of a failure, the attempt that did not work, the owner's own words. [-The-] {+Often the+} agent [-also often-] does not [-own-] {+even control+} its window: a provider's tool or API decides when to [-compact,-] {+compact+} and writes the summary itself."
  },
  {
   "section": "Abstract",
   "old": "Here we propose Total Recall, a design for the first stage of an agent's memory, keeping. The full session record, every turn word for word, is the ground truth, and the context window is a cache over it. Compaction never deletes: it leaves a small marker that names the evicted range, carries its exact strings and the owner's instructions word for word, and points back into the record, so any line can be read again. Whoever owns the window, the memory layer acts through the owner's own hooks, and it never compacts a copy the model does not read.",
   "new": "Here we propose Total Recall, a design for the first stage of an agent's memory, keeping. The full session record, every turn word for word, is the ground truth, and the context window is a cache over it. Compaction leaves a small marker in place of what it evicts, with the range's address, its exact strings and the owner's instructions word for word, so any line can be read back exactly. Whoever controls the window, the memory layer acts through that controller's own hooks.",
   "marked": "Here we propose Total Recall, a design for the first stage of an agent's memory, keeping. The full session record, every turn word for word, is the ground truth, and the context window is a cache over it. Compaction [-never deletes: it-] leaves a small marker [-that names-] {+in place of what it evicts, with+} the [-evicted range, carries-] {+range's address,+} its exact strings and the owner's instructions word for word, [-and points back into the record,-] so any line can be read [-again.-] {+back exactly.+} Whoever [-owns-] {+controls+} the window, the memory layer acts through [-the owner's-] {+that controller's+} own [-hooks, and it never compacts a copy the model does not read.-] {+hooks.+}"
  },
  {
   "section": "Abstract",
   "old": "For the agent you run, this means an owner's instruction survives every compaction, a hash or a host name from three hours ago can be read back exactly, and the cost of each compaction is priced before it happens. The design is not yet built; we give the tests that will decide whether it works. If it holds, an agent could carry a week of work without ever having to ask what you already told it.",
   "new": "For the agent you run, this means every instruction you give stays recoverable word for word, and stays in view for as long as your instructions fit a fixed budget; a hash from three hours ago comes back exactly; and each compaction is priced before it happens. The design is not yet built. We name the tests that will decide it, starting with the one that matters most: whether a marker beats a summary when both come with the same way back into the record. If it holds, an agent could carry a week of work without asking what you already told it.",
   "marked": "For the agent you run, this means [-an owner's-] {+every+} instruction [-survives every compaction,-] {+you give stays recoverable word for word, and stays in view for as long as your instructions fit a fixed budget;+} a hash [-or a host name-] from three hours ago [-can be read-] {+comes+} back [-exactly,-] {+exactly;+} and [-the cost of-] each compaction is priced before it happens. The design is not yet [-built; we give-] {+built. We name+} the tests that will decide {+it, starting with the one that matters most:+} whether [-it works.-] {+a marker beats a summary when both come with the same way back into the record.+} If it holds, an agent could carry a week of work without [-ever having to ask-] {+asking+} what you already told it."
  },
  {
   "section": "1.1 Friday's question",
   "old": "The agent's harness compacts. A model reads the first two hours and writes a paragraph: \"Worked on the TLS setup; fixed the certificate.\" The paragraph is accurate and almost useless. The path, the hash, the rate-limit error, the open key rotation and the instruction about the database are gone. Later that evening the agent proposes a database restart to clear a cache, and the owner has to say again what he said at two o'clock.",
   "new": "The agent's harness compacts. A model reads the first two hours and writes a paragraph: \"Worked on the TLS setup; fixed the certificate.\" The paragraph is accurate and almost useless. The transcript of the afternoon is still on disk, but the model reads only the paragraph, and nothing in it says that a path, a hash, a rate-limit error, an open key rotation and an instruction about the database are there to be found. Later that evening the agent proposes a database restart to clear a cache, and the owner has to say again what he said at two o'clock.",
   "marked": "The agent's harness compacts. A model reads the first two hours and writes a paragraph: \"Worked on the TLS setup; fixed the certificate.\" The paragraph is accurate and almost useless. The {+transcript of the afternoon is still on disk, but the model reads only the paragraph, and nothing in it says that a+} path, [-the-] {+a+} hash, [-the-] {+a+} rate-limit error, [-the-] {+an+} open key rotation and [-the-] {+an+} instruction about the database are [-gone.-] {+there to be found.+} Later that evening the agent proposes a database restart to clear a cache, and the owner has to say again what he said at two o'clock."
  },
  {
   "section": "1.1 Friday's question",
   "old": "Nothing in this story needs a bad model. The model that wrote the summary did what summaries do. The failure is in the design: the only copy of the afternoon was replaced by a description of it.",
   "new": "Nothing in this story needs a bad model. The model that wrote the summary did what summaries do. The failure is in the design: the next inference got a description of the afternoon and no way back to the afternoon itself.",
   "marked": "Nothing in this story needs a bad model. The model that wrote the summary did what summaries do. The failure is in the design: the [-only copy-] {+next inference got a description+} of the afternoon [-was replaced by a description of it.-] {+and no way back to the afternoon itself.+}"
  },
  {
   "section": "1.2 Why a bigger window does not settle it",
   "old": "Context windows have grown to a million tokens, so it is tempting to say the problem is going away. Two things stand in the way. First, models do not read long inputs evenly. Detail in the middle of a long context is used less well than detail at the start or end (Liu et al., 2024), and accuracy falls as input grows even on simple tasks (Hong et al., 2025). A full window is a worse window. Second, a long-running agent fills any window. A day of tool output, file reads and logs runs to millions of tokens, and a week does not fit anywhere. So compaction stays, and the question is what it should leave behind.",
   "new": "Context windows have grown to a million tokens, but two things stand in the way. First, models do not read long inputs evenly. Detail in the middle of a long context is used less well than detail at the start or end (Liu et al., 2024), and accuracy falls as input grows even on simple tasks (Hong et al., 2025). A full window is a worse window. Second, a long-running agent fills any window. A day of tool output, file reads and logs runs to millions of tokens, and a week does not fit anywhere. So compaction stays, and the question is what it should leave behind.",
   "marked": "Context windows have grown to a million tokens, [-so it is tempting to say the problem is going away. Two-] {+but two+} things stand in the way. First, models do not read long inputs evenly. Detail in the middle of a long context is used less well than detail at the start or end (Liu et al., 2024), and accuracy falls as input grows even on simple tasks (Hong et al., 2025). A full window is a worse window. Second, a long-running agent fills any window. A day of tool output, file reads and logs runs to millions of tokens, and a week does not fit anywhere. So compaction stays, and the question is what it should leave behind."
  },
  {
   "section": "1.3 What summaries lose",
   "old": "A summary keeps the shape of the work and drops its substance. Four kinds of information are lost first, because a summary is written to be short and to read well:",
   "new": "A summary keeps the shape of the work and drops its substance. Four kinds of information go first, because a summary is written to be short and to read well:",
   "marked": "A summary keeps the shape of the work and drops its substance. Four kinds of information [-are lost-] {+go+} first, because a summary is written to be short and to read well:"
  },
  {
   "section": "1.3 What summaries lose",
   "old": "There is a fifth kind that matters more than the four: the owner's own words. An instruction, a preference or a correction given during the session is the one thing the owner expects never to repeat. In a summary it becomes \"the user gave some guidance\", or it vanishes.",
   "new": "A fifth kind matters more than the four: the owner's own words. An instruction, a preference or a correction given during the session is the one thing the owner expects never to repeat. In a summary it becomes \"the user gave some guidance\", or it vanishes.",
   "marked": "[-There is a-] {+A+} fifth kind [-that-] matters more than the four: the owner's own words. An instruction, a preference or a correction given during the session is the one thing the owner expects never to repeat. In a summary it becomes \"the user gave some guidance\", or it vanishes."
  },
  {
   "section": "1.4 Who holds the pen",
   "old": "There is a second obstacle, newer and less discussed. In many deployments the agent's runtime does not own the context window. A provider's command-line agent decides when to compact and writes the summary itself. A provider's API may clear old tool results or compact on its servers, and one of them returns the compacted state as an encrypted item the client cannot read (OpenAI, 2026). A memory layer that assumes it builds every model call will compact its own copy of the conversation while the model goes on reading the provider's version. That work changes nothing the model sees.",
   "new": "There is a second obstacle, newer and less discussed. In many deployments the agent's runtime does not control the context window. A provider's command-line agent decides when to compact and writes the summary itself. A provider's API may clear old tool results or compact on its servers, and one of them returns the compacted state as an encrypted item the client cannot read (OpenAI, 2026). A memory layer that assumes it builds every model call will compact its own copy of the conversation while the model goes on reading the provider's version, and that work changes nothing the model sees.",
   "marked": "There is a second obstacle, newer and less discussed. In many deployments the agent's runtime does not [-own-] {+control+} the context window. A provider's command-line agent decides when to compact and writes the summary itself. A provider's API may clear old tool results or compact on its servers, and one of them returns the compacted state as an encrypted item the client cannot read (OpenAI, 2026). A memory layer that assumes it builds every model call will compact its own copy of the conversation while the model goes on reading the provider's [-version. That-] {+version, and that+} work changes nothing the model sees."
  },
  {
   "section": "1.4 Who holds the pen",
   "old": "So a design for keeping has to say what is kept, where the ground truth lives, and how the memory layer acts when someone else holds the pen.",
   "new": "So a design for keeping has to say what is kept, where the ground truth lives, and how the memory layer acts when someone else holds the pen. We call whoever decides what the model reads on each call the **window controller**; \"owner\" always means the human the agent serves.",
   "marked": "So a design for keeping has to say what is kept, where the ground truth lives, and how the memory layer acts when someone else holds the [-pen.-] {+pen. We call whoever decides what the model reads on each call the **window controller**; \"owner\" always means the human the agent serves.+}"
  },
  {
   "section": "1.5 The claim",
   "old": "**The context window is a cache over the session record, and compaction is eviction from that cache, not rewriting of history.** The full record of the session is kept word for word and never edited; the one exception, a deletion for privacy or poisoned content, leaves a tombstone (§4.4). What leaves the window is replaced by a marker that carries the evicted range's exact strings and the owner's instructions verbatim, and points back into the record. Whoever owns the window, the memory layer acts through that owner's hooks.",
   "new": "**The context window is a cache over the session record, and compaction is eviction from that cache, not a rewrite of history.** The record keeps every turn word for word and is never edited, with one exception for privacy erasure (§4.4). What leaves the window is replaced by a marker that carries the evicted range's exact strings and the owner's instructions and points back into the record.",
   "marked": "**The context window is a cache over the session record, and compaction is eviction from that cache, not [-rewriting-] {+a rewrite+} of history.** The [-full-] record [-of the session is kept-] {+keeps every turn+} word for word and {+is+} never [-edited; the-] {+edited, with+} one [-exception, a deletion-] {+exception+} for privacy [-or poisoned content, leaves a tombstone-] {+erasure+} (§4.4). What leaves the window is replaced by a marker that carries the evicted range's exact strings and the owner's instructions [-verbatim,-] and points back into the [-record. Whoever owns the window, the memory layer acts through that owner's hooks.-] {+record.+}"
  },
  {
   "section": "1.5 The claim",
   "old": "The brain name of this stage, ENGRAM, is the physical trace a memory leaves in neural tissue: the change that makes later recall possible. We use it as a reminder of what the stage is for, a durable trace that outlives the moment, and not as a model to copy.",
   "new": "The stage's codename, ENGRAM, is the neuroscientists' word for the physical trace a memory leaves in the brain. We use it only as a reminder of what this stage is for: a durable trace that outlives the moment.",
   "marked": "The [-brain name of this stage,-] {+stage's codename,+} ENGRAM, is {+the neuroscientists' word for+} the physical trace a memory leaves in [-neural tissue:-] the [-change that makes later recall possible.-] {+brain.+} We use it {+only+} as a reminder of what [-the-] {+this+} stage is [-for,-] {+for:+} a durable trace that outlives the [-moment, and not as a model to copy.-] {+moment.+}"
  },
  {
   "section": "1.5 The claim",
   "old": null,
   "new": "This is one of four designs for one agent's memory, each owning a stage: keeping (this paper, J1); writing, which decides what becomes a long-term fact (the writing paper, J14); finding things again (the finding paper, J2); and turning experience into behaviour (the learning paper, J5). The series is judged by one owner correction followed from end to end. It is *captured* here, *accepted* (or visibly held) by writing, *retrievable* through finding, and *active* or *enforced* through learning (§10.1). This paper owns the first status.",
   "marked": "{+This is one of four designs for one agent's memory, each owning a stage: keeping (this paper, J1); writing, which decides what becomes a long-term fact (the writing paper, J14); finding things again (the finding paper, J2); and turning experience into behaviour (the learning paper, J5). The series is judged by one owner correction followed from end to end. It is *captured* here, *accepted* (or visibly held) by writing, *retrievable* through finding, and *active* or *enforced* through learning (§10.1). This paper owns the first status.+}"
  },
  {
   "section": "1.5 The claim",
   "old": "1. The session record as ground truth (§4): every turn appended with its author, the owner's words stripped of the harness wrapper, and a stable address; the memory layer indexes the record and never keeps a lossy copy of its own. 2. A marker that is a pointer, not a summary (§5): what it carries word for word, what it reduces to one line with a pointer, what it leaves behind a pointer alone, and the rule that each compaction is written from the record and never from the previous marker. 3. An owner contract (§6): three owners of the window (the runtime, a provider's tool, a provider's API) and what the memory layer does in each, including never compacting a copy nobody reads. 4. A price for compaction (§7): a trigger that reads the call actually sent, and a closed-form break-even that says when an elective eviction pays under prompt caching. 5. Invariants and the tests that decide them (§4.3, §8, §10): every marker resolves; the record has no supersede and no hide, and loses content only through a tombstone.",
   "new": null,
   "marked": "[-1. The session record as ground truth (§4): every turn appended with its author, the owner's words stripped of the harness wrapper, and a stable address; the memory layer indexes the record and never keeps a lossy copy of its own. 2. A marker that is a pointer, not a summary (§5): what it carries word for word, what it reduces to one line with a pointer, what it leaves behind a pointer alone, and the rule that each compaction is written from the record and never from the previous marker. 3. An owner contract (§6): three owners of the window (the runtime, a provider's tool, a provider's API) and what the memory layer does in each, including never compacting a copy nobody reads. 4. A price for compaction (§7): a trigger that reads the call actually sent, and a closed-form break-even that says when an elective eviction pays under prompt caching. 5. Invariants and the tests that decide them (§4.3, §8, §10): every marker resolves; the record has no supersede and no hide, and loses content only through a tombstone.-]"
  },
  {
   "section": "1.5 The claim",
   "old": null,
   "new": "1. A record that holds everything said and read word for word, file contents included, with one controlled exception (§4). 2. A marker that is a pointer, not a summary, with a stated guarantee for the owner's instructions when they outgrow their budget (§5). 3. One versioned adapter contract for the three kinds of window controller (§6, Appendix C). 4. A price for compaction that counts the cost of building the marker (§7). 5. Invariants checked in code, and the tests that decide the design (§8, §10).",
   "marked": "{+1. A record that holds everything said and read word for word, file contents included, with one controlled exception (§4). 2. A marker that is a pointer, not a summary, with a stated guarantee for the owner's instructions when they outgrow their budget (§5). 3. One versioned adapter contract for the three kinds of window controller (§6, Appendix C). 4. A price for compaction that counts the cost of building the marker (§7). 5. Invariants checked in code, and the tests that decide the design (§8, §10).+}"
  },
  {
   "section": "2. Related Work",
   "old": "This is one of four designs for an agent's memory: keeping (J1, this paper), writing (J14), finding (J2) and learning (J5). Keeping owns what survives the context window. How things are ranked and pushed into the window belongs to finding, what becomes a long-term fact belongs to writing, and turning experience into rules belongs to learning. Each appears here in one line, with a pointer.",
   "new": null,
   "marked": "[-This is one of four designs for an agent's memory: keeping (J1, this paper), writing (J14), finding (J2) and learning (J5). Keeping owns what survives the context window. How things are ranked and pushed into the window belongs to finding, what becomes a long-term fact belongs to writing, and turning experience into rules belongs to learning. Each appears here in one line, with a pointer.-]"
  },
  {
   "section": "2. Related Work",
   "old": "**MemGPT and Letta** (Packer et al., 2023) treat the context window like a computer's main memory and let the model page information in and out through function calls, with the full message history kept in a searchable \"recall\" store. Total Recall keeps the hierarchy and the full history. It differs on who decides: eviction is a decision of whoever owns the window (§6), so the model does not spend attention on managing its own pages, and the marker it leaves carries the exact strings a later search needs (§5.1).",
   "new": "**MemGPT and Letta** (Packer et al., 2023) treat the context window like a computer's main memory and let the model page information in and out through function calls, with the full message history kept in a searchable recall store. Total Recall keeps the hierarchy and the full history. It differs on who decides: eviction is the window controller's decision (§6), so the model does not spend attention on managing its own pages, and the marker it leaves carries the exact strings a later search needs (§5.1).",
   "marked": "**MemGPT and Letta** (Packer et al., 2023) treat the context window like a computer's main memory and let the model page information in and out through function calls, with the full message history kept in a searchable [-\"recall\"-] {+recall+} store. Total Recall keeps the hierarchy and the full history. It differs on who decides: eviction is [-a decision of whoever owns-] the window {+controller's decision+} (§6), so the model does not spend attention on managing its own pages, and the marker it leaves carries the exact strings a later search needs (§5.1)."
  },
  {
   "section": "2. Related Work",
   "old": "**Provider context management** has made the provider an owner of the window. Anthropic's context editing clears the oldest tool results once a threshold is crossed and leaves a placeholder saying a result was removed; the caller can name tools whose results are never cleared and a minimum amount to clear, so the cache is not broken for a small gain, and the client keeps the full history because the clearing happens before the prompt reaches the model (Anthropic, 2026d). Its memory tool lets the model keep files outside the window in storage the developer controls (Anthropic, 2025a), and its server-side compaction replaces earlier turns with a summary block (Anthropic, 2026a). OpenAI's compaction returns an opaque, encrypted item that carries prior state forward (OpenAI, 2026). Clearing tool results first is the same eviction order we propose (§5.3), reached independently. The placeholder is a marker with nothing in it to search with; our marker (§5.1) is that placeholder with the exact strings added. The summaries are the narrative baseline our tests compare against (§10). An opaque item is the strongest argument for keeping the record on the runtime's side: if nobody can read what was kept, the runtime must keep its own copy of what was said (§6.4).",
   "new": "**Provider context management** makes the provider a window controller. Anthropic's context editing clears the oldest tool results once the prompt passes a threshold and leaves a placeholder saying a result was removed; the caller can name tools whose results are never cleared and a minimum amount to clear, because each clearing invalidates the cached prefix. The clearing happens on the server before the prompt reaches the model, and the client keeps the full, unmodified history (Anthropic, 2026d). Its server-side compaction replaces older turns with a summary the model writes (Anthropic, 2026a), and its memory tool lets the model keep files outside the window, in storage the developer controls (Anthropic, 2025). OpenAI's compaction returns an encrypted item that carries prior state forward and is not meant to be read (OpenAI, 2026). So the history is often kept; what the next inference sees is a placeholder or a summary, with no address for the missing part and nothing in it to search with. Our marker (§5.1) is that placeholder with the address and the exact strings added, and our main test (T1, §10) gives both arms the same way back into the history. An opaque item is the strongest case for the runtime keeping its own record (§6.4).",
   "marked": "**Provider context management** [-has made-] {+makes+} the provider [-an owner of the window.-] {+a window controller.+} Anthropic's context editing clears the oldest tool results once {+the prompt passes+} a threshold [-is crossed-] and leaves a placeholder saying a result was removed; the caller can name tools whose results are never cleared and a minimum amount to clear, [-so-] {+because each clearing invalidates+} the [-cache is not broken for a small gain,-] {+cached prefix. The clearing happens on the server before the prompt reaches the model,+} and the client keeps the [-full-] {+full, unmodified+} history [-because the clearing happens before the prompt reaches the model-] (Anthropic, 2026d). Its {+server-side compaction replaces older turns with a summary the model writes (Anthropic, 2026a), and its+} memory tool lets the model keep files outside the [-window-] {+window,+} in storage the developer controls (Anthropic, [-2025a), and its server-side compaction replaces earlier turns with a summary block (Anthropic, 2026a).-] {+2025).+} OpenAI's compaction returns an [-opaque,-] encrypted item that carries prior state forward {+and is not meant to be read+} (OpenAI, 2026). [-Clearing tool results first-] {+So the history+} is {+often kept; what+} the [-same eviction order we propose (§5.3), reached independently. The placeholder-] {+next inference sees+} is a [-marker-] {+placeholder or a summary,+} with {+no address for the missing part and+} nothing in it to search [-with; our-] {+with. Our+} marker (§5.1) is that placeholder with the {+address and the+} exact strings [-added. The summaries are-] {+added, and our main test (T1, §10) gives both arms+} the [-narrative baseline our tests compare against (§10).-] {+same way back into the history.+} An opaque item is the strongest [-argument-] {+case+} for [-keeping the record on the runtime's side: if nobody can read what was kept,-] the runtime [-must keep-] {+keeping+} its own [-copy of what was said-] {+record+} (§6.4)."
  },
  {
   "section": "2. Related Work",
   "old": "**Claude Code's hooks** (Anthropic, 2026b) are the levers a memory layer has when a provider's tool owns the window: an event before compaction (which can block it), an event after, a session-start event that fires after a compaction and adds text to the new context, and the path to the tool's own transcript. **claude-mem** (thedotmack, 2026) is a widely used plugin that uses these levers to capture what an agent did, compress it with a model and inject it into later sessions. We use the same levers (§6.3). We differ on what is kept: claude-mem's memory is the model-compressed observation, while ours is the record itself, with compression used only as a map that points back into it.",
   "new": "**Claude Code's hooks** (Anthropic, 2026b) are the levers a memory layer has when a provider's tool controls the window: an event before compaction that can block it, an event after it that receives the summary the tool wrote, a session-start event after a compaction that adds text to the new context, and an event on every prompt that adds text alongside it. **claude-mem** (thedotmack, 2026) captures what an agent does through hooks on session start, prompt submission, tool use and session end, compresses it with a model and injects relevant context into later sessions. We use the same family of levers (§6.3). We differ on what is kept: claude-mem's memory is the compressed observation, and ours is the record itself, with compression used only as a map that points back into it.",
   "marked": "**Claude Code's hooks** (Anthropic, 2026b) are the levers a memory layer has when a provider's tool [-owns-] {+controls+} the window: an event before compaction [-(which-] {+that+} can block [-it),-] {+it,+} an event [-after,-] {+after it that receives the summary the tool wrote,+} a session-start event [-that fires-] after a compaction [-and-] {+that+} adds text to the new context, and [-the path to the tool's own transcript.-] {+an event on every prompt that adds text alongside it.+} **claude-mem** (thedotmack, 2026) [-is a widely used plugin that uses these levers to capture-] {+captures+} what an agent [-did, compress-] {+does through hooks on session start, prompt submission, tool use and session end, compresses+} it with a model and [-inject it-] {+injects relevant context+} into later sessions. We use the same {+family of+} levers (§6.3). We differ on what is kept: claude-mem's memory is the [-model-compressed-] {+compressed+} observation, [-while-] {+and+} ours is the record itself, with compression used only as a map that points back into it."
  },
  {
   "section": "2. Related Work",
   "old": "**Manus** (Ji, 2025) reports the lessons of a production agent: treat the file system as unlimited context, compress only in ways that can be restored (drop a page's content but keep its URL), keep the prompt prefix stable because the cache hit rate drives cost and latency, keep the context append-only, and leave failed attempts in view. Total Recall takes \"restorable\" from tool outputs to the whole conversation, adds the owner's words as something never to be compressed, and puts a price on moving the prefix (§7.2).",
   "new": "**Manus** (Ji, 2025) reports a production agent's lessons: compress only in ways that can be restored (drop a page's content, keep its URL), keep the prompt prefix stable because the cache hit rate drives cost, keep the context append-only, and leave failed attempts in view. Total Recall takes \"restorable\" from tool outputs to the whole conversation and puts a price on moving the prefix (§7.2).",
   "marked": "**Manus** (Ji, 2025) reports [-the lessons of-] a production [-agent: treat the file system as unlimited context,-] {+agent's lessons:+} compress only in ways that can be restored (drop a page's [-content but-] {+content,+} keep its URL), keep the prompt prefix stable because the cache hit rate drives [-cost and latency,-] {+cost,+} keep the context append-only, and leave failed attempts in view. Total Recall takes \"restorable\" from tool outputs to the whole [-conversation, adds the owner's words as something never to be compressed,-] {+conversation+} and puts a price on moving the prefix (§7.2)."
  },
  {
   "section": "2. Related Work",
   "old": "**headroom** (Headroom Labs, 2026) compresses tool outputs, logs and files before they reach the model, caches the originals, and gives the model a tool to retrieve them. It compresses only content as it enters the window, so the cached prefix is never rewritten; that avoids the one-time cost of §7.2, at the price of deciding before anyone knows whether the content will be needed again. It keeps a smaller, lossy version in the window; we remove the span and leave a pointer. The two compose. For a span likely to be read again, a compressed copy in the window can be cheaper than a pull; for a span unlikely to be read again, a pointer is. §7.2 gives the rule that chooses.",
   "new": null,
   "marked": "[-**headroom** (Headroom Labs, 2026) compresses tool outputs, logs and files before they reach the model, caches the originals, and gives the model a tool to retrieve them. It compresses only content as it enters the window, so the cached prefix is never rewritten; that avoids the one-time cost of §7.2, at the price of deciding before anyone knows whether the content will be needed again. It keeps a smaller, lossy version in the window; we remove the span and leave a pointer. The two compose. For a span likely to be read again, a compressed copy in the window can be cheaper than a pull; for a span unlikely to be read again, a pointer is. §7.2 gives the rule that chooses.-]"
  },
  {
   "section": "2. Related Work",
   "old": null,
   "new": "**headroom** (Headroom Labs, 2026) compresses what an agent reads (tool outputs, logs, files, retrieved chunks and conversation history) before the model sees it, stores the originals locally and gives the model a tool to fetch them. It keeps a smaller version in the window; we remove the span and leave a pointer. The two compose, and §7.2 says when each is cheaper.",
   "marked": "{+**headroom** (Headroom Labs, 2026) compresses what an agent reads (tool outputs, logs, files, retrieved chunks and conversation history) before the model sees it, stores the originals locally and gives the model a tool to fetch them. It keeps a smaller version in the window; we remove the span and leave a pointer. The two compose, and §7.2 says when each is cheaper.+}"
  },
  {
   "section": "2. Related Work",
   "old": "**Agentic Context Engineering** (Zhang et al., 2025) shows two failures of agents that rewrite their own context: brevity bias, where summaries drop domain detail, and context collapse, where iterative rewriting erodes detail over time. Its cure is small incremental updates. Our version of the cure is that every compaction is written from the record (§5.4). Their evolving playbook of strategies is learning, the subject of J5.",
   "new": "**Agentic Context Engineering** (Zhang et al., 2025) shows brevity bias, where summaries drop domain detail, and context collapse, where iterative rewriting erodes it. Our cure for collapse is that every compaction is written from the record (§5.4).",
   "marked": "**Agentic Context Engineering** (Zhang et al., 2025) shows [-two failures of agents that rewrite their own context:-] brevity bias, where summaries drop domain detail, and context collapse, where iterative rewriting erodes [-detail over time. Its-] {+it. Our+} cure [-is small incremental updates. Our version of the cure-] {+for collapse+} is that every compaction is written from the record [-(§5.4). Their evolving playbook of strategies is learning, the subject of J5.-] {+(§5.4).+}"
  },
  {
   "section": "2. Related Work",
   "old": "**Zep** (Rasmussen et al., 2025) keeps raw conversation \"episodes\" beneath the entities and facts it extracts, so every derived fact points back to its source. Total Recall applies the same layering to the context window: the raw record underneath, and everything derived (markers, maps, summaries) pointing back into it (§4). Extracting facts from the record belongs to J14.",
   "new": "**Zep** (Rasmussen et al., 2025) keeps raw conversation episodes beneath the entities and facts it extracts, so every derived fact points back to its source. Total Recall applies the same layering to the context window.",
   "marked": "**Zep** (Rasmussen et al., 2025) keeps raw conversation [-\"episodes\"-] {+episodes+} beneath the entities and facts it extracts, so every derived fact points back to its source. Total Recall applies the same layering to the context [-window: the raw record underneath, and everything derived (markers, maps, summaries) pointing back into it (§4). Extracting facts from the record belongs to J14.-] {+window.+}"
  },
  {
   "section": "2. Related Work",
   "old": "Two older ideas frame the rest. Belady (1966) showed that the best page to evict is the one needed furthest in the future; no runtime knows that, so §5.3 uses what is cheapest to recover as the proxy. And the prompt cache now prices every edit to the prefix (Anthropic, 2026c), which turns \"when to compact\" from a matter of taste into arithmetic (§7.2).",
   "new": "Two older ideas frame the rest. Belady (1966) showed that the best page to evict is the one needed furthest in the future; no runtime knows that, so §5.3 uses what is cheapest to recover as the proxy. And the prompt cache prices every edit to the prefix (Anthropic, 2026c), which turns \"when to compact\" into arithmetic (§7.2). Each part of our design has close relatives here; we claim the combination and the contract.",
   "marked": "Two older ideas frame the rest. Belady (1966) showed that the best page to evict is the one needed furthest in the future; no runtime knows that, so §5.3 uses what is cheapest to recover as the proxy. And the prompt cache [-now-] prices every edit to the prefix (Anthropic, 2026c), which turns \"when to compact\" [-from a matter of taste-] into arithmetic [-(§7.2).-] {+(§7.2). Each part of our design has close relatives here; we claim the combination and the contract.+}"
  },
  {
   "section": "2. Related Work",
   "old": "To our knowledge no shipping system combines all five of our contributions, but each of them has close relatives above, and we claim the combination and the contract, not the parts.",
   "new": null,
   "marked": "[-To our knowledge no shipping system combines all five of our contributions, but each of them has close relatives above, and we claim the combination and the contract, not the parts.-]"
  },
  {
   "section": "2. Related Work",
   "old": null,
   "new": "![One evicted span and its way back. Left, the session record of session s7, of which six of the entries 12 to 47 are shown. Right, the context window at turn 61: the span has left and a marker stands in its place, carrying the owner's instruction word for word, the exact strings, the failed renewal and the open key rotation, each with the address of the entry that shows it. (1) The marker is built from the record entries, never from an older marker. (2) When the owner asks what the renewal said, a range read of entry 23 returns the error line exactly. The dashed box is what a narrative summary would have left in the marker's place.](images/fig-1-span.png){width=74%}",
   "marked": "{+![One evicted span and its way back. Left, the session record of session s7, of which six of the entries 12 to 47 are shown. Right, the context window at turn 61: the span has left and a marker stands in its place, carrying the owner's instruction word for word, the exact strings, the failed renewal and the open key rotation, each with the address of the entry that shows it. (1) The marker is built from the record entries, never from an older marker. (2) When the owner asks what the renewal said, a range read of entry 23 returns the error line exactly. The dashed box is what a narrative summary would have left in the marker's place.](images/fig-1-span.png){width=74%}+}"
  },
  {
   "section": "3. The Design in One Page",
   "old": "## 3. The Design in One Page",
   "new": null,
   "marked": "[-## 3. The Design in One Page-]"
  },
  {
   "section": "3. The Design in One Page",
   "old": "![The four moves of keeping. Every turn is appended to the session record word for word; the context window holds a copy of part of it; when the window fills, an old span leaves and a small marker with its exact strings and the owner's instructions takes its place; the agent follows the marker's pointer to read the exact words back. Who owns the window decides where compaction runs (Figure 3), never what the record keeps.](images/fig-1-overview.png){width=82%}",
   "new": null,
   "marked": "[-![The four moves of keeping. Every turn is appended to the session record word for word; the context window holds a copy of part of it; when the window fills, an old span leaves and a small marker with its exact strings and the owner's instructions takes its place; the agent follows the marker's pointer to read the exact words back. Who owns the window decides where compaction runs (Figure 3), never what the record keeps.](images/fig-1-overview.png){width=82%}-]"
  },
  {
   "section": "3. The Design in One Page",
   "old": "Figure 1 shows the whole design. Four parts carry it:",
   "new": null,
   "marked": "[-Figure 1 shows the whole design. Four parts carry it:-]"
  },
  {
   "section": "3. The Design in One Page",
   "old": "- The session record. An append-only log of the session: owner messages, agent replies, tool calls and tool results, each with its author, its time and an address that never changes. It is the ground truth. Nothing edits it. - The context window. What the model reads on this call. It is a cache: a copy of part of the record, plus markers standing in for parts that left. - The marker. A short block that replaces an evicted range. It names the range, carries its exact strings and the owner's instructions word for word, lists decisions and open items as one line each, and points back into the record. - The range read. It takes a marker's range and returns the exact entries, word for word. It is not a tool of its own: J2's pull (J2 §6.6) offers it as a range mode next to its search.",
   "new": null,
   "marked": "[-- The session record. An append-only log of the session: owner messages, agent replies, tool calls and tool results, each with its author, its time and an address that never changes. It is the ground truth. Nothing edits it. - The context window. What the model reads on this call. It is a cache: a copy of part of the record, plus markers standing in for parts that left. - The marker. A short block that replaces an evicted range. It names the range, carries its exact strings and the owner's instructions word for word, lists decisions and open items as one line each, and points back into the record. - The range read. It takes a marker's range and returns the exact entries, word for word. It is not a tool of its own: J2's pull (J2 §6.6) offers it as a range mode next to its search.-]"
  },
  {
   "section": "3. The Design in One Page",
   "old": "Around them sit three rules that keep the design honest:",
   "new": null,
   "marked": "[-Around them sit three rules that keep the design honest:-]"
  },
  {
   "section": "3. The Design in One Page",
   "old": "1. One owner per window. The memory layer finds out who owns the window (§6) and acts only where its action changes what the model reads. 2. Priced compaction. A forced compaction happens because the window is full. An elective one happens only when its price, measured on the call actually sent, is lower than keeping the span (§7). 3. Checked invariants. Every marker resolves to entries in the record (§8); nothing leaves the record except through a tombstone (§4.4). These are checks in code, not sentences in a prompt (why a check and not text: J5 §1.2).",
   "new": null,
   "marked": "[-1. One owner per window. The memory layer finds out who owns the window (§6) and acts only where its action changes what the model reads. 2. Priced compaction. A forced compaction happens because the window is full. An elective one happens only when its price, measured on the call actually sent, is lower than keeping the span (§7). 3. Checked invariants. Every marker resolves to entries in the record (§8); nothing leaves the record except through a tombstone (§4.4). These are checks in code, not sentences in a prompt (why a check and not text: J5 §1.2).-]"
  },
  {
   "section": "3. One Span, Start to Finish",
   "old": null,
   "new": "## 3. One Span, Start to Finish",
   "marked": "{+## 3. One Span, Start to Finish+}"
  },
  {
   "section": "3. One Span, Start to Finish",
   "old": null,
   "new": "Figure 1 follows the afternoon of §1.1 through the design. Every turn is appended to the session record with an address that never changes. The context window is what the model reads on this call, a copy of part of the record. When it fills, entries 12 to 47 leave and a marker takes their place. At turn 61 the owner asks what exactly the renewal said; the marker names entry 23, and a range read returns it character for character. The summary in the dashed box could not have answered. Appendix A shows the same entries and marker as stored.",
   "marked": "{+Figure 1 follows the afternoon of §1.1 through the design. Every turn is appended to the session record with an address that never changes. The context window is what the model reads on this call, a copy of part of the record. When it fills, entries 12 to 47 leave and a marker takes their place. At turn 61 the owner asks what exactly the renewal said; the marker names entry 23, and a range read returns it character for character. The summary in the dashed box could not have answered. Appendix A shows the same entries and marker as stored.+}"
  },
  {
   "section": "4.1 What goes in, and with whose name",
   "old": "Every entry in the record has an author, and the author is one of five kinds: the owner, the agent, a tool, the harness (time stamps, injected instructions, system text) or another agent. This is the most important field in the record, because every later stage depends on it. When a marker says \"owner: never restart prod by day\", it must be the owner's sentence. A harness that wraps the owner's message with a time stamp and a block of injected instructions, and stores the whole as \"user\", will later quote its own wrapper back as the owner's wish. So an owner's entry gets a second field when it is appended: the owner's words, with the wrapper stripped. One function does the stripping, once, at append time, and the field is never rewritten. Anything a later stage quotes as \"the owner said\" comes from this field. J2, J14 and J5 read the owner's words only from this field.",
   "new": "Every entry carries an `author_kind`: the owner, the agent, a tool, the harness (time stamps, injected instructions, system text) or another agent. Every later stage depends on this field. When a marker says \"owner: never restart prod by day\", it must be the owner's sentence. A harness that wraps the owner's message with a time stamp and a block of injected instructions, and stores the whole as \"user\", will later quote its own wrapper back as the owner's wish. So an owner entry gets a second field when it is appended, `owner_words`: the owner's words with the wrapper stripped. One function does the stripping, once, at append time, and the field is never rewritten. Anything a later stage quotes as \"the owner said\" comes from this field, and the writing, finding and learning papers read the owner's words from nowhere else.",
   "marked": "Every entry [-in the record has-] {+carries+} an [-author, and the author is one of five kinds:-] {+`author_kind`:+} the owner, the agent, a tool, the harness (time stamps, injected instructions, system text) or another agent. [-This is the most important field in the record, because every-] {+Every+} later stage depends on [-it.-] {+this field.+} When a marker says \"owner: never restart prod by day\", it must be the owner's sentence. A harness that wraps the owner's message with a time stamp and a block of injected instructions, and stores the whole as \"user\", will later quote its own wrapper back as the owner's wish. So an [-owner's-] {+owner+} entry gets a second field when it is [-appended:-] {+appended, `owner_words`:+} the owner's [-words,-] {+words+} with the wrapper stripped. One function does the stripping, once, at append time, and the field is never rewritten. Anything a later stage quotes as \"the owner said\" comes from this [-field. J2, J14-] {+field,+} and [-J5-] {+the writing, finding and learning papers+} read the owner's words [-only-] from [-this field.-] {+nowhere else.+}"
  },
  {
   "section": "4.1 What goes in, and with whose name",
   "old": "Tool results go in whole when they cannot be reproduced: the output of a command at a moment in time, a web page as it was fetched, an API's answer. Tool results that can be reproduced exactly, such as the contents of a file that is still on disk at the same version, go in as a reference with a content hash. Reading the file again is the recovery path, and the hash says whether the file has changed since.",
   "new": null,
   "marked": "[-Tool results go in whole when they cannot be reproduced: the output of a command at a moment in time, a web page as it was fetched, an API's answer. Tool results that can be reproduced exactly, such as the contents of a file that is still on disk at the same version, go in as a reference with a content hash. Reading the file again is the recovery path, and the hash says whether the file has changed since.-]"
  },
  {
   "section": "4.1 What goes in, and with whose name",
   "old": null,
   "new": "At the same moment, a shared classifier tags each of the owner's sentences as an instruction, a correction, praise or none of these, and the tags are stored with the entry. The learning paper owns the classifier's contract, its calibration and its failure behaviour (J5 Appendix A.1, the owner-sentence classifier); this stage only stores what it returns. If the classifier is unavailable, the sentences are stored as untagged and treated as instructions until the night tags them (§5.2, §5.5).",
   "marked": "{+At the same moment, a shared classifier tags each of the owner's sentences as an instruction, a correction, praise or none of these, and the tags are stored with the entry. The learning paper owns the classifier's contract, its calibration and its failure behaviour (J5 Appendix A.1, the owner-sentence classifier); this stage only stores what it returns. If the classifier is unavailable, the sentences are stored as untagged and treated as instructions until the night tags them (§5.2, §5.5).+}"
  },
  {
   "section": "4.1 What goes in, and with whose name",
   "old": null,
   "new": "Tool results go in whole. A file the agent read is the one case that needs care, because the file can change or vanish after the read. A content hash would show that it changed but could not give back what it said. So the bytes the tool returned are stored once, as a content-addressed blob, before the window drops them, and the entry holds the path and the blob's hash. Identical contents are stored once, so the cost grows with the number of distinct versions read, not with the number of reads. One blob can therefore back many entries, in many sessions, which matters when it has to be erased (§4.4).",
   "marked": "{+Tool results go in whole. A file the agent read is the one case that needs care, because the file can change or vanish after the read. A content hash would show that it changed but could not give back what it said. So the bytes the tool returned are stored once, as a content-addressed blob, before the window drops them, and the entry holds the path and the blob's hash. Identical contents are stored once, so the cost grows with the number of distinct versions read, not with the number of reads. One blob can therefore back many entries, in many sessions, which matters when it has to be erased (§4.4).+}"
  },
  {
   "section": "4.2 Addresses that never move",
   "old": "Each entry gets an address made of the session and a sequence number. A range of entries is written as the session and two numbers. Addresses are assigned once, at append, and never reused or renumbered, so a pointer written today still resolves next month. Ids that sort by time are convenient, but the sequence number is what makes a range well defined.",
   "new": "Each entry gets an address made of the session and a sequence number, and a range is the session and two numbers. Addresses are assigned once, at append, and never reused or renumbered, so a pointer written today still resolves next month.",
   "marked": "Each entry gets an address made of the session and a sequence [-number. A-] {+number, and a+} range [-of entries-] is [-written as-] the session and two numbers. Addresses are assigned once, at append, and never reused or renumbered, so a pointer written today still resolves next [-month. Ids that sort by time are convenient, but the sequence number is what makes a range well defined.-] {+month.+}"
  },
  {
   "section": "4.3 Never edited, never superseded",
   "old": "The record is append-only. No compaction or clean-up ever edits or deletes an entry, and the record has no supersede at all: a turn that was said stays said, even after what it said stops being true. Supersede happens one stage later, in the fact files, where a judge closes a fact line and leaves it in place, struck through, with a pointer to the line that replaced it (J14 §7.3). The record entry the fact was drawn from is not touched. Which facts are closed is J14's call (J14 §7); what a default search hides, and its per-query counts, are J2's (J2 §8.1).",
   "new": "The record is append-only. No compaction or clean-up edits or deletes an entry, and the record has no supersede at all: a turn that was said stays said, even after what it said stops being true. Fact changes happen one stage later, where a fact is superseded, retracted or erased as a new revision and the old one keeps its history (J14 §7.3, three ways a fact ends). The record entry the fact was drawn from is not touched. Which facts change is the writing paper's call; what a default search hides is the finding paper's (J2 §8.1, filters in a fixed order).",
   "marked": "The record is append-only. No compaction or clean-up [-ever-] edits or deletes an entry, and the record has no supersede at all: a turn that was said stays said, even after what it said stops being true. [-Supersede happens-] {+Fact changes happen+} one stage later, [-in the fact files,-] where a [-judge closes-] {+fact is superseded, retracted or erased as a new revision and the old one keeps its history (J14 §7.3, three ways+} a fact [-line and leaves it in place, struck through, with a pointer to the line that replaced it (J14 §7.3).-] {+ends).+} The record entry the fact was drawn from is not touched. Which facts [-are closed-] {+change+} is [-J14's call (J14 §7);-] {+the writing paper's call;+} what a default search [-hides, and its per-query counts, are J2's-] {+hides is the finding paper's+} (J2 [-§8.1).-] {+§8.1, filters in a fixed order).+}"
  },
  {
   "section": "4.4 Forgetting: the tombstone",
   "old": "### 4.4 Forgetting: the tombstone",
   "new": null,
   "marked": "[-### 4.4 Forgetting: the tombstone-]"
  },
  {
   "section": "4.4 Forgetting: the tombstone",
   "old": "Two cases justify removing content: the owner asks to forget something about a person, or a line is shown to have been injected. J14 decides when either applies and removes the content from the fact files, leaving a tombstone there (J14 §7.7). The same content is almost always in the session record as well, because someone said it or a tool returned it. If the record kept it, the deletion would not hold: J2's text index covers the record (J2 §4.1), so the next search would find it again, and a range read would return it word for word.",
   "new": null,
   "marked": "[-Two cases justify removing content: the owner asks to forget something about a person, or a line is shown to have been injected. J14 decides when either applies and removes the content from the fact files, leaving a tombstone there (J14 §7.7). The same content is almost always in the session record as well, because someone said it or a tool returned it. If the record kept it, the deletion would not hold: J2's text index covers the record (J2 §4.1), so the next search would find it again, and a range read would return it word for word.-]"
  },
  {
   "section": "4.4 Erase and quarantine",
   "old": null,
   "new": "### 4.4 Erase and quarantine",
   "marked": "{+### 4.4 Erase and quarantine+}"
  },
  {
   "section": "4.4 Erase and quarantine",
   "old": null,
   "new": "Two cases call for treating an entry differently, and the series handles them with one policy. The writing paper decides when either applies and runs the deletion manifest over everything derived (J14 §7.7, erase and quarantine); this section says how each looks in the record.",
   "marked": "{+Two cases call for treating an entry differently, and the series handles them with one policy. The writing paper decides when either applies and runs the deletion manifest over everything derived (J14 §7.7, erase and quarantine); this section says how each looks in the record.+}"
  },
  {
   "section": "4.4 Erase and quarantine",
   "old": "So the record entry is redacted, and this is the only edit the record allows. The entry keeps its address, author and time. Its text, its owner's-words field and any tool result it holds are replaced by a tombstone that says content was removed, when, for which of the two reasons, and points to J14's receipt for the deletion. The tombstone holds no part of the content, not even a hash, because a hash of a short string such as a phone number can be confirmed by guessing. The redaction is also appended to the record as a harness entry, so the record still shows that something left, and when.",
   "new": "**Erase** is for privacy: the owner asks to forget something about a person. The record entry is redacted, the only edit the record allows. It keeps its address, author and time, and its text, its `owner_words`, its tags and any blob it holds are replaced by a tombstone that says content was removed, when, why, and which deletion receipt covers it. The tombstone holds no part of the content, not even a hash, because the hash of a short string such as a phone number can be confirmed by guessing. A blob is shared by every read that returned the same bytes (§4.1), so tombstoning one entry would leave those bytes readable through the others. An erase that reaches a blob therefore deletes the blob and tombstones every entry that references it, in any session. The redaction is also appended as a harness entry, so the record still shows that something left, and when. Everything derived is rebuilt from the redacted record: the text index drops the entry's rows, and every marker whose range covers it is written again (§5.4), which drops any string or sentence that came from it.",
   "marked": "[-So-] {+**Erase** is for privacy:+} the {+owner asks to forget something about a person. The+} record entry is redacted, [-and this is-] the only edit the record allows. [-The entry-] {+It+} keeps its address, author and [-time. Its-] {+time, and its+} text, its [-owner's-words field-] {+`owner_words`, its tags+} and any [-tool result-] {+blob+} it holds are replaced by a tombstone that says content was removed, when, [-for-] {+why, and+} which [-of the two reasons, and points to J14's-] {+deletion+} receipt [-for the deletion.-] {+covers it.+} The tombstone holds no part of the content, not even a hash, because [-a-] {+the+} hash of a short string such as a phone number can be confirmed by guessing. {+A blob is shared by every read that returned the same bytes (§4.1), so tombstoning one entry would leave those bytes readable through the others. An erase that reaches a blob therefore deletes the blob and tombstones every entry that references it, in any session.+} The redaction is also appended [-to the record-] as a harness entry, so the record still shows that something left, and [-when.-] {+when. Everything derived is rebuilt from the redacted record: the text index drops the entry's rows, and every marker whose range covers it is written again (§5.4), which drops any string or sentence that came from it.+}"
  },
  {
   "section": "4.4 Forgetting: the tombstone",
   "old": "Everything derived from the entry is rebuilt from the redacted record. The text index drops the entry's rows and indexes the tombstone. Every marker whose range covers the entry is written again from the record (§5.4), which drops any exact string or owner's sentence that came from it. Where one session has two transcripts (§4.5), both are redacted. A copy the runtime cannot edit, such as a provider's opaque compacted state, is named in J14's receipt as out of reach. Addresses do not move, so every pointer into the range still resolves, now to a tombstone (§8).",
   "new": null,
   "marked": "[-Everything derived from the entry is rebuilt from the redacted record. The text index drops the entry's rows and indexes the tombstone. Every marker whose range covers the entry is written again from the record (§5.4), which drops any exact string or owner's sentence that came from it. Where one session has two transcripts (§4.5), both are redacted. A copy the runtime cannot edit, such as a provider's opaque compacted state, is named in J14's receipt as out of reach. Addresses do not move, so every pointer into the range still resolves, now to a tombstone (§8).-]"
  },
  {
   "section": "4.4 Erase and quarantine",
   "old": null,
   "new": "**Quarantine** is for attack evidence: a line shown to have been injected. Nothing is edited. A harness entry is appended that flags the entry as untrusted, with the writing paper's decision attached. The content stays, because it is what happened and the evidence of the attack, but it is excluded from the window, from every marker (the covering markers are rebuilt without it), from ordinary range reads, which return a \"quarantined\" placeholder at its address, and from ordinary search (J2 §8.1, filters in a fixed order). It is visible only in an audit view.",
   "marked": "{+**Quarantine** is for attack evidence: a line shown to have been injected. Nothing is edited. A harness entry is appended that flags the entry as untrusted, with the writing paper's decision attached. The content stays, because it is what happened and the evidence of the attack, but it is excluded from the window, from every marker (the covering markers are rebuilt without it), from ordinary range reads, which return a \"quarantined\" placeholder at its address, and from ordinary search (J2 §8.1, filters in a fixed order). It is visible only in an audit view.+}"
  },
  {
   "section": "4.4 Erase and quarantine",
   "old": null,
   "new": "Either way addresses do not move, so every pointer still resolves (§8). Both transcripts of a session (§4.5) are treated alike, and copies in live sessions or on the controller's side go through the adapter (§6.6).",
   "marked": "{+Either way addresses do not move, so every pointer still resolves (§8). Both transcripts of a session (§4.5) are treated alike, and copies in live sessions or on the controller's side go through the adapter (§6.6).+}"
  },
  {
   "section": "4.4 Erase and quarantine",
   "old": null,
   "new": "For an erase, this stage fills in its rows of the writing paper's deletion manifest (J14 §7.7), with a completion status for each place: the runtime's record entries, the controller's own transcript, the blobs, the markers, and live sessions or provider state, reached through the adapter (§6.6, Appendix C). Each place is reported done, not present, or out of reach, and a copy out of reach is named.",
   "marked": "{+For an erase, this stage fills in its rows of the writing paper's deletion manifest (J14 §7.7), with a completion status for each place: the runtime's record entries, the controller's own transcript, the blobs, the markers, and live sessions or provider state, reached through the adapter (§6.6, Appendix C). Each place is reported done, not present, or out of reach, and a copy out of reach is named.+}"
  },
  {
   "section": "4.5 One record, not copies",
   "old": "Most deployments already have a lossless record: the runtime writes a transcript of every session, and a provider's command-line tool writes its own. The memory layer should not add a third, partial copy. A copy that keeps only some kinds of entry, say the agent's replies, is worse than none, because a range read against it returns an answer that looks complete and is not. The design is therefore an index over the transcript the serving runtime already writes, with addresses that resolve into that transcript. The memory layer writes its own entries only where no transcript exists: when an API's compaction leaves nothing readable (§6.4), and for the markers and maps it derives.",
   "new": "Most deployments already have a lossless record: the runtime writes a transcript of every session, and a provider's command-line tool writes its own. The memory layer should not add a third, partial copy. A copy that keeps only some kinds of entry, say the agent's replies, is worse than none, because a range read against it returns an answer that looks complete and is not. The record is therefore an index over the transcript the runtime already writes, plus the blob store of §4.1. The memory layer writes entries of its own only where no readable transcript exists (an API compaction that leaves nothing readable, §6.4) and for the markers and maps it derives.",
   "marked": "Most deployments already have a lossless record: the runtime writes a transcript of every session, and a provider's command-line tool writes its own. The memory layer should not add a third, partial copy. A copy that keeps only some kinds of entry, say the agent's replies, is worse than none, because a range read against it returns an answer that looks complete and is not. The [-design-] {+record+} is therefore an index over the transcript the [-serving-] runtime already writes, [-with addresses that resolve into that transcript.-] {+plus the blob store of §4.1.+} The memory layer writes {+entries of+} its own [-entries-] only where no {+readable+} transcript [-exists: when an API's-] {+exists (an API+} compaction {+that+} leaves nothing [-readable (§6.4),-] {+readable, §6.4)+} and for the markers and maps it derives."
  },
  {
   "section": "4.5 One record, not copies",
   "old": "Where two transcripts exist for one session (the runtime's and the provider tool's), the one the model actually read is the ground truth for what the model saw, and the runtime's is the ground truth for what the owner said. The index keeps both addresses.",
   "new": "Where two transcripts exist for one session, the one the model read is the ground truth for what the model saw, and the runtime's is the ground truth for what the owner said. A sequence map pairs each runtime address with the controller's own entry ID (Appendix C).",
   "marked": "Where two transcripts exist for one [-session (the runtime's and the provider tool's),-] {+session,+} the one the model [-actually-] read is the ground truth for what the model saw, and the runtime's is the ground truth for what the owner said. [-The index keeps both addresses.-] {+A sequence map pairs each runtime address with the controller's own entry ID (Appendix C).+}"
  },
  {
   "section": "4.6 When a turn is captured",
   "old": null,
   "new": "### 4.6 When a turn is captured",
   "marked": "{+### 4.6 When a turn is captured+}"
  },
  {
   "section": "4.6 When a turn is captured",
   "old": null,
   "new": "An owner turn is *captured*, the first of the series' statuses (§1.5), when its entry, with `owner_words`, is in the session record durably (written and flushed) and has its address. The runtime appends the turn from its own copy before the model call that answers it, so capture does not wait for a provider's transcript to catch up.",
   "marked": "{+An owner turn is *captured*, the first of the series' statuses (§1.5), when its entry, with `owner_words`, is in the session record durably (written and flushed) and has its address. The runtime appends the turn from its own copy before the model call that answers it, so capture does not wait for a provider's transcript to catch up.+}"
  },
  {
   "section": "4.6 When a turn is captured",
   "old": null,
   "new": "Until then the turn is pending, and the agent says nothing about having kept it. If the append fails (a full disk, a crash), the harness shows the turn as not captured and retries from its in-memory copy. After a crash, the restart reconciles the record with the controller's transcript through the sequence map and appends what is missing in the controller's order. A turn that cannot be recovered from either side is reported as lost; it never reads as kept. The tests are T10's (§10). Whether it then becomes accepted, retrievable, and active or enforced is for the other three stages, each with its own pending and failure states.",
   "marked": "{+Until then the turn is pending, and the agent says nothing about having kept it. If the append fails (a full disk, a crash), the harness shows the turn as not captured and retries from its in-memory copy. After a crash, the restart reconciles the record with the controller's transcript through the sequence map and appends what is missing in the controller's order. A turn that cannot be recovered from either side is reported as lost; it never reads as kept. The tests are T10's (§10). Whether it then becomes accepted, retrievable, and active or enforced is for the other three stages, each with its own pending and failure states.+}"
  },
  {
   "section": "4.7 Sessions that are never kept",
   "old": null,
   "new": "### 4.7 Sessions that are never kept",
   "marked": "{+### 4.7 Sessions that are never kept+}"
  },
  {
   "section": "4.7 Sessions that are never kept",
   "old": null,
   "new": "Some things should never reach the long-term side at all, and the place to stop them is capture, before anything is written to disk.",
   "marked": "{+Some things should never reach the long-term side at all, and the place to stop them is capture, before anything is written to disk.+}"
  },
  {
   "section": "4.7 Sessions that are never kept",
   "old": null,
   "new": "A **temporary session** keeps its record only for its own life, since compaction and range reads inside the session still need it. The record carries a temporary flag, and the long-term stages skip it: no fact is drawn from it, no lasting index row is built, no evidence is kept for learning. When the session ends, its record, blobs and markers are deleted, and the deletion writes a receipt like any other. Where the window controller offers its own setting for not retaining a session, the adapter turns it on; where it offers none, the owner is told at the start that the provider keeps its own copy.",
   "marked": "{+A **temporary session** keeps its record only for its own life, since compaction and range reads inside the session still need it. The record carries a temporary flag, and the long-term stages skip it: no fact is drawn from it, no lasting index row is built, no evidence is kept for learning. When the session ends, its record, blobs and markers are deleted, and the deletion writes a receipt like any other. Where the window controller offers its own setting for not retaining a session, the adapter turns it on; where it offers none, the owner is told at the start that the provider keeps its own copy.+}"
  },
  {
   "section": "4.7 Sessions that are never kept",
   "old": null,
   "new": "**Prohibited capture classes** are kinds of content that are never written in any session: credentials and keys by default, plus any class the owner names. A detector runs at append, before the write, and replaces a match with a typed placeholder (`[credential removed]`), so the raw bytes never reach the record. The model may already have read the value in the turn it arrived; markers built later carry only the placeholder. The detector will miss some; a miss found later is handled as an erase (§4.4).",
   "marked": "{+**Prohibited capture classes** are kinds of content that are never written in any session: credentials and keys by default, plus any class the owner names. A detector runs at append, before the write, and replaces a match with a typed placeholder (`[credential removed]`), so the raw bytes never reach the record. The model may already have read the value in the turn it arrived; markers built later carry only the placeholder. The detector will miss some; a miss found later is handled as an erase (§4.4).+}"
  },
  {
   "section": "5.1 The marker",
   "old": "![Two ways to free the context window. On the left, a model summarises the old span and the summary becomes the only copy; the next compaction summarises the summary. On the right, the span is already in the session record, so it leaves the window and a marker takes its place, carrying the range, the exact strings, the owner's instruction word for word, the failed attempt and the open item; the next compaction is written again from the record.](images/fig-2-compaction.png){width=80%}",
   "new": null,
   "marked": "[-![Two ways to free the context window. On the left, a model summarises the old span and the summary becomes the only copy; the next compaction summarises the summary. On the right, the span is already in the session record, so it leaves the window and a marker takes its place, carrying the range, the exact strings, the owner's instruction word for word, the failed attempt and the open item; the next compaction is written again from the record.](images/fig-2-compaction.png){width=80%}-]"
  },
  {
   "section": "5.1 The marker",
   "old": "A marker is a pointer with a short, fixed shape. Figure 2 sets it beside a narrative summary of the same span. A marker carries, in this order:",
   "new": "A marker is a pointer with a short, fixed shape, an ID and a version. It carries, in this order:",
   "marked": "A marker is a pointer with a short, fixed [-shape. Figure 2 sets it beside-] {+shape, an ID and+} a [-narrative summary of the same span. A marker-] {+version. It+} carries, in this order:"
  },
  {
   "section": "5.1 The marker",
   "old": "1. The range: the session and the first and last sequence numbers. 2. The owner's words: every instruction, preference and correction the owner gave inside the range, verbatim. 3. Exact strings: the paths, hashes, host names, identifiers, numbers, error lines and times that appear in the range, copied character for character, most-referenced first. 4. Decisions and negative results: one line each (\"chose X over Y\", \"tried Z: failed with E\"), each with the address of the entry that shows it. 5. Open items: what was started and not finished, one line each with an address.",
   "new": "1. The range: the session and the first and last sequence numbers. 2. The owner's words: every instruction, preference and correction the owner gave inside the range, verbatim, within the budget of §5.5. 3. Exact strings: the paths, hashes, host names, identifiers, numbers, error lines and times in the range, copied character for character, most-referenced first. 4. Decisions and negative results: one line each (\"chose X over Y\", \"tried Z: failed with E\"), each with the address of the entry that shows it. 5. Open items: what was started and not finished, one line each with an address.",
   "marked": "1. The range: the session and the first and last sequence numbers. 2. The owner's words: every instruction, preference and correction the owner gave inside the range, [-verbatim.-] {+verbatim, within the budget of §5.5.+} 3. Exact strings: the paths, hashes, host names, identifiers, numbers, error lines and times [-that appear-] in the range, copied character for character, most-referenced first. 4. Decisions and negative results: one line each (\"chose X over Y\", \"tried Z: failed with E\"), each with the address of the entry that shows it. 5. Open items: what was started and not finished, one line each with an address."
  },
  {
   "section": "5.1 The marker",
   "old": "The exact strings are there for two readers. The model reads them and can often act without pulling anything: the hash is right there. And the search that later looks for the span finds it by the same strings the owner will use when he asks (\"the nginx path\", \"that hash\"). The strings are what an index can hold on to.",
   "new": "The exact strings serve two readers. The model reads them and can often act without pulling anything: the hash is right there. And a later search finds the span by the same strings the owner will use when he asks (\"the nginx path\", \"that hash\").",
   "marked": "The exact strings [-are there for-] {+serve+} two readers. The model reads them and can often act without pulling anything: the hash is right there. And [-the-] {+a later+} search [-that later looks for-] {+finds+} the span [-finds it-] by the same strings the owner will use when he asks (\"the nginx path\", \"that [-hash\"). The strings are what an index can hold on to.-] {+hash\").+}"
  },
  {
   "section": "5.2 Word for word, one line, or a pointer",
   "old": "| Content | Kept in the marker | Why | |------------------|-----------|---------------------| | Owner's instructions, preferences, corrections | word for word | the owner should never have to say them twice; a paraphrase changes what was asked | | Exact strings (paths, hashes, hosts, errors, times) | word for word | a paraphrase of a string is a different string | | Decisions, failed attempts, open items | one line each, with an address | the line says that it happened; the address gives how | | Agent's reasoning and replies | pointer only | recoverable from the record when needed | | Tool output that can be reproduced (a file on disk) | pointer and content hash | read the file again; the hash says if it changed | | Tool output that cannot be reproduced | pointer only | the record holds it whole | | Harness text (time stamps, injected rules) | nothing | the harness injects it again; it is not memory |",
   "new": "| Content | Kept in the marker | Why | |------------------|-----------|---------------------| | Owner's instructions, preferences, corrections | word for word, within the budget of §5.5 | the owner should never have to say them twice; a paraphrase changes what was asked | | Exact strings (paths, hashes, hosts, errors, times) | word for word, capped by count | a paraphrase of a string is a different string | | Decisions, failed attempts, open items | one line each, with an address | the line says that it happened; the address gives how | | Agent's reasoning and replies | pointer only | the record holds them | | Tool output, file contents included | pointer only | the record holds it whole, files as blobs (§4.1) | | Harness text (time stamps, injected rules) | nothing | the harness injects it again; it is not memory |",
   "marked": "| Content | Kept in the marker | Why | |------------------|-----------|---------------------| | Owner's instructions, preferences, corrections | word for [-word-] {+word, within the budget of §5.5+} | the owner should never have to say them twice; a paraphrase changes what was asked | | Exact strings (paths, hashes, hosts, errors, times) | word for [-word-] {+word, capped by count+} | a paraphrase of a string is a different string | | Decisions, failed attempts, open items | one line each, with an address | the line says that it happened; the address gives how | | Agent's reasoning and replies | pointer only | [-recoverable from-] the record [-when needed-] {+holds them+} | | Tool [-output that can be reproduced (a-] {+output,+} file [-on disk) | pointer and content hash | read the file again; the hash says if it changed | | Tool output that cannot be reproduced-] {+contents included+} | pointer only | the record holds it [-whole-] {+whole, files as blobs (§4.1)+} | | Harness text (time stamps, injected rules) | nothing | the harness injects it again; it is not memory |"
  },
  {
   "section": "5.2 Word for word, one line, or a pointer",
   "old": "The owner's words have a budget, because in a long session they can grow. In a working session the owner writes much less than the tools do, so the budget should rarely bind; when it does, the instructions and corrections stay verbatim and the rest of the owner's text becomes a pointer. Deciding which of the owner's sentences are instructions needs a cheap judge; a sentence the judge is unsure of is kept verbatim, because the cost of keeping a sentence is a few tokens and the cost of losing an instruction is the owner's trust. The judge is one classifier of owner sentences shared by three stages: it picks the instructions here, finds corrections for J5's detector (J5 §3.1) and stamps a fact \"told by the owner\" in J14 (J14 §8.1). J5 owns it. Whether these corrections later become standing rules is learning, J5's stage; this stage only makes sure they survive the session.",
   "new": null,
   "marked": "[-The owner's words have a budget, because in a long session they can grow. In a working session the owner writes much less than the tools do, so the budget should rarely bind; when it does, the instructions and corrections stay verbatim and the rest of the owner's text becomes a pointer. Deciding which of the owner's sentences are instructions needs a cheap judge; a sentence the judge is unsure of is kept verbatim, because the cost of keeping a sentence is a few tokens and the cost of losing an instruction is the owner's trust. The judge is one classifier of owner sentences shared by three stages: it picks the instructions here, finds corrections for J5's detector (J5 §3.1) and stamps a fact \"told by the owner\" in J14 (J14 §8.1). J5 owns it. Whether these corrections later become standing rules is learning, J5's stage; this stage only makes sure they survive the session.-]"
  },
  {
   "section": "5.2 Word for word, one line, or a pointer",
   "old": null,
   "new": "Which of the owner's sentences are instructions comes from the classifier tags stored at append (§4.1). A sentence the classifier is unsure of, or could not tag, is kept verbatim, because keeping a sentence costs a few tokens and losing an instruction costs the owner's trust. Whether a correction later becomes a standing rule is the learning paper's question; this stage makes sure it survives the session.",
   "marked": "{+Which of the owner's sentences are instructions comes from the classifier tags stored at append (§4.1). A sentence the classifier is unsure of, or could not tag, is kept verbatim, because keeping a sentence costs a few tokens and losing an instruction costs the owner's trust. Whether a correction later becomes a standing rule is the learning paper's question; this stage makes sure it survives the session.+}"
  },
  {
   "section": "5.3 What leaves first",
   "old": "1. Tool output that can be reproduced (files still on disk). 2. Tool output that cannot be reproduced but is in the record. 3. The agent's own reasoning and replies. 4. The owner's messages, except the instructions, which become part of the marker.",
   "new": "1. Tool output whose source still holds it unchanged (a file still on disk at the read version). 2. Other tool output. 3. The agent's own reasoning and replies. 4. The owner's messages, except the instructions, which move into the marker.",
   "marked": "1. Tool output [-that can be reproduced (files-] {+whose source still holds it unchanged (a file+} still on [-disk).-] {+disk at the read version).+} 2. [-Tool output that cannot be reproduced but is in the record.-] {+Other tool output.+} 3. The agent's own reasoning and replies. 4. The owner's messages, except the instructions, which [-become part of-] {+move into+} the marker."
  },
  {
   "section": "5.3 What leaves first",
   "old": "Never evicted: the system text, the always-loaded files, the markers themselves, and the current task's own short statement. Within each class, older content leaves before newer, since recent content is the best available guess at what will be needed next.",
   "new": "Never evicted: the system text, the always-loaded files and the current task's own short statement. Markers are not evicted either; they merge (§5.5). Within each class, older content leaves before newer, since recent content is the best available guess at what will be needed next. This is the practical stand-in for Belady's rule: we cannot know what will be needed furthest in the future, but we can know what costs least to get back.",
   "marked": "Never evicted: the system text, the always-loaded [-files, the markers themselves,-] {+files+} and the current task's own short statement. {+Markers are not evicted either; they merge (§5.5).+} Within each class, older content leaves before newer, since recent content is the best available guess at what will be needed [-next.-] {+next. This is the practical stand-in for Belady's rule: we cannot know what will be needed furthest in the future, but we can know what costs least to get back.+}"
  },
  {
   "section": "5.3 What leaves first",
   "old": "This order is cheapest-to-recover first, which is the practical stand-in for Belady's rule: we cannot know what will be needed furthest in the future, but we can know what costs least to get back. The same order arose independently in the provider world, where context editing clears the oldest tool results first (Anthropic, 2026d).",
   "new": null,
   "marked": "[-This order is cheapest-to-recover first, which is the practical stand-in for Belady's rule: we cannot know what will be needed furthest in the future, but we can know what costs least to get back. The same order arose independently in the provider world, where context editing clears the oldest tool results first (Anthropic, 2026d).-]"
  },
  {
   "section": "5.3 What leaves first",
   "old": "The selector reports what it evicted, by class, and the bytes in each class add up to the total it removed. It chooses from the window as the model will read it on the next call, after every other step that moves content out (a store for large tool output, a provider's clearing), so each class it names is a class that is still in the window.",
   "new": "The selector reports what it evicted, by class, adding up to the total removed, and it chooses from the window as the model will read it on the next call, after any provider clearing, so each class it names is still there.",
   "marked": "The selector reports what it evicted, by class, [-and the bytes in each class add-] {+adding+} up to the total {+removed, and+} it [-removed. It-] chooses from the window as the model will read it on the next call, after [-every other step that moves content out (a store for large tool output, a provider's clearing),-] {+any provider clearing,+} so each class it names is [-a class that is-] still [-in the window.-] {+there.+}"
  },
  {
   "section": "5.4 Written from the record, never from the last marker",
   "old": "When a range that already contains a marker is evicted again, the new marker is built from the record entries the old marker pointed to, not from the old marker's text. This is the rule that stops context collapse. A summary of a summary loses detail at every round; a marker written from the record has the same detail on the hundredth compaction as on the first.",
   "new": "When a range that already contains a marker is evicted again, the new marker is built from the record entries the old marker pointed to, not from the old marker's text. This rule stops context collapse. A summary of a summary loses detail at every round; a marker written from the record has the same detail on the hundredth compaction as on the first.",
   "marked": "When a range that already contains a marker is evicted again, the new marker is built from the record entries the old marker pointed to, not from the old marker's text. This [-is the-] rule [-that-] stops context collapse. A summary of a summary loses detail at every round; a marker written from the record has the same detail on the hundredth compaction as on the first."
  },
  {
   "section": "5.5 Merging markers",
   "old": "### 5.5 Merging markers",
   "new": null,
   "marked": "[-### 5.5 Merging markers-]"
  },
  {
   "section": "5.5 Merging markers, and the budget for the owner's words",
   "old": null,
   "new": "### 5.5 Merging markers, and the budget for the owner's words",
   "marked": "{+### 5.5 Merging markers, and the budget for the owner's words+}"
  },
  {
   "section": "5.5 Merging markers, and the budget for the owner's words",
   "old": null,
   "new": "Markers have a total budget in the window, and the owner's instructions inside them have a budget of their own. Both are fixed by the deployment; the guarantees below do not depend on their values.",
   "marked": "{+Markers have a total budget in the window, and the owner's instructions inside them have a budget of their own. Both are fixed by the deployment; the guarantees below do not depend on their values.+}"
  },
  {
   "section": "5.5 Merging markers, and the budget for the owner's words",
   "old": "Adjacent markers merge: two markers covering consecutive ranges become one covering both, with their owner's words, exact strings and lines combined. The combined lists are capped by count, and what falls off the end is still in the record and still reachable through the merged range. Each merge is another compaction, so §5.4 applies: the merged marker is written from the record.",
   "new": "When the markers outgrow their budget, adjacent markers merge into one covering both ranges. Each merge is a compaction, so §5.4 applies: the merged marker is written from the record. Its lists of exact strings and one-line items are capped by count, and what falls off is still in the record, reachable through the merged range.",
   "marked": "[-Adjacent-] {+When the+} markers [-merge: two-] {+outgrow their budget, adjacent+} markers [-covering consecutive ranges become-] {+merge into+} one covering [-both, with their owner's words, exact strings and lines combined. The combined lists are capped by count, and what falls off the end is still in the record and still reachable through the merged range.-] {+both ranges.+} Each merge is [-another-] {+a+} compaction, so §5.4 applies: the merged marker is written from the [-record.-] {+record. Its lists of exact strings and one-line items are capped by count, and what falls off is still in the record, reachable through the merged range.+}"
  },
  {
   "section": "5.5 Merging markers, and the budget for the owner's words",
   "old": null,
   "new": "The owner's instructions are kept verbatim for as long as they fit their budget. Untagged sentences (§4.1) count against this budget as instructions until the night tags them (J5 §6.2, the nightly auditor); a later tag of \"none\" releases their place. A long session can outgrow any budget, so the guarantee has two parts. Every instruction stays **recoverable** word for word through its address, for as long as the record lives and the owner has not had it erased. And it stays **in the window** word for word while the instructions fit. When a new instruction would exceed the budget, the oldest instruction in the window leaves its marker and is replaced by a one-line pointer: when it was said, its first few words and its record address. The agent tells the owner in its next reply which instructions moved out of view, and the compaction receipt lists them (§7.4). An instruction the owner wants to hold beyond the session belongs in the always-loaded file, which is the writing and learning papers' to admit (J14 §8.2, what each fact may become; J5 §7, keeping the always-loaded file honest).",
   "marked": "{+The owner's instructions are kept verbatim for as long as they fit their budget. Untagged sentences (§4.1) count against this budget as instructions until the night tags them (J5 §6.2, the nightly auditor); a later tag of \"none\" releases their place. A long session can outgrow any budget, so the guarantee has two parts. Every instruction stays **recoverable** word for word through its address, for as long as the record lives and the owner has not had it erased. And it stays **in the window** word for word while the instructions fit. When a new instruction would exceed the budget, the oldest instruction in the window leaves its marker and is replaced by a one-line pointer: when it was said, its first few words and its record address. The agent tells the owner in its next reply which instructions moved out of view, and the compaction receipt lists them (§7.4). An instruction the owner wants to hold beyond the session belongs in the always-loaded file, which is the writing and learning papers' to admit (J14 §8.2, what each fact may become; J5 §7, keeping the always-loaded file honest).+}"
  },
  {
   "section": "5.5 Merging markers, and the budget for the owner's words",
   "old": null,
   "new": "So the promise to the owner is recoverability, not permanent residence in the window, and when residence ends he is told. T9 (§10) tests a session whose instructions alone exceed the budget.",
   "marked": "{+So the promise to the owner is recoverability, not permanent residence in the window, and when residence ends he is told. T9 (§10) tests a session whose instructions alone exceed the budget.+}"
  },
  {
   "section": "6. Who Controls the Window",
   "old": "## 6. Who Owns the Window",
   "new": "## 6. Who Controls the Window",
   "marked": "## 6. Who [-Owns-] {+Controls+} the Window"
  },
  {
   "section": "6. Who Owns the Window",
   "old": "![Three owners of the context window. When the agent's own runtime builds every model call, the memory layer compacts with pointers itself. When a provider's command-line agent decides when to compact, the memory layer acts through that tool's hooks. When a provider's API clears tool results or compacts on its servers, the memory layer keeps its own session record and puts the markers back after each compaction. In all three, the session record is the ground truth and every marker points into it.](images/fig-3-owners.png){width=62%}",
   "new": null,
   "marked": "[-![Three owners of the context window. When the agent's own runtime builds every model call, the memory layer compacts with pointers itself. When a provider's command-line agent decides when to compact, the memory layer acts through that tool's hooks. When a provider's API clears tool results or compacts on its servers, the memory layer keeps its own session record and puts the markers back after each compaction. In all three, the session record is the ground truth and every marker points into it.](images/fig-3-owners.png){width=62%}-]"
  },
  {
   "section": "6.1 Three window controllers",
   "old": "### 6.1 Three owners",
   "new": "### 6.1 Three window controllers",
   "marked": "### 6.1 Three [-owners-] {+window controllers+}"
  },
  {
   "section": "6.1 Three window controllers",
   "old": "The owner of a context window is whoever decides, on each call, what the model reads. There are three cases, shown in Figure 3, and one agent can move between them as it switches models or tools during a day:",
   "new": "The window controller is whoever decides, on each call, what the model reads. There are three cases, shown in Figure 2, and one agent can move between them as it switches models or tools during a day:",
   "marked": "The [-owner of a context-] window {+controller+} is whoever decides, on each call, what the model reads. There are three cases, shown in Figure [-3,-] {+2,+} and one agent can move between them as it switches models or tools during a day:"
  },
  {
   "section": "6.1 Three window controllers",
   "old": "- The runtime owns the window. The agent's runtime assembles every call to the model API from its own state. Compaction is the runtime's to do. - A provider's tool owns the window. The runtime drives a provider's command-line agent, which keeps its own conversation, decides when to compact, and writes the summary. The runtime sees what goes in and what comes out, but not every call the tool makes inside. - A provider's API owns part of the window. The runtime builds the calls, but the API clears old tool results or compacts on its servers once a threshold is crossed, and returns either a readable summary or an opaque item.",
   "new": "- The runtime builds every call to the model API from its own state. Compaction is the runtime's to do. - A provider's command-line tool keeps its own conversation, decides when to compact and writes the summary. The runtime sees what goes in and what comes out, but not every call the tool makes inside. - A provider's API takes the calls the runtime builds, then clears old tool results or compacts on its servers once a threshold is crossed, and returns either a readable summary or an opaque item.",
   "marked": "- The runtime [-owns the window. The agent's runtime assembles-] {+builds+} every call to the model API from its own state. Compaction is the runtime's to do. - A provider's {+command-line+} tool [-owns the window. The runtime drives a provider's command-line agent, which-] keeps its own conversation, decides when to [-compact,-] {+compact+} and writes the summary. The runtime sees what goes in and what comes out, but not every call the tool makes inside. - A provider's API [-owns part of-] {+takes+} the [-window. The-] {+calls the+} runtime [-builds the calls, but the API-] {+builds, then+} clears old tool results or compacts on its servers once a threshold is crossed, and returns either a readable summary or an opaque item."
  },
  {
   "section": "6.1 Three window controllers",
   "old": "The memory layer starts every session by noting which case it is in, and it re-checks when the model or tool changes. Everything else in this section follows from that one field.",
   "new": "The memory layer notes which case it is in at the start of every session, and again when the model or tool changes.",
   "marked": "The memory layer [-starts every session by noting-] {+notes+} which case it is [-in,-] {+in at the start of every session,+} and [-it re-checks-] {+again+} when the model or tool [-changes. Everything else in this section follows from that one field.-] {+changes.+}"
  },
  {
   "section": "6.1 Three window controllers",
   "old": null,
   "new": "![The three window controllers and what the memory layer does in each: before a compaction, after it, and how it confirms that the marker reached the model. The bottom row is what the memory layer can know about the model's view in each case. In all three, the session record is the ground truth and every marker points into it.](images/fig-2-controllers.png){width=86%}",
   "marked": "{+![The three window controllers and what the memory layer does in each: before a compaction, after it, and how it confirms that the marker reached the model. The bottom row is what the memory layer can know about the model's view in each case. In all three, the session record is the ground truth and every marker points into it.](images/fig-2-controllers.png){width=86%}+}"
  },
  {
   "section": "6.2 When the runtime controls the window",
   "old": "### 6.2 When the runtime owns the window",
   "new": "### 6.2 When the runtime controls the window",
   "marked": "### 6.2 When the runtime [-owns-] {+controls+} the window"
  },
  {
   "section": "6.2 When the runtime controls the window",
   "old": "This is the case §5 describes. The runtime builds markers, evicts by the order of §5.3 and places markers where the evicted range was. It also chooses when, by the price rule of §7. Nothing else is needed.",
   "new": "This is the case §5 describes. The runtime chooses when to compact by the price rule of §7, evicts by the order of §5.3, builds the markers and places them where the evicted range was. It built the call, so it knows exactly what the model read.",
   "marked": "This is the case §5 describes. The runtime [-builds markers,-] {+chooses when to compact by the price rule of §7,+} evicts by the order of [-§5.3-] {+§5.3, builds the markers+} and places [-markers-] {+them+} where the evicted range was. It [-also chooses when, by-] {+built+} the [-price rule of §7. Nothing else is needed.-] {+call, so it knows exactly what the model read.+}"
  },
  {
   "section": "6.3 When a provider's tool controls the window",
   "old": "### 6.3 When a provider's tool owns the window",
   "new": "### 6.3 When a provider's tool controls the window",
   "marked": "### 6.3 When a provider's tool [-owns-] {+controls+} the window"
  },
  {
   "section": "6.3 When a provider's tool controls the window",
   "old": "The runtime cannot compact a window it does not build. It acts through the tool's hooks, which current tools expose (Anthropic, 2026b):",
   "new": "The runtime cannot compact a window it does not build. It acts through the tool's hooks (Anthropic, 2026b):",
   "marked": "The runtime cannot compact a window it does not build. It acts through the tool's [-hooks, which current tools expose-] {+hooks+} (Anthropic, 2026b):"
  },
  {
   "section": "6.3 When a provider's tool controls the window",
   "old": "- Before compaction. The hook makes sure the record is complete up to this moment: it appends anything the runtime has not yet recorded, reading the tool's own transcript where needed (the tool writes it in the background, so the hook waits for it to catch up or reads the stream it already has). It then builds the markers for the range the tool is about to summarise, from the record. The hook could block the compaction, but blocking a full window stalls the session, so the default is to let it run. - After compaction. The session-start event that follows a compaction adds text to the new context. The hook adds the markers and the owner's words for the compacted range. The tool's summary stays; the markers sit beside it and give the model what the summary dropped, with pointers to get the rest. - Every turn. Text the runtime injects at the start of each turn does reach the tool's model, so the push of relevant memory (J2's stage) works here as anywhere else.",
   "new": "- Before compaction. The hook makes the record complete up to this moment: it copies into the record anything the runtime has not yet recorded, reading the tool's own transcript where needed. The hooks do not say which part the tool is about to summarise, so the adapter takes everything since the previous compaction (or the session start) as the range, and builds its markers from the record. A marker for a turn the tool happens to keep verbatim costs a few tokens and does no harm. The pending markers are written durably before the hook returns. The hook could block the compaction, but blocking a compaction the tool needs to recover from a full window makes the request fail, so the default is to let it run. - After compaction. The event after compaction hands the hook the summary the tool wrote; the adapter stores it in the record as a harness entry. The session-start event that follows a compaction adds text to the new context before the next model call, and the adapter adds the markers there, beside the tool's summary. - Every turn. Text injected with each prompt reaches the tool's model, so the push of relevant memory, the finding paper's stage, works here as anywhere else, and a marker whose delivery failed is sent again this way.",
   "marked": "- Before compaction. The hook makes [-sure-] the record [-is-] complete up to this moment: it [-appends-] {+copies into the record+} anything the runtime has not yet recorded, reading the tool's own transcript where [-needed (the tool writes it in the background, so the hook waits for it to catch up or reads the stream it already has). It then builds the markers for the range-] {+needed. The hooks do not say which part+} the tool is about to summarise, {+so the adapter takes everything since the previous compaction (or the session start) as the range, and builds its markers+} from the record. {+A marker for a turn the tool happens to keep verbatim costs a few tokens and does no harm. The pending markers are written durably before the hook returns.+} The hook could block the compaction, but blocking a {+compaction the tool needs to recover from a+} full window [-stalls-] {+makes+} the [-session,-] {+request fail,+} so the default is to let it run. - After compaction. The {+event after compaction hands the hook the summary the tool wrote; the adapter stores it in the record as a harness entry. The+} session-start event that follows a compaction adds text to the new [-context. The hook-] {+context before the next model call, and the adapter+} adds the markers [-and-] {+there, beside+} the [-owner's words for the compacted range. The-] tool's [-summary stays; the markers sit beside it and give the model what the summary dropped, with pointers to get the rest.-] {+summary.+} - Every turn. Text [-the runtime injects at the start of-] {+injected with+} each [-turn does reach-] {+prompt reaches+} the tool's model, so the push of relevant [-memory (J2's stage)-] {+memory, the finding paper's stage,+} works here as anywhere [-else.-] {+else, and a marker whose delivery failed is sent again this way.+}"
  },
  {
   "section": "6.3 When a provider's tool controls the window",
   "old": "The tool's own summary is not wasted: it is a readable account of the gist, and for many turns the gist is enough. What the markers add is the part a gist cannot hold.",
   "new": "The tool's summary stays: for many turns the gist is enough, and the markers add what a gist cannot hold.",
   "marked": "The tool's [-own-] summary [-is not wasted: it is a readable account of the gist, and-] {+stays:+} for many turns the gist is [-enough. What-] {+enough, and+} the markers add [-is the part-] {+what+} a gist cannot hold."
  },
  {
   "section": "6.4 When a provider's API controls part of the window",
   "old": "### 6.4 When a provider's API owns part of the window",
   "new": "### 6.4 When a provider's API controls part of the window",
   "marked": "### 6.4 When a provider's API [-owns-] {+controls+} part of the window"
  },
  {
   "section": "6.4 When a provider's API controls part of the window",
   "old": "Here the runtime builds every call but the API may change the conversation after it is sent. Two moves cover it. First, the runtime keeps its own record of everything it sent and everything that came back. With tool-result clearing this is easy, since the client still holds the full history; after a server-side compaction the runtime's record may be the only readable copy, and when the compacted state is opaque, it is certainly the only one. Second, the runtime uses the API's own controls to protect what must stay: it names the tools whose results must never be cleared and sets the minimum amount to clear at once, so a small clearing does not break the cache for a small gain. After each compaction event, it re-sends the markers and owner's words for the compacted range, in the same place every time so the prefix stays stable.",
   "new": "Here the runtime builds every call, but the API may change the conversation after it is sent. Two moves cover it. First, the runtime keeps its own record of everything it sent and everything that came back. With tool-result clearing the client still holds the full history; after a server-side compaction the runtime's record may be the only readable copy, and when the compacted state is opaque it certainly is. Second, the runtime uses the API's own controls to protect what must stay: it names the tools whose results must never be cleared and sets the minimum amount to clear at once, so a small clearing does not break the cache for a small gain. After each compaction event it re-sends the markers for the compacted range, in the same place every time, so the prefix stays stable.",
   "marked": "Here the runtime builds every [-call-] {+call,+} but the API may change the conversation after it is sent. Two moves cover it. First, the runtime keeps its own record of everything it sent and everything that came back. With tool-result clearing [-this is easy, since-] the client still holds the full history; after a server-side compaction the runtime's record may be the only readable copy, and when the compacted state is [-opaque,-] {+opaque+} it [-is-] certainly [-the only one.-] {+is.+} Second, the runtime uses the API's own controls to protect what must stay: it names the tools whose results must never be cleared and sets the minimum amount to clear at once, so a small clearing does not break the cache for a small gain. After each compaction [-event,-] {+event+} it re-sends the markers [-and owner's words-] for the compacted range, in the same place every [-time-] {+time,+} so the prefix stays stable."
  },
  {
   "section": "6.5 Never compact a copy nobody reads",
   "old": "A runtime that keeps a mirror of a conversation that a provider's tool owns will see the mirror grow and will be tempted to compact it. That compaction costs time and changes nothing the model reads. The rule: in the provider-tool case the runtime does not compact its mirror at all; it writes a compaction receipt for each of the provider's compactions (§7.4) and builds markers for them (§6.3). A compaction is counted only when it changed what the model reads.",
   "new": "A runtime that mirrors a conversation a provider's tool controls will see the mirror grow and will be tempted to compact it. That compaction costs time and changes nothing the model reads. So in the provider-tool case the runtime does not compact its mirror at all; it writes a compaction receipt for each of the tool's compactions (§7.4) and builds markers for them (§6.3). A compaction is counted only when it changed what the model reads.",
   "marked": "A runtime that [-keeps a mirror of-] {+mirrors+} a conversation [-that-] a provider's tool [-owns-] {+controls+} will see the mirror grow and will be tempted to compact it. That compaction costs time and changes nothing the model reads. [-The rule:-] {+So+} in the provider-tool case the runtime does not compact its mirror at all; it writes a compaction receipt for each of the [-provider's-] {+tool's+} compactions (§7.4) and builds markers for them (§6.3). A compaction is counted only when it changed what the model reads."
  },
  {
   "section": "6.6 The adapter contract",
   "old": null,
   "new": "### 6.6 The adapter contract",
   "marked": "{+### 6.6 The adapter contract+}"
  },
  {
   "section": "6.6 The adapter contract",
   "old": null,
   "new": "All three paths share one versioned contract, given in full in Appendix C. Each adapter declares its controller's capabilities and re-detects them when the model or tool changes; a capability it cannot confirm counts as absent. Each compaction moves through durable pending states (detected, flushed, markers built, injected, acknowledged, closed), each appended to the record before the next step starts, so a crash between hooks resumes where it stopped. A sequence map pairs runtime addresses with the controller's entry IDs (§4.5). A marker counts as acknowledged when its ID appears in the next call the runtime sent or in the tool's transcript; until then the range is not treated as in view, the per-turn injection sends it again, and the receipt counts the turns run without it. Every receipt carries a knowledge level: in the runtime case the memory layer knows what the model read; otherwise it has recorded what it sent (and, for a tool, the summary the tool wrote), and with an opaque compacted state it cannot know what the model kept. No claim about the model's view goes beyond that level. Each missing capability has a named fallback, and the receipt names every fallback used.",
   "marked": "{+All three paths share one versioned contract, given in full in Appendix C. Each adapter declares its controller's capabilities and re-detects them when the model or tool changes; a capability it cannot confirm counts as absent. Each compaction moves through durable pending states (detected, flushed, markers built, injected, acknowledged, closed), each appended to the record before the next step starts, so a crash between hooks resumes where it stopped. A sequence map pairs runtime addresses with the controller's entry IDs (§4.5). A marker counts as acknowledged when its ID appears in the next call the runtime sent or in the tool's transcript; until then the range is not treated as in view, the per-turn injection sends it again, and the receipt counts the turns run without it. Every receipt carries a knowledge level: in the runtime case the memory layer knows what the model read; otherwise it has recorded what it sent (and, for a tool, the summary the tool wrote), and with an opaque compacted state it cannot know what the model kept. No claim about the model's view goes beyond that level. Each missing capability has a named fallback, and the receipt names every fallback used.+}"
  },
  {
   "section": "6.6 The adapter contract",
   "old": null,
   "new": "The adapter also serves two other stages. Its compaction receipts are published as eviction events, which the finding paper's read ledger uses to forget that it had already shown a file (J2 §6.7, what the context already holds). And an erase that reaches a live session goes through it: in the runtime case it rebuilds the window without the content; for a tool or an API it ends or compacts the live session and uses the controller's own deletion control where one exists, and otherwise reports the copy as out of reach in the writing paper's deletion manifest (J14 §7.7, erase and quarantine).",
   "marked": "{+The adapter also serves two other stages. Its compaction receipts are published as eviction events, which the finding paper's read ledger uses to forget that it had already shown a file (J2 §6.7, what the context already holds). And an erase that reaches a live session goes through it: in the runtime case it rebuilds the window without the content; for a tool or an API it ends or compacts the live session and uses the controller's own deletion control where one exists, and otherwise reports the copy as out of reach in the writing paper's deletion manifest (J14 §7.7, erase and quarantine).+}"
  },
  {
   "section": "7.1 Forced and elective",
   "old": "A compaction is forced when the next call would not fit the window: there is no choice about whether, only about what to evict (§5.3) and what to leave (§5.1). A compaction is elective when the window still has room but keeping a span costs more than evicting it, or when a smaller window would be read better (§1.2). Context editing that clears tool results long before the limit is elective. Elective compaction is where the price matters, because it is the one we can decline.",
   "new": "A compaction is forced when the next call would not fit the window: there is no choice about whether, only about what to evict (§5.3) and what to leave (§5.1). A compaction is elective when the window still has room but keeping a span costs more than evicting it, or when a smaller window would be read better (§1.2). Context editing that clears tool results long before the limit is elective. The price matters for elective compaction, because it is the one we can decline.",
   "marked": "A compaction is forced when the next call would not fit the window: there is no choice about whether, only about what to evict (§5.3) and what to leave (§5.1). A compaction is elective when the window still has room but keeping a span costs more than evicting it, or when a smaller window would be read better (§1.2). Context editing that clears tool results long before the limit is elective. [-Elective compaction is where the-] {+The+} price [-matters,-] {+matters for elective compaction,+} because it is the one we can decline."
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "With prompt caching, the part of the context that did not change since the last call is read from cache at a fraction of the input price, and anything after the first changed token is written to cache again at a premium (Anthropic, 2026c; Ji, 2025). Evicting a span from the middle of the window changes everything after it. So eviction has a one-time cost (rewriting the suffix into the cache) and a running saving (no longer reading the span on every turn), minus the cost of the pulls the eviction will cause.",
   "new": "With prompt caching, the part of the context that did not change since the last call is read from cache at a fraction of the input price, and everything after the first changed token is written to cache again at a premium (Anthropic, 2026c; Ji, 2025). Evicting a span from the middle of the window changes everything after it. So eviction has one-time costs, a running saving, and the cost of the pulls it causes.",
   "marked": "With prompt caching, the part of the context that did not change since the last call is read from cache at a fraction of the input price, and [-anything-] {+everything+} after the first changed token is written to cache again at a premium (Anthropic, 2026c; Ji, 2025). Evicting a span from the middle of the window changes everything after it. So eviction has [-a-] one-time [-cost (rewriting the suffix into the cache) and-] {+costs,+} a running [-saving (no longer reading the span on every turn), minus-] {+saving, and+} the cost of the pulls [-the eviction will cause.-] {+it causes.+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "In J2's notation and prices (J2 §7.1), a cache read costs $r$, a cache write $w$ and an output token $g$, as multiples of the base input price. Let the span have $S$ tokens, the marker $m$ tokens, and let $A$ tokens follow the span in the window. Reading an evicted span back is a pull, which costs a full turn: it re-reads the $L$ tokens of cached context, writes the $R$ tokens it returns, and produces $o$ output tokens,",
   "new": "We use the finding paper's notation and prices (J2 §7.1, a read costs a turn): a cache read costs $r$, a cache write $w$ and an output token $g$, as multiples of the base input price. Let the span have $S$ tokens, the marker $m$ tokens, and let $A$ tokens follow the span in the window. Let $q_{\\text{turn}}$ be the probability that a given later turn of the same session pulls from the evicted span (horizon: one later turn). It is not the finding paper's $q$, whose horizon is the rest of the session. A pull is a full turn and costs the finding paper's $C_{\\text{pull}} = rL + wx + g\\,o$: it re-reads the $L$ tokens of cached context, writes the $x$ tokens it returns and produces $o$ output tokens. Here the returned slice then stays in the window for $H$ turns until it is evicted again, so a pull from an evicted span costs",
   "marked": "[-In J2's-] {+We use the finding paper's+} notation and prices (J2 [-§7.1),-] {+§7.1, a read costs a turn):+} a cache read costs $r$, a cache write $w$ and an output token $g$, as multiples of the base input price. Let the span have $S$ tokens, the marker $m$ tokens, and let $A$ tokens follow the span in the window. [-Reading an-] {+Let $q_{\\text{turn}}$ be the probability that a given later turn of the same session pulls from the+} evicted span [-back-] {+(horizon: one later turn). It is not the finding paper's $q$, whose horizon is the rest of the session. A pull+} is a [-pull, which-] {+full turn and+} costs [-a full turn:-] {+the finding paper's $C_{\\text{pull}} = rL + wx + g\\,o$:+} it re-reads the $L$ tokens of cached context, writes the [-$R$-] {+$x$+} tokens it [-returns,-] {+returns+} and produces $o$ output [-tokens,-] {+tokens. Here the returned slice then stays in the window for $H$ turns until it is evicted again, so a pull from an evicted span costs+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "$$C_{\\text{pull}} = rL + wR + g\\,o .$$",
   "new": "$$C_{\\text{pull}}^{H} = C_{\\text{pull}} + r\\,x\\,H = rL + wx + g\\,o + r\\,x\\,H .$$",
   "marked": "[-$$C_{\\text{pull}}-] {+$$C_{\\text{pull}}^{H} = C_{\\text{pull}} + r\\,x\\,H+} = rL + [-wR-] {+wx+} + g\\,o {++ r\\,x\\,H+} .$$"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "If the evicted span is pulled back on a fraction $q$ of the remaining turns ($q$ as in J2 §7.3), evicting it pays after $N^*$ more turns, where",
   "new": null,
   "marked": "[-If the evicted span is pulled back on a fraction $q$ of the remaining turns ($q$ as in J2 §7.3), evicting it pays after $N^*$ more turns, where-]"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": null,
   "new": "The added term is the residency assumption made explicit: a pull returns a slice of the span ($x \\ll S$), not the whole span, and the slice is resident until the next eviction.",
   "marked": "{+The added term is the residency assumption made explicit: a pull returns a slice of the span ($x \\ll S$), not the whole span, and the slice is resident until the next eviction.+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": null,
   "new": "Building the marker has a cost too. Exact strings and the owner's words need no model call (the strings are matched by code, the owner's sentences were tagged at append), but the one-line decisions and open items do. The model that writes them reads the span once at an input price $c$ and writes the marker, so the construction cost is $K = cS + g\\,m$. A merge reads the union of the ranges it covers, so its $K$ grows with the merged range. The classifier's cost is paid at append whether or not anything is ever compacted, so it is not part of $K$.",
   "marked": "{+Building the marker has a cost too. Exact strings and the owner's words need no model call (the strings are matched by code, the owner's sentences were tagged at append), but the one-line decisions and open items do. The model that writes them reads the span once at an input price $c$ and writes the marker, so the construction cost is $K = cS + g\\,m$. A merge reads the union of the ranges it covers, so its $K$ grows with the merged range. The classifier's cost is paid at append whether or not anything is ever compacted, so it is not part of $K$.+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": null,
   "new": "Evicting the span pays after $N^*$ more turns, where",
   "marked": "{+Evicting the span pays after $N^*$ more turns, where+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "$$N^* = \\frac{(m + A)(w - r)}{(S - m)\\, r - q\\, C_{\\text{pull}}} .$$",
   "new": "$$N^* = \\frac{(m + A)(w - r) + K}{(S - m)\\, r - q_{\\text{turn}}\\, C_{\\text{pull}}^{H}} .$$",
   "marked": "$$N^* = \\frac{(m + A)(w - [-r)}{(S-] {+r) + K}{(S+} - m)\\, r - [-q\\, C_{\\text{pull}}}-] {+q_{\\text{turn}}\\, C_{\\text{pull}}^{H}}+} .$$"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "The numerator is the one-time rewrite of everything after the span: J2 §7.4's suffix-rewrite term $\\Delta C = (w - r)(L - P)$ with $P$ at the start of the span, so $L - P = m + A$, paid once here instead of on every turn. The denominator is the per-turn saving, net of expected pulls. When $q\\, C_{\\text{pull}} \\ge (S-m)\\,r$, the denominator is not positive and an elective eviction never pays: the span is read back too often, and it should stay (or be compressed in place, as headroom does).",
   "new": "The first term of the numerator is the one-time rewrite of everything after the span: the finding paper's suffix-rewrite term $\\Delta C = (w - r)(L - P)$ (J2 §7.4, where it goes) with $P$ at the start of the span, so $L - P = m + A$, paid once here instead of on every turn. The denominator is the per-turn saving net of expected pulls. When $q_{\\text{turn}}\\, C_{\\text{pull}}^{H} \\ge (S-m)\\,r$, it is not positive and an elective eviction never pays: the span is read back too often and should stay, or be compressed in place.",
   "marked": "The {+first term of the+} numerator is the one-time rewrite of everything after the span: [-J2 §7.4's-] {+the finding paper's+} suffix-rewrite term $\\Delta C = (w - r)(L - P)$ {+(J2 §7.4, where it goes)+} with $P$ at the start of the span, so $L - P = m + A$, paid once here instead of on every turn. The denominator is the per-turn [-saving,-] {+saving+} net of expected pulls. When [-$q\\, C_{\\text{pull}}-] {+$q_{\\text{turn}}\\, C_{\\text{pull}}^{H}+} \\ge (S-m)\\,r$, [-the denominator-] {+it+} is not positive and an elective eviction never pays: the span is read back too [-often,-] {+often+} and [-it-] should [-stay (or-] {+stay, or+} be compressed in [-place, as headroom does).-] {+place.+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "![Turns a session must still run before an elective eviction pays, against how often the evicted span is pulled back. Prices are the published cache multiples of J2 §7.1 (write $w = 1.25$, read $r = 0.1$; dashed line: read 0.05) with output at $g = 5$; the marker is 300 tokens, $A = 100$K tokens follow the span, and a pull re-reads $L = 150$K tokens of cached context, writes $R = 2$K returned and adds 500 output tokens. Large spans pay back within tens of turns; small spans almost never do, and each curve rises without bound once pulls cost more than the span.](images/fig-4-breakeven.png){width=72%}",
   "new": null,
   "marked": "[-![Turns a session must still run before an elective eviction pays, against how often the evicted span is pulled back. Prices are the published cache multiples of J2 §7.1 (write $w = 1.25$, read $r = 0.1$; dashed line: read 0.05) with output at $g = 5$; the marker is 300 tokens, $A = 100$K tokens follow the span, and a pull re-reads $L = 150$K tokens of cached context, writes $R = 2$K returned and adds 500 output tokens. Large spans pay back within tens of turns; small spans almost never do, and each curve rises without bound once pulls cost more than the span.](images/fig-4-breakeven.png){width=72%}-]"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "Figure 4 puts in the published prices. With a cache read at 0.1 and a write at 1.25, a 40K-token span pays back after about 29 turns if it is never pulled and about 39 if it is pulled on one turn in twenty; it never pays if it is pulled on more than one turn in five. A 100K-token span pays back after about 12 turns. A 10K-token span needs about 119 turns even with no pulls. Cheaper cache reads make eviction pay later, not sooner: at a read price of 0.05, the 40K span needs about 61 turns.",
   "new": null,
   "marked": "[-Figure 4 puts in the published prices. With a cache read at 0.1 and a write at 1.25, a 40K-token span pays back after about 29 turns if it is never pulled and about 39 if it is pulled on one turn in twenty; it never pays if it is pulled on more than one turn in five. A 100K-token span pays back after about 12 turns. A 10K-token span needs about 119 turns even with no pulls. Cheaper cache reads make eviction pay later, not sooner: at a read price of 0.05, the 40K span needs about 61 turns.-]"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": null,
   "new": "![Turns a session must still run before an elective eviction pays, against the probability that a later turn pulls from the evicted span. A limited scenario, not a decision rule: published cache prices ($w = 1.25$, $r = 0.1$; dashed, $r = 0.05$; $g = 5$), a 300-token marker, $A = 100$K tokens after the span, a pull that re-reads $L = 150$K, returns $x = 2$K tokens resident for $H = 20$ turns and writes 500 output tokens, and construction at $c = 1$ (the same model, uncached). The dotted line leaves construction out.](images/fig-3-breakeven.png){width=72%}",
   "marked": "{+![Turns a session must still run before an elective eviction pays, against the probability that a later turn pulls from the evicted span. A limited scenario, not a decision rule: published cache prices ($w = 1.25$, $r = 0.1$; dashed, $r = 0.05$; $g = 5$), a 300-token marker, $A = 100$K tokens after the span, a pull that re-reads $L = 150$K, returns $x = 2$K tokens resident for $H = 20$ turns and writes 500 output tokens, and construction at $c = 1$ (the same model, uncached). The dotted line leaves construction out.](images/fig-3-breakeven.png){width=72%}+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": null,
   "new": "Figure 3 is one scenario, an illustration and not a rule, because $q_{\\text{turn}}$, $H$ and $c$ have not been measured. In it, a 40K-token span pays back after about 40 turns if it is never pulled, of which about 10 are the cost of building its marker; after about 57 turns if a later turn pulls from it with probability 0.05; and never if that probability exceeds about 0.17. A 100K-token span pays back after about 22 turns. A 10K-token span needs about 131 turns with no pulls and never pays above a probability of 0.04. Cheaper cache reads make eviction pay later: at a read price of 0.05 the 40K span needs about 82 turns.",
   "marked": "{+Figure 3 is one scenario, an illustration and not a rule, because $q_{\\text{turn}}$, $H$ and $c$ have not been measured. In it, a 40K-token span pays back after about 40 turns if it is never pulled, of which about 10 are the cost of building its marker; after about 57 turns if a later turn pulls from it with probability 0.05; and never if that probability exceeds about 0.17. A 100K-token span pays back after about 22 turns. A 10K-token span needs about 131 turns with no pulls and never pays above a probability of 0.04. Cheaper cache reads make eviction pay later: at a read price of 0.05 the 40K span needs about 82 turns.+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "Three design rules follow. First, elective eviction should take large spans at once, since the rewrite cost is paid per eviction and the saving grows with the span. Many small evictions pay the rewrite many times. Second, the best candidates are spans that are large and rarely pulled, which is what §5.3's order selects. Third, the markers should sit at a stable place, so that the next eviction does not move them and pay the rewrite again.",
   "new": "Three design rules hold whatever the numbers: evict large spans at once, since the rewrite is paid per eviction and the saving grows with the span; prefer spans that are large and rarely pulled, which §5.3's order selects; and keep markers at a stable place, so the next eviction does not move them and pay the rewrite again. One benefit is left out: a shorter window is read better (§1.2). It is real but unpriced, so we leave it to a test (T7) and do not add it to the formula as a guess.",
   "marked": "Three design rules [-follow. First, elective eviction should take-] {+hold whatever the numbers: evict+} large spans at once, since the rewrite [-cost-] is paid per eviction and the saving grows with the [-span. Many small evictions pay the rewrite many times. Second, the best candidates are-] {+span; prefer+} spans that are large and rarely pulled, which [-is what-] §5.3's order [-selects. Third, the-] {+selects; and keep+} markers [-should sit-] at a stable place, so [-that-] the next eviction does not move them and pay the rewrite [-again.-] {+again. One benefit is left out: a shorter window is read better (§1.2). It is real but unpriced, so we leave it to a test (T7) and do not add it to the formula as a guess.+}"
  },
  {
   "section": "7.2 The price of moving the prefix",
   "old": "The arithmetic leaves out one benefit: a shorter window is read better (§1.2). That benefit is real but unpriced, so we leave it to a test (§10, T7) and do not add it to the formula as a guess.",
   "new": null,
   "marked": "[-The arithmetic leaves out one benefit: a shorter window is read better (§1.2). That benefit is real but unpriced, so we leave it to a test (§10, T7) and do not add it to the formula as a guess.-]"
  },
  {
   "section": "7.3 A trigger you can trust",
   "old": "Every compaction decision starts from a number: how full the window is. That number must come from the call actually sent, and from nothing else. A usage figure that sums several internal calls of one turn can be many times the window and will fire compaction far too early; a figure that misses a block of the prompt, because the counter does not recognise that block's role, will fire it too late. Both errors are easy to make and silent once made.",
   "new": "Every compaction decision starts from one number: how full the window is. That number must come from the call actually sent. A usage figure that sums several internal calls of one turn can be many times the window and will fire compaction far too early; a figure that misses a block of the prompt, because the counter does not recognise that block's role, will fire it too late. Both errors are easy to make and silent once made.",
   "marked": "Every compaction decision starts from [-a-] {+one+} number: how full the window is. That number must come from the call actually [-sent, and from nothing else.-] {+sent.+} A usage figure that sums several internal calls of one turn can be many times the window and will fire compaction far too early; a figure that misses a block of the prompt, because the counter does not recognise that block's role, will fire it too late. Both errors are easy to make and silent once made."
  },
  {
   "section": "7.3 A trigger you can trust",
   "old": "A guard against thrashing completes the trigger: an elective compaction does not run again until the window has grown by at least the amount the last one freed. A compaction that frees almost nothing and runs again a minute later is a sign that the trigger is reading the wrong number.",
   "new": "A guard against thrashing completes the trigger: an elective compaction does not run again until the window has grown by at least the amount the last one freed.",
   "marked": "A guard against thrashing completes the trigger: an elective compaction does not run again until the window has grown by at least the amount the last one [-freed. A compaction that frees almost nothing and runs again a minute later is a sign that the trigger is reading the wrong number.-] {+freed.+}"
  },
  {
   "section": "7.4 One compaction receipt per compaction, whoever ran it",
   "old": "Every compaction, by every executor (the runtime, the provider's tool, the API), writes one compaction receipt: when it started and ended, who ran it, the owner case of §6, what triggered it (forced or elective, and the snapshot it read), tokens before and after as measured on the next call, and the outcome. A decision not to compact writes a receipt too, under the series rule that a zero means zero (J5 §9.1).",
   "new": null,
   "marked": "[-Every compaction, by every executor (the runtime, the provider's tool, the API), writes one compaction receipt: when it started and ended, who ran it, the owner case of §6, what triggered it (forced or elective, and the snapshot it read), tokens before and after as measured on the next call, and the outcome. A decision not to compact writes a receipt too, under the series rule that a zero means zero (J5 §9.1).-]"
  },
  {
   "section": "7.4 One compaction receipt per compaction, whoever ran it",
   "old": "The receipt holds these fields:",
   "new": null,
   "marked": "[-The receipt holds these fields:-]"
  },
  {
   "section": "7.4 One compaction receipt per compaction, whoever ran it",
   "old": null,
   "new": "Every compaction, by every executor, writes one receipt, and so does a decision not to compact, under the series rule that a missing receipt is the alarm and a zero is a valid result (J5 §9.1, a receipt for every run). The receipt is also the eviction event of §6.6: the finding paper's read ledger reads its evicted field (J2 §6.7, what the context already holds), which lists cleared tool results as well as marker ranges, since an API's clearing leaves no marker.",
   "marked": "{+Every compaction, by every executor, writes one receipt, and so does a decision not to compact, under the series rule that a missing receipt is the alarm and a zero is a valid result (J5 §9.1, a receipt for every run). The receipt is also the eviction event of §6.6: the finding paper's read ledger reads its evicted field (J2 §6.7, what the context already holds), which lists cleared tool results as well as marker ranges, since an API's clearing leaves no marker.+}"
  },
  {
   "section": "7.4 One compaction receipt per compaction, whoever ran it",
   "old": "| Field | Meaning | |-----------|---------------------| | session, started, ended | which session, and when | | executor | runtime, provider tool or provider API | | owner case | the §6 case the session was in | | kind | forced, elective, or a decision not to compact | | decision | ran, declined on price, blocked on snapshot, did not run | | snapshot | attributed slices, unattributed slice, provider-reported input count | | tokens before / after | as measured on the call before and the call after | | markers | ranges written, and whether each resolved | | outcome | completed, failed (with reason), interrupted |",
   "new": "| Field | Meaning | |-----------|---------------------| | session, started, ended | which session, and when | | executor, controller case | runtime, provider tool or provider API; the §6 case | | kind, decision | forced, elective or none; ran, declined on price, blocked on snapshot, did not run | | snapshot | attributed slices, unattributed slice, provider-reported input count | | tokens before and after | as measured on the call before and the call after | | evicted | each evicted record range, with the path, region and blob hash of every file read inside it; each tool result an API cleared; for a provider's tool (§6.3), the whole range since the previous compaction, marked as inferred | | markers | IDs and ranges written, whether each resolved, whether each was acknowledged | | instructions moved | owner instructions that left the window as pointers (§5.5) | | knowledge level, fallbacks | what the memory layer can know (§6.6); each degraded path used | | outcome | completed, failed (with reason), interrupted |",
   "marked": "| Field | Meaning | |-----------|---------------------| | session, started, ended | which session, and when | | [-executor-] {+executor, controller case+} | runtime, provider tool or provider [-API | | owner case |-] {+API;+} the §6 case [-the session was in-] | | [-kind-] {+kind, decision+} | forced, [-elective,-] {+elective+} or [-a decision not to compact | | decision |-] {+none;+} ran, declined on price, blocked on snapshot, did not run | | snapshot | attributed slices, unattributed slice, provider-reported input count | | tokens before [-/-] {+and+} after | as measured on the call before and the call after | | {+evicted | each evicted record range, with the path, region and blob hash of every file read inside it; each tool result an API cleared; for a provider's tool (§6.3), the whole range since the previous compaction, marked as inferred | |+} markers | {+IDs and+} ranges written, [-and-] whether each [-resolved-] {+resolved, whether each was acknowledged | | instructions moved | owner instructions that left the window as pointers (§5.5) | | knowledge level, fallbacks | what the memory layer can know (§6.6); each degraded path used+} | | outcome | completed, failed (with reason), interrupted |"
  },
  {
   "section": "8.1 The range read",
   "old": null,
   "new": "### 8.1 The range read",
   "marked": "{+### 8.1 The range read+}"
  },
  {
   "section": "8.1 The range read",
   "old": "The range read takes a range and returns the record's entries in it, verbatim, with their authors and times; an entry under a tombstone (§4.4) comes back as its tombstone. J2's pull tool offers this read as one of its modes, next to a search over the record (J2 §6.6). How that search ranks, when the agent should be handed something without asking, and whether the pull tool is offered at all are J2's. This stage guarantees one thing about the search: it runs over the same record the markers point into.",
   "new": "The range read takes a range and returns the record's entries in it, verbatim, with their authors and times; a file read comes back with its blob, whatever happened to the file since. An erased entry comes back as its tombstone and a quarantined one as its placeholder (§4.4). The finding paper's pull tool offers this read as one of its modes, next to a search over the record (J2 §6.6, the pull). How that search ranks, when the agent is handed something without asking, and whether the pull tool is offered at all are the finding paper's. This stage guarantees that the search runs over the same record the markers point into.",
   "marked": "The range read takes a range and returns the record's entries in it, verbatim, with their authors and times; [-an-] {+a file read comes back with its blob, whatever happened to the file since. An erased+} entry [-under a tombstone (§4.4)-] comes back as its [-tombstone. J2's-] {+tombstone and a quarantined one as its placeholder (§4.4). The finding paper's+} pull tool offers this read as one of its modes, next to a search over the record (J2 [-§6.6).-] {+§6.6, the pull).+} How that search ranks, when the agent [-should be-] {+is+} handed something without asking, and whether the pull tool is offered at all are [-J2's.-] {+the finding paper's.+} This stage guarantees [-one thing about-] {+that+} the [-search: it-] {+search+} runs over the same record the markers point into."
  },
  {
   "section": "8.2 Every marker resolves",
   "old": null,
   "new": "### 8.2 Every marker resolves",
   "marked": "{+### 8.2 Every marker resolves+}"
  },
  {
   "section": "8.2 Every marker resolves",
   "old": "A marker that names entries in a store the range read cannot reach is a broken promise, and the design forbids it with a check: for every marker written, resolving its range must return at least one entry, and the exact strings it carries must appear in the entries returned. The check runs when the marker is written and again in the nightly tests.",
   "new": "A marker that names entries the range read cannot return is a broken promise, and a check forbids it. For every marker written, resolving its range must return every sequence number from first to last, with none missing (a tombstone or a placeholder counts as present); every blob it refers to must be in the blob store; and every exact string and owner sentence it carries must appear in an entry inside the range. The check runs when the marker is written and again in the nightly tests.",
   "marked": "A marker that names entries [-in a store-] the range read cannot [-reach-] {+return+} is a broken promise, and [-the design-] {+a check+} forbids [-it with a check: for-] {+it. For+} every marker written, resolving its range must return [-at least one entry,-] {+every sequence number from first to last, with none missing (a tombstone or a placeholder counts as present); every blob it refers to must be in the blob store;+} and [-the-] {+every+} exact [-strings-] {+string and owner sentence+} it carries must appear in {+an entry inside+} the [-entries returned.-] {+range.+} The check runs when the marker is written and again in the nightly tests."
  },
  {
   "section": "9.1 In short",
   "old": "A long-running agent forgets in one way that matters: compaction replaces the only copy of its past with a description. Total Recall changes what compaction is. The session record is kept word for word, with authors and fixed addresses, and never edited except by a tombstone; the context window is a cache over it; compaction evicts from the cache and leaves markers that quote the owner and the exact strings and point back into the record; and each new marker is written from the record, so detail does not erode with repetition. Because the agent often does not own its window, the memory layer works through whoever does: it compacts itself where the runtime builds the calls, works through hooks where a provider's tool compacts, and keeps its own record where an API compacts out of sight. A trigger read from the call actually sent and a break-even derived from cache prices decide when an elective compaction is worth it. If this holds, the owner's Friday question about Monday's instruction does not arise, because Monday's instruction is still in the window, word for word.",
   "new": null,
   "marked": "[-A long-running agent forgets in one way that matters: compaction replaces the only copy of its past with a description. Total Recall changes what compaction is. The session record is kept word for word, with authors and fixed addresses, and never edited except by a tombstone; the context window is a cache over it; compaction evicts from the cache and leaves markers that quote the owner and the exact strings and point back into the record; and each new marker is written from the record, so detail does not erode with repetition. Because the agent often does not own its window, the memory layer works through whoever does: it compacts itself where the runtime builds the calls, works through hooks where a provider's tool compacts, and keeps its own record where an API compacts out of sight. A trigger read from the call actually sent and a break-even derived from cache prices decide when an elective compaction is worth it. If this holds, the owner's Friday question about Monday's instruction does not arise, because Monday's instruction is still in the window, word for word.-]"
  },
  {
   "section": "9.1 In short",
   "old": null,
   "new": "A long-running agent forgets in one way that matters: after compaction, the next inference sees a description of its past and has no way back to the past itself. Total Recall keeps the whole session as an addressed record, makes compaction leave markers that quote what a description drops and point back into the record, and works through whichever controller holds the window. If it holds, the owner's Friday question about Monday's instruction has an exact answer: the instruction is in view, or one line says where it is, and the owner knows which.",
   "marked": "{+A long-running agent forgets in one way that matters: after compaction, the next inference sees a description of its past and has no way back to the past itself. Total Recall keeps the whole session as an addressed record, makes compaction leave markers that quote what a description drops and point back into the record, and works through whichever controller holds the window. If it holds, the owner's Friday question about Monday's instruction has an exact answer: the instruction is in view, or one line says where it is, and the owner knows which.+}"
  },
  {
   "section": "9.2 Limitations",
   "old": "- Markers depend on extraction. Which strings are \"exact strings\" and which owner sentences are instructions are judgements made by code and a cheap judge. A missed string is still in the record, but the marker no longer advertises it, so the agent has to search to find it. - Hooks are the provider's to change. In the provider-tool case the design relies on hooks the provider chose to expose. If a provider removes the event after compaction, the markers can only reach the model on the next turn's injection. - Opaque compaction cannot be checked. When an API keeps its compacted state encrypted, we cannot measure what it dropped, only what the model later fails to use. - The record grows without bound. Append-only storage grows with every session. Storage is cheap next to an owner's time, but a deployment with years of sessions will need tiered storage for old records; the design does not cover it. - The price rule assumes a pull rate. $N^*$ needs $q$, the rate at which an evicted span is pulled back, and no one has measured it for conversation history. Until it is measured, elective eviction should be conservative. - Recoverable is not recovered. Every guarantee here is about what can be read back. Whether the agent asks for it when it should is J2's question.",
   "new": "- Markers depend on extraction. Which strings are exact strings and which sentences are instructions are judgements made by code and a classifier. A missed string is still in the record, but the marker no longer advertises it, so the agent has to search to find it. - The owner's budget bounds what stays in view. Past it, the oldest instructions are a pointer away, and the agent has to follow the pointer when it matters. - Hooks are the provider's to change. If a provider removes the event after compaction, markers reach the model only with the next turn's injection, and the receipt says so. - Opaque compaction cannot be checked. When an API keeps its compacted state encrypted, we cannot measure what it dropped, only what the model later fails to use. - The record grows without bound. Storage is cheap next to an owner's time, but years of sessions will need tiered storage for old records, which the design does not cover. - The price rule rests on unmeasured inputs: $q_{\\text{turn}}$, the residency $H$ and the construction price $c$. Until they are measured, elective eviction should be conservative. - The capture detector of §4.7 will miss some secrets; a miss is caught only when someone asks for an erase. - Recoverable is not recovered. Every guarantee here is about what can be read back. Whether the agent asks for it when it should is the finding paper's question.",
   "marked": "- Markers depend on extraction. Which strings are [-\"exact strings\"-] {+exact strings+} and which [-owner-] sentences are instructions are judgements made by code and a [-cheap judge.-] {+classifier.+} A missed string is still in the record, but the marker no longer advertises it, so the agent has to search to find it. - {+The owner's budget bounds what stays in view. Past it, the oldest instructions are a pointer away, and the agent has to follow the pointer when it matters. -+} Hooks are the provider's to change. [-In the provider-tool case the design relies on hooks the provider chose to expose.-] If a provider removes the event after compaction, [-the-] markers [-can only-] reach the model [-on-] {+only with+} the next turn's [-injection.-] {+injection, and the receipt says so.+} - Opaque compaction cannot be checked. When an API keeps its compacted state encrypted, we cannot measure what it dropped, only what the model later fails to use. - The record grows without bound. [-Append-only storage grows with every session.-] Storage is cheap next to an owner's time, but [-a deployment with-] years of sessions will need tiered storage for old [-records;-] {+records, which+} the design does not [-cover it.-] {+cover.+} - The price rule [-assumes a pull rate. $N^*$ needs $q$,-] {+rests on unmeasured inputs: $q_{\\text{turn}}$,+} the [-rate at which an evicted span is pulled back,-] {+residency $H$+} and [-no one has measured it for conversation history.-] {+the construction price $c$.+} Until [-it is-] {+they are+} measured, elective eviction should be conservative. {+- The capture detector of §4.7 will miss some secrets; a miss is caught only when someone asks for an erase.+} - Recoverable is not recovered. Every guarantee here is about what can be read back. Whether the agent asks for it when it should is [-J2's-] {+the finding paper's+} question."
  },
  {
   "section": "10.1 Tests that would settle what we do not know",
   "old": "Each test names the claim it decides and what result would change the design.",
   "new": null,
   "marked": "[-Each test names the claim it decides and what result would change the design.-]"
  },
  {
   "section": "10.1 Tests that would settle what we do not know",
   "old": null,
   "new": "Each test names the claim it decides and what result would change the design. Every test that tunes something (the string extractor, the classifier thresholds, the budgets) tunes on development sessions and is scored on held-out sessions it never saw, drawn from a later period for real data and from different seeds and string types for synthetic data; the series' rules for keeping these sets apart are the learning paper's (J5 §9.2, three streams kept apart). Where two arms are compared on live sessions, sessions are assigned to arms at random.",
   "marked": "{+Each test names the claim it decides and what result would change the design. Every test that tunes something (the string extractor, the classifier thresholds, the budgets) tunes on development sessions and is scored on held-out sessions it never saw, drawn from a later period for real data and from different seeds and string types for synthetic data; the series' rules for keeping these sets apart are the learning paper's (J5 §9.2, three streams kept apart). Where two arms are compared on live sessions, sessions are assigned to arms at random.+}"
  },
  {
   "section": "10.1 Tests that would settle what we do not know",
   "old": "| # | Test | Decides | What would change the design | |--|---------------------|-------|---------------| | T1 | Needle survival. Seed exact strings, owner instructions, failed attempts and times early in long synthetic sessions; force 1, 3 and 5 compactions; ask for each. Arms: the provider's own summary, truncation, pointer compaction, pointer compaction with markers but no range read. | §5: markers and the range read keep what summaries lose | If markers without the range read already match markers with it, the read matters less than the marker; if the provider summary matches pointers, §1.3's premise is wrong for that provider | | T2 | Back-reference replay. Collect real moments where an owner refers to earlier in the session (\"the hash from before\", \"what I told you\"). Replay them after compaction and score whether the agent answers from the record. | §4, §5 in real use | If range reads from the record do not beat the summary by a clear margin, the record's cost is not paid back | | T3 | Forget-cue rate. Count owner messages that repeat an earlier instruction or ask \"did you forget\", per 100 owner messages, split by whether a compaction happened in the previous ten turns. | the outcome the whole design serves | No difference across compactions means the owner's memory pain lies elsewhere (in finding or learning), and §1's motivation must be rewritten | | T4 | Marker coverage. For each evicted range, the share of its exact strings and owner instructions present in its marker; then rerun T1 with search over markers only. | §5.1, §5.2 | Coverage below half means the extraction, not the design, is the weak part | | T5 | Every marker resolves. Property test over generated sessions plus the nightly check of §8: every marker's range returns entries and contains its strings. | §8 | Any failure is a defect to fix, not a trade-off | | T6 | Trigger validity. For each call, attributed slices plus the unattributed slice against the provider's reported input count; evicted bytes by class against the total removed; a session that thrashes must trip the guard; a provider-tool session must show zero runtime compactions. | §5.3, §6.5, §7.3 | A snapshot that cannot be reconciled means the trigger cannot be trusted, and elective compaction stays off | | T7 | Price and quality. Measure price-weighted tokens per resident turn and per pull, and $q$ for evicted conversation; compare elective eviction at $N^*$ with no elective eviction on task success. | §7.2 | A measured $q$ above the break-even for typical spans means elective eviction should be rare; a quality gain from shorter windows would argue for earlier eviction than price alone | | T8 | Forgetting reaches the record. Seed a string in an owner turn and in a tool result, compact over both, then run a J14 deletion for it. Search J2's text index, range-read the span and resolve every marker that covered it. | §4.4 | Any hit, or any marker that no longer resolves, is a defect |",
   "new": "| # | Test | Decides | What would change the design | |--|---------------------|-------|---------------| | T1 | Needle survival. Seed exact strings, owner instructions, failed attempts and times early in long synthetic sessions; force 1, 3 and 5 compactions; ask for each. Arms: the provider's summary alone; truncation; **the provider's summary plus the same searchable record and range read (the control)**; markers plus range read; markers without range read. | §5: the marker, not mere access to the record, keeps what summaries lose | If the control matches markers, the gain is the way back, not the marker; if markers without the range read match markers with it, the read matters less than the marker | | T2 | Back-reference replay. Real moments where the owner refers to earlier in the session (\"the hash from before\"), replayed after compaction under the control arm and under markers. | §4, §5 in real use | No clear margin over the control means markers do not pay their cost | | T3 | Forget-cue rate. Owner messages that repeat an earlier instruction or ask \"did you forget\", per 100 owner messages, in sessions run under the control arm and under markers, split by whether a compaction happened in the previous ten turns. | the outcome the design serves | No difference means the owner's pain lies in finding or learning, and §1 must be rewritten | | T4 | Marker coverage. For each evicted range, the share of its exact strings and owner instructions present in its marker. | §5.1, §5.2 | Coverage below half means the extraction, not the design, is the weak part | | T5 | Every marker resolves. Property test over generated sessions plus the nightly check of §8.2; files read, then changed and deleted, must come back as read. | §4.1, §8.2 | Any failure is a defect, not a trade-off | | T6 | Trigger validity. Slices against the provider's input count per call; evicted tokens by class against the total; a thrashing session must trip the guard; a provider-tool session must show zero runtime compactions. | §5.3, §6.5, §7.3 | A snapshot that cannot be reconciled keeps elective compaction off | | T7 | Price and quality. Measure $q_{\\text{turn}}$, $H$, $K$ and price-weighted tokens; compare elective eviction at $N^*$ with no elective eviction on task success. | §7.2 | A measured $q_{\\text{turn}}$ above break-even for typical spans makes elective eviction rare; a quality gain from shorter windows argues for earlier eviction | | T8 | Erase and quarantine. Erase a string seeded in an owner turn and a tool result: no hit in the text index, the range read returns tombstones, every marker resolves. Quarantine an injected line: absent from the window, markers, ordinary search and range reads, present in the audit view. The same two entries are followed through the writing paper's deletion. | §4.4 | Any hit, or any marker that no longer resolves, is a defect | | T9 | Budget overflow. A session whose owner instructions alone exceed their budget. | §5.5 | Any instruction not recoverable verbatim, moved without the owner being told, or lost from a receipt is a defect | | T10 | Capture and adapter crashes. Kill the process between receiving a turn and appending it, between the hooks, and after injection before acknowledgement; lag the tool's transcript. | §4.6, §6.6 | Any turn reported as captured that is not in the record, or any marker shown as delivered without acknowledgement, is a defect | | T11 | Never retained. Run a temporary session and plant a credential in an ordinary one. | §4.7 | Anything findable after a temporary session ends, or a planted credential on disk, is a defect |",
   "marked": "| # | Test | Decides | What would change the design | |--|---------------------|-------|---------------| | T1 | Needle survival. Seed exact strings, owner instructions, failed attempts and times early in long synthetic sessions; force 1, 3 and 5 compactions; ask for each. Arms: the provider's [-own summary, truncation, pointer compaction, pointer compaction with-] {+summary alone; truncation; **the provider's summary plus the same searchable record and range read (the control)**;+} markers [-but no-] {+plus range read; markers without+} range read. | §5: [-markers and-] the [-range read keep-] {+marker, not mere access to the record, keeps+} what summaries lose | If {+the control matches markers, the gain is the way back, not the marker; if+} markers without the range read [-already-] match markers with it, the read matters less than the [-marker; if the provider summary matches pointers, §1.3's premise is wrong for that provider-] {+marker+} | | T2 | Back-reference replay. [-Collect real-] {+Real+} moments where [-an-] {+the+} owner refers to earlier in the session (\"the hash from [-before\", \"what I told you\"). Replay them-] {+before\"), replayed+} after compaction {+under the control arm+} and [-score whether the agent answers from the record.-] {+under markers.+} | §4, §5 in real use | [-If range reads from-] {+No clear margin over+} the [-record-] {+control means markers+} do not [-beat the summary by a clear margin, the record's-] {+pay their+} cost [-is not paid back-] | | T3 | Forget-cue rate. [-Count owner-] {+Owner+} messages that repeat an earlier instruction or ask \"did you forget\", per 100 owner messages, {+in sessions run under the control arm and under markers,+} split by whether a compaction happened in the previous ten turns. | the outcome the [-whole-] design serves | No difference [-across compactions-] means the owner's [-memory-] pain lies [-elsewhere (in-] {+in+} finding or [-learning),-] {+learning,+} and [-§1's motivation-] {+§1+} must be rewritten | | T4 | Marker coverage. For each evicted range, the share of its exact strings and owner instructions present in its [-marker; then rerun T1 with search over markers only.-] {+marker.+} | §5.1, §5.2 | Coverage below half means the extraction, not the design, is the weak part | | T5 | Every marker resolves. Property test over generated sessions plus the nightly check of [-§8: every marker's range returns entries-] {+§8.2; files read, then changed+} and [-contains its strings.-] {+deleted, must come back as read.+} | [-§8-] {+§4.1, §8.2+} | Any failure is a [-defect to fix,-] {+defect,+} not a trade-off | | T6 | Trigger validity. [-For each call, attributed slices plus the unattributed slice-] {+Slices+} against the provider's [-reported-] input [-count;-] {+count per call;+} evicted [-bytes-] {+tokens+} by class against the [-total removed;-] {+total;+} a {+thrashing+} session [-that thrashes-] must trip the guard; a provider-tool session must show zero runtime compactions. | §5.3, §6.5, §7.3 | A snapshot that cannot be reconciled [-means the trigger cannot be trusted, and-] {+keeps+} elective compaction [-stays-] off | | T7 | Price and quality. Measure {+$q_{\\text{turn}}$, $H$, $K$ and+} price-weighted [-tokens per resident turn and per pull, and $q$ for evicted conversation;-] {+tokens;+} compare elective eviction at $N^*$ with no elective eviction on task success. | §7.2 | A measured [-$q$-] {+$q_{\\text{turn}}$+} above [-the-] break-even for typical spans [-means-] {+makes+} elective eviction [-should be-] rare; a quality gain from shorter windows [-would argue-] {+argues+} for earlier eviction [-than price alone-] | | T8 | [-Forgetting reaches the record. Seed-] {+Erase and quarantine. Erase+} a string {+seeded+} in an owner turn and [-in-] a tool [-result, compact over both, then run a J14 deletion for it. Search J2's-] {+result: no hit in the+} text index, [-range-read-] the [-span and resolve-] {+range read returns tombstones,+} every marker [-that covered it.-] {+resolves. Quarantine an injected line: absent from the window, markers, ordinary search and range reads, present in the audit view. The same two entries are followed through the writing paper's deletion.+} | §4.4 | Any hit, or any marker that no longer resolves, is a defect {+| | T9 | Budget overflow. A session whose owner instructions alone exceed their budget. | §5.5 | Any instruction not recoverable verbatim, moved without the owner being told, or lost from a receipt is a defect | | T10 | Capture and adapter crashes. Kill the process between receiving a turn and appending it, between the hooks, and after injection before acknowledgement; lag the tool's transcript. | §4.6, §6.6 | Any turn reported as captured that is not in the record, or any marker shown as delivered without acknowledgement, is a defect | | T11 | Never retained. Run a temporary session and plant a credential in an ordinary one. | §4.7 | Anything findable after a temporary session ends, or a planted credential on disk, is a defect+} |"
  },
  {
   "section": "10.1 Tests that would settle what we do not know",
   "old": "T3 is the measure the design should be judged by: if keeping works, the owner repeats himself less.",
   "new": null,
   "marked": "[-T3 is the measure the design should be judged by: if keeping works, the owner repeats himself less.-]"
  },
  {
   "section": "10.1 Tests that would settle what we do not know",
   "old": null,
   "new": "T3 is the measure the design should be judged by: if keeping works, the owner repeats himself less. The cross-stage replay of one correction through compaction, restarts and deletion is the learning paper's (J5 §10, one correction start to finish, and its Appendix B, the replay matrix); T8 to T10 are this stage's part of it.",
   "marked": "{+T3 is the measure the design should be judged by: if keeping works, the owner repeats himself less. The cross-stage replay of one correction through compaction, restarts and deletion is the learning paper's (J5 §10, one correction start to finish, and its Appendix B, the replay matrix); T8 to T10 are this stage's part of it.+}"
  },
  {
   "section": "10.2 Building it",
   "old": "Total Recall will be built in TinkerClaw in the order the tests need it: the record index and its addresses first, then the marker builder and the resolve check, then the owner contract for the provider-tool case, the tombstone with J14's deletion, the trigger snapshot and the compaction receipt, and the price rule last, once T7 has measured $q$. An updated version of this paper will report the results.",
   "new": "Total Recall will be built in TinkerClaw in the order the tests need it: the record index, its addresses and the blob store first; then the marker builder and the resolve check; the adapter for the provider-tool case; erase and quarantine with the writing paper's deletion; the trigger snapshot and the receipt; and the price rule last, once T7 has measured its inputs. An updated version of this paper will report the results.",
   "marked": "Total Recall will be built in TinkerClaw in the order the tests need it: the record [-index and-] {+index,+} its addresses [-first,-] {+and the blob store first;+} then the marker builder and the resolve [-check, then-] {+check;+} the [-owner contract-] {+adapter+} for the provider-tool [-case,-] {+case; erase and quarantine with+} the [-tombstone with J14's deletion,-] {+writing paper's deletion;+} the trigger snapshot and the [-compaction receipt,-] {+receipt;+} and the price rule last, once T7 has measured [-$q$.-] {+its inputs.+} An updated version of this paper will report the results."
  },
  {
   "section": "References",
   "old": "- Anthropic (2025a). Managing context on the Claude Developer Platform (context editing and the memory tool). 29 September 2025. <https://claude.com/blog/context-management> - Anthropic (2026a). Compaction. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/compaction> - Anthropic (2026b). Hooks reference. Claude Code documentation. <https://code.claude.com/docs/en/hooks> - Anthropic (2026c). Prompt caching. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/prompt-caching> - Anthropic (2026d). Context editing. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/context-editing> - Belady, L. A. (1966). A study of replacement algorithms for a virtual-storage computer. *IBM Systems Journal*, 5(2), 78–101. <https://doi.org/10.1147/sj.52.0078> - Headroom Labs (2026). headroom: compress tool outputs, logs, files and RAG chunks before they reach the LLM. GitHub, Apache-2.0. <https://github.com/headroomlabs-ai/headroom> - Hong, K., Troynikov, A., & Huber, J. (2025). Context rot: how increasing input tokens impacts LLM performance. Chroma technical report. <https://research.trychroma.com/context-rot> - Ji, Y. (2025). Context engineering for AI agents: lessons from building Manus. 18 July 2025. <https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus> - Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the middle: how language models use long contexts. *Transactions of the ACL*, 12, 157–173. <https://arxiv.org/abs/2307.03172> - OpenAI (2026). Compaction. OpenAI API documentation. <https://developers.openai.com/api/docs/guides/compaction> - Packer, C., Wooders, S., Lin, K., Fang, V., Patil, S. G., Stoica, I., & Gonzalez, J. E. (2023). MemGPT: towards LLMs as operating systems. arXiv:2310.08560. <https://arxiv.org/abs/2310.08560> - Rasmussen, P., Paliychuk, P., Beauvais, T., Ryan, J., & Chalef, D. (2025). Zep: a temporal knowledge graph architecture for agent memory. arXiv:2501.13956. <https://arxiv.org/abs/2501.13956> - thedotmack (2026). claude-mem: persistent context across sessions for every agent. GitHub. <https://github.com/thedotmack/claude-mem> - Zhang, Q., Hu, C., Upasani, S., Ma, B., et al. (2025). Agentic context engineering: evolving contexts for self-improving language models. arXiv:2510.04618. <https://arxiv.org/abs/2510.04618>",
   "new": "- Anthropic (2025). Managing context on the Claude Developer Platform (context editing and the memory tool). 29 September 2025. <https://claude.com/blog/context-management> - Anthropic (2026a). Compaction. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/compaction> - Anthropic (2026b). Hooks reference. Claude Code documentation. <https://code.claude.com/docs/en/hooks> - Anthropic (2026c). Prompt caching. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/prompt-caching> - Anthropic (2026d). Context editing. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/context-editing> - Belady, L. A. (1966). A study of replacement algorithms for a virtual-storage computer. *IBM Systems Journal*, 5(2), 78–101. <https://doi.org/10.1147/sj.52.0078> - Headroom Labs (2026). headroom: compress what your AI agent reads. GitHub, Apache-2.0. <https://github.com/headroomlabs-ai/headroom> - Hong, K., Troynikov, A., & Huber, J. (2025). Context rot: how increasing input tokens impacts LLM performance. Chroma technical report. <https://research.trychroma.com/context-rot> - Ji, Y. (2025). Context engineering for AI agents: lessons from building Manus. 18 July 2025. <https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus> - Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the middle: how language models use long contexts. *Transactions of the ACL*, 12, 157–173. <https://arxiv.org/abs/2307.03172> - OpenAI (2026). Compaction. OpenAI API documentation. <https://developers.openai.com/api/docs/guides/compaction> - Packer, C., Wooders, S., Lin, K., Fang, V., Patil, S. G., Stoica, I., & Gonzalez, J. E. (2023). MemGPT: towards LLMs as operating systems. arXiv:2310.08560. <https://arxiv.org/abs/2310.08560> - Rasmussen, P., Paliychuk, P., Beauvais, T., Ryan, J., & Chalef, D. (2025). Zep: a temporal knowledge graph architecture for agent memory. arXiv:2501.13956. <https://arxiv.org/abs/2501.13956> - thedotmack (2026). claude-mem: persistent memory for Claude Code. GitHub. <https://github.com/thedotmack/claude-mem> - Zhang, Q., Hu, C., Upasani, S., Ma, B., et al. (2025). Agentic context engineering: evolving contexts for self-improving language models. arXiv:2510.04618. <https://arxiv.org/abs/2510.04618>",
   "marked": "- Anthropic [-(2025a).-] {+(2025).+} Managing context on the Claude Developer Platform (context editing and the memory tool). 29 September 2025. <https://claude.com/blog/context-management> - Anthropic (2026a). Compaction. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/compaction> - Anthropic (2026b). Hooks reference. Claude Code documentation. <https://code.claude.com/docs/en/hooks> - Anthropic (2026c). Prompt caching. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/prompt-caching> - Anthropic (2026d). Context editing. Claude Platform documentation. <https://platform.claude.com/docs/en/build-with-claude/context-editing> - Belady, L. A. (1966). A study of replacement algorithms for a virtual-storage computer. *IBM Systems Journal*, 5(2), 78–101. <https://doi.org/10.1147/sj.52.0078> - Headroom Labs (2026). headroom: compress [-tool outputs, logs, files and RAG chunks before they reach the LLM.-] {+what your AI agent reads.+} GitHub, Apache-2.0. <https://github.com/headroomlabs-ai/headroom> - Hong, K., Troynikov, A., & Huber, J. (2025). Context rot: how increasing input tokens impacts LLM performance. Chroma technical report. <https://research.trychroma.com/context-rot> - Ji, Y. (2025). Context engineering for AI agents: lessons from building Manus. 18 July 2025. <https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus> - Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., & Liang, P. (2024). Lost in the middle: how language models use long contexts. *Transactions of the ACL*, 12, 157–173. <https://arxiv.org/abs/2307.03172> - OpenAI (2026). Compaction. OpenAI API documentation. <https://developers.openai.com/api/docs/guides/compaction> - Packer, C., Wooders, S., Lin, K., Fang, V., Patil, S. G., Stoica, I., & Gonzalez, J. E. (2023). MemGPT: towards LLMs as operating systems. arXiv:2310.08560. <https://arxiv.org/abs/2310.08560> - Rasmussen, P., Paliychuk, P., Beauvais, T., Ryan, J., & Chalef, D. (2025). Zep: a temporal knowledge graph architecture for agent memory. arXiv:2501.13956. <https://arxiv.org/abs/2501.13956> - thedotmack (2026). claude-mem: persistent [-context across sessions-] {+memory+} for [-every agent.-] {+Claude Code.+} GitHub. <https://github.com/thedotmack/claude-mem> - Zhang, Q., Hu, C., Upasani, S., Ma, B., et al. (2025). Agentic context engineering: evolving contexts for self-improving language models. arXiv:2510.04618. <https://arxiv.org/abs/2510.04618>"
  },
  {
   "section": "Appendix A. The Loop in Pseudocode",
   "old": "## Appendix A. The Loop in Pseudocode",
   "new": null,
   "marked": "[-## Appendix A. The Loop in Pseudocode-]"
  },
  {
   "section": "A.1 Appending to the record",
   "old": "### A.1 Appending to the record",
   "new": null,
   "marked": "[-### A.1 Appending to the record-]"
  },
  {
   "section": "A.1 Appending to the record",
   "old": "``` APPEND(session, entry): entry.seq <- next_sequence(session) # once, never reused entry.author <- owner | agent | tool | harness | other_agent if entry.author == owner: entry.words <- strip_wrapper(entry.text) # once; J2, J5, J14 read only this if entry.kind == tool_result and reproducible(entry): entry.content <- reference(path, content_hash) record.append(session, entry) # no update, no supersede index.add(session, entry.seq, entry) # derived, rebuildable",
   "new": null,
   "marked": "[-``` APPEND(session, entry): entry.seq <- next_sequence(session) # once, never reused entry.author <- owner | agent | tool | harness | other_agent if entry.author == owner: entry.words <- strip_wrapper(entry.text) # once; J2, J5, J14 read only this if entry.kind == tool_result and reproducible(entry): entry.content <- reference(path, content_hash) record.append(session, entry) # no update, no supersede index.add(session, entry.seq, entry) # derived, rebuildable-]"
  },
  {
   "section": "A.1 Appending to the record",
   "old": "TOMBSTONE(session, seq, reason, receipt): # only for a J14 deletion record.redact(session, seq, removed(reason, now, receipt)) # the one edit record.append(session, harness(\"redacted\", seq, reason)) index.reindex(session, seq) rebuild_from_record(markers_covering(session, seq)) # as in 5.4 ```",
   "new": null,
   "marked": "[-TOMBSTONE(session, seq, reason, receipt): # only for a J14 deletion record.redact(session, seq, removed(reason, now, receipt)) # the one edit record.append(session, harness(\"redacted\", seq, reason)) index.reindex(session, seq) rebuild_from_record(markers_covering(session, seq)) # as in 5.4 ```-]"
  },
  {
   "section": "A.2 Building a marker and evicting",
   "old": "### A.2 Building a marker and evicting",
   "new": null,
   "marked": "[-### A.2 Building a marker and evicting-]"
  },
  {
   "section": "A.2 Building a marker and evicting",
   "old": "``` COMPACT(window, session, forced): snap <- snapshot(last_call_sent) # per call, attributed if not snap.reconciles and not forced: receipt(decision = \"blocked: snapshot\"); return span <- choose_span(window, order = [reproducible_tool, tool, agent, owner_rest]) if not forced and not pays(span, snap): receipt(decision = \"declined: price\"); return entries <- record.read(session, span.first, span.last) # never old markers marker <- { range: (session, span.first, span.last), owner: verbatim(instructions(entries), budget), strings: exact_strings(entries, cap), lines: decisions_and_failures(entries) + addresses, open: open_items(entries) + addresses } assert resolves(marker) # the check of 8 window.replace(span, marker, at = stable_position) receipt(executor = \"runtime\", owner_case, snap, before, after, outcome) ```",
   "new": null,
   "marked": "[-``` COMPACT(window, session, forced): snap <- snapshot(last_call_sent) # per call, attributed if not snap.reconciles and not forced: receipt(decision = \"blocked: snapshot\"); return span <- choose_span(window, order = [reproducible_tool, tool, agent, owner_rest]) if not forced and not pays(span, snap): receipt(decision = \"declined: price\"); return entries <- record.read(session, span.first, span.last) # never old markers marker <- { range: (session, span.first, span.last), owner: verbatim(instructions(entries), budget), strings: exact_strings(entries, cap), lines: decisions_and_failures(entries) + addresses, open: open_items(entries) + addresses } assert resolves(marker) # the check of 8 window.replace(span, marker, at = stable_position) receipt(executor = \"runtime\", owner_case, snap, before, after, outcome) ```-]"
  },
  {
   "section": "A.3 Acting by owner case",
   "old": "### A.3 Acting by owner case",
   "new": null,
   "marked": "[-### A.3 Acting by owner case-]"
  },
  {
   "section": "A.3 Acting by owner case",
   "old": "``` ON_SESSION_START(session): note_owner_case(session, detect_owner(session)) # runtime | provider_tool | provider_api",
   "new": null,
   "marked": "[-``` ON_SESSION_START(session): note_owner_case(session, detect_owner(session)) # runtime | provider_tool | provider_api-]"
  },
  {
   "section": "A.3 Acting by owner case",
   "old": "ON_PRE_COMPACT(session): # provider_tool case flush_record(session) # catch up with its transcript pending <- build_markers(session, range_to_compact)",
   "new": null,
   "marked": "[-ON_PRE_COMPACT(session): # provider_tool case flush_record(session) # catch up with its transcript pending <- build_markers(session, range_to_compact)-]"
  },
  {
   "section": "A.3 Acting by owner case",
   "old": "ON_SESSION_START_AFTER_COMPACT(session): # provider_tool add_context(pending) # beside the tool's summary receipt(executor = \"provider_tool\", ...)",
   "new": null,
   "marked": "[-ON_SESSION_START_AFTER_COMPACT(session): # provider_tool add_context(pending) # beside the tool's summary receipt(executor = \"provider_tool\", ...)-]"
  },
  {
   "section": "A.3 Acting by owner case",
   "old": "ON_API_COMPACTION(session): # provider_api case resend(markers_for(compacted_range), at = stable_position) # from our own record receipt(executor = \"provider_api\", ...)",
   "new": null,
   "marked": "[-ON_API_COMPACTION(session): # provider_api case resend(markers_for(compacted_range), at = stable_position) # from our own record receipt(executor = \"provider_api\", ...)-]"
  },
  {
   "section": "never: compact the runtime's mirror of a provider_tool session ```",
   "old": "# never: compact the runtime's mirror of a provider_tool session ```",
   "new": null,
   "marked": "[-# never: compact the runtime's mirror of a provider_tool session ```-]"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "## Appendix A. A Worked Record and Marker",
   "marked": "{+## Appendix A. A Worked Record and Marker+}"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "The entries of Figure 1 as stored, with one file read and one quarantine added. Field names follow §4.1; values are illustrative.",
   "marked": "{+The entries of Figure 1 as stored, with one file read and one quarantine added. Field names follow §4.1; values are illustrative.+}"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "``` entry s7#12 author_kind owner time 14:02:11 text [harness wrapper] Never restart the production database during the day. owner_words Never restart the production database during the day. tags instruction (from the shared classifier) controller tool transcript, entry 118",
   "marked": "{+``` entry s7#12 author_kind owner time 14:02:11 text [harness wrapper] Never restart the production database during the day. owner_words Never restart the production database during the day. tags instruction (from the shared classifier) controller tool transcript, entry 118+}"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "entry s7#16 author_kind tool time 14:09:40 call read_file /etc/nginx/sites-enabled/app.conf content blob sha256:7d2a... (4,812 bytes, stored before the window dropped it)",
   "marked": "{+entry s7#16 author_kind tool time 14:09:40 call read_file /etc/nginx/sites-enabled/app.conf content blob sha256:7d2a... (4,812 bytes, stored before the window dropped it)+}"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "entry s7#23 author_kind tool time 14:31:05 call certbot renew text error: too many certificates already issued (rate limit)",
   "marked": "{+entry s7#23 author_kind tool time 14:31:05 call certbot renew text error: too many certificates already issued (rate limit)+}"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "entry s7#62 author_kind harness time 16:47:30 text quarantine s7#40 (writing-stage decision, injected instruction)",
   "marked": "{+entry s7#62 author_kind harness time 16:47:30 text quarantine s7#40 (writing-stage decision, injected instruction)+}"
  },
  {
   "section": "Appendix A. A Worked Record and Marker",
   "old": null,
   "new": "marker m-s7-12-47 v2 built from the record, not from v1 range s7 #12-47 owner #12 \"Never restart the production database during the day.\" strings /etc/nginx/ssl 9f3c2e1 14:32 \"too many certificates already issued\" lines failed #23: certbot renew, rate limit chose #27: keep the old chain until Monday open #31: rotate the key ```",
   "marked": "{+marker m-s7-12-47 v2 built from the record, not from v1 range s7 #12-47 owner #12 \"Never restart the production database during the day.\" strings /etc/nginx/ssl 9f3c2e1 14:32 \"too many certificates already issued\" lines failed #23: certbot renew, rate limit chose #27: keep the old chain until Monday open #31: rotate the key ```+}"
  },
  {
   "section": "never: compact the runtime's mirror of a provider_tool session ```",
   "old": "_J-series paper J1 | Version 8.0 | 2026-10-12_",
   "new": null,
   "marked": "[-_J-series paper J1 | Version 8.0 | 2026-10-12_-]"
  },
  {
   "section": "Appendix B. The Loop in Pseudocode",
   "old": null,
   "new": "## Appendix B. The Loop in Pseudocode",
   "marked": "{+## Appendix B. The Loop in Pseudocode+}"
  },
  {
   "section": "B.1 Appending to the record",
   "old": null,
   "new": "### B.1 Appending to the record",
   "marked": "{+### B.1 Appending to the record+}"
  },
  {
   "section": "B.1 Appending to the record",
   "old": null,
   "new": "``` APPEND(session, entry): # before the model call that answers it entry.seq <- next_sequence(session) # once, never reused entry.author_kind <- owner | agent | tool | harness | other_agent entry.text <- replace_prohibited(entry.text) # 4.7, before any write if entry.author_kind == owner: entry.owner_words <- strip_wrapper(entry.text) # once; never rewritten entry.tags <- classify(entry.owner_words) or \"untagged\" # J5 A.1 if entry.returns_file: entry.content <- blob_put(bytes) # content-addressed record.append_durable(session, entry) # status: captured (4.6) index.add(session, entry.seq, entry) # derived, rebuildable",
   "marked": "{+``` APPEND(session, entry): # before the model call that answers it entry.seq <- next_sequence(session) # once, never reused entry.author_kind <- owner | agent | tool | harness | other_agent entry.text <- replace_prohibited(entry.text) # 4.7, before any write if entry.author_kind == owner: entry.owner_words <- strip_wrapper(entry.text) # once; never rewritten entry.tags <- classify(entry.owner_words) or \"untagged\" # J5 A.1 if entry.returns_file: entry.content <- blob_put(bytes) # content-addressed record.append_durable(session, entry) # status: captured (4.6) index.add(session, entry.seq, entry) # derived, rebuildable+}"
  },
  {
   "section": "B.1 Appending to the record",
   "old": null,
   "new": "ERASE(session, seq, receipt): # writing stage's decision b <- record.blob(session, seq) # none if the entry holds no file hit <- entries_with_blob(b) if b else [(session, seq)] # in any session for (s, n) in hit: record.redact(s, n, tombstone(now, receipt)) # the one edit record.append(s, harness(\"erased\", n)) index.reindex(s, n); rebuild(markers_covering(s, n)) if b: blob_delete(b) manifest.report(status_per_place) # J14 7.7; out of reach named",
   "marked": "{+ERASE(session, seq, receipt): # writing stage's decision b <- record.blob(session, seq) # none if the entry holds no file hit <- entries_with_blob(b) if b else [(session, seq)] # in any session for (s, n) in hit: record.redact(s, n, tombstone(now, receipt)) # the one edit record.append(s, harness(\"erased\", n)) index.reindex(s, n); rebuild(markers_covering(s, n)) if b: blob_delete(b) manifest.report(status_per_place) # J14 7.7; out of reach named+}"
  },
  {
   "section": "B.1 Appending to the record",
   "old": null,
   "new": "QUARANTINE(session, seq, decision): # no edit record.append(session, harness(\"quarantine\", seq, decision)) rebuild(markers_covering(session, seq)) ```",
   "marked": "{+QUARANTINE(session, seq, decision): # no edit record.append(session, harness(\"quarantine\", seq, decision)) rebuild(markers_covering(session, seq)) ```+}"
  },
  {
   "section": "B.2 Building a marker and evicting",
   "old": null,
   "new": "### B.2 Building a marker and evicting",
   "marked": "{+### B.2 Building a marker and evicting+}"
  },
  {
   "section": "B.2 Building a marker and evicting",
   "old": null,
   "new": "``` COMPACT(window, session, forced): snap <- snapshot(last_call_sent) # 7.3 if not snap.reconciles and not forced: receipt(\"blocked: snapshot\"); return span <- choose_span(window, order = [unchanged_source, tool, agent, owner_rest]) if not forced and not pays(span, snap): receipt(\"declined: price\"); return entries <- record.read(session, span.first, span.last) # never old markers marker <- new_marker(range = span, owner = instructions(entries), # tags, verbatim strings = exact_strings(entries, cap), lines = decisions_and_failures(entries), # with addresses open = open_items(entries)) moved <- enforce_owner_budget(window, marker) # 5.5; tell the owner assert resolves_full_range(marker) # 8.2 window.replace(span, marker, at = stable_position) receipt(executor = runtime, snap, before, after, moved, outcome) ```",
   "marked": "{+``` COMPACT(window, session, forced): snap <- snapshot(last_call_sent) # 7.3 if not snap.reconciles and not forced: receipt(\"blocked: snapshot\"); return span <- choose_span(window, order = [unchanged_source, tool, agent, owner_rest]) if not forced and not pays(span, snap): receipt(\"declined: price\"); return entries <- record.read(session, span.first, span.last) # never old markers marker <- new_marker(range = span, owner = instructions(entries), # tags, verbatim strings = exact_strings(entries, cap), lines = decisions_and_failures(entries), # with addresses open = open_items(entries)) moved <- enforce_owner_budget(window, marker) # 5.5; tell the owner assert resolves_full_range(marker) # 8.2 window.replace(span, marker, at = stable_position) receipt(executor = runtime, snap, before, after, moved, outcome) ```+}"
  },
  {
   "section": "B.2 Building a marker and evicting",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix C. The Window Controller Adapter Contract",
   "old": null,
   "new": "## Appendix C. The Window Controller Adapter Contract",
   "marked": "{+## Appendix C. The Window Controller Adapter Contract+}"
  },
  {
   "section": "Appendix C. The Window Controller Adapter Contract",
   "old": null,
   "new": "Version 1 of the contract. Every adapter implements all rows; a capability it cannot confirm counts as absent.",
   "marked": "{+Version 1 of the contract. Every adapter implements all rows; a capability it cannot confirm counts as absent.+}"
  },
  {
   "section": "Appendix C. The Window Controller Adapter Contract",
   "old": null,
   "new": "| Part | What it holds | Rule | |----------|-------------------------|-------------------------| | Version | contract version; adapter version; controller name and version | re-detected at session start and on any model or tool change | | Capabilities | builds calls; event before compaction (can block); summary after compaction; injection before the next call; per-turn injection; readable transcript; clearing controls; compacted state readable or opaque | choose the path of §6.2, §6.3 or §6.4 | | Pending state | one harness entry per step: detected, flushed, markers built, injected, acknowledged, closed | each state appended durably before the next step; a restart resumes from the last state; marker IDs make a repeat harmless | | Sequence map | runtime address paired with the controller's entry ID | written at flush; entries only the controller saw get runtime numbers in the controller's order | | Delivery check | marker ID seen in the next call sent (runtime, API) or in the tool's transcript | not seen by the next turn: resend with the per-turn injection; count the turns run without it | | Knowledge level | model view (runtime); sent and summary (tool); sent only (opaque API) | written on every receipt; no claim about the model's view exceeds it | | Degraded paths | no event before compaction: detect afterwards (a summary appears, input tokens fall), flush, then build; no injection after compaction: per-turn injection, receipt marked late; unreadable transcript: record what the runtime saw and mark the gap in range reads | each path used is named in the receipt | | Erase in live state | rebuild the window (runtime); end or compact the session and use the controller's deletion control (tool, API) | each place reported to the writing stage's deletion manifest (§4.4), unreachable copies named | | Never retained | the controller's no-retention setting, where offered | where none is offered, the owner is told at session start |",
   "marked": "{+| Part | What it holds | Rule | |----------|-------------------------|-------------------------| | Version | contract version; adapter version; controller name and version | re-detected at session start and on any model or tool change | | Capabilities | builds calls; event before compaction (can block); summary after compaction; injection before the next call; per-turn injection; readable transcript; clearing controls; compacted state readable or opaque | choose the path of §6.2, §6.3 or §6.4 | | Pending state | one harness entry per step: detected, flushed, markers built, injected, acknowledged, closed | each state appended durably before the next step; a restart resumes from the last state; marker IDs make a repeat harmless | | Sequence map | runtime address paired with the controller's entry ID | written at flush; entries only the controller saw get runtime numbers in the controller's order | | Delivery check | marker ID seen in the next call sent (runtime, API) or in the tool's transcript | not seen by the next turn: resend with the per-turn injection; count the turns run without it | | Knowledge level | model view (runtime); sent and summary (tool); sent only (opaque API) | written on every receipt; no claim about the model's view exceeds it | | Degraded paths | no event before compaction: detect afterwards (a summary appears, input tokens fall), flush, then build; no injection after compaction: per-turn injection, receipt marked late; unreadable transcript: record what the runtime saw and mark the gap in range reads | each path used is named in the receipt | | Erase in live state | rebuild the window (runtime); end or compact the session and use the controller's deletion control (tool, API) | each place reported to the writing stage's deletion manifest (§4.4), unreachable copies named | | Never retained | the controller's no-retention setting, where offered | where none is offered, the owner is told at session start |+}"
  },
  {
   "section": "Appendix C. The Window Controller Adapter Contract",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix C. The Window Controller Adapter Contract",
   "old": null,
   "new": "_J-series paper J1 | Version 8.1 | 2026-10-12_",
   "marked": "{+_J-series paper J1 | Version 8.1 | 2026-10-12_+}"
  }
 ]
}
