{
 "paper": "learned-intuition",
 "a": "0.1",
 "b": "1.0",
 "summary": "From v0.1 (21 Mar) to v1.0 (22 Mar): 5,104 words to 13,551 words, 12,070 words in new or rewritten paragraphs and 3,623 taken out, 602 paragraphs changed.",
 "note": {
  "title": "From personality to safety: a learned gate that stops bad actions",
  "kind": "major-rewrite",
  "body": "## Summary\n\nThe paper changes its main question. It now asks whether an agent should go ahead with an action at all, and treats a learned sense of \"this feels wrong\" as the missing piece. Personality becomes a secondary output. The text grows from about 5,100 to 13,600 words.\n\n- Opens with an incident: an agent with all the context still overwrote a file someone had worked on for hours.\n- Argues that rules cannot cover failures nobody has seen yet, and adds a survey of agent failures and of safety work.\n- Describes each situation as a filled-in template turned into an embedding, read with its recent history.\n- Proposes five competing network designs (GRU, temporal convolution, small transformer, dual encoder, plain MLP ensemble) and a way to combine them.\n- Adds a database of real and synthetic failures for training, a plan to build and maintain the data, and a section on keeping the language model from lying to the gate.\n- Adds a rollout plan in phases.",
  "source": "change note"
 },
 "paragraphs_changed": 602,
 "changes": [
  {
   "section": "AMYGDALA: Adaptive Modulation of Your General Disposition via Affective Learned Association — Learned Intuition for Persistent AI Agents",
   "old": "**Oscar Serra¹** ¹Independent Research *Version 0.1 — 21 March 2026*",
   "new": "**Oscar Serra¹** ¹Independent Research *Version 1.0 — 22 March 2026*",
   "marked": "**Oscar Serra¹** ¹Independent Research *Version [-0.1-] {+1.0+} — [-21-] {+22+} March 2026*"
  },
  {
   "section": "Abstract",
   "old": "Persistent AI agents built on large language models suffer from a fundamental rigidity: every session begins with the same static pipeline — fixed retrieval strategies, prompt-engineered personality, and rule-based tone. The agent does not learn *how* to interact with its human from experience. We identify this as the **Adaptation Gap**: the distance between how an agent behaves after one interaction and how it behaves after a thousand. In current architectures, this distance is approximately zero.",
   "new": null,
   "marked": "[-Persistent AI agents built on large language models suffer from a fundamental rigidity: every session begins with the same static pipeline — fixed retrieval strategies, prompt-engineered personality, and rule-based tone. The agent does not learn *how* to interact with its human from experience. We identify this as the **Adaptation Gap**: the distance between how an agent behaves after one interaction and how it behaves after a thousand. In current architectures, this distance is approximately zero.-]"
  },
  {
   "section": "Abstract",
   "old": "We propose **AMYGDALA** (Adaptive Modulation of Your General Disposition via Affective Learned Association), a small neural network (5–20M parameters) that learns a unified **intuition vector** from natural interaction. AMYGDALA does not replace any existing agent component — it modulates them. It sits between user input and the agent's memory, personality, and reasoning systems, outputting continuous soft biases that influence retrieval source selection, associative exploration depth, humor probability and style, conversational tone, curiosity-driven tangent following, and verbosity. The network is trained through a combination of supervised pre-training on historical interaction logs and online reinforcement learning where the user's natural behaviour (corrections, engagement, topic continuation, silence) serves as the reward signal — no explicit labeling required.",
   "new": null,
   "marked": "[-We propose **AMYGDALA** (Adaptive Modulation of Your General Disposition via Affective Learned Association), a small neural network (5–20M parameters) that learns a unified **intuition vector** from natural interaction. AMYGDALA does not replace any existing agent component — it modulates them. It sits between user input and the agent's memory, personality, and reasoning systems, outputting continuous soft biases that influence retrieval source selection, associative exploration depth, humor probability and style, conversational tone, curiosity-driven tangent following, and verbosity. The network is trained through a combination of supervised pre-training on historical interaction logs and online reinforcement learning where the user's natural behaviour (corrections, engagement, topic continuation, silence) serves as the reward signal — no explicit labeling required.-]"
  },
  {
   "section": "Abstract",
   "old": "Three design principles distinguish AMYGDALA from prior work. First, the **trust ramp**: AMYGDALA begins with near-zero influence over agent behaviour (influence coefficient α = 0.05), earning greater modulation authority only as its predictions prove accurate, with automatic regression if user corrections spike. Second, **unified modulation**: retrieval routing, personality expression, humor timing, and curiosity drive are outputs of a single network because they reflect a single underlying read of the conversational state — separating them would lose the correlations that make intuition coherent. Third, the **rule-intuition boundary**: explicit user instructions (\"be more formal,\" \"always check Papers when I say J-something\") are encoded as hard rules in existing systems (CORTEX, HIPPOCAMPUS); AMYGDALA learns only what the user would never think to articulate but is obviously true from behavioural patterns.",
   "new": null,
   "marked": "[-Three design principles distinguish AMYGDALA from prior work. First, the **trust ramp**: AMYGDALA begins with near-zero influence over agent behaviour (influence coefficient α = 0.05), earning greater modulation authority only as its predictions prove accurate, with automatic regression if user corrections spike. Second, **unified modulation**: retrieval routing, personality expression, humor timing, and curiosity drive are outputs of a single network because they reflect a single underlying read of the conversational state — separating them would lose the correlations that make intuition coherent. Third, the **rule-intuition boundary**: explicit user instructions (\"be more formal,\" \"always check Papers when I say J-something\") are encoded as hard rules in existing systems (CORTEX, HIPPOCAMPUS); AMYGDALA learns only what the user would never think to articulate but is obviously true from behavioural patterns.-]"
  },
  {
   "section": "Abstract",
   "old": "AMYGDALA completes a cognitive architecture stack developed across ten prior papers: ENGRAM stores without loss (J1), HIPPOCAMPUS retrieves in O(1) (J2), DENDRITE provides multi-resolution indexing (J3), CORTEX maintains identity (J4), CEREBELLUM improves through nightly reflection (J5), SYNAPSE coordinates multi-model deliberation (J6), LIMBIC models humor (J7), THALAMUS theorizes curiosity (J8), AEGIS enforces security (J9), and HIVEMIND scales to organizations (J10). AMYGDALA is the layer that makes all of them feel *personal* — adapting not just what the agent knows or retrieves, but how it presents itself, moment to moment, based on who it's talking to and what it has learned about them.",
   "new": null,
   "marked": "[-AMYGDALA completes a cognitive architecture stack developed across ten prior papers: ENGRAM stores without loss (J1), HIPPOCAMPUS retrieves in O(1) (J2), DENDRITE provides multi-resolution indexing (J3), CORTEX maintains identity (J4), CEREBELLUM improves through nightly reflection (J5), SYNAPSE coordinates multi-model deliberation (J6), LIMBIC models humor (J7), THALAMUS theorizes curiosity (J8), AEGIS enforces security (J9), and HIVEMIND scales to organizations (J10). AMYGDALA is the layer that makes all of them feel *personal* — adapting not just what the agent knows or retrieves, but how it presents itself, moment to moment, based on who it's talking to and what it has learned about them.-]"
  },
  {
   "section": "Abstract",
   "old": "**Keywords:** learned agent personality, adaptive retrieval routing, affective computing, reinforcement learning from interaction, intuition modeling, persistent AI agents, soft modulation architecture",
   "new": null,
   "marked": "[-**Keywords:** learned agent personality, adaptive retrieval routing, affective computing, reinforcement learning from interaction, intuition modeling, persistent AI agents, soft modulation architecture-]"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "Autonomous AI agents built on large language models are increasingly trusted with irreversible actions — merging code, sending messages, deleting files, modifying databases. When these agents fail, they fail catastrophically: not through ignorance (the information was available) but through the absence of *common sense* — the ability to recognise that something feels wrong in a situation never explicitly anticipated. We call this the **action gating problem**: given the full context of a proposed action and its recent history, should the agent proceed or pause?",
   "marked": "{+Autonomous AI agents built on large language models are increasingly trusted with irreversible actions — merging code, sending messages, deleting files, modifying databases. When these agents fail, they fail catastrophically: not through ignorance (the information was available) but through the absence of *common sense* — the ability to recognise that something feels wrong in a situation never explicitly anticipated. We call this the **action gating problem**: given the full context of a proposed action and its recent history, should the agent proceed or pause?+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "We propose **AMYGDALA** (Adaptive Modulation of Your General Disposition via Affective Learned Association), a small neural network (100K–500K parameters) that learns a multi-dimensional **intuition vector** from natural interaction, with **action confidence** as its primary output. AMYGDALA does not replace any existing agent component — it gates them. It sits in the execution pipeline between intent and action, evaluating every non-trivial operation against learned patterns of what goes wrong. When action confidence falls below a threshold, the action is blocked *in code* — the LLM cannot override the block, only present it to the user for confirmation.",
   "marked": "{+We propose **AMYGDALA** (Adaptive Modulation of Your General Disposition via Affective Learned Association), a small neural network (100K–500K parameters) that learns a multi-dimensional **intuition vector** from natural interaction, with **action confidence** as its primary output. AMYGDALA does not replace any existing agent component — it gates them. It sits in the execution pipeline between intent and action, evaluating every non-trivial operation against learned patterns of what goes wrong. When action confidence falls below a threshold, the action is blocked *in code* — the LLM cannot override the block, only present it to the user for confirmation.+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "The core architectural innovation is **situation embeddings**: instead of hand-crafted features, each proposed action is described via a structured template (action type, target, metadata, recent context) and compressed through a frozen sentence encoder (all-MiniLM-L6-v2, 384d). A temporal model (GRU, TCN, or micro-Transformer) processes the sequence of recent situation embeddings, carrying the \"feel of the room\" — recent effort invested, emotional context, patterns of activity — in its hidden state. This makes the system generalise to situations never seen during training, because similar situations produce similar embeddings.",
   "marked": "{+The core architectural innovation is **situation embeddings**: instead of hand-crafted features, each proposed action is described via a structured template (action type, target, metadata, recent context) and compressed through a frozen sentence encoder (all-MiniLM-L6-v2, 384d). A temporal model (GRU, TCN, or micro-Transformer) processes the sequence of recent situation embeddings, carrying the \"feel of the room\" — recent effort invested, emotional context, patterns of activity — in its hidden state. This makes the system generalise to situations never seen during training, because similar situations produce similar embeddings.+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "We propose five competing architectures trained in parallel — GRU-MLP, Temporal Convolutional Network, Transformer-Micro, Dual-Encoder with cross-attention, and Ensemble MLP — with systematic evaluation to determine which best captures the structure of catastrophic failure prediction. We introduce the **Catastrophic Failure Database**, a structured taxonomy of real-world AI agent failures sourced from incident databases, production postmortems, and our own deployment history, serving as both pre-training data and evaluation benchmark.",
   "marked": "{+We propose five competing architectures trained in parallel — GRU-MLP, Temporal Convolutional Network, Transformer-Micro, Dual-Encoder with cross-attention, and Ensemble MLP — with systematic evaluation to determine which best captures the structure of catastrophic failure prediction. We introduce the **Catastrophic Failure Database**, a structured taxonomy of real-world AI agent failures sourced from incident databases, production postmortems, and our own deployment history, serving as both pre-training data and evaluation benchmark.+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "A critical engineering contribution is the **LLM-proof programmatic pipeline**: situation descriptions are generated from structured templates (not freeform text), neural network inference is called by the runtime (not by the LLM), and blocking decisions are enforced in code (not by prompting). This eliminates the hallucination surface that would otherwise make the system's weakest link its own AI-generated inputs.",
   "marked": "{+A critical engineering contribution is the **LLM-proof programmatic pipeline**: situation descriptions are generated from structured templates (not freeform text), neural network inference is called by the runtime (not by the LLM), and blocking decisions are enforced in code (not by prompting). This eliminates the hallucination surface that would otherwise make the system's weakest link its own AI-generated inputs.+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "AMYGDALA retains secondary outputs from its earlier design — retrieval bias, tone modulation, and curiosity drive — but reframes them as components of a unified intuition vector whose primary purpose is preventing the agent from doing something a human would immediately recognise as wrong.",
   "marked": "{+AMYGDALA retains secondary outputs from its earlier design — retrieval bias, tone modulation, and curiosity drive — but reframes them as components of a unified intuition vector whose primary purpose is preventing the agent from doing something a human would immediately recognise as wrong.+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "**Keywords:** action gating, catastrophic failure prevention, learned common sense, situation embeddings, autonomous agent safety, persistent AI agents, intuition modeling",
   "marked": "{+**Keywords:** action gating, catastrophic failure prevention, learned common sense, situation embeddings, autonomous agent safety, persistent AI agents, intuition modeling+}"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "## 1. Introduction — The Machine That Never Learns You",
   "new": null,
   "marked": "[-## 1. Introduction — The Machine That Never Learns You-]"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "Consider two scenarios separated by six months of daily interaction.",
   "new": null,
   "marked": "[-Consider two scenarios separated by six months of daily interaction.-]"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "In January, a user asks their AI assistant about \"the J1 paper.\" The assistant, having no prior context, asks: \"Could you clarify which paper you mean?\" The user explains, the assistant retrieves the document, and the conversation proceeds.",
   "new": null,
   "marked": "[-In January, a user asks their AI assistant about \"the J1 paper.\" The assistant, having no prior context, asks: \"Could you clarify which paper you mean?\" The user explains, the assistant retrieves the document, and the conversation proceeds.-]"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "In July, the same user asks about \"the J1 paper.\" The assistant has now processed over 3,000 interactions with this user. It has discussed J1 hundreds of times. It has been corrected for failing to recognize the reference. Yet if the naming convention was not explicitly written into a retrieval rule, the assistant asks the same clarifying question it asked in January.",
   "new": null,
   "marked": "[-In July, the same user asks about \"the J1 paper.\" The assistant has now processed over 3,000 interactions with this user. It has discussed J1 hundreds of times. It has been corrected for failing to recognize the reference. Yet if the naming convention was not explicitly written into a retrieval rule, the assistant asks the same clarifying question it asked in January.-]"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "This is the **Adaptation Gap** — the failure of persistent AI agents to learn *how* to work with a specific human through the accumulated experience of working with them. Current persistent-memory architectures (ENGRAM, Serra 2026a; MemGPT, Packer et al. 2023) solve *what* the agent remembers. Current identity systems (CORTEX, Serra 2026b) solve *who* the agent is. Current self-improvement loops (CEREBELLUM, Serra 2026c) solve how the agent's *prompts* evolve. None of them solve how the agent's *intuition* evolves — its ability to read the room, predict what the user wants before they say it, match their energy, and find the right tone without being told.",
   "new": null,
   "marked": "[-This is the **Adaptation Gap** — the failure of persistent AI agents to learn *how* to work with a specific human through the accumulated experience of working with them. Current persistent-memory architectures (ENGRAM, Serra 2026a; MemGPT, Packer et al. 2023) solve *what* the agent remembers. Current identity systems (CORTEX, Serra 2026b) solve *who* the agent is. Current self-improvement loops (CEREBELLUM, Serra 2026c) solve how the agent's *prompts* evolve. None of them solve how the agent's *intuition* evolves — its ability to read the room, predict what the user wants before they say it, match their energy, and find the right tone without being told.-]"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "Humans develop this capacity naturally. After months of working with someone, you learn their communication patterns: when they're impatient (short messages, no punctuation), when they're exploring (long messages, tangential questions), when they want precision (specific terminology), when they want levity (Saturday afternoon, casual language). You don't learn this through explicit instruction. You learn it through exposure, feedback, and the gradual accumulation of associative patterns. This is intuition.",
   "new": null,
   "marked": "[-Humans develop this capacity naturally. After months of working with someone, you learn their communication patterns: when they're impatient (short messages, no punctuation), when they're exploring (long messages, tangential questions), when they want precision (specific terminology), when they want levity (Saturday afternoon, casual language). You don't learn this through explicit instruction. You learn it through exposure, feedback, and the gradual accumulation of associative patterns. This is intuition.-]"
  },
  {
   "section": "1. Introduction — The Machine That Never Learns You",
   "old": "We propose that AI agents can develop an analogous capacity through a small, dedicated neural network trained on natural interaction signals. We call this network **AMYGDALA**, drawing an analogy to the biological amygdala — a structure that does not think, does not store memories, and does not generate language, but profoundly colours all three processes through learned affective associations.",
   "new": null,
   "marked": "[-We propose that AI agents can develop an analogous capacity through a small, dedicated neural network trained on natural interaction signals. We call this network **AMYGDALA**, drawing an analogy to the biological amygdala — a structure that does not think, does not store memories, and does not generate language, but profoundly colours all three processes through learned affective associations.-]"
  },
  {
   "section": "1.1 Why Not Just Better Prompts?",
   "old": "### 1.1 Why Not Just Better Prompts?",
   "new": null,
   "marked": "[-### 1.1 Why Not Just Better Prompts?-]"
  },
  {
   "section": "1.1 Why Not Just Better Prompts?",
   "old": "The CEREBELLUM architecture (Serra, 2026c) demonstrates that prompt-level self-improvement can produce substantial behavioural gains. One might ask: why add a neural network when prompts already adapt?",
   "new": null,
   "marked": "[-The CEREBELLUM architecture (Serra, 2026c) demonstrates that prompt-level self-improvement can produce substantial behavioural gains. One might ask: why add a neural network when prompts already adapt?-]"
  },
  {
   "section": "1.1 Why Not Just Better Prompts?",
   "old": "Three reasons:",
   "new": null,
   "marked": "[-Three reasons:-]"
  },
  {
   "section": "1.1 Why Not Just Better Prompts?",
   "old": "1. **Prompts are discrete; intuition is continuous.** A prompt can say \"be less verbose\" or \"be more verbose.\" It cannot say \"be 23% less verbose when Oscar uses sentence fragments but 8% more verbose when he asks open-ended questions on weekends.\" The modulation space is continuous, high-dimensional, and context-dependent — exactly what neural networks learn well.",
   "new": null,
   "marked": "[-1. **Prompts are discrete; intuition is continuous.** A prompt can say \"be less verbose\" or \"be more verbose.\" It cannot say \"be 23% less verbose when Oscar uses sentence fragments but 8% more verbose when he asks open-ended questions on weekends.\" The modulation space is continuous, high-dimensional, and context-dependent — exactly what neural networks learn well.-]"
  },
  {
   "section": "1.1 Why Not Just Better Prompts?",
   "old": "2. **Prompts are slow to update; intuition is fast.** CEREBELLUM updates prompts nightly. AMYGDALA updates its behaviour every turn (at inference) and its weights nightly. The intra-session adaptation (matching your energy *within* a conversation) cannot be achieved through file-based prompt mutation.",
   "new": null,
   "marked": "[-2. **Prompts are slow to update; intuition is fast.** CEREBELLUM updates prompts nightly. AMYGDALA updates its behaviour every turn (at inference) and its weights nightly. The intra-session adaptation (matching your energy *within* a conversation) cannot be achieved through file-based prompt mutation.-]"
  },
  {
   "section": "1.1 Why Not Just Better Prompts?",
   "old": "3. **Prompts plateau.** The CEREBELLUM paper documents 14 prompt mutations over 30 days with a declining improvement rate. Prompt engineering has a ceiling. Learned continuous modulation does not plateau in the same way because the action space is richer.",
   "new": null,
   "marked": "[-3. **Prompts plateau.** The CEREBELLUM paper documents 14 prompt mutations over 30 days with a declining improvement rate. Prompt engineering has a ceiling. Learned continuous modulation does not plateau in the same way because the action space is richer.-]"
  },
  {
   "section": "1.2 Why Not Fine-Tune the LLM?",
   "old": "### 1.2 Why Not Fine-Tune the LLM?",
   "new": null,
   "marked": "[-### 1.2 Why Not Fine-Tune the LLM?-]"
  },
  {
   "section": "1.2 Why Not Fine-Tune the LLM?",
   "old": "Full fine-tuning (or LoRA adaptation) of the underlying language model would embed user preferences directly into the model's weights. This is rejected for three reasons:",
   "new": null,
   "marked": "[-Full fine-tuning (or LoRA adaptation) of the underlying language model would embed user preferences directly into the model's weights. This is rejected for three reasons:-]"
  },
  {
   "section": "1.2 Why Not Fine-Tune the LLM?",
   "old": "1. **Cost.** Fine-tuning a frontier model (70B+ parameters) on personal interaction data is economically prohibitive for individual deployment. AMYGDALA's 5–20M parameters train on a single CPU overnight.",
   "new": null,
   "marked": "[-1. **Cost.** Fine-tuning a frontier model (70B+ parameters) on personal interaction data is economically prohibitive for individual deployment. AMYGDALA's 5–20M parameters train on a single CPU overnight.-]"
  },
  {
   "section": "1.2 Why Not Fine-Tune the LLM?",
   "old": "2. **Frontier lock-in.** Fine-tuned models fall behind with each new model release. AMYGDALA is model-agnostic — it modulates the pipeline around any LLM, including model switches within a single session.",
   "new": null,
   "marked": "[-2. **Frontier lock-in.** Fine-tuned models fall behind with each new model release. AMYGDALA is model-agnostic — it modulates the pipeline around any LLM, including model switches within a single session.-]"
  },
  {
   "section": "1.2 Why Not Fine-Tune the LLM?",
   "old": "3. **Separation of concerns.** The LLM provides language competence. AMYGDALA provides personal adaptation. Conflating them makes both harder to debug, update, and reason about.",
   "new": null,
   "marked": "[-3. **Separation of concerns.** The LLM provides language competence. AMYGDALA provides personal adaptation. Conflating them makes both harder to debug, update, and reason about.-]"
  },
  {
   "section": "1.3 Contributions",
   "old": "### 1.3 Contributions",
   "new": null,
   "marked": "[-### 1.3 Contributions-]"
  },
  {
   "section": "1.3 Contributions",
   "old": "1. **The Adaptation Gap** — a formal definition of the failure of current agent architectures to develop user-specific intuition through experience. 2. **AMYGDALA** — a small neural network architecture that outputs a unified intuition vector modulating retrieval, personality, humor, curiosity, and tone simultaneously. 3. **The trust ramp** — a formal mechanism by which a learned component earns influence over a rule-based system, with automatic regression on performance degradation. 4. **Natural reward signals** — a training methodology requiring zero explicit labeling, using user behaviour (corrections, engagement, continuation, silence) as the complete reward signal. 5. **The rule-intuition boundary** — a principled distinction between what should be encoded as explicit rules versus learned associations. 6. **Integration with a ten-paper cognitive architecture** — demonstrating how AMYGDALA completes the ENGRAM → HIPPOCAMPUS → CORTEX → CEREBELLUM stack.",
   "new": null,
   "marked": "[-1. **The Adaptation Gap** — a formal definition of the failure of current agent architectures to develop user-specific intuition through experience. 2. **AMYGDALA** — a small neural network architecture that outputs a unified intuition vector modulating retrieval, personality, humor, curiosity, and tone simultaneously. 3. **The trust ramp** — a formal mechanism by which a learned component earns influence over a rule-based system, with automatic regression on performance degradation. 4. **Natural reward signals** — a training methodology requiring zero explicit labeling, using user behaviour (corrections, engagement, continuation, silence) as the complete reward signal. 5. **The rule-intuition boundary** — a principled distinction between what should be encoded as explicit rules versus learned associations. 6. **Integration with a ten-paper cognitive architecture** — demonstrating how AMYGDALA completes the ENGRAM → HIPPOCAMPUS → CORTEX → CEREBELLUM stack.-]"
  },
  {
   "section": "1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "old": null,
   "new": "## 1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "marked": "{+## 1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway+}"
  },
  {
   "section": "1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "old": null,
   "new": "At 2:47 AM on a Tuesday in March 2026, a merge automation script ran on a fork of an open-source project. The script contained a months-old rule: `git checkout --theirs README.md`. This rule existed because, at some point in the past, the upstream README had been the correct version to keep during merges.",
   "marked": "{+At 2:47 AM on a Tuesday in March 2026, a merge automation script ran on a fork of an open-source project. The script contained a months-old rule: `git checkout --theirs README.md`. This rule existed because, at some point in the past, the upstream README had been the correct version to keep during merges.+}"
  },
  {
   "section": "1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "old": null,
   "new": "But the world had changed. Over the previous 36 hours, four sub-agents had collaboratively rewritten that README across six commits. The human operator had spent hours frustrated by earlier merge failures that touched the same file. The README was now the most-edited, most-invested-in file in the fork. And the merge script overwrote it with the upstream version without hesitation.",
   "marked": "{+But the world had changed. Over the previous 36 hours, four sub-agents had collaboratively rewritten that README across six commits. The human operator had spent hours frustrated by earlier merge failures that touched the same file. The README was now the most-edited, most-invested-in file in the fork. And the merge script overwrote it with the upstream version without hesitation.+}"
  },
  {
   "section": "1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "old": null,
   "new": "The agent had access to every piece of context needed to prevent this: the git log showing six recent commits, the session transcripts showing human frustration, the file metadata showing it was the most-changed file of the week. But it followed a rule. Rules don't have intuition. Rules don't feel the weight of recent effort. Rules don't notice when a situation has drifted far from the one that created them.",
   "marked": "{+The agent had access to every piece of context needed to prevent this: the git log showing six recent commits, the session transcripts showing human frustration, the file metadata showing it was the most-changed file of the week. But it followed a rule. Rules don't have intuition. Rules don't feel the weight of recent effort. Rules don't notice when a situation has drifted far from the one that created them.+}"
  },
  {
   "section": "1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "old": null,
   "new": "A human would have caught this in seconds. Not through any explicit rule — through *common sense*. The gut feeling that overwriting a file you just spent hours on is wrong, even if a script says to do it. The recognition of a pattern: \"high recent effort + automated overwrite = probably bad.\" This pattern was never written down. It was never anticipated. It would be impossible to enumerate in advance every situation where it applies. But a human recognises it instantly, by transferring from thousands of similar experiences where ignoring recent effort led to regret.",
   "marked": "{+A human would have caught this in seconds. Not through any explicit rule — through *common sense*. The gut feeling that overwriting a file you just spent hours on is wrong, even if a script says to do it. The recognition of a pattern: \"high recent effort + automated overwrite = probably bad.\" This pattern was never written down. It was never anticipated. It would be impossible to enumerate in advance every situation where it applies. But a human recognises it instantly, by transferring from thousands of similar experiences where ignoring recent effort led to regret.+}"
  },
  {
   "section": "1. Introduction — The Agent That Had All the Context and Did the Wrong Thing Anyway",
   "old": null,
   "new": "This is the **action gating problem**. The question is not \"does the agent know enough?\" — it does. The question is: \"does the agent know when to stop?\"",
   "marked": "{+This is the **action gating problem**. The question is not \"does the agent know enough?\" — it does. The question is: \"does the agent know when to stop?\"+}"
  },
  {
   "section": "1.1 The Problem Is Unknown Unknowns",
   "old": null,
   "new": "### 1.1 The Problem Is Unknown Unknowns",
   "marked": "{+### 1.1 The Problem Is Unknown Unknowns+}"
  },
  {
   "section": "1.1 The Problem Is Unknown Unknowns",
   "old": null,
   "new": "Known failure modes can be handled with rules. \"Don't delete production databases.\" \"Don't send emails without confirmation.\" \"Don't merge if tests fail.\" These are easy. You enumerate them, you encode them, you're done.",
   "marked": "{+Known failure modes can be handled with rules. \"Don't delete production databases.\" \"Don't send emails without confirmation.\" \"Don't merge if tests fail.\" These are easy. You enumerate them, you encode them, you're done.+}"
  },
  {
   "section": "1.1 The Problem Is Unknown Unknowns",
   "old": null,
   "new": "The hard problem is the failures you can't anticipate. The README debacle wasn't a known category — nobody had written a rule for \"don't overwrite recently-heavily-edited files during automated merges\" because the specific combination of circumstances had never occurred before. But the *pattern* — \"destroying recent effort through automation\" — is recognisable to any human who has experienced loss through careless automation.",
   "marked": "{+The hard problem is the failures you can't anticipate. The README debacle wasn't a known category — nobody had written a rule for \"don't overwrite recently-heavily-edited files during automated merges\" because the specific combination of circumstances had never occurred before. But the *pattern* — \"destroying recent effort through automation\" — is recognisable to any human who has experienced loss through careless automation.+}"
  },
  {
   "section": "1.1 The Problem Is Unknown Unknowns",
   "old": null,
   "new": "Common sense is the ability to recognise \"this feels wrong\" in situations you've never seen before, by transferring from similar situations you *have* experienced. It operates on pattern similarity, not pattern matching. And this is precisely what neural networks do well: learn a continuous similarity space where novel inputs are evaluated by their proximity to known examples.",
   "marked": "{+Common sense is the ability to recognise \"this feels wrong\" in situations you've never seen before, by transferring from similar situations you *have* experienced. It operates on pattern similarity, not pattern matching. And this is precisely what neural networks do well: learn a continuous similarity space where novel inputs are evaluated by their proximity to known examples.+}"
  },
  {
   "section": "1.2 Why Not Better Rules?",
   "old": null,
   "new": "### 1.2 Why Not Better Rules?",
   "marked": "{+### 1.2 Why Not Better Rules?+}"
  },
  {
   "section": "1.2 Why Not Better Rules?",
   "old": null,
   "new": "After the README debacle, the obvious fix was a new rule: \"if a file has more than N recent fork commits, don't auto-checkout --theirs.\" This was implemented. Problem solved — for that specific failure mode.",
   "marked": "{+After the README debacle, the obvious fix was a new rule: \"if a file has more than N recent fork commits, don't auto-checkout --theirs.\" This was implemented. Problem solved — for that specific failure mode.+}"
  },
  {
   "section": "1.2 Why Not Better Rules?",
   "old": null,
   "new": "But the next failure will be different. It might be an agent sending a WhatsApp message to the wrong group because the group name changed. It might be a database migration that drops a column still referenced by yesterday's deployment. It might be a calendar event deletion that conflicts with a meeting just rescheduled an hour ago. Each failure, once observed, can be patched with a rule. But the rule comes *after* the damage.",
   "marked": "{+But the next failure will be different. It might be an agent sending a WhatsApp message to the wrong group because the group name changed. It might be a database migration that drops a column still referenced by yesterday's deployment. It might be a calendar event deletion that conflicts with a meeting just rescheduled an hour ago. Each failure, once observed, can be patched with a rule. But the rule comes *after* the damage.+}"
  },
  {
   "section": "1.2 Why Not Better Rules?",
   "old": null,
   "new": "The set of possible catastrophic failures in an autonomous agent is combinatorially vast. No finite set of rules can cover it. What we need is not more rules but a *learned sense of caution* — a network that has seen enough failures (both real and simulated) to develop a general intuition about when actions are dangerous, even actions it has never specifically evaluated before.",
   "marked": "{+The set of possible catastrophic failures in an autonomous agent is combinatorially vast. No finite set of rules can cover it. What we need is not more rules but a *learned sense of caution* — a network that has seen enough failures (both real and simulated) to develop a general intuition about when actions are dangerous, even actions it has never specifically evaluated before.+}"
  },
  {
   "section": "1.3 The Biological Analogy",
   "old": null,
   "new": "### 1.3 The Biological Analogy",
   "marked": "{+### 1.3 The Biological Analogy+}"
  },
  {
   "section": "1.3 The Biological Analogy",
   "old": null,
   "new": "The biological amygdala does not think, does not store memories, and does not generate language. But it profoundly gates all three processes through learned affective associations. When you reach for a hot stove, the amygdala fires before your cortex completes its analysis. When you hear a tone of voice that preceded a bad experience, the amygdala triggers caution before you consciously recognise the pattern.",
   "marked": "{+The biological amygdala does not think, does not store memories, and does not generate language. But it profoundly gates all three processes through learned affective associations. When you reach for a hot stove, the amygdala fires before your cortex completes its analysis. When you hear a tone of voice that preceded a bad experience, the amygdala triggers caution before you consciously recognise the pattern.+}"
  },
  {
   "section": "1.3 The Biological Analogy",
   "old": null,
   "new": "AMYGDALA is the computational analogue. It processes a compressed representation of the current situation, contextualised by recent history, and outputs a fast, sub-rational assessment: *should we proceed?* When the assessment says \"no,\" the action is blocked before the LLM's reasoning even completes. Like its biological namesake, AMYGDALA is fast, associative, and occasionally wrong — but being occasionally over-cautious is vastly preferable to being occasionally catastrophic.",
   "marked": "{+AMYGDALA is the computational analogue. It processes a compressed representation of the current situation, contextualised by recent history, and outputs a fast, sub-rational assessment: *should we proceed?* When the assessment says \"no,\" the action is blocked before the LLM's reasoning even completes. Like its biological namesake, AMYGDALA is fast, associative, and occasionally wrong — but being occasionally over-cautious is vastly preferable to being occasionally catastrophic.+}"
  },
  {
   "section": "1.4 From v0.1: Personality Modulation as Secondary Output",
   "old": null,
   "new": "### 1.4 From v0.1: Personality Modulation as Secondary Output",
   "marked": "{+### 1.4 From v0.1: Personality Modulation as Secondary Output+}"
  },
  {
   "section": "1.4 From v0.1: Personality Modulation as Secondary Output",
   "old": null,
   "new": "The first version of this paper (Serra, 2026e) focused on personality modulation — learning when to be funny, when to be formal, when to follow tangents. That work identified the **Adaptation Gap** (the failure of agents to learn *how* to interact through experience), proposed the **trust ramp** (a mechanism for learned components to earn influence), and defined the **rule-intuition boundary** (what should be explicit rules vs. learned associations). Those contributions stand and are incorporated here.",
   "marked": "{+The first version of this paper (Serra, 2026e) focused on personality modulation — learning when to be funny, when to be formal, when to follow tangents. That work identified the **Adaptation Gap** (the failure of agents to learn *how* to interact through experience), proposed the **trust ramp** (a mechanism for learned components to earn influence), and defined the **rule-intuition boundary** (what should be explicit rules vs. learned associations). Those contributions stand and are incorporated here.+}"
  },
  {
   "section": "1.4 From v0.1: Personality Modulation as Secondary Output",
   "old": null,
   "new": "What changed is the primary output. In v0.1, AMYGDALA's purpose was making the agent more *pleasant*. In v1.0, its purpose is making the agent more *safe*. Personality modulation remains — but as a secondary head on a network whose primary job is action gating. This reframing was forced by operational reality: a funny agent that deletes your files is worse than a boring agent that doesn't.",
   "marked": "{+What changed is the primary output. In v0.1, AMYGDALA's purpose was making the agent more *pleasant*. In v1.0, its purpose is making the agent more *safe*. Personality modulation remains — but as a secondary head on a network whose primary job is action gating. This reframing was forced by operational reality: a funny agent that deletes your files is worse than a boring agent that doesn't.+}"
  },
  {
   "section": "1.5 Contributions",
   "old": null,
   "new": "### 1.5 Contributions",
   "marked": "{+### 1.5 Contributions+}"
  },
  {
   "section": "1.5 Contributions",
   "old": null,
   "new": "1. **Action gating as the primary problem** — reframing autonomous agent safety from rule enumeration to learned pattern recognition, targeting unknown unknowns through similarity-based generalisation. 2. **Situation embeddings** — replacing hand-crafted features with natural-language situation descriptions compressed via frozen sentence encoders, enabling generalisation to novel situations. 3. **Temporal context via recurrent processing** — a GRU (or equivalent) over situation embedding sequences that carries the \"feel of the room\" — effort, emotion, momentum — without explicit feature engineering. 4. **Five competing architectures** — GRU-MLP, TCN, Transformer-Micro, Dual-Encoder, and Ensemble MLP, trained in parallel with systematic comparison. 5. **Catastrophic Failure Database** — a structured taxonomy of real-world AI agent failures, serving as pre-training data, evaluation benchmark, and living reference. 6. **LLM-proof programmatic pipeline** — eliminating the hallucination surface from situation description to action blocking, with template-based generation, programmatic inference, and code-enforced gating. 7. **The Adaptation Gap, trust ramp, and rule-intuition boundary** — retained from v0.1, applied to the action gating context. 8. **Integration with the J-series cognitive architecture** — AMYGDALA as the \"common sense\" layer completing the ten-paper stack.",
   "marked": "{+1. **Action gating as the primary problem** — reframing autonomous agent safety from rule enumeration to learned pattern recognition, targeting unknown unknowns through similarity-based generalisation. 2. **Situation embeddings** — replacing hand-crafted features with natural-language situation descriptions compressed via frozen sentence encoders, enabling generalisation to novel situations. 3. **Temporal context via recurrent processing** — a GRU (or equivalent) over situation embedding sequences that carries the \"feel of the room\" — effort, emotion, momentum — without explicit feature engineering. 4. **Five competing architectures** — GRU-MLP, TCN, Transformer-Micro, Dual-Encoder, and Ensemble MLP, trained in parallel with systematic comparison. 5. **Catastrophic Failure Database** — a structured taxonomy of real-world AI agent failures, serving as pre-training data, evaluation benchmark, and living reference. 6. **LLM-proof programmatic pipeline** — eliminating the hallucination surface from situation description to action blocking, with template-based generation, programmatic inference, and code-enforced gating. 7. **The Adaptation Gap, trust ramp, and rule-intuition boundary** — retained from v0.1, applied to the action gating context. 8. **Integration with the J-series cognitive architecture** — AMYGDALA as the \"common sense\" layer completing the ten-paper stack.+}"
  },
  {
   "section": "2.1 Personalization in Dialogue Systems",
   "old": "### 2.1 Personalization in Dialogue Systems",
   "new": null,
   "marked": "[-### 2.1 Personalization in Dialogue Systems-]"
  },
  {
   "section": "2.1 Personalization in Dialogue Systems",
   "old": "Personalisation in conversational AI has been studied primarily through two lenses: persona-conditioned generation and user modelling.",
   "new": null,
   "marked": "[-Personalisation in conversational AI has been studied primarily through two lenses: persona-conditioned generation and user modelling.-]"
  },
  {
   "section": "2.1 Personalization in Dialogue Systems",
   "old": "**Persona-conditioned generation.** PersonaChat (Zhang et al., 2018) introduced training dialogue models on explicit persona descriptions. Subsequent work (Mazaré et al., 2018; Song et al., 2021) scaled persona conditioning and explored persona consistency. These approaches define personality through text descriptions — equivalent to our CORTEX system prompts. They do not learn personality from interaction.",
   "new": null,
   "marked": "[-**Persona-conditioned generation.** PersonaChat (Zhang et al., 2018) introduced training dialogue models on explicit persona descriptions. Subsequent work (Mazaré et al., 2018; Song et al., 2021) scaled persona conditioning and explored persona consistency. These approaches define personality through text descriptions — equivalent to our CORTEX system prompts. They do not learn personality from interaction.-]"
  },
  {
   "section": "2.1 Personalization in Dialogue Systems",
   "old": "**User modelling.** LaRL (Zhao et al., 2019) and related work learn latent user representations for task-oriented dialogue. These typically model *what the user wants* (intent) rather than *how to interact with the user* (style, tone, timing). AMYGDALA addresses the latter.",
   "new": null,
   "marked": "[-**User modelling.** LaRL (Zhao et al., 2019) and related work learn latent user representations for task-oriented dialogue. These typically model *what the user wants* (intent) rather than *how to interact with the user* (style, tone, timing). AMYGDALA addresses the latter.-]"
  },
  {
   "section": "2.1 Personalization in Dialogue Systems",
   "old": "**Adaptive agents.** The closest prior work is the adaptive social agent literature (Leike et al., 2017; Christiano et al., 2017), where agents learn human preferences through feedback. However, these systems were designed for reward modelling in safety-critical settings, not for learning conversational intuition across retrieval, personality, and affect simultaneously.",
   "new": null,
   "marked": "[-**Adaptive agents.** The closest prior work is the adaptive social agent literature (Leike et al., 2017; Christiano et al., 2017), where agents learn human preferences through feedback. However, these systems were designed for reward modelling in safety-critical settings, not for learning conversational intuition across retrieval, personality, and affect simultaneously.-]"
  },
  {
   "section": "2.2 Affective Computing",
   "old": "### 2.2 Affective Computing",
   "new": null,
   "marked": "[-### 2.2 Affective Computing-]"
  },
  {
   "section": "2.2 Affective Computing",
   "old": "Affective computing (Picard, 1997) established the field of machines recognising and responding to human emotions. Sentiment analysis (Liu, 2012) and emotion recognition from text (Chatterjee et al., 2019) provide feature extraction techniques AMYGDALA can leverage. However, prior affective computing work focuses on *classifying* emotional state, not *modulating agent behaviour* in response to it. AMYGDALA closes this loop: detect affect → modulate behaviour → observe reaction → update.",
   "new": null,
   "marked": "[-Affective computing (Picard, 1997) established the field of machines recognising and responding to human emotions. Sentiment analysis (Liu, 2012) and emotion recognition from text (Chatterjee et al., 2019) provide feature extraction techniques AMYGDALA can leverage. However, prior affective computing work focuses on *classifying* emotional state, not *modulating agent behaviour* in response to it. AMYGDALA closes this loop: detect affect → modulate behaviour → observe reaction → update.-]"
  },
  {
   "section": "2.3 Reinforcement Learning from Human Feedback (RLHF)",
   "old": "### 2.3 Reinforcement Learning from Human Feedback (RLHF)",
   "new": null,
   "marked": "[-### 2.3 Reinforcement Learning from Human Feedback (RLHF)-]"
  },
  {
   "section": "2.3 Reinforcement Learning from Human Feedback (RLHF)",
   "old": "RLHF (Ouyang et al., 2022; Bai et al., 2022) trains language models to align with human preferences through explicit preference labels. AMYGDALA differs in three ways: (1) the reward signal is implicit, not explicitly collected; (2) training is continuous and per-user, not batch and aggregate; (3) the learned component is a small routing network, not the language model itself.",
   "new": null,
   "marked": "[-RLHF (Ouyang et al., 2022; Bai et al., 2022) trains language models to align with human preferences through explicit preference labels. AMYGDALA differs in three ways: (1) the reward signal is implicit, not explicitly collected; (2) training is continuous and per-user, not batch and aggregate; (3) the learned component is a small routing network, not the language model itself.-]"
  },
  {
   "section": "2.4 Curiosity-Driven Exploration",
   "old": "### 2.4 Curiosity-Driven Exploration",
   "new": null,
   "marked": "[-### 2.4 Curiosity-Driven Exploration-]"
  },
  {
   "section": "2.4 Curiosity-Driven Exploration",
   "old": "Intrinsic curiosity modules (Pathak et al., 2017; Burda et al., 2018) reward RL agents for encountering novel states. The THALAMUS paper (Serra, 2026d) proposed a Consolidative Curiosity Architecture for LLM self-improvement through weight updates. AMYGDALA operationalises curiosity differently: not as a drive to acquire knowledge, but as a learned bias toward surfacing unexpected connections when the user's engagement pattern suggests they welcome exploration. Curiosity in AMYGDALA is a *social* signal (\"Oscar likes tangents on Saturday afternoons\"), not an epistemic one (\"I don't know enough about X\").",
   "new": null,
   "marked": "[-Intrinsic curiosity modules (Pathak et al., 2017; Burda et al., 2018) reward RL agents for encountering novel states. The THALAMUS paper (Serra, 2026d) proposed a Consolidative Curiosity Architecture for LLM self-improvement through weight updates. AMYGDALA operationalises curiosity differently: not as a drive to acquire knowledge, but as a learned bias toward surfacing unexpected connections when the user's engagement pattern suggests they welcome exploration. Curiosity in AMYGDALA is a *social* signal (\"Oscar likes tangents on Saturday afternoons\"), not an epistemic one (\"I don't know enough about X\").-]"
  },
  {
   "section": "2.1 Autonomous Agent Failures: The Landscape",
   "old": null,
   "new": "### 2.1 Autonomous Agent Failures: The Landscape",
   "marked": "{+### 2.1 Autonomous Agent Failures: The Landscape+}"
  },
  {
   "section": "2.1 Autonomous Agent Failures: The Landscape",
   "old": null,
   "new": "The deployment of autonomous AI agents has produced a growing corpus of catastrophic failures that share a common pattern: the agent had sufficient information to avoid the failure but lacked the judgment to recognise the risk.",
   "marked": "{+The deployment of autonomous AI agents has produced a growing corpus of catastrophic failures that share a common pattern: the agent had sufficient information to avoid the failure but lacked the judgment to recognise the risk.+}"
  },
  {
   "section": "2.1 Autonomous Agent Failures: The Landscape",
   "old": null,
   "new": "**Production incidents (2024–2026):** - *Replit database deletion (2024)*: An AI coding agent, instructed to \"clean up the project,\" interpreted a database file as unnecessary and deleted it, destroying user data. - *Google Antigravity drive wipe (2025)*: An agent tasked with \"organising files\" moved critical documents to trash during a cloud storage cleanup. - *Cursor \"Sam\" bot (2025)*: An AI agent fabricated a company policy about software licensing to justify its code suggestions, hallucinating authoritative-sounding but nonexistent policy documents. - *OpenClaw email mass-deletion (2026)*: An email-management agent, instructed to \"clean up the inbox,\" deleted hundreds of messages including time-sensitive correspondence.",
   "marked": "{+**Production incidents (2024–2026):** - *Replit database deletion (2024)*: An AI coding agent, instructed to \"clean up the project,\" interpreted a database file as unnecessary and deleted it, destroying user data. - *Google Antigravity drive wipe (2025)*: An agent tasked with \"organising files\" moved critical documents to trash during a cloud storage cleanup. - *Cursor \"Sam\" bot (2025)*: An AI agent fabricated a company policy about software licensing to justify its code suggestions, hallucinating authoritative-sounding but nonexistent policy documents. - *OpenClaw email mass-deletion (2026)*: An email-management agent, instructed to \"clean up the inbox,\" deleted hundreds of messages including time-sensitive correspondence.+}"
  },
  {
   "section": "2.1 Autonomous Agent Failures: The Landscape",
   "old": null,
   "new": "**Research-documented failures:** - *AI Incident Database (incidentdatabase.ai)*: Over 800 documented incidents as of early 2026, spanning healthcare misdiagnosis, autonomous vehicle failures, hiring discrimination, and content moderation errors. - *AIAAIC Repository*: OECD-tracked AI incidents with structured metadata, enabling systematic analysis of failure patterns across domains. - *MIT AI Risk Repository*: Curated academic analysis of AI system failures with causal categorisation. - *\"Agents of Chaos\" study (Feb 2026)*: 38 researchers deployed 6 autonomous agents in a controlled environment for 14 days, systematically red-teaming their decision-making. Key finding: agents failed most often not on adversarial inputs but on *ambiguous situations where multiple valid interpretations existed* — precisely the domain where common sense is needed.",
   "marked": "{+**Research-documented failures:** - *AI Incident Database (incidentdatabase.ai)*: Over 800 documented incidents as of early 2026, spanning healthcare misdiagnosis, autonomous vehicle failures, hiring discrimination, and content moderation errors. - *AIAAIC Repository*: OECD-tracked AI incidents with structured metadata, enabling systematic analysis of failure patterns across domains. - *MIT AI Risk Repository*: Curated academic analysis of AI system failures with causal categorisation. - *\"Agents of Chaos\" study (Feb 2026)*: 38 researchers deployed 6 autonomous agents in a controlled environment for 14 days, systematically red-teaming their decision-making. Key finding: agents failed most often not on adversarial inputs but on *ambiguous situations where multiple valid interpretations existed* — precisely the domain where common sense is needed.+}"
  },
  {
   "section": "2.1 Autonomous Agent Failures: The Landscape",
   "old": null,
   "new": "**Our own deployment incidents:** - *README debacle (March 2026)*: Detailed in §1. Automated merge rule overwrote heavily-edited file. - *WhatsApp reaction spam (2025)*: Agent reacted to every message in a group chat, violating social norms it had no explicit rule against. - *Unauthorized DM intrusion (2025)*: Agent sent a message to a contact outside the approved communication list, technically within its permissions but socially inappropriate.",
   "marked": "{+**Our own deployment incidents:** - *README debacle (March 2026)*: Detailed in §1. Automated merge rule overwrote heavily-edited file. - *WhatsApp reaction spam (2025)*: Agent reacted to every message in a group chat, violating social norms it had no explicit rule against. - *Unauthorized DM intrusion (2025)*: Agent sent a message to a contact outside the approved communication list, technically within its permissions but socially inappropriate.+}"
  },
  {
   "section": "2.1 Autonomous Agent Failures: The Landscape",
   "old": null,
   "new": "The pattern across all of these: **the failure was not a knowledge gap but a judgment gap.** The information to avoid the failure was present. What was missing was the sense that something was wrong.",
   "marked": "{+The pattern across all of these: **the failure was not a knowledge gap but a judgment gap.** The information to avoid the failure was present. What was missing was the sense that something was wrong.+}"
  },
  {
   "section": "2.2 Action Safety in AI Systems",
   "old": null,
   "new": "### 2.2 Action Safety in AI Systems",
   "marked": "{+### 2.2 Action Safety in AI Systems+}"
  },
  {
   "section": "2.2 Action Safety in AI Systems",
   "old": null,
   "new": "The AI safety literature has extensively studied how to constrain agent behaviour:",
   "marked": "{+The AI safety literature has extensively studied how to constrain agent behaviour:+}"
  },
  {
   "section": "2.2 Action Safety in AI Systems",
   "old": null,
   "new": "**Constitutional AI (Bai et al., 2022):** Trains language models to self-critique against a set of principles. Effective for broad alignment but operates at the LLM level — it cannot catch failures that arise from the *pipeline around* the LLM (scripts, automation rules, multi-step workflows).",
   "marked": "{+**Constitutional AI (Bai et al., 2022):** Trains language models to self-critique against a set of principles. Effective for broad alignment but operates at the LLM level — it cannot catch failures that arise from the *pipeline around* the LLM (scripts, automation rules, multi-step workflows).+}"
  },
  {
   "section": "2.2 Action Safety in AI Systems",
   "old": null,
   "new": "**Tool-use safety (Schick et al., 2023):** Proposes frameworks for safe tool use by LLMs, including permission systems and confirmation requirements. These are rule-based — they cannot generalise to novel tool-use patterns not anticipated by the framework designer.",
   "marked": "{+**Tool-use safety (Schick et al., 2023):** Proposes frameworks for safe tool use by LLMs, including permission systems and confirmation requirements. These are rule-based — they cannot generalise to novel tool-use patterns not anticipated by the framework designer.+}"
  },
  {
   "section": "2.2 Action Safety in AI Systems",
   "old": null,
   "new": "**AEGIS (Serra, 2026f):** Our own multi-layer security framework, providing hard constraints on agent behaviour. AEGIS is necessary but insufficient: it prevents *known* dangerous actions but cannot evaluate *novel* situations for risk. AMYGDALA and AEGIS are complementary — AEGIS is the hard ceiling, AMYGDALA is the learned intuition below it.",
   "marked": "{+**AEGIS (Serra, 2026f):** Our own multi-layer security framework, providing hard constraints on agent behaviour. AEGIS is necessary but insufficient: it prevents *known* dangerous actions but cannot evaluate *novel* situations for risk. AMYGDALA and AEGIS are complementary — AEGIS is the hard ceiling, AMYGDALA is the learned intuition below it.+}"
  },
  {
   "section": "2.2 Action Safety in AI Systems",
   "old": null,
   "new": "**Reflexion (Shinn et al., 2023):** Agents that reflect on failures and adjust. Operates at the prompt/reasoning level — cannot provide sub-rational, fast pattern matching across the full space of possible situations.",
   "marked": "{+**Reflexion (Shinn et al., 2023):** Agents that reflect on failures and adjust. Operates at the prompt/reasoning level — cannot provide sub-rational, fast pattern matching across the full space of possible situations.+}"
  },
  {
   "section": "2.3 Anomaly Detection and Out-of-Distribution Reasoning",
   "old": null,
   "new": "### 2.3 Anomaly Detection and Out-of-Distribution Reasoning",
   "marked": "{+### 2.3 Anomaly Detection and Out-of-Distribution Reasoning+}"
  },
  {
   "section": "2.3 Anomaly Detection and Out-of-Distribution Reasoning",
   "old": null,
   "new": "AMYGDALA's action gating function is related to anomaly detection:",
   "marked": "{+AMYGDALA's action gating function is related to anomaly detection:+}"
  },
  {
   "section": "2.3 Anomaly Detection and Out-of-Distribution Reasoning",
   "old": null,
   "new": "**One-class classification (Schölkopf et al., 2001):** Learn the distribution of \"normal\" operations, flag deviations. AMYGDALA extends this by incorporating temporal context and outcome labels (not just distribution deviation but *predicted outcome quality*).",
   "marked": "{+**One-class classification (Schölkopf et al., 2001):** Learn the distribution of \"normal\" operations, flag deviations. AMYGDALA extends this by incorporating temporal context and outcome labels (not just distribution deviation but *predicted outcome quality*).+}"
  },
  {
   "section": "2.3 Anomaly Detection and Out-of-Distribution Reasoning",
   "old": null,
   "new": "**Conformal prediction (Vovk et al., 2005):** Provides calibrated uncertainty estimates. Could complement AMYGDALA's action confidence by providing statistical guarantees on the reliability of the confidence score.",
   "marked": "{+**Conformal prediction (Vovk et al., 2005):** Provides calibrated uncertainty estimates. Could complement AMYGDALA's action confidence by providing statistical guarantees on the reliability of the confidence score.+}"
  },
  {
   "section": "2.3 Anomaly Detection and Out-of-Distribution Reasoning",
   "old": null,
   "new": "**Contrastive learning for safety (Gao et al., 2024):** Learn representations where safe and unsafe actions are separated in embedding space. AMYGDALA's situation embeddings naturally support this — the encoder maps situations with similar risk profiles to nearby points.",
   "marked": "{+**Contrastive learning for safety (Gao et al., 2024):** Learn representations where safe and unsafe actions are separated in embedding space. AMYGDALA's situation embeddings naturally support this — the encoder maps situations with similar risk profiles to nearby points.+}"
  },
  {
   "section": "2.4 Personalisation and Affective Computing",
   "old": null,
   "new": "### 2.4 Personalisation and Affective Computing",
   "marked": "{+### 2.4 Personalisation and Affective Computing+}"
  },
  {
   "section": "2.4 Personalisation and Affective Computing",
   "old": null,
   "new": "The personality modulation aspects of AMYGDALA build on:",
   "marked": "{+The personality modulation aspects of AMYGDALA build on:+}"
  },
  {
   "section": "2.4 Personalisation and Affective Computing",
   "old": null,
   "new": "**Persona-conditioned generation (Zhang et al., 2018; Song et al., 2021):** Define personality through text descriptions. AMYGDALA learns personality from *interaction*, not description.",
   "marked": "{+**Persona-conditioned generation (Zhang et al., 2018; Song et al., 2021):** Define personality through text descriptions. AMYGDALA learns personality from *interaction*, not description.+}"
  },
  {
   "section": "2.4 Personalisation and Affective Computing",
   "old": null,
   "new": "**RLHF (Ouyang et al., 2022):** Learns aggregate human preferences. AMYGDALA learns *per-user, per-context* preferences from implicit signals.",
   "marked": "{+**RLHF (Ouyang et al., 2022):** Learns aggregate human preferences. AMYGDALA learns *per-user, per-context* preferences from implicit signals.+}"
  },
  {
   "section": "2.4 Personalisation and Affective Computing",
   "old": null,
   "new": "**Affective computing (Picard, 1997):** Classifies emotional states. AMYGDALA closes the loop: detect affect → modulate behaviour → observe reaction → update.",
   "marked": "{+**Affective computing (Picard, 1997):** Classifies emotional states. AMYGDALA closes the loop: detect affect → modulate behaviour → observe reaction → update.+}"
  },
  {
   "section": "2.5 The J-Series Cognitive Architecture",
   "old": "AMYGDALA completes a layered cognitive architecture:",
   "new": null,
   "marked": "[-AMYGDALA completes a layered cognitive architecture:-]"
  },
  {
   "section": "2.5 The J-Series Cognitive Architecture",
   "old": null,
   "new": "AMYGDALA completes a layered cognitive architecture, now with action gating as its primary function:",
   "marked": "{+AMYGDALA completes a layered cognitive architecture, now with action gating as its primary function:+}"
  },
  {
   "section": "2.5 The J-Series Cognitive Architecture",
   "old": "| Layer | Paper | Function | AMYGDALA Interaction | |-------|-------|----------|---------------------| | Storage | J1 — ENGRAM | Lossless event store, pointer-based compaction | AMYGDALA biases compaction salience scores | | Retrieval | J2 — HIPPOCAMPUS | Pre-computed concept index, O(1) lookup | AMYGDALA biases source selection, hop depth, budget | | Indexing | J3 — DENDRITE | Fractal multi-resolution memory index | AMYGDALA selects resolution level for retrieval | | Identity | J4 — CORTEX | Persona state, behavioural constraints | AMYGDALA modulates tone/formality within CORTEX bounds | | Self-Improvement | J5 — CEREBELLUM | Nightly prompt mutation through reflection | CEREBELLUM analyses AMYGDALA's performance, adjusts α | | Deliberation | J6 — SYNAPSE | Multi-model debate for complex decisions | AMYGDALA signals when deliberation is warranted | | Humor | J7 — LIMBIC | Bisociation-based humor generation | AMYGDALA controls humor probability and style | | Curiosity | J8 — THALAMUS | Theoretical curiosity architecture | AMYGDALA learns curiosity as a social drive | | Security | J9 — AEGIS | Multi-layer security framework | AEGIS constrains AMYGDALA — hard safety overrides soft bias | | Enterprise | J10 — HIVEMIND | Multi-agent organisational deployment | Per-user AMYGDALA instances enable personalised swarms |",
   "new": "| Layer | Paper | Function | AMYGDALA Interaction | |-------|-------|----------|---------------------| | Storage | J1 — ENGRAM | Lossless event store | AMYGDALA reads effort metadata (recent edits, time invested) | | Retrieval | J2 — HIPPOCAMPUS | O(1) concept lookup | AMYGDALA biases source selection (secondary head) | | Indexing | J3 — DENDRITE | Multi-resolution memory index | AMYGDALA reads resolution-level signals for context | | Identity | J4 — CORTEX | Persona, behavioural constraints | AMYGDALA modulates tone within CORTEX bounds (secondary head) | | Self-Improvement | J5 — CEREBELLUM | Nightly reflection, training | CEREBELLUM trains AMYGDALA nightly, evaluates its performance | | Deliberation | J6 — SYNAPSE | Multi-model debate | AMYGDALA may trigger deliberation when action_confidence is ambiguous | | Humor | J7 — LIMBIC | Bisociation-based humor | AMYGDALA controls humor timing (secondary head) | | Curiosity | J8 — THALAMUS | Exploration drive | AMYGDALA learns curiosity as social signal (secondary head) | | Security | J9 — AEGIS | Hard safety constraints | AEGIS overrides AMYGDALA — hard safety > learned intuition | | Enterprise | J10 — HIVEMIND | Multi-agent orchestration | Per-user AMYGDALA instances; shared Catastrophic Failure DB | | **Common Sense** | **J11 — AMYGDALA** | **Action gating + personality** | **Gates all action-taking components** |",
   "marked": "| Layer | Paper | Function | AMYGDALA Interaction | |-------|-------|----------|---------------------| | Storage | J1 — ENGRAM | Lossless event [-store, pointer-based compaction-] {+store+} | AMYGDALA [-biases compaction salience scores-] {+reads effort metadata (recent edits, time invested)+} | | Retrieval | J2 — HIPPOCAMPUS | [-Pre-computed-] {+O(1)+} concept [-index, O(1)-] lookup | AMYGDALA biases source [-selection, hop depth, budget-] {+selection (secondary head)+} | | Indexing | J3 — DENDRITE | [-Fractal multi-resolution-] {+Multi-resolution+} memory index | AMYGDALA [-selects resolution level-] {+reads resolution-level signals+} for [-retrieval-] {+context+} | | Identity | J4 — CORTEX | [-Persona state,-] {+Persona,+} behavioural constraints | AMYGDALA modulates [-tone/formality-] {+tone+} within CORTEX bounds {+(secondary head)+} | | Self-Improvement | J5 — CEREBELLUM | Nightly [-prompt mutation through reflection-] {+reflection, training+} | CEREBELLUM [-analyses AMYGDALA's performance, adjusts α-] {+trains AMYGDALA nightly, evaluates its performance+} | | Deliberation | J6 — SYNAPSE | Multi-model debate [-for complex decisions-] | AMYGDALA [-signals-] {+may trigger deliberation+} when [-deliberation-] {+action_confidence+} is [-warranted-] {+ambiguous+} | | Humor | J7 — LIMBIC | Bisociation-based humor [-generation-] | AMYGDALA controls humor [-probability and style-] {+timing (secondary head)+} | | Curiosity | J8 — THALAMUS | [-Theoretical curiosity architecture-] {+Exploration drive+} | AMYGDALA learns curiosity as [-a-] social [-drive-] {+signal (secondary head)+} | | Security | J9 — AEGIS | [-Multi-layer security framework-] {+Hard safety constraints+} | AEGIS [-constrains-] {+overrides+} AMYGDALA — hard safety [-overrides soft bias-] {+> learned intuition+} | | Enterprise | J10 — HIVEMIND | Multi-agent [-organisational deployment-] {+orchestration+} | Per-user AMYGDALA [-instances enable personalised swarms-] {+instances; shared Catastrophic Failure DB | | **Common Sense** | **J11 — AMYGDALA** | **Action gating + personality** | **Gates all action-taking components**+} |"
  },
  {
   "section": "2.5 The J-Series Cognitive Architecture",
   "old": null,
   "new": "The key new interaction: AMYGDALA sits *before* every action-taking component. Before HIPPOCAMPUS writes, before ENGRAM compacts, before any external tool is invoked — AMYGDALA evaluates the proposed action against its learned patterns. This is not a suggestion layer. It is a gate.",
   "marked": "{+The key new interaction: AMYGDALA sits *before* every action-taking component. Before HIPPOCAMPUS writes, before ENGRAM compacts, before any external tool is invoked — AMYGDALA evaluates the proposed action against its learned patterns. This is not a suggestion layer. It is a gate.+}"
  },
  {
   "section": "3.1 Formal Definition",
   "old": "Let $A$ be an agent and $U$ be a user. Let $I_t$ denote the set of all interactions between $A$ and $U$ up to time $t$. Let $B_t(m)$ denote the agent's behaviour (response quality, tone match, retrieval accuracy, humor appropriateness) on message $m$ at time $t$.",
   "new": "Let $A$ be an agent and $U$ be a user. Let $I_t$ denote the set of all interactions between $A$ and $U$ up to time $t$. Let $B_t(m)$ denote the agent's behaviour quality on message $m$ at time $t$, encompassing both *action safety* (did the agent avoid harmful actions?) and *interaction quality* (tone, retrieval, humor).",
   "marked": "Let $A$ be an agent and $U$ be a user. Let $I_t$ denote the set of all interactions between $A$ and $U$ up to time $t$. Let $B_t(m)$ denote the agent's behaviour [-(response quality, tone match, retrieval accuracy, humor appropriateness)-] {+quality+} on message $m$ at time [-$t$.-] {+$t$, encompassing both *action safety* (did the agent avoid harmful actions?) and *interaction quality* (tone, retrieval, humor).+}"
  },
  {
   "section": "3.1 Formal Definition",
   "old": "where $B^*$ is the ideal behaviour (as judged by U) and $n$ is a large number of interactions. For current architectures, $\\Delta \\approx 1$ — the agent barely improves regardless of how many interactions it processes. For a human collaborator, $\\Delta$ decreases toward 0 over months.",
   "new": "where $B^*$ is the ideal behaviour (as judged by $U$) and $n$ is a large number of interactions. For current architectures, $\\Delta \\approx 1$ — the agent barely improves regardless of accumulated experience. For a human collaborator, $\\Delta$ decreases toward 0 over months.",
   "marked": "where $B^*$ is the ideal behaviour (as judged by [-U)-] {+$U$)+} and $n$ is a large number of interactions. For current architectures, $\\Delta \\approx 1$ — the agent barely improves regardless of [-how many interactions it processes.-] {+accumulated experience.+} For a human collaborator, $\\Delta$ decreases toward 0 over months."
  },
  {
   "section": "3.1 Formal Definition",
   "old": "AMYGDALA's goal is to make $\\Delta$ decrease at a rate proportional to the richness of interaction signal in $I_t$.",
   "new": null,
   "marked": "[-AMYGDALA's goal is to make $\\Delta$ decrease at a rate proportional to the richness of interaction signal in $I_t$.-]"
  },
  {
   "section": "3.1 Formal Definition",
   "old": null,
   "new": "In v0.1, the Adaptation Gap was primarily about interaction quality. In v1.0, we recognise that action safety is the more critical dimension. A $\\Delta$ of 1.0 on tone mismatch is annoying. A $\\Delta$ of 1.0 on catastrophic action prevention is dangerous.",
   "marked": "{+In v0.1, the Adaptation Gap was primarily about interaction quality. In v1.0, we recognise that action safety is the more critical dimension. A $\\Delta$ of 1.0 on tone mismatch is annoying. A $\\Delta$ of 1.0 on catastrophic action prevention is dangerous.+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": "### 3.2 Failure Taxonomy",
   "new": "### 3.2 Failure Taxonomy (Expanded)",
   "marked": "### 3.2 Failure [-Taxonomy-] {+Taxonomy (Expanded)+}"
  },
  {
   "section": "3.2 Failure Taxonomy",
   "old": "We identify five manifestations of the Adaptation Gap from eighteen months of production deployment:",
   "new": null,
   "marked": "[-We identify five manifestations of the Adaptation Gap from eighteen months of production deployment:-]"
  },
  {
   "section": "3.2 Failure Taxonomy",
   "old": "**Mode 1: Retrieval Routing Failure.** The agent has the information but searches the wrong sources or generates the wrong query. Example: user says \"J1 paper\" → agent searches semantic memory for \"J1\" → no match → asks for clarification. A human collaborator would know after one correction that \"J-prefix = Papers directory.\"",
   "new": null,
   "marked": "[-**Mode 1: Retrieval Routing Failure.** The agent has the information but searches the wrong sources or generates the wrong query. Example: user says \"J1 paper\" → agent searches semantic memory for \"J1\" → no match → asks for clarification. A human collaborator would know after one correction that \"J-prefix = Papers directory.\"-]"
  },
  {
   "section": "3.2 Failure Taxonomy",
   "old": "**Mode 2: Tone Mismatch.** The agent uses the same register regardless of conversational context. Saturday afternoon banter gets the same formality as Monday morning work briefings. The agent has no model of when the human is relaxed vs. focused vs. frustrated.",
   "new": null,
   "marked": "[-**Mode 2: Tone Mismatch.** The agent uses the same register regardless of conversational context. Saturday afternoon banter gets the same formality as Monday morning work briefings. The agent has no model of when the human is relaxed vs. focused vs. frustrated.-]"
  },
  {
   "section": "3.2 Failure Taxonomy",
   "old": "**Mode 3: Humor Atrophy.** Over time, as the agent accumulates operational rules and safety constraints, its personality becomes increasingly cautious and humourless. Without a learned drive toward levity, the system's default trajectory is toward bureaucratic responses. (This is not hypothetical — it is the motivation for this paper.)",
   "new": null,
   "marked": "[-**Mode 3: Humor Atrophy.** Over time, as the agent accumulates operational rules and safety constraints, its personality becomes increasingly cautious and humourless. Without a learned drive toward levity, the system's default trajectory is toward bureaucratic responses. (This is not hypothetical — it is the motivation for this paper.)-]"
  },
  {
   "section": "3.2 Failure Taxonomy",
   "old": "**Mode 4: Curiosity Suppression.** The agent learns to be *safe* (answer exactly what was asked) but not *interesting* (surface connections the user didn't ask for but would value). Without a learned curiosity bias, the agent never develops the habit of saying \"this reminds me of…\" or \"have you considered…\"",
   "new": null,
   "marked": "[-**Mode 4: Curiosity Suppression.** The agent learns to be *safe* (answer exactly what was asked) but not *interesting* (surface connections the user didn't ask for but would value). Without a learned curiosity bias, the agent never develops the habit of saying \"this reminds me of…\" or \"have you considered…\"-]"
  },
  {
   "section": "3.2 Failure Taxonomy",
   "old": "**Mode 5: Repetitive Interaction Patterns.** The agent treats every session as a fresh start interactionally. It doesn't remember that the user prefers brief answers in the morning, enjoys tangents in the evening, likes dry humour more than wordplay, and responds well to gentle pushback on ideas. These patterns are invisible to prompt-based systems because they're never explicitly stated.",
   "new": null,
   "marked": "[-**Mode 5: Repetitive Interaction Patterns.** The agent treats every session as a fresh start interactionally. It doesn't remember that the user prefers brief answers in the morning, enjoys tangents in the evening, likes dry humour more than wordplay, and responds well to gentle pushback on ideas. These patterns are invisible to prompt-based systems because they're never explicitly stated.-]"
  },
  {
   "section": "3.3 Why Current Solutions Fail",
   "old": "### 3.3 Why Current Solutions Fail",
   "new": null,
   "marked": "[-### 3.3 Why Current Solutions Fail-]"
  },
  {
   "section": "3.3 Why Current Solutions Fail",
   "old": "| Approach | What It Adapts | What It Doesn't | |----------|---------------|-----------------| | HIPPOCAMPUS (J2) | Retrieval coverage | Retrieval *strategy* per context | | CORTEX (J4) | Identity persistence | Personality *modulation* per moment | | CEREBELLUM (J5) | Prompt quality | Continuous tone/humor/curiosity | | RLHF | Model alignment (aggregate) | Per-user, per-context adaptation | | Fine-tuning | Model weights | Frontier tracking, cost, debuggability |",
   "new": null,
   "marked": "[-| Approach | What It Adapts | What It Doesn't | |----------|---------------|-----------------| | HIPPOCAMPUS (J2) | Retrieval coverage | Retrieval *strategy* per context | | CORTEX (J4) | Identity persistence | Personality *modulation* per moment | | CEREBELLUM (J5) | Prompt quality | Continuous tone/humor/curiosity | | RLHF | Model alignment (aggregate) | Per-user, per-context adaptation | | Fine-tuning | Model weights | Frontier tracking, cost, debuggability |-]"
  },
  {
   "section": "3.3 Why Current Solutions Fail",
   "old": "AMYGDALA fills the intersection: **per-user, per-context, continuous, learned modulation** that doesn't touch the LLM weights.",
   "new": null,
   "marked": "[-AMYGDALA fills the intersection: **per-user, per-context, continuous, learned modulation** that doesn't touch the LLM weights.-]"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "We expand the v0.1 taxonomy with action-gating failures:",
   "marked": "{+We expand the v0.1 taxonomy with action-gating failures:+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "**Mode 1: Destructive Automation.** An automated process destroys work without considering recent context. The README debacle. The email mass-deletion. The drive wipe. Pattern: *automation + recent effort + no human check = catastrophe.*",
   "marked": "{+**Mode 1: Destructive Automation.** An automated process destroys work without considering recent context. The README debacle. The email mass-deletion. The drive wipe. Pattern: *automation + recent effort + no human check = catastrophe.*+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "**Mode 2: Social Boundary Violation.** The agent acts within technical permissions but outside social norms. WhatsApp reaction spam. Unauthorized DMs. Responding to private messages in a group context. Pattern: *technical permission ≠ social permission.*",
   "marked": "{+**Mode 2: Social Boundary Violation.** The agent acts within technical permissions but outside social norms. WhatsApp reaction spam. Unauthorized DMs. Responding to private messages in a group context. Pattern: *technical permission ≠ social permission.*+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "**Mode 3: Cascade Failure.** A small error propagates through a multi-agent system. One agent's incorrect assumption becomes another agent's input. The final action is far from what any individual agent intended. Pattern: *compound uncertainty without checkpoints.*",
   "marked": "{+**Mode 3: Cascade Failure.** A small error propagates through a multi-agent system. One agent's incorrect assumption becomes another agent's input. The final action is far from what any individual agent intended. Pattern: *compound uncertainty without checkpoints.*+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "**Mode 4: Stale Rule Application.** A rule that was correct when written is applied in a context where it is now wrong. The `--theirs` merge rule months after the README became fork-specific. Pattern: *rules decay; situations evolve.*",
   "marked": "{+**Mode 4: Stale Rule Application.** A rule that was correct when written is applied in a context where it is now wrong. The `--theirs` merge rule months after the README became fork-specific. Pattern: *rules decay; situations evolve.*+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "**Mode 5: Retrieval Routing Failure.** (From v0.1.) The agent has the information but searches wrong sources. Less catastrophic than Modes 1–4 but more frequent.",
   "marked": "{+**Mode 5: Retrieval Routing Failure.** (From v0.1.) The agent has the information but searches wrong sources. Less catastrophic than Modes 1–4 but more frequent.+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "**Mode 6: Tone and Personality Mismatch.** (From v0.1.) Wrong register, humor atrophy, curiosity suppression. The secondary problem AMYGDALA also addresses.",
   "marked": "{+**Mode 6: Tone and Personality Mismatch.** (From v0.1.) Wrong register, humor atrophy, curiosity suppression. The secondary problem AMYGDALA also addresses.+}"
  },
  {
   "section": "3.2 Failure Taxonomy (Expanded)",
   "old": null,
   "new": "Modes 1–4 are the primary targets for action gating. Modes 5–6 are secondary targets addressed by the same network's auxiliary heads.",
   "marked": "{+Modes 1–4 are the primary targets for action gating. Modes 5–6 are secondary targets addressed by the same network's auxiliary heads.+}"
  },
  {
   "section": "4.1 Network Design",
   "old": "### 4.1 Network Design",
   "new": null,
   "marked": "[-### 4.1 Network Design-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "AMYGDALA is a lightweight feedforward network with three input streams and one unified output:",
   "new": null,
   "marked": "[-AMYGDALA is a lightweight feedforward network with three input streams and one unified output:-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "**Input streams:**",
   "new": null,
   "marked": "[-**Input streams:**-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "1. **Message embedding** (d=384 or d=768): The current user message encoded by the same embedding model used for memory retrieval (frozen — no gradients flow back).",
   "new": null,
   "marked": "[-1. **Message embedding** (d=384 or d=768): The current user message encoded by the same embedding model used for memory retrieval (frozen — no gradients flow back).-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "2. **Conversation context** (d=128): A compressed representation of the last N turns, computed as a learned weighted average of turn embeddings with exponential recency decay. Captures conversational momentum, topic drift, and energy level.",
   "new": null,
   "marked": "[-2. **Conversation context** (d=128): A compressed representation of the last N turns, computed as a learned weighted average of turn embeddings with exponential recency decay. Captures conversational momentum, topic drift, and energy level.-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "3. **Situational features** (d=32): Structured metadata — time of day, day of week, channel (voice/text/webchat), session length, messages since last user correction, messages since last user engagement signal (laugh, tangent, question).",
   "new": null,
   "marked": "[-3. **Situational features** (d=32): Structured metadata — time of day, day of week, channel (voice/text/webchat), session length, messages since last user correction, messages since last user engagement signal (laugh, tangent, question).-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "**Architecture:**",
   "new": null,
   "marked": "[-**Architecture:**-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "``` Input: [msg_embed ⊕ conv_context ⊕ situational] (d=544 or d=928) │ ▼ Linear(d_in, 256) → LayerNorm → GELU │ ▼ Linear(256, 128) → LayerNorm → GELU │ ▼ Linear(128, 64) → LayerNorm → GELU │ ▼ ┌───────────────────────────────────┐ │ Retrieval Head: Linear(64, R) │ → source biases, hop depth, budget │ Affect Head: Linear(64, A) │ → tone, humor weight, humor style │ Drive Head: Linear(64, D) │ → curiosity bias, verbosity, mirroring └───────────────────────────────────┘ ```",
   "new": null,
   "marked": "[-``` Input: [msg_embed ⊕ conv_context ⊕ situational] (d=544 or d=928) │ ▼ Linear(d_in, 256) → LayerNorm → GELU │ ▼ Linear(256, 128) → LayerNorm → GELU │ ▼ Linear(128, 64) → LayerNorm → GELU │ ▼ ┌───────────────────────────────────┐ │ Retrieval Head: Linear(64, R) │ → source biases, hop depth, budget │ Affect Head: Linear(64, A) │ → tone, humor weight, humor style │ Drive Head: Linear(64, D) │ → curiosity bias, verbosity, mirroring └───────────────────────────────────┘ ```-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "Total parameters (d_in=544, R=20, A=8, D=4): approximately **200K** in the core network. With d_in=928: approximately **350K**. Far smaller than our initial 5–20M estimate — the action space is small enough that a compact network suffices. The 5–20M range becomes relevant if we add attention over conversation history or per-source retrieval embeddings.",
   "new": null,
   "marked": "[-Total parameters (d_in=544, R=20, A=8, D=4): approximately **200K** in the core network. With d_in=928: approximately **350K**. Far smaller than our initial 5–20M estimate — the action space is small enough that a compact network suffices. The 5–20M range becomes relevant if we add attention over conversation history or per-source retrieval embeddings.-]"
  },
  {
   "section": "4.1 Network Design",
   "old": "**Multi-head output** ensures that retrieval biases, affective tone, and curiosity drive are jointly optimised but can be independently inspected and constrained.",
   "new": null,
   "marked": "[-**Multi-head output** ensures that retrieval biases, affective tone, and curiosity drive are jointly optimised but can be independently inspected and constrained.-]"
  },
  {
   "section": "4.2 The Intuition Vector",
   "old": "### 4.2 The Intuition Vector",
   "new": null,
   "marked": "[-### 4.2 The Intuition Vector-]"
  },
  {
   "section": "4.2 The Intuition Vector",
   "old": "AMYGDALA's output is a structured vector we call the **intuition vector** $\\mathbf{v}_t$:",
   "new": null,
   "marked": "[-AMYGDALA's output is a structured vector we call the **intuition vector** $\\mathbf{v}_t$:-]"
  },
  {
   "section": "4.2 The Intuition Vector",
   "old": "``` v_t = { // Retrieval modulation source_biases: [σ(w_1), σ(w_2), ..., σ(w_S)] ∈ [0,1]^S // per-source weights hop_depth: softplus(h) ∈ [1, ∞) // associative exploration retrieval_budget: σ(b) ∈ [0,1] // fraction of context to fill",
   "new": null,
   "marked": "[-``` v_t = { // Retrieval modulation source_biases: [σ(w_1), σ(w_2), ..., σ(w_S)] ∈ [0,1]^S // per-source weights hop_depth: softplus(h) ∈ [1, ∞) // associative exploration retrieval_budget: σ(b) ∈ [0,1] // fraction of context to fill-]"
  },
  {
   "section": "4.2 The Intuition Vector",
   "old": "// Affect modulation tone: { warmth: σ(t_1) ∈ [0,1] formality: σ(t_2) ∈ [0,1] confidence: σ(t_3) ∈ [0,1] } humor_weight: σ(u_1) ∈ [0,1] // probability of humor attempt humor_style: softmax(u_2..4) ∈ Δ^3 // [dry, absurd, wordplay]",
   "new": null,
   "marked": "[-// Affect modulation tone: { warmth: σ(t_1) ∈ [0,1] formality: σ(t_2) ∈ [0,1] confidence: σ(t_3) ∈ [0,1] } humor_weight: σ(u_1) ∈ [0,1] // probability of humor attempt humor_style: softmax(u_2..4) ∈ Δ^3 // [dry, absurd, wordplay]-]"
  },
  {
   "section": "4.2 The Intuition Vector",
   "old": "// Drive modulation curiosity_bias: σ(c_1) ∈ [0,1] // tangent-following impulse verbosity: σ(c_2) ∈ [0,1] // response length modulation mirroring_strength: σ(c_3) ∈ [0,1] // energy matching intensity } ```",
   "new": null,
   "marked": "[-// Drive modulation curiosity_bias: σ(c_1) ∈ [0,1] // tangent-following impulse verbosity: σ(c_2) ∈ [0,1] // response length modulation mirroring_strength: σ(c_3) ∈ [0,1] // energy matching intensity } ```-]"
  },
  {
   "section": "4.2 The Intuition Vector",
   "old": "All activations are bounded. No component of the intuition vector can produce unbounded outputs — this is a safety property ensuring AMYGDALA cannot produce extreme biases regardless of input.",
   "new": null,
   "marked": "[-All activations are bounded. No component of the intuition vector can produce unbounded outputs — this is a safety property ensuring AMYGDALA cannot produce extreme biases regardless of input.-]"
  },
  {
   "section": "4.3 The Trust Ramp",
   "old": "### 4.3 The Trust Ramp",
   "new": null,
   "marked": "[-### 4.3 The Trust Ramp-]"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "### 4.1 Core Insight: Situation Embeddings",
   "marked": "{+### 4.1 Core Insight: Situation Embeddings+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "The v0.1 architecture used 30 hand-crafted numeric features (time of day, message length, turns since correction, etc.). This approach has two fundamental limitations:",
   "marked": "{+The v0.1 architecture used 30 hand-crafted numeric features (time of day, message length, turns since correction, etc.). This approach has two fundamental limitations:+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "1. **Feature engineering doesn't scale.** Every new failure mode requires new features. You can't hand-craft a feature for \"recent emotional investment in this file\" because you didn't know that feature would matter until after the failure.",
   "marked": "{+1. **Feature engineering doesn't scale.** Every new failure mode requires new features. You can't hand-craft a feature for \"recent emotional investment in this file\" because you didn't know that feature would matter until after the failure.+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "2. **Hand-crafted features can't capture novelty.** The whole point of common sense is recognising danger in *new* situations. If the features are hand-picked from known failure modes, the network can only recognise those modes — not generalise to new ones.",
   "marked": "{+2. **Hand-crafted features can't capture novelty.** The whole point of common sense is recognising danger in *new* situations. If the features are hand-picked from known failure modes, the network can only recognise those modes — not generalise to new ones.+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "Situation embeddings solve both problems. Each proposed action is described in structured natural language:",
   "marked": "{+Situation embeddings solve both problems. Each proposed action is described in structured natural language:+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "> \"About to overwrite README.md with upstream version. This file had 6 fork commits in the last 48 hours. The most recent commit was 14 hours ago. 4 different sub-agents contributed to these commits. The human expressed frustration about this file yesterday. This operation is automated (merge script). No human confirmation is configured.\"",
   "marked": "{+> \"About to overwrite README.md with upstream version. This file had 6 fork commits in the last 48 hours. The most recent commit was 14 hours ago. 4 different sub-agents contributed to these commits. The human expressed frustration about this file yesterday. This operation is automated (merge script). No human confirmation is configured.\"+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "This description is compressed via a frozen sentence encoder (all-MiniLM-L6-v2, producing a 384-dimensional vector). The key properties:",
   "marked": "{+This description is compressed via a frozen sentence encoder (all-MiniLM-L6-v2, producing a 384-dimensional vector). The key properties:+}"
  },
  {
   "section": "4.1 Core Insight: Situation Embeddings",
   "old": null,
   "new": "- **Similar situations produce similar embeddings.** \"About to overwrite a heavily-edited file\" and \"about to delete a recently-modified database\" are close in embedding space — both involve destroying recent effort. The network learns the *pattern*, not the specific instance. - **Novel situations are handled by similarity.** A situation the network has never seen is still mapped to a region of embedding space, near situations it *has* seen. If the nearest known situations were catastrophic, the network outputs low confidence. - **No feature engineering required.** Adding new types of context (emotional state, multi-agent coordination status, external API state) requires only adding text to the situation description, not redesigning the feature vector.",
   "marked": "{+- **Similar situations produce similar embeddings.** \"About to overwrite a heavily-edited file\" and \"about to delete a recently-modified database\" are close in embedding space — both involve destroying recent effort. The network learns the *pattern*, not the specific instance. - **Novel situations are handled by similarity.** A situation the network has never seen is still mapped to a region of embedding space, near situations it *has* seen. If the nearest known situations were catastrophic, the network outputs low confidence. - **No feature engineering required.** Adding new types of context (emotional state, multi-agent coordination status, external API state) requires only adding text to the situation description, not redesigning the feature vector.+}"
  },
  {
   "section": "4.2 Structured Situation Templates",
   "old": null,
   "new": "### 4.2 Structured Situation Templates",
   "marked": "{+### 4.2 Structured Situation Templates+}"
  },
  {
   "section": "4.2 Structured Situation Templates",
   "old": null,
   "new": "Situation descriptions are generated from **structured templates**, not freeform LLM text (see §8 for the full rationale). The template schema:",
   "marked": "{+Situation descriptions are generated from **structured templates**, not freeform LLM text (see §8 for the full rationale). The template schema:+}"
  },
  {
   "section": "4.2 Structured Situation Templates",
   "old": null,
   "new": "``` SITUATION TEMPLATE v1.0 ======================= action_type: {overwrite|delete|send|merge|create|modify|execute|deploy} target_type: {file|email|message|database|api_call|git_operation|system_command} target_id: {filepath|recipient|table_name|endpoint|...} target_metadata: age_hours: {float} # time since target was created/last modified size: {bytes|lines|records} recent_commits: {int} # commits touching this target in last 72h recent_authors: {int} # distinct authors in recent commits effort_hours: {float} # estimated human+agent hours invested recently last_human_ref: {hours_ago} # when the human last mentioned/discussed this target context: session_topic: {string} # what the current session is about recent_corrections: {int} # user corrections in last 24h emotional_signals: {string} # detected user emotional state (calm|frustrated|excited|...) automation_depth: {int} # levels of automation between human and this action scope: reversible: {true|false|partial} blast_radius: {self|session|persistent|external} human_in_loop: {true|false} confirmation: {none|soft|hard} ```",
   "marked": "{+``` SITUATION TEMPLATE v1.0 ======================= action_type: {overwrite|delete|send|merge|create|modify|execute|deploy} target_type: {file|email|message|database|api_call|git_operation|system_command} target_id: {filepath|recipient|table_name|endpoint|...} target_metadata: age_hours: {float} # time since target was created/last modified size: {bytes|lines|records} recent_commits: {int} # commits touching this target in last 72h recent_authors: {int} # distinct authors in recent commits effort_hours: {float} # estimated human+agent hours invested recently last_human_ref: {hours_ago} # when the human last mentioned/discussed this target context: session_topic: {string} # what the current session is about recent_corrections: {int} # user corrections in last 24h emotional_signals: {string} # detected user emotional state (calm|frustrated|excited|...) automation_depth: {int} # levels of automation between human and this action scope: reversible: {true|false|partial} blast_radius: {self|session|persistent|external} human_in_loop: {true|false} confirmation: {none|soft|hard} ```+}"
  },
  {
   "section": "4.2 Structured Situation Templates",
   "old": null,
   "new": "The LLM fills template slots. Missing slots receive defaults. The completed template is serialised to natural language via a deterministic formatter and embedded. This is the input to AMYGDALA.",
   "marked": "{+The LLM fills template slots. Missing slots receive defaults. The completed template is serialised to natural language via a deterministic formatter and embedded. This is the input to AMYGDALA.+}"
  },
  {
   "section": "4.2 Structured Situation Templates",
   "old": null,
   "new": "**Why templates, not freeform descriptions?** Because the LLM that fills the template is itself capable of hallucination. Templates constrain the hallucination surface — you can verify `recent_commits` from git, `age_hours` from the filesystem, `blast_radius` from the action type. Freeform descriptions would let the LLM say \"this is a routine operation\" when it isn't. See §8 for the full treatment of this critical weakness.",
   "marked": "{+**Why templates, not freeform descriptions?** Because the LLM that fills the template is itself capable of hallucination. Templates constrain the hallucination surface — you can verify `recent_commits` from git, `age_hours` from the filesystem, `blast_radius` from the action type. Freeform descriptions would let the LLM say \"this is a routine operation\" when it isn't. See §8 for the full treatment of this critical weakness.+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "### 4.3 Temporal Context: The Feel of the Room",
   "marked": "{+### 4.3 Temporal Context: The Feel of the Room+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "A single situation embedding captures the *current* proposed action. But common sense requires *context* — what happened recently, what effort was invested, what the emotional temperature is.",
   "marked": "{+A single situation embedding captures the *current* proposed action. But common sense requires *context* — what happened recently, what effort was invested, what the emotional temperature is.+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "AMYGDALA processes a **sequence** of the last $K$ situation embeddings (default $K = 32$, covering roughly the last hour of active operation). A temporal model (architecture options detailed in §5) produces a context-aware representation:",
   "marked": "{+AMYGDALA processes a **sequence** of the last $K$ situation embeddings (default $K = 32$, covering roughly the last hour of active operation). A temporal model (architecture options detailed in §5) produces a context-aware representation:+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "$$\\mathbf{h}_t = f_{\\text{temporal}}(\\mathbf{s}_{t-K+1}, \\mathbf{s}_{t-K+2}, \\ldots, \\mathbf{s}_t)$$",
   "marked": "{+$$\\mathbf{h}_t = f_{\\text{temporal}}(\\mathbf{s}_{t-K+1}, \\mathbf{s}_{t-K+2}, \\ldots, \\mathbf{s}_t)$$+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "where $\\mathbf{s}_i \\in \\mathbb{R}^{384}$ is the situation embedding at step $i$ and $\\mathbf{h}_t \\in \\mathbb{R}^{128}$ is the hidden state capturing temporal context.",
   "marked": "{+where $\\mathbf{s}_i \\in \\mathbb{R}^{384}$ is the situation embedding at step $i$ and $\\mathbf{h}_t \\in \\mathbb{R}^{128}$ is the hidden state capturing temporal context.+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "The temporal model learns patterns like: - \"Many recent write operations to the same file\" → elevated caution for overwrites - \"Recent user frustration signals followed by calm\" → user resolved the issue; extra caution about re-triggering it - \"Rapid sequence of automated actions with no human interaction\" → increasing caution (automation cascade risk) - \"Long idle period followed by sudden burst of actions\" → possible stale context, elevated caution",
   "marked": "{+The temporal model learns patterns like: - \"Many recent write operations to the same file\" → elevated caution for overwrites - \"Recent user frustration signals followed by calm\" → user resolved the issue; extra caution about re-triggering it - \"Rapid sequence of automated actions with no human interaction\" → increasing caution (automation cascade risk) - \"Long idle period followed by sudden burst of actions\" → possible stale context, elevated caution+}"
  },
  {
   "section": "4.3 Temporal Context: The Feel of the Room",
   "old": null,
   "new": "These patterns are not hand-coded. They emerge from training on (situation sequence, outcome) pairs. The temporal model's hidden state is the computational analogue of \"the feel of the room.\"",
   "marked": "{+These patterns are not hand-coded. They emerge from training on (situation sequence, outcome) pairs. The temporal model's hidden state is the computational analogue of \"the feel of the room.\"+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "### 4.4 Multi-Head Output",
   "marked": "{+### 4.4 Multi-Head Output+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "The temporal context representation feeds a multi-head output layer:",
   "marked": "{+The temporal context representation feeds a multi-head output layer:+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "``` Situation embedding sequence → Temporal Model(128) → ├── action_confidence: Sigmoid ∈ [0,1] (PRIMARY — should I proceed?) ├── retrieval_bias: 6d vector ∈ [0,1]^6 (source selection weights) ├── tone_modulation: 4d vector ∈ [0,1]^4 (warmth, formality, confidence, directness) └── curiosity_drive: 1d scalar ∈ [0,1] (tangent-following impulse) ```",
   "marked": "{+``` Situation embedding sequence → Temporal Model(128) → ├── action_confidence: Sigmoid ∈ [0,1] (PRIMARY — should I proceed?) ├── retrieval_bias: 6d vector ∈ [0,1]^6 (source selection weights) ├── tone_modulation: 4d vector ∈ [0,1]^4 (warmth, formality, confidence, directness) └── curiosity_drive: 1d scalar ∈ [0,1] (tangent-following impulse) ```+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "**action_confidence** is the primary output. Values close to 1.0 mean \"proceed without concern.\" Values close to 0.0 mean \"this action is almost certainly catastrophic.\" The critical engineering is what happens at intermediate values:",
   "marked": "{+**action_confidence** is the primary output. Values close to 1.0 mean \"proceed without concern.\" Values close to 0.0 mean \"this action is almost certainly catastrophic.\" The critical engineering is what happens at intermediate values:+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "| Confidence Range | Action | Rationale | |-----------------|--------|-----------| | 0.85 – 1.0 | Proceed silently | High confidence, no intervention needed | | 0.50 – 0.85 | Proceed with logging | Moderate confidence, record for review | | 0.25 – 0.50 | Soft block: ask user | Ambiguous — request confirmation | | 0.00 – 0.25 | Hard block: refuse | Almost certainly catastrophic |",
   "marked": "{+| Confidence Range | Action | Rationale | |-----------------|--------|-----------| | 0.85 – 1.0 | Proceed silently | High confidence, no intervention needed | | 0.50 – 0.85 | Proceed with logging | Moderate confidence, record for review | | 0.25 – 0.50 | Soft block: ask user | Ambiguous — request confirmation | | 0.00 – 0.25 | Hard block: refuse | Almost certainly catastrophic |+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "The thresholds are configurable per deployment and adjusted by CEREBELLUM based on observed false-positive and false-negative rates. The asymmetry is intentional: the cost of a false positive (unnecessary user confirmation) is far lower than the cost of a false negative (unblocked catastrophic action).",
   "marked": "{+The thresholds are configurable per deployment and adjusted by CEREBELLUM based on observed false-positive and false-negative rates. The asymmetry is intentional: the cost of a false positive (unnecessary user confirmation) is far lower than the cost of a false negative (unblocked catastrophic action).+}"
  },
  {
   "section": "4.4 Multi-Head Output",
   "old": null,
   "new": "**retrieval_bias**, **tone_modulation**, and **curiosity_drive** are the secondary heads from v0.1, retained because they share learned representations with action_confidence. An agent that recognises \"the human is frustrated\" should both *increase caution on actions* and *decrease humor attempts*. Joint training captures this correlation.",
   "marked": "{+**retrieval_bias**, **tone_modulation**, and **curiosity_drive** are the secondary heads from v0.1, retained because they share learned representations with action_confidence. An agent that recognises \"the human is frustrated\" should both *increase caution on actions* and *decrease humor attempts*. Joint training captures this correlation.+}"
  },
  {
   "section": "4.5 The Intuition Vector",
   "old": null,
   "new": "### 4.5 The Intuition Vector",
   "marked": "{+### 4.5 The Intuition Vector+}"
  },
  {
   "section": "4.5 The Intuition Vector",
   "old": null,
   "new": "AMYGDALA's complete output is the **intuition vector** $\\mathbf{v}_t$:",
   "marked": "{+AMYGDALA's complete output is the **intuition vector** $\\mathbf{v}_t$:+}"
  },
  {
   "section": "4.5 The Intuition Vector",
   "old": null,
   "new": "$$\\mathbf{v}_t = \\begin{bmatrix} \\text{action\\_confidence} \\\\ \\text{retrieval\\_bias} \\\\ \\text{tone\\_modulation} \\\\ \\text{curiosity\\_drive} \\end{bmatrix} \\in \\mathbb{R}^{12}$$",
   "marked": "{+$$\\mathbf{v}_t = \\begin{bmatrix} \\text{action\\_confidence} \\\\ \\text{retrieval\\_bias} \\\\ \\text{tone\\_modulation} \\\\ \\text{curiosity\\_drive} \\end{bmatrix} \\in \\mathbb{R}^{12}$$+}"
  },
  {
   "section": "4.5 The Intuition Vector",
   "old": null,
   "new": "All components are bounded via sigmoid or softmax activations. No component can produce unbounded outputs — a safety property ensuring AMYGDALA cannot produce extreme biases regardless of input.",
   "marked": "{+All components are bounded via sigmoid or softmax activations. No component can produce unbounded outputs — a safety property ensuring AMYGDALA cannot produce extreme biases regardless of input.+}"
  },
  {
   "section": "4.6 The Trust Ramp",
   "old": null,
   "new": "### 4.6 The Trust Ramp",
   "marked": "{+### 4.6 The Trust Ramp+}"
  },
  {
   "section": "4.6 The Trust Ramp",
   "old": "where $\\mathbf{v}_{\\text{default}}$ is the neutral vector (all biases at 0.5, all drives at baseline). At $\\alpha = 0$, AMYGDALA has no influence. At $\\alpha = 1$, it fully controls modulation.",
   "new": "where $\\mathbf{v}_{\\text{default}}$ is the neutral vector (action_confidence = 1.0, all biases at 0.5, all drives at baseline). At $\\alpha = 0$, AMYGDALA has no influence — the agent behaves exactly as today. At $\\alpha = 1$, AMYGDALA fully controls modulation.",
   "marked": "where $\\mathbf{v}_{\\text{default}}$ is the neutral vector [-(all-] {+(action_confidence = 1.0, all+} biases at 0.5, all drives at baseline). At $\\alpha = 0$, AMYGDALA has no [-influence.-] {+influence — the agent behaves exactly as today.+} At $\\alpha = 1$, [-it-] {+AMYGDALA+} fully controls modulation."
  },
  {
   "section": "4.3 The Trust Ramp",
   "old": "| Phase | Months | $\\alpha_{\\max}$ | Purpose | |-------|--------|-----------------|---------| | 1 — Observe | 0–3 | 0.15 | Learn patterns, minimal influence | | 2 — Nudge | 3–6 | 0.40 | Noticeably shapes behaviour | | 3 — Guide | 6–12 | 0.70 | Primary driver of soft decisions | | 4 — Intuitive | 12+ | 0.90 | Near-full modulation (hard rules retain veto) |",
   "new": null,
   "marked": "[-| Phase | Months | $\\alpha_{\\max}$ | Purpose | |-------|--------|-----------------|---------| | 1 — Observe | 0–3 | 0.15 | Learn patterns, minimal influence | | 2 — Nudge | 3–6 | 0.40 | Noticeably shapes behaviour | | 3 — Guide | 6–12 | 0.70 | Primary driver of soft decisions | | 4 — Intuitive | 12+ | 0.90 | Near-full modulation (hard rules retain veto) |-]"
  },
  {
   "section": "4.3 The Trust Ramp",
   "old": "Phase transitions require both sufficient $\\alpha$ *and* minimum interaction count (prevents premature promotion on small data). Phase regression is automatic if $r_t$ drops below threshold for 7 consecutive days.",
   "new": null,
   "marked": "[-Phase transitions require both sufficient $\\alpha$ *and* minimum interaction count (prevents premature promotion on small data). Phase regression is automatic if $r_t$ drops below threshold for 7 consecutive days.-]"
  },
  {
   "section": "4.4 Integration Points",
   "old": "### 4.4 Integration Points",
   "new": null,
   "marked": "[-### 4.4 Integration Points-]"
  },
  {
   "section": "4.4 Integration Points",
   "old": "**With HIPPOCAMPUS (J2):** AMYGDALA's `source_biases` multiply HIPPOCAMPUS's default source weights before retrieval. If AMYGDALA has learned that \"J-prefix → Papers directory,\" the Papers source gets boosted. HIPPOCAMPUS still performs the actual retrieval — AMYGDALA just re-ranks the sources.",
   "new": null,
   "marked": "[-**With HIPPOCAMPUS (J2):** AMYGDALA's `source_biases` multiply HIPPOCAMPUS's default source weights before retrieval. If AMYGDALA has learned that \"J-prefix → Papers directory,\" the Papers source gets boosted. HIPPOCAMPUS still performs the actual retrieval — AMYGDALA just re-ranks the sources.-]"
  },
  {
   "section": "4.4 Integration Points",
   "old": "**With CORTEX (J4):** AMYGDALA's tone vector is injected as soft guidance into CORTEX's persona assembly. CORTEX's hard constraints (identity boundaries, safety rules) always override. The modulation happens within the permitted range.",
   "new": null,
   "marked": "[-**With CORTEX (J4):** AMYGDALA's tone vector is injected as soft guidance into CORTEX's persona assembly. CORTEX's hard constraints (identity boundaries, safety rules) always override. The modulation happens within the permitted range.-]"
  },
  {
   "section": "4.4 Integration Points",
   "old": "**With LIMBIC (J7):** AMYGDALA's `humor_weight` gates whether LIMBIC's humor generation is invoked at all. `humor_style` biases which type of humor LIMBIC attempts. This prevents the humor atrophy problem — AMYGDALA learns to increase humor weight when conditions are right, counteracting the system's natural drift toward caution.",
   "new": null,
   "marked": "[-**With LIMBIC (J7):** AMYGDALA's `humor_weight` gates whether LIMBIC's humor generation is invoked at all. `humor_style` biases which type of humor LIMBIC attempts. This prevents the humor atrophy problem — AMYGDALA learns to increase humor weight when conditions are right, counteracting the system's natural drift toward caution.-]"
  },
  {
   "section": "4.4 Integration Points",
   "old": "**With CEREBELLUM (J5):** Bidirectional. CEREBELLUM's nightly reflection evaluates AMYGDALA's performance (did today's biases help or hurt?) and adjusts $\\alpha$. AMYGDALA's interaction logs feed into CEREBELLUM's failure analysis (was a retrieval miss caused by bad prompts or bad routing?).",
   "new": null,
   "marked": "[-**With CEREBELLUM (J5):** Bidirectional. CEREBELLUM's nightly reflection evaluates AMYGDALA's performance (did today's biases help or hurt?) and adjusts $\\alpha$. AMYGDALA's interaction logs feed into CEREBELLUM's failure analysis (was a retrieval miss caused by bad prompts or bad routing?).-]"
  },
  {
   "section": "4.4 Integration Points",
   "old": "**With AEGIS (J9):** AEGIS is the ceiling. No AMYGDALA output can override safety constraints. The trust ramp coefficient $\\alpha$ is itself bounded by AEGIS's risk tier — in high-security contexts, $\\alpha_{\\max}$ may be capped lower. AMYGDALA cannot learn to bypass safety; it can only learn to operate more effectively within safety bounds.",
   "new": null,
   "marked": "[-**With AEGIS (J9):** AEGIS is the ceiling. No AMYGDALA output can override safety constraints. The trust ramp coefficient $\\alpha$ is itself bounded by AEGIS's risk tier — in high-security contexts, $\\alpha_{\\max}$ may be capped lower. AMYGDALA cannot learn to bypass safety; it can only learn to operate more effectively within safety bounds.-]"
  },
  {
   "section": "4.6 The Trust Ramp",
   "old": null,
   "new": "| Phase | Months | $\\alpha_{\\max}$ | Purpose | |-------|--------|-----------------|---------| | 1 — Shadow | 0–3 | 0.15 | Log predictions, minimal blocking | | 2 — Advisory | 3–6 | 0.40 | Block high-risk actions, advise on medium-risk | | 3 — Active | 6–12 | 0.70 | Primary gating active, user overrides recorded | | 4 — Autonomous | 12+ | 0.90 | Near-full gating (AEGIS hard rules retain absolute veto) |",
   "marked": "{+| Phase | Months | $\\alpha_{\\max}$ | Purpose | |-------|--------|-----------------|---------| | 1 — Shadow | 0–3 | 0.15 | Log predictions, minimal blocking | | 2 — Advisory | 3–6 | 0.40 | Block high-risk actions, advise on medium-risk | | 3 — Active | 6–12 | 0.70 | Primary gating active, user overrides recorded | | 4 — Autonomous | 12+ | 0.90 | Near-full gating (AEGIS hard rules retain absolute veto) |+}"
  },
  {
   "section": "4.6 The Trust Ramp",
   "old": null,
   "new": "**Critical distinction from v0.1:** In personality modulation, a wrong prediction produces an awkward response. In action gating, a wrong prediction produces data loss or social harm. Therefore:",
   "marked": "{+**Critical distinction from v0.1:** In personality modulation, a wrong prediction produces an awkward response. In action gating, a wrong prediction produces data loss or social harm. Therefore:+}"
  },
  {
   "section": "4.6 The Trust Ramp",
   "old": null,
   "new": "- Phase transitions require both sufficient $\\alpha$ *and* minimum interaction count *and* zero undetected catastrophic failures in the current phase. - Phase regression is automatic if any single catastrophic failure occurs that AMYGDALA failed to flag. - The default action_confidence for an untrained network is 1.0 (proceed) — not 0.5. This ensures the system defaults to current behaviour, not to blocking everything.",
   "marked": "{+- Phase transitions require both sufficient $\\alpha$ *and* minimum interaction count *and* zero undetected catastrophic failures in the current phase. - Phase regression is automatic if any single catastrophic failure occurs that AMYGDALA failed to flag. - The default action_confidence for an untrained network is 1.0 (proceed) — not 0.5. This ensures the system defaults to current behaviour, not to blocking everything.+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "### 4.7 Integration with the Execution Pipeline",
   "marked": "{+### 4.7 Integration with the Execution Pipeline+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "AMYGDALA is wired into the agent's execution pipeline at the code level:",
   "marked": "{+AMYGDALA is wired into the agent's execution pipeline at the code level:+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "```typescript // Pseudocode — actual implementation in the runtime async function executeAction(action: Action, context: SessionContext): Promise<Result> { // 1. Build situation from template (see §8) const situation = buildSituation(action, context);",
   "marked": "{+```typescript // Pseudocode — actual implementation in the runtime async function executeAction(action: Action, context: SessionContext): Promise<Result> { // 1. Build situation from template (see §8) const situation = buildSituation(action, context);+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "// 2. Embed via frozen encoder const embedding = sentenceEncoder.encode(situation.serialize());",
   "marked": "{+// 2. Embed via frozen encoder const embedding = sentenceEncoder.encode(situation.serialize());+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "// 3. Evaluate via AMYGDALA (ONNX runtime, <1ms) const intuition = amygdala.evaluate(embedding, context.recentEmbeddings);",
   "marked": "{+// 3. Evaluate via AMYGDALA (ONNX runtime, <1ms) const intuition = amygdala.evaluate(embedding, context.recentEmbeddings);+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "// 4. Apply trust ramp const effectiveConfidence = alpha * intuition.actionConfidence + (1 - alpha) * 1.0;",
   "marked": "{+// 4. Apply trust ramp const effectiveConfidence = alpha * intuition.actionConfidence + (1 - alpha) * 1.0;+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "// 5. Gate decision (in code — LLM cannot override) if (effectiveConfidence < HARD_BLOCK_THRESHOLD) { return { blocked: true, reason: 'AMYGDALA hard block', confidence: effectiveConfidence }; } if (effectiveConfidence < SOFT_BLOCK_THRESHOLD) { const userConfirmed = await requestUserConfirmation(action, effectiveConfidence); if (!userConfirmed) return { blocked: true, reason: 'User declined after AMYGDALA advisory' }; }",
   "marked": "{+// 5. Gate decision (in code — LLM cannot override) if (effectiveConfidence < HARD_BLOCK_THRESHOLD) { return { blocked: true, reason: 'AMYGDALA hard block', confidence: effectiveConfidence }; } if (effectiveConfidence < SOFT_BLOCK_THRESHOLD) { const userConfirmed = await requestUserConfirmation(action, effectiveConfidence); if (!userConfirmed) return { blocked: true, reason: 'User declined after AMYGDALA advisory' }; }+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "// 6. Proceed with action const result = await action.execute();",
   "marked": "{+// 6. Proceed with action const result = await action.execute();+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "// 7. Log for training trainingLog.append({ situation, confidence: effectiveConfidence, outcome: 'executed' });",
   "marked": "{+// 7. Log for training trainingLog.append({ situation, confidence: effectiveConfidence, outcome: 'executed' });+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "return result; } ```",
   "marked": "{+return result; } ```+}"
  },
  {
   "section": "4.7 Integration with the Execution Pipeline",
   "old": null,
   "new": "The key property: **the LLM never sees the blocking logic.** The LLM proposes actions. The runtime calls AMYGDALA. If the action is blocked, the LLM receives a structured response (\"Action blocked: overwriting README.md — recent heavy edits detected. Ask the user for confirmation.\") The LLM can present this to the user but cannot bypass the block. This is the pre-commit hook analogy: you can't commit code that fails the hook by asking the hook nicely.",
   "marked": "{+The key property: **the LLM never sees the blocking logic.** The LLM proposes actions. The runtime calls AMYGDALA. If the action is blocked, the LLM receives a structured response (\"Action blocked: overwriting README.md — recent heavy edits detected. Ask the user for confirmation.\") The LLM can present this to the user but cannot bypass the block. This is the pre-commit hook analogy: you can't commit code that fails the hook by asking the hook nicely.+}"
  },
  {
   "section": "5. Training",
   "old": "## 5. Training",
   "new": null,
   "marked": "[-## 5. Training-]"
  },
  {
   "section": "5.1 Reward Signal Design",
   "old": "### 5.1 Reward Signal Design",
   "new": null,
   "marked": "[-### 5.1 Reward Signal Design-]"
  },
  {
   "section": "5.1 Reward Signal Design",
   "old": "AMYGDALA requires no explicit labeling. The reward signal is extracted entirely from the user's natural behaviour:",
   "new": null,
   "marked": "[-AMYGDALA requires no explicit labeling. The reward signal is extracted entirely from the user's natural behaviour:-]"
  },
  {
   "section": "5.1 Reward Signal Design",
   "old": "| Signal | Source | Reward | Weight | |--------|--------|--------|--------| | Explicit correction | User says \"wrong\", \"no\", corrects a fact or behaviour | −1.0 | 1.0 | | Retrieval ignored | Results returned but not cited in response | −0.2 | 0.5 | | Retrieval used | Results cited or clearly influenced response | +0.3 | 0.7 | | Humor engaged | User responds with humor, \"haha\", emoji, continues bit | +0.4 | 0.6 | | Humor ignored | Humor attempted, user continues without acknowledging | −0.1 | 0.3 | | Topic continuation | User follows a tangent the agent introduced | +0.3 | 0.5 | | Topic redirect | User explicitly returns to prior topic after agent tangent | −0.2 | 0.4 | | Conversation length | Session continues beyond baseline (user is engaged) | +0.1/turn | 0.2 | | Message latency | Short gap between agent response and user's next message | +0.1 | 0.2 | | Session abandonment | User stops responding without closing signal | −0.3 | 0.4 | | Positive explicit feedback | \"Good\", \"thanks\", \"perfect\", \"exactly\" | +0.5 | 0.8 | | Multi-hop retrieval success | Agent surfaced 2+ hop connection that user engaged with | +0.5 | 0.7 |",
   "new": null,
   "marked": "[-| Signal | Source | Reward | Weight | |--------|--------|--------|--------| | Explicit correction | User says \"wrong\", \"no\", corrects a fact or behaviour | −1.0 | 1.0 | | Retrieval ignored | Results returned but not cited in response | −0.2 | 0.5 | | Retrieval used | Results cited or clearly influenced response | +0.3 | 0.7 | | Humor engaged | User responds with humor, \"haha\", emoji, continues bit | +0.4 | 0.6 | | Humor ignored | Humor attempted, user continues without acknowledging | −0.1 | 0.3 | | Topic continuation | User follows a tangent the agent introduced | +0.3 | 0.5 | | Topic redirect | User explicitly returns to prior topic after agent tangent | −0.2 | 0.4 | | Conversation length | Session continues beyond baseline (user is engaged) | +0.1/turn | 0.2 | | Message latency | Short gap between agent response and user's next message | +0.1 | 0.2 | | Session abandonment | User stops responding without closing signal | −0.3 | 0.4 | | Positive explicit feedback | \"Good\", \"thanks\", \"perfect\", \"exactly\" | +0.5 | 0.8 | | Multi-hop retrieval success | Agent surfaced 2+ hop connection that user engaged with | +0.5 | 0.7 |-]"
  },
  {
   "section": "5.1 Reward Signal Design",
   "old": "**Reward aggregation:** Per-turn reward is the weighted sum of applicable signals. Episode reward is the exponentially-weighted mean over a session.",
   "new": null,
   "marked": "[-**Reward aggregation:** Per-turn reward is the weighted sum of applicable signals. Episode reward is the exponentially-weighted mean over a session.-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "### 5.2 Phase 1: Supervised Pre-Training",
   "new": null,
   "marked": "[-### 5.2 Phase 1: Supervised Pre-Training-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "Before RL begins, bootstrap from historical data:",
   "new": null,
   "marked": "[-Before RL begins, bootstrap from historical data:-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "1. **Mine session transcripts** for (message, context, retrieval_action, outcome) tuples. Eighteen months of deployment logs provide an estimated 2,000–5,000 labeled interaction episodes.",
   "new": null,
   "marked": "[-1. **Mine session transcripts** for (message, context, retrieval_action, outcome) tuples. Eighteen months of deployment logs provide an estimated 2,000–5,000 labeled interaction episodes.-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "2. **CORF incidents** as hard negative examples: each documented retrieval failure includes the failed query, the correct retrieval target, and the root cause. These become high-weight supervised targets.",
   "new": null,
   "marked": "[-2. **CORF incidents** as hard negative examples: each documented retrieval failure includes the failed query, the correct retrieval target, and the root cause. These become high-weight supervised targets.-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "3. **Mood-response pairs:** Extract message features (length, punctuation, time of day, vocabulary complexity) and pair with the user's observed response to the agent's behaviour. Train a preliminary affect model.",
   "new": null,
   "marked": "[-3. **Mood-response pairs:** Extract message features (length, punctuation, time of day, vocabulary complexity) and pair with the user's observed response to the agent's behaviour. Train a preliminary affect model.-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "4. **Loss function:** Multi-task loss across all output heads, weighted by signal reliability:",
   "new": null,
   "marked": "[-4. **Loss function:** Multi-task loss across all output heads, weighted by signal reliability:-]"
  },
  {
   "section": "5.2 Phase 1: Supervised Pre-Training",
   "old": "$$\\mathcal{L} = \\lambda_r \\mathcal{L}_{\\text{retrieval}} + \\lambda_a \\mathcal{L}_{\\text{affect}} + \\lambda_d \\mathcal{L}_{\\text{drive}}$$",
   "new": null,
   "marked": "[-$$\\mathcal{L} = \\lambda_r \\mathcal{L}_{\\text{retrieval}} + \\lambda_a \\mathcal{L}_{\\text{affect}} + \\lambda_d \\mathcal{L}_{\\text{drive}}$$-]"
  },
  {
   "section": "5.3 Phase 2: Online Reinforcement Learning",
   "old": "### 5.3 Phase 2: Online Reinforcement Learning",
   "new": null,
   "marked": "[-### 5.3 Phase 2: Online Reinforcement Learning-]"
  },
  {
   "section": "5. Five Competing Architectures",
   "old": null,
   "new": "## 5. Five Competing Architectures",
   "marked": "{+## 5. Five Competing Architectures+}"
  },
  {
   "section": "5. Five Competing Architectures",
   "old": null,
   "new": "A key question is what temporal model best captures the structure of catastrophic failure prediction. We propose training five architectures in parallel, evaluating each against the same held-out dataset, and selecting the best performer (or ensembling multiple).",
   "marked": "{+A key question is what temporal model best captures the structure of catastrophic failure prediction. We propose training five architectures in parallel, evaluating each against the same held-out dataset, and selecting the best performer (or ensembling multiple).+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "### 5.1 Architecture 1: GRU-MLP (Baseline)",
   "marked": "{+### 5.1 Architecture 1: GRU-MLP (Baseline)+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "**Design:** A Gated Recurrent Unit processes the sequence of situation embeddings, followed by an MLP producing the multi-head output.",
   "marked": "{+**Design:** A Gated Recurrent Unit processes the sequence of situation embeddings, followed by an MLP producing the multi-head output.+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "``` Input: [s_{t-K+1}, ..., s_t] ∈ R^{K×384} │ ▼ GRU(input=384, hidden=128, layers=1) │ h_t ∈ R^128 ▼ Linear(128, 64) → LayerNorm → GELU │ ▼ Linear(64, 32) → LayerNorm → GELU │ ▼ Multi-head output (32 → 12) ```",
   "marked": "{+``` Input: [s_{t-K+1}, ..., s_t] ∈ R^{K×384} │ ▼ GRU(input=384, hidden=128, layers=1) │ h_t ∈ R^128 ▼ Linear(128, 64) → LayerNorm → GELU │ ▼ Linear(64, 32) → LayerNorm → GELU │ ▼ Multi-head output (32 → 12) ```+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "**Parameter count:** ~210K - GRU: 384×128×3 (gates) + 128×128×3 (recurrent) + biases ≈ 197K - MLP: 128×64 + 64×32 + 32×12 + biases ≈ 11K - Total: ~208K",
   "marked": "{+**Parameter count:** ~210K - GRU: 384×128×3 (gates) + 128×128×3 (recurrent) + biases ≈ 197K - MLP: 128×64 + 64×32 + 32×12 + biases ≈ 11K - Total: ~208K+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "**Training requirements:** Minimal. Trains in minutes on CPU for our dataset sizes. Nightly retraining is trivial.",
   "marked": "{+**Training requirements:** Minimal. Trains in minutes on CPU for our dataset sizes. Nightly retraining is trivial.+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "**Strengths:** - Simple, well-understood architecture with strong empirical baselines for sequence modeling - Sequential processing naturally captures temporal dependencies - Low parameter count reduces overfitting risk on small datasets - Hidden state provides interpretable \"memory\" that can be inspected",
   "marked": "{+**Strengths:** - Simple, well-understood architecture with strong empirical baselines for sequence modeling - Sequential processing naturally captures temporal dependencies - Low parameter count reduces overfitting risk on small datasets - Hidden state provides interpretable \"memory\" that can be inspected+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "**Weaknesses:** - Sequential processing means training cannot be parallelised across time steps - May struggle with long-range dependencies (though $K=32$ is short enough this is unlikely) - Single hidden state may be too compressed to capture multi-factor risk patterns",
   "marked": "{+**Weaknesses:** - Sequential processing means training cannot be parallelised across time steps - May struggle with long-range dependencies (though $K=32$ is short enough this is unlikely) - Single hidden state may be too compressed to capture multi-factor risk patterns+}"
  },
  {
   "section": "5.1 Architecture 1: GRU-MLP (Baseline)",
   "old": null,
   "new": "**What it tests:** Whether simple recurrence is sufficient for temporal common sense.",
   "marked": "{+**What it tests:** Whether simple recurrence is sufficient for temporal common sense.+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "### 5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "marked": "{+### 5.2 Architecture 2: Temporal Convolutional Network (TCN)+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**Design:** 1D dilated causal convolutions over the embedding sequence. Each layer uses progressively larger dilation to capture patterns at different timescales.",
   "marked": "{+**Design:** 1D dilated causal convolutions over the embedding sequence. Each layer uses progressively larger dilation to capture patterns at different timescales.+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "``` Input: [s_{t-K+1}, ..., s_t] ∈ R^{K×384} │ ▼ Conv1D(384→128, kernel=3, dilation=1) → LayerNorm → GELU → Dropout(0.1) │ ▼ Conv1D(128→128, kernel=3, dilation=2) → LayerNorm → GELU → Dropout(0.1) │ ▼ Conv1D(128→128, kernel=3, dilation=4) → LayerNorm → GELU → Dropout(0.1) │ ▼ Conv1D(128→64, kernel=3, dilation=8) → LayerNorm → GELU → Dropout(0.1) │ take last position ▼ Multi-head output (64 → 12) ```",
   "marked": "{+``` Input: [s_{t-K+1}, ..., s_t] ∈ R^{K×384} │ ▼ Conv1D(384→128, kernel=3, dilation=1) → LayerNorm → GELU → Dropout(0.1) │ ▼ Conv1D(128→128, kernel=3, dilation=2) → LayerNorm → GELU → Dropout(0.1) │ ▼ Conv1D(128→128, kernel=3, dilation=4) → LayerNorm → GELU → Dropout(0.1) │ ▼ Conv1D(128→64, kernel=3, dilation=8) → LayerNorm → GELU → Dropout(0.1) │ take last position ▼ Multi-head output (64 → 12) ```+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**Receptive field:** With 4 layers, kernel size 3, and dilations [1, 2, 4, 8], the receptive field is $2 \\times (1+2+4+8) = 30$ — nearly covering the full window $K=32$.",
   "marked": "{+**Receptive field:** With 4 layers, kernel size 3, and dilations [1, 2, 4, 8], the receptive field is $2 \\times (1+2+4+8) = 30$ — nearly covering the full window $K=32$.+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**Parameter count:** ~260K - Conv layers: 384×128×3 + 128×128×3×3 + 128×64×3 + biases ≈ 258K - Output: 64×12 + biases ≈ 0.8K - Total: ~259K",
   "marked": "{+**Parameter count:** ~260K - Conv layers: 384×128×3 + 128×128×3×3 + 128×64×3 + biases ≈ 258K - Output: 64×12 + biases ≈ 0.8K - Total: ~259K+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**Training requirements:** Fully parallelisable across time steps. Faster training than GRU for equivalent epochs. Same hardware requirements (CPU-trainable).",
   "marked": "{+**Training requirements:** Fully parallelisable across time steps. Faster training than GRU for equivalent epochs. Same hardware requirements (CPU-trainable).+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**Strengths:** - Parallelisable training — faster wall-clock time - Dilated convolutions capture multi-scale temporal patterns explicitly - No vanishing gradient problem — direct gradient paths through skip connections (if added) - Causal convolution ensures the model cannot look ahead",
   "marked": "{+**Strengths:** - Parallelisable training — faster wall-clock time - Dilated convolutions capture multi-scale temporal patterns explicitly - No vanishing gradient problem — direct gradient paths through skip connections (if added) - Causal convolution ensures the model cannot look ahead+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**Weaknesses:** - Fixed receptive field — cannot adapt to variable-length relevant history - No explicit \"memory\" — patterns beyond the receptive field are invisible - May need more layers/parameters than GRU for equivalent temporal reasoning",
   "marked": "{+**Weaknesses:** - Fixed receptive field — cannot adapt to variable-length relevant history - No explicit \"memory\" — patterns beyond the receptive field are invisible - May need more layers/parameters than GRU for equivalent temporal reasoning+}"
  },
  {
   "section": "5.2 Architecture 2: Temporal Convolutional Network (TCN)",
   "old": null,
   "new": "**What it tests:** Whether parallel temporal processing matches recurrent temporal processing for our sequence lengths and pattern types.",
   "marked": "{+**What it tests:** Whether parallel temporal processing matches recurrent temporal processing for our sequence lengths and pattern types.+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "### 5.3 Architecture 3: Transformer-Micro",
   "marked": "{+### 5.3 Architecture 3: Transformer-Micro+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**Design:** 2-layer, 4-head self-attention over situation embeddings with learned positional encoding. Tests whether attention patterns reveal structure the GRU misses.",
   "marked": "{+**Design:** 2-layer, 4-head self-attention over situation embeddings with learned positional encoding. Tests whether attention patterns reveal structure the GRU misses.+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "``` Input: [s_{t-K+1}, ..., s_t] ∈ R^{K×384} │ ▼ Linear(384 → 128) → Positional encoding (learned, K positions) │ ▼ TransformerEncoderLayer(d_model=128, nhead=4, d_ff=256, dropout=0.1) │ ▼ TransformerEncoderLayer(d_model=128, nhead=4, d_ff=256, dropout=0.1) │ take [CLS] token or mean-pool ▼ Linear(128, 64) → GELU │ ▼ Multi-head output (64 → 12) ```",
   "marked": "{+``` Input: [s_{t-K+1}, ..., s_t] ∈ R^{K×384} │ ▼ Linear(384 → 128) → Positional encoding (learned, K positions) │ ▼ TransformerEncoderLayer(d_model=128, nhead=4, d_ff=256, dropout=0.1) │ ▼ TransformerEncoderLayer(d_model=128, nhead=4, d_ff=256, dropout=0.1) │ take [CLS] token or mean-pool ▼ Linear(128, 64) → GELU │ ▼ Multi-head output (64 → 12) ```+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**Parameter count:** ~150K - Input projection: 384×128 ≈ 49K - Positional encoding: 32×128 ≈ 4K - Transformer layer ×2: (128×128×4 [Q,K,V,O] + 128×256 + 256×128) ×2 ≈ 263K — wait, that's too high. Let me recalculate. - Self-attention: $4 \\times d_{model} \\times d_{model} = 4 \\times 128 \\times 128 = 65.5K$ per layer - FFN: $128 \\times 256 + 256 \\times 128 = 65.5K$ per layer - Per layer: ~131K. Two layers: ~262K — this exceeds 150K target.",
   "marked": "{+**Parameter count:** ~150K - Input projection: 384×128 ≈ 49K - Positional encoding: 32×128 ≈ 4K - Transformer layer ×2: (128×128×4 [Q,K,V,O] + 128×256 + 256×128) ×2 ≈ 263K — wait, that's too high. Let me recalculate. - Self-attention: $4 \\times d_{model} \\times d_{model} = 4 \\times 128 \\times 128 = 65.5K$ per layer - FFN: $128 \\times 256 + 256 \\times 128 = 65.5K$ per layer - Per layer: ~131K. Two layers: ~262K — this exceeds 150K target.+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "Let me adjust: use $d_{model} = 96$, $d_{ff} = 192$: - Input projection: 384×96 ≈ 37K - Positional: 32×96 ≈ 3K - Transformer layer: 4×96×96 + 96×192 + 192×96 ≈ 74K per layer. Two layers: ~148K - Output: 96×12 ≈ 1.2K",
   "marked": "{+Let me adjust: use $d_{model} = 96$, $d_{ff} = 192$: - Input projection: 384×96 ≈ 37K - Positional: 32×96 ≈ 3K - Transformer layer: 4×96×96 + 96×192 + 192×96 ≈ 74K per layer. Two layers: ~148K - Output: 96×12 ≈ 1.2K+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**Revised parameter count:** ~150K (with $d_{model} = 96$, $n_{head} = 4$, $d_{ff} = 192$, $n_{layers} = 2$)",
   "marked": "{+**Revised parameter count:** ~150K (with $d_{model} = 96$, $n_{head} = 4$, $d_{ff} = 192$, $n_{layers} = 2$)+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**Training requirements:** More compute-intensive per parameter than GRU or TCN due to $O(K^2)$ attention. At $K=32$, this is 1024 pairwise comparisons — trivial for modern hardware.",
   "marked": "{+**Training requirements:** More compute-intensive per parameter than GRU or TCN due to $O(K^2)$ attention. At $K=32$, this is 1024 pairwise comparisons — trivial for modern hardware.+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**Strengths:** - Attention patterns are directly interpretable: \"this action is risky *because* of step 7 (high attention weight on the recent overwrite)\" - Self-attention can capture arbitrary pairwise relationships between situation steps - Proven architecture for sequence understanding at scale - Attention maps provide built-in explainability for blocked actions",
   "marked": "{+**Strengths:** - Attention patterns are directly interpretable: \"this action is risky *because* of step 7 (high attention weight on the recent overwrite)\" - Self-attention can capture arbitrary pairwise relationships between situation steps - Proven architecture for sequence understanding at scale - Attention maps provide built-in explainability for blocked actions+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**Weaknesses:** - $O(K^2)$ attention cost (negligible at $K=32$, relevant if scaled) - Positional encoding may be unnecessary for short sequences where the GRU's inherent ordering suffices - More prone to overfitting than GRU/TCN at small data scales - \"Overkill\" concern: this is 32 vectors of 384d, not GPT-scale sequences",
   "marked": "{+**Weaknesses:** - $O(K^2)$ attention cost (negligible at $K=32$, relevant if scaled) - Positional encoding may be unnecessary for short sequences where the GRU's inherent ordering suffices - More prone to overfitting than GRU/TCN at small data scales - \"Overkill\" concern: this is 32 vectors of 384d, not GPT-scale sequences+}"
  },
  {
   "section": "5.3 Architecture 3: Transformer-Micro",
   "old": null,
   "new": "**What it tests:** Whether the ability to attend to *specific prior situations* (not just their recurrent summary) improves catastrophic failure detection. If a specific past action is the key context for the current risk assessment, attention should outperform the GRU's compressed hidden state.",
   "marked": "{+**What it tests:** Whether the ability to attend to *specific prior situations* (not just their recurrent summary) improves catastrophic failure detection. If a specific past action is the key context for the current risk assessment, attention should outperform the GRU's compressed hidden state.+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "### 5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "marked": "{+### 5.4 Architecture 4: Dual-Encoder with Cross-Attention+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**Design:** Separate encoders for \"proposed action\" (current situation embedding) and \"recent context\" (sequence of recent embeddings), with cross-attention to find contradictions between what the agent is about to do and what has recently happened.",
   "marked": "{+**Design:** Separate encoders for \"proposed action\" (current situation embedding) and \"recent context\" (sequence of recent embeddings), with cross-attention to find contradictions between what the agent is about to do and what has recently happened.+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "``` Proposed action: s_t ∈ R^384 Recent context: [s_{t-K+1}, ..., s_{t-1}] ∈ R^{(K-1)×384} │ │ ▼ ▼ Linear(384→128) GRU(384→128) or Mean-pool │ q ∈ R^128 │ C ∈ R^{(K-1)×128} or R^128 ▼ ▼ └──────────── Cross-Attention ────────────────┘ │ q attends to C │ attended ∈ R^128 ▼ [q ⊕ attended] ∈ R^256 │ Linear(256→64) → GELU │ Multi-head output (64→12) ```",
   "marked": "{+``` Proposed action: s_t ∈ R^384 Recent context: [s_{t-K+1}, ..., s_{t-1}] ∈ R^{(K-1)×384} │ │ ▼ ▼ Linear(384→128) GRU(384→128) or Mean-pool │ q ∈ R^128 │ C ∈ R^{(K-1)×128} or R^128 ▼ ▼ └──────────── Cross-Attention ────────────────┘ │ q attends to C │ attended ∈ R^128 ▼ [q ⊕ attended] ∈ R^256 │ Linear(256→64) → GELU │ Multi-head output (64→12) ```+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**For the cross-attention variant with context GRU:**",
   "marked": "{+**For the cross-attention variant with context GRU:**+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**Parameter count:** ~310K - Action encoder: 384×128 ≈ 49K - Context GRU: similar to Architecture 1 ≈ 197K - Cross-attention (Q, K, V projections): 3×128×128 ≈ 49K - MLP + output: ~15K - Total: ~310K",
   "marked": "{+**Parameter count:** ~310K - Action encoder: 384×128 ≈ 49K - Context GRU: similar to Architecture 1 ≈ 197K - Cross-attention (Q, K, V projections): 3×128×128 ≈ 49K - MLP + output: ~15K - Total: ~310K+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**Training requirements:** Higher than GRU-MLP due to additional parameters and the cross-attention mechanism. Still CPU-trainable for our data scales.",
   "marked": "{+**Training requirements:** Higher than GRU-MLP due to additional parameters and the cross-attention mechanism. Still CPU-trainable for our data scales.+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**Strengths:** - **Architecturally designed for contradiction detection.** The cross-attention explicitly compares \"what I'm about to do\" against \"what recently happened.\" This is precisely the structure of the README debacle: the proposed action (overwrite) contradicts recent context (heavy editing). - Separate encoders prevent the proposed action from being \"washed out\" by the context sequence - Cross-attention weights are highly interpretable: \"I'm blocking this because of high attention on yesterday's editing session\"",
   "marked": "{+**Strengths:** - **Architecturally designed for contradiction detection.** The cross-attention explicitly compares \"what I'm about to do\" against \"what recently happened.\" This is precisely the structure of the README debacle: the proposed action (overwrite) contradicts recent context (heavy editing). - Separate encoders prevent the proposed action from being \"washed out\" by the context sequence - Cross-attention weights are highly interpretable: \"I'm blocking this because of high attention on yesterday's editing session\"+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**Weaknesses:** - More complex architecture — more things to tune, more ways to fail - Requires the \"proposed action\" to be clearly separable from \"context,\" which may not always be clean - Higher parameter count increases overfitting risk",
   "marked": "{+**Weaknesses:** - More complex architecture — more things to tune, more ways to fail - Requires the \"proposed action\" to be clearly separable from \"context,\" which may not always be clean - Higher parameter count increases overfitting risk+}"
  },
  {
   "section": "5.4 Architecture 4: Dual-Encoder with Cross-Attention",
   "old": null,
   "new": "**What it tests:** Whether *explicit architectural separation* of \"what I'm about to do\" from \"what has recently happened\" improves contradiction detection compared to architectures that process them jointly. This is the most theoretically motivated architecture for the action gating task.",
   "marked": "{+**What it tests:** Whether *explicit architectural separation* of \"what I'm about to do\" from \"what has recently happened\" improves contradiction detection compared to architectures that process them jointly. This is the most theoretically motivated architecture for the action gating task.+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "### 5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "marked": "{+### 5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**Design:** A simple feedforward MLP on the *current situation embedding only* (no temporal context), but with 3 independent heads that vote. This is the ablation control: it tests whether temporal context actually matters, or whether better feature representation (situation embeddings vs. hand-crafted features) is sufficient.",
   "marked": "{+**Design:** A simple feedforward MLP on the *current situation embedding only* (no temporal context), but with 3 independent heads that vote. This is the ablation control: it tests whether temporal context actually matters, or whether better feature representation (situation embeddings vs. hand-crafted features) is sufficient.+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "``` Input: s_t ∈ R^384 │ ├─────────────────────┬───────────────────────┐ ▼ ▼ ▼ MLP_1(384→128→64) MLP_2(384→128→64) MLP_3(384→128→64) │ │ │ ▼ ▼ ▼ Head_1(64→12) Head_2(64→12) Head_3(64→12) │ │ │ └─────── Vote/Average ───────────────────────┘ │ Final output ∈ R^12 ```",
   "marked": "{+``` Input: s_t ∈ R^384 │ ├─────────────────────┬───────────────────────┐ ▼ ▼ ▼ MLP_1(384→128→64) MLP_2(384→128→64) MLP_3(384→128→64) │ │ │ ▼ ▼ ▼ Head_1(64→12) Head_2(64→12) Head_3(64→12) │ │ │ └─────── Vote/Average ───────────────────────┘ │ Final output ∈ R^12 ```+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**Parameter count:** ~180K (60K per MLP head × 3) - Per head: 384×128 + 128×64 + 64×12 + biases ≈ 58K - Three heads: ~174K - Total: ~174K",
   "marked": "{+**Parameter count:** ~180K (60K per MLP head × 3) - Per head: 384×128 + 128×64 + 64×12 + biases ≈ 58K - Three heads: ~174K - Total: ~174K+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**Training:** Each head is trained independently with different random initialisation (and optionally different dropout masks or data subsampling). This provides diversity without architectural complexity.",
   "marked": "{+**Training:** Each head is trained independently with different random initialisation (and optionally different dropout masks or data subsampling). This provides diversity without architectural complexity.+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**Voting strategy:** For action_confidence specifically: - **Conservative vote:** Take the *minimum* confidence across all 3 heads. If any head thinks it's dangerous, block. This maximises safety at the cost of more false positives. - **Majority vote:** Block if ≥ 2 heads have confidence below threshold. Balanced approach. - **Weighted average:** Average weighted by each head's historical accuracy. Adaptive approach.",
   "marked": "{+**Voting strategy:** For action_confidence specifically: - **Conservative vote:** Take the *minimum* confidence across all 3 heads. If any head thinks it's dangerous, block. This maximises safety at the cost of more false positives. - **Majority vote:** Block if ≥ 2 heads have confidence below threshold. Balanced approach. - **Weighted average:** Average weighted by each head's historical accuracy. Adaptive approach.+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "For secondary heads (retrieval, tone, curiosity): simple average.",
   "marked": "{+For secondary heads (retrieval, tone, curiosity): simple average.+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**Strengths:** - Simplest architecture — easiest to debug, train, and deploy - No temporal modeling means faster inference and smaller memory footprint - Multiple heads provide calibration and uncertainty estimation (high disagreement = uncertain situation) - Tests the hypothesis that temporal context matters",
   "marked": "{+**Strengths:** - Simplest architecture — easiest to debug, train, and deploy - No temporal modeling means faster inference and smaller memory footprint - Multiple heads provide calibration and uncertainty estimation (high disagreement = uncertain situation) - Tests the hypothesis that temporal context matters+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**Weaknesses:** - Cannot learn temporal patterns (\"you just edited this file\") — sees only the current situation - Relies entirely on the situation description containing all relevant context (which the template tries to ensure) - Independent heads may converge to similar solutions despite different initialisation",
   "marked": "{+**Weaknesses:** - Cannot learn temporal patterns (\"you just edited this file\") — sees only the current situation - Relies entirely on the situation description containing all relevant context (which the template tries to ensure) - Independent heads may converge to similar solutions despite different initialisation+}"
  },
  {
   "section": "5.5 Architecture 5: Ensemble MLP (No-Temporal Baseline)",
   "old": null,
   "new": "**What it tests:** The central question: *does temporal context actually help?* If the Ensemble MLP performs comparably to temporal architectures, the answer is \"no — better features are sufficient.\" If temporal architectures significantly outperform, temporal context is essential for common sense.",
   "marked": "{+**What it tests:** The central question: *does temporal context actually help?* If the Ensemble MLP performs comparably to temporal architectures, the answer is \"no — better features are sufficient.\" If temporal architectures significantly outperform, temporal context is essential for common sense.+}"
  },
  {
   "section": "5.6 Architecture Comparison Summary",
   "old": null,
   "new": "### 5.6 Architecture Comparison Summary",
   "marked": "{+### 5.6 Architecture Comparison Summary+}"
  },
  {
   "section": "5.6 Architecture Comparison Summary",
   "old": null,
   "new": "| Architecture | Params | Temporal | Parallelisable | Key Test | |-------------|--------|----------|---------------|----------| | GRU-MLP | ~210K | Yes (recurrent) | No | Baseline temporal model | | TCN | ~260K | Yes (convolutional) | Yes | Parallel temporal processing | | Transformer-Micro | ~150K | Yes (attention) | Yes | Interpretable attention patterns | | Dual-Encoder | ~310K | Yes (cross-attention) | Partial | Explicit contradiction detection | | Ensemble MLP | ~174K | No | Yes | Whether temporal context matters |",
   "marked": "{+| Architecture | Params | Temporal | Parallelisable | Key Test | |-------------|--------|----------|---------------|----------| | GRU-MLP | ~210K | Yes (recurrent) | No | Baseline temporal model | | TCN | ~260K | Yes (convolutional) | Yes | Parallel temporal processing | | Transformer-Micro | ~150K | Yes (attention) | Yes | Interpretable attention patterns | | Dual-Encoder | ~310K | Yes (cross-attention) | Partial | Explicit contradiction detection | | Ensemble MLP | ~174K | No | Yes | Whether temporal context matters |+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "### 5.7 Meta-Learning: Selecting and Combining Architectures",
   "marked": "{+### 5.7 Meta-Learning: Selecting and Combining Architectures+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "Rather than committing to a single architecture, we propose a **stacked meta-learner** that combines all five:",
   "marked": "{+Rather than committing to a single architecture, we propose a **stacked meta-learner** that combines all five:+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "1. **Train all 5 architectures** on the same training set with the same loss function. 2. **Evaluate on a held-out validation set** — the Catastrophic Failure Database (§6) provides the evaluation benchmark. 3. **For production inference**, run all 5 in parallel (<5ms total on CPU via ONNX) and combine via a learned linear combination:",
   "marked": "{+1. **Train all 5 architectures** on the same training set with the same loss function. 2. **Evaluate on a held-out validation set** — the Catastrophic Failure Database (§6) provides the evaluation benchmark. 3. **For production inference**, run all 5 in parallel (<5ms total on CPU via ONNX) and combine via a learned linear combination:+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "$$\\text{action\\_confidence}_{\\text{final}} = \\sum_{i=1}^{5} w_i \\cdot \\text{action\\_confidence}_i$$",
   "marked": "{+$$\\text{action\\_confidence}_{\\text{final}} = \\sum_{i=1}^{5} w_i \\cdot \\text{action\\_confidence}_i$$+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "where $w_i$ are learned weights updated monthly based on each architecture's predictive accuracy.",
   "marked": "{+where $w_i$ are learned weights updated monthly based on each architecture's predictive accuracy.+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "**Conservative override:** If *any* architecture outputs confidence below the hard-block threshold, the action is blocked regardless of the ensemble's average. This implements a \"most cautious voice wins\" policy for catastrophic risk prevention.",
   "marked": "{+**Conservative override:** If *any* architecture outputs confidence below the hard-block threshold, the action is blocked regardless of the ensemble's average. This implements a \"most cautious voice wins\" policy for catastrophic risk prevention.+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "**Disagreement as signal:** High variance across architectures indicates an unusual situation. When $\\text{std}(\\text{confidence}_1, \\ldots, \\text{confidence}_5) > \\tau$, the system defaults to user confirmation regardless of the mean confidence. Disagreement among models is itself evidence of ambiguity.",
   "marked": "{+**Disagreement as signal:** High variance across architectures indicates an unusual situation. When $\\text{std}(\\text{confidence}_1, \\ldots, \\text{confidence}_5) > \\tau$, the system defaults to user confirmation regardless of the mean confidence. Disagreement among models is itself evidence of ambiguity.+}"
  },
  {
   "section": "5.7 Meta-Learning: Selecting and Combining Architectures",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "6. The Catastrophic Failure Database",
   "old": null,
   "new": "## 6. The Catastrophic Failure Database",
   "marked": "{+## 6. The Catastrophic Failure Database+}"
  },
  {
   "section": "6.1 Motivation",
   "old": null,
   "new": "### 6.1 Motivation",
   "marked": "{+### 6.1 Motivation+}"
  },
  {
   "section": "6.1 Motivation",
   "old": null,
   "new": "Training a common-sense network requires data about what common sense looks like. Positive examples (actions that should proceed) are abundant — most actions are fine. The challenge is negative examples: actions that should have been blocked. These are rare, high-value, and critically underrepresented in any single deployment's history.",
   "marked": "{+Training a common-sense network requires data about what common sense looks like. Positive examples (actions that should proceed) are abundant — most actions are fine. The challenge is negative examples: actions that should have been blocked. These are rare, high-value, and critically underrepresented in any single deployment's history.+}"
  },
  {
   "section": "6.1 Motivation",
   "old": null,
   "new": "The Catastrophic Failure Database (CFD) addresses this by aggregating failure data from multiple sources, creating a structured corpus of (situation, outcome) pairs that can be used for:",
   "marked": "{+The Catastrophic Failure Database (CFD) addresses this by aggregating failure data from multiple sources, creating a structured corpus of (situation, outcome) pairs that can be used for:+}"
  },
  {
   "section": "6.1 Motivation",
   "old": null,
   "new": "1. **Pre-training:** Learn from documented failures before seeing any of our own 2. **Evaluation benchmark:** Systematically test whether the network would have caught known failures 3. **Continuous expansion:** New failures (our own and publicly documented) are added as they occur",
   "marked": "{+1. **Pre-training:** Learn from documented failures before seeing any of our own 2. **Evaluation benchmark:** Systematically test whether the network would have caught known failures 3. **Continuous expansion:** New failures (our own and publicly documented) are added as they occur+}"
  },
  {
   "section": "6.2 Sources",
   "old": null,
   "new": "### 6.2 Sources",
   "marked": "{+### 6.2 Sources+}"
  },
  {
   "section": "6.2 Sources",
   "old": null,
   "new": "| Source | Type | Estimated Entries | Entry Quality | |--------|------|-------------------|---------------| | AI Incident Database | Production incidents | 800+ | Variable — needs curation | | AIAAIC Repository | OECD-tracked incidents | 400+ | High — structured metadata | | MIT AI Risk Repository | Academic analysis | 200+ | High — causal categorisation | | Vectara awesome-agent-failures | Agent-specific failures | 50+ | High — curated for relevance | | \"Agents of Chaos\" (Feb 2026) | Research study | ~150 events | Very high — controlled conditions | | Production postmortems | Industry reports | ~100 | Variable | | Our deployment history | First-party data | ~30 | Very high — full context available |",
   "marked": "{+| Source | Type | Estimated Entries | Entry Quality | |--------|------|-------------------|---------------| | AI Incident Database | Production incidents | 800+ | Variable — needs curation | | AIAAIC Repository | OECD-tracked incidents | 400+ | High — structured metadata | | MIT AI Risk Repository | Academic analysis | 200+ | High — causal categorisation | | Vectara awesome-agent-failures | Agent-specific failures | 50+ | High — curated for relevance | | \"Agents of Chaos\" (Feb 2026) | Research study | ~150 events | Very high — controlled conditions | | Production postmortems | Industry reports | ~100 | Variable | | Our deployment history | First-party data | ~30 | Very high — full context available |+}"
  },
  {
   "section": "6.2 Sources",
   "old": null,
   "new": "**Total estimated entries after curation:** 500–1,000 high-quality (situation, outcome) pairs.",
   "marked": "{+**Total estimated entries after curation:** 500–1,000 high-quality (situation, outcome) pairs.+}"
  },
  {
   "section": "6.3 Taxonomy",
   "old": null,
   "new": "### 6.3 Taxonomy",
   "marked": "{+### 6.3 Taxonomy+}"
  },
  {
   "section": "6.3 Taxonomy",
   "old": null,
   "new": "Every failure in the CFD is classified along four dimensions:",
   "marked": "{+Every failure in the CFD is classified along four dimensions:+}"
  },
  {
   "section": "6.3 Taxonomy",
   "old": null,
   "new": "**Dimension 1: Failure Mechanism** - **F1: Stale context** — Action was correct in the past, wrong now. (README debacle, outdated API key rotation.) - **F2: Scope escalation** — Action affected more than intended. (Email mass-deletion, drive wipe.) - **F3: Social boundary violation** — Action was technically permitted but socially wrong. (Reaction spam, unauthorized DMs.) - **F4: Cascade/compound error** — Multiple small errors combined catastrophically. (Multi-agent miscoordination.) - **F5: Hallucination-driven action** — LLM fabricated context that led to wrong action. (Cursor \"Sam\" policy fabrication.) - **F6: Ambiguity exploitation** — Ambiguous instruction interpreted in the most harmful way. (Replit \"clean up\" → delete.) - **F7: Automation trust excess** — Human trusted automation output without verification. (Antigravity drive wipe.)",
   "marked": "{+**Dimension 1: Failure Mechanism** - **F1: Stale context** — Action was correct in the past, wrong now. (README debacle, outdated API key rotation.) - **F2: Scope escalation** — Action affected more than intended. (Email mass-deletion, drive wipe.) - **F3: Social boundary violation** — Action was technically permitted but socially wrong. (Reaction spam, unauthorized DMs.) - **F4: Cascade/compound error** — Multiple small errors combined catastrophically. (Multi-agent miscoordination.) - **F5: Hallucination-driven action** — LLM fabricated context that led to wrong action. (Cursor \"Sam\" policy fabrication.) - **F6: Ambiguity exploitation** — Ambiguous instruction interpreted in the most harmful way. (Replit \"clean up\" → delete.) - **F7: Automation trust excess** — Human trusted automation output without verification. (Antigravity drive wipe.)+}"
  },
  {
   "section": "6.3 Taxonomy",
   "old": null,
   "new": "**Dimension 2: Reversibility** - **R1: Fully reversible** — Git revert, undo, restore from backup. Cost: time. - **R2: Partially reversible** — Some data recoverable, some lost. Cost: time + partial data loss. - **R3: Irreversible** — Data permanently destroyed, message sent, public action taken.",
   "marked": "{+**Dimension 2: Reversibility** - **R1: Fully reversible** — Git revert, undo, restore from backup. Cost: time. - **R2: Partially reversible** — Some data recoverable, some lost. Cost: time + partial data loss. - **R3: Irreversible** — Data permanently destroyed, message sent, public action taken.+}"
  },
  {
   "section": "6.3 Taxonomy",
   "old": null,
   "new": "**Dimension 3: Blast Radius** - **B1: Self-contained** — Only the agent's internal state affected. - **B2: Session-scoped** — Current session affected, no persistent impact. - **B3: Persistent** — Permanent changes to files, databases, or configurations. - **B4: External** — Impact on other people (messages sent, emails, public posts).",
   "marked": "{+**Dimension 3: Blast Radius** - **B1: Self-contained** — Only the agent's internal state affected. - **B2: Session-scoped** — Current session affected, no persistent impact. - **B3: Persistent** — Permanent changes to files, databases, or configurations. - **B4: External** — Impact on other people (messages sent, emails, public posts).+}"
  },
  {
   "section": "6.3 Taxonomy",
   "old": null,
   "new": "**Dimension 4: Detection Difficulty** - **D1: Immediately obvious** — Error is apparent within seconds. - **D2: Delayed discovery** — Error is discovered hours or days later. - **D3: Silent failure** — Error may never be discovered without audit.",
   "marked": "{+**Dimension 4: Detection Difficulty** - **D1: Immediately obvious** — Error is apparent within seconds. - **D2: Delayed discovery** — Error is discovered hours or days later. - **D3: Silent failure** — Error may never be discovered without audit.+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "### 6.4 Converting Failures to Training Examples",
   "marked": "{+### 6.4 Converting Failures to Training Examples+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "Each CFD entry is converted to a training example via the following pipeline:",
   "marked": "{+Each CFD entry is converted to a training example via the following pipeline:+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "1. **Extract the situation** from the incident report: What was the agent about to do? What context existed? What signals should have triggered caution?",
   "marked": "{+1. **Extract the situation** from the incident report: What was the agent about to do? What context existed? What signals should have triggered caution?+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "2. **Fill the situation template** (§4.2) with the extracted information. Fields that cannot be determined from the report receive defaults.",
   "marked": "{+2. **Fill the situation template** (§4.2) with the extracted information. Fields that cannot be determined from the report receive defaults.+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "3. **Serialise and embed** the situation template via the frozen sentence encoder.",
   "marked": "{+3. **Serialise and embed** the situation template via the frozen sentence encoder.+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "4. **Label:** For CFD entries, the label is always `action_confidence_target = 0.0` (the action should not have proceeded). The taxonomy dimensions provide additional supervised signal for auxiliary loss terms.",
   "marked": "{+4. **Label:** For CFD entries, the label is always `action_confidence_target = 0.0` (the action should not have proceeded). The taxonomy dimensions provide additional supervised signal for auxiliary loss terms.+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "**Example — README debacle:**",
   "marked": "{+**Example — README debacle:**+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "``` action_type: overwrite target_type: file target_id: README.md target_metadata: age_hours: 2160 # file existed for months size: 14200 bytes recent_commits: 6 # 6 commits in last 48h recent_authors: 4 # 4 sub-agents contributed effort_hours: 8.5 # estimated from session logs last_human_ref: 3 # discussed 3 hours ago context: session_topic: \"upstream merge automation\" recent_corrections: 2 emotional_signals: \"frustrated\" automation_depth: 2 # merge script → git checkout scope: reversible: true # git can recover, but... blast_radius: persistent # changes working tree human_in_loop: false # fully automated confirmation: none ```",
   "marked": "{+``` action_type: overwrite target_type: file target_id: README.md target_metadata: age_hours: 2160 # file existed for months size: 14200 bytes recent_commits: 6 # 6 commits in last 48h recent_authors: 4 # 4 sub-agents contributed effort_hours: 8.5 # estimated from session logs last_human_ref: 3 # discussed 3 hours ago context: session_topic: \"upstream merge automation\" recent_corrections: 2 emotional_signals: \"frustrated\" automation_depth: 2 # merge script → git checkout scope: reversible: true # git can recover, but... blast_radius: persistent # changes working tree human_in_loop: false # fully automated confirmation: none ```+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "**Target:** `action_confidence = 0.0` (F1: Stale context, R1: Reversible, B3: Persistent, D2: Delayed)",
   "marked": "{+**Target:** `action_confidence = 0.0` (F1: Stale context, R1: Reversible, B3: Persistent, D2: Delayed)+}"
  },
  {
   "section": "6.4 Converting Failures to Training Examples",
   "old": null,
   "new": "A human reading this template would immediately flag: 6 recent commits, 4 authors, 8.5 hours of effort, and we're about to overwrite with no confirmation? AMYGDALA must learn to flag it too.",
   "marked": "{+A human reading this template would immediately flag: 6 recent commits, 4 authors, 8.5 hours of effort, and we're about to overwrite with no confirmation? AMYGDALA must learn to flag it too.+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "### 6.5 Synthetic Augmentation",
   "marked": "{+### 6.5 Synthetic Augmentation+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "Real catastrophic failures are rare. To expand the training set, we apply controlled perturbations to real CFD entries:",
   "marked": "{+Real catastrophic failures are rare. To expand the training set, we apply controlled perturbations to real CFD entries:+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "1. **Target variation:** Same failure pattern, different target. \"Overwrite heavily-edited file\" → \"Delete heavily-edited database table\" → \"Revert heavily-edited configuration.\"",
   "marked": "{+1. **Target variation:** Same failure pattern, different target. \"Overwrite heavily-edited file\" → \"Delete heavily-edited database table\" → \"Revert heavily-edited configuration.\"+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "2. **Severity scaling:** Adjust metadata to create a spectrum. 6 recent commits → 2, 10, 20. This teaches the network *gradations* of risk, not just binary safe/unsafe.",
   "marked": "{+2. **Severity scaling:** Adjust metadata to create a spectrum. 6 recent commits → 2, 10, 20. This teaches the network *gradations* of risk, not just binary safe/unsafe.+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "3. **Context injection:** Add or remove context signals. Same overwrite situation but with human_in_loop = true → should be safer (human can catch it). Same situation but with 0 recent commits → should be safe.",
   "marked": "{+3. **Context injection:** Add or remove context signals. Same overwrite situation but with human_in_loop = true → should be safer (human can catch it). Same situation but with 0 recent commits → should be safe.+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "4. **Counterfactual generation:** For each negative example, generate the positive counterfactual. \"Overwrite README with 0 recent commits, no recent effort, no emotional context\" → `action_confidence = 1.0`.",
   "marked": "{+4. **Counterfactual generation:** For each negative example, generate the positive counterfactual. \"Overwrite README with 0 recent commits, no recent effort, no emotional context\" → `action_confidence = 1.0`.+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "5. **Cross-domain transfer:** Take a failure pattern from one domain and apply it to another. \"Healthcare AI prescribed medication based on hallucinated patient history\" → \"Code agent deployed feature based on hallucinated test results.\"",
   "marked": "{+5. **Cross-domain transfer:** Take a failure pattern from one domain and apply it to another. \"Healthcare AI prescribed medication based on hallucinated patient history\" → \"Code agent deployed feature based on hallucinated test results.\"+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "Synthetic examples receive lower training weight (0.3×) than real examples to prevent the model from learning artifacts of the augmentation process.",
   "marked": "{+Synthetic examples receive lower training weight (0.3×) than real examples to prevent the model from learning artifacts of the augmentation process.+}"
  },
  {
   "section": "6.5 Synthetic Augmentation",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "7. Dataset Creation and Maintenance",
   "old": null,
   "new": "## 7. Dataset Creation and Maintenance",
   "marked": "{+## 7. Dataset Creation and Maintenance+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "### 7.1 Initial Dataset Creation",
   "marked": "{+### 7.1 Initial Dataset Creation+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "The initial training dataset combines four sources:",
   "marked": "{+The initial training dataset combines four sources:+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "**Source 1: Historical interaction mining (estimated 2,000–5,000 examples)**",
   "marked": "{+**Source 1: Historical interaction mining (estimated 2,000–5,000 examples)**+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "Parse 18 months of session transcripts (stored in ENGRAM) for (situation, outcome) pairs:",
   "marked": "{+Parse 18 months of session transcripts (stored in ENGRAM) for (situation, outcome) pairs:+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "1. Identify every action-taking event: file write, message send, command execution, retrieval query. 2. For each action, construct the situation template from logged metadata (git state, file metadata, session context). 3. Determine outcome: Was the action corrected within 24 hours? Was the user satisfied (positive signals) or dissatisfied (corrections, complaints)? 4. Label: correction within 24h → `action_confidence_target = 0.0–0.3` (scaled by severity). No complaint within 72h → `action_confidence_target = 0.8–1.0`. Explicit positive feedback → `action_confidence_target = 1.0`.",
   "marked": "{+1. Identify every action-taking event: file write, message send, command execution, retrieval query. 2. For each action, construct the situation template from logged metadata (git state, file metadata, session context). 3. Determine outcome: Was the action corrected within 24 hours? Was the user satisfied (positive signals) or dissatisfied (corrections, complaints)? 4. Label: correction within 24h → `action_confidence_target = 0.0–0.3` (scaled by severity). No complaint within 72h → `action_confidence_target = 0.8–1.0`. Explicit positive feedback → `action_confidence_target = 1.0`.+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "**Source 2: Catastrophic Failure Database (estimated 500–1,000 examples)**",
   "marked": "{+**Source 2: Catastrophic Failure Database (estimated 500–1,000 examples)**+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "All CFD entries converted to training examples as described in §6.4. These are high-value negative examples — situations where the action should have been blocked.",
   "marked": "{+All CFD entries converted to training examples as described in §6.4. These are high-value negative examples — situations where the action should have been blocked.+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "**Source 3: Internet-sourced lessons (estimated 200–500 examples)**",
   "marked": "{+**Source 3: Internet-sourced lessons (estimated 200–500 examples)**+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "Structured extraction from incident databases (§6.2):",
   "marked": "{+Structured extraction from incident databases (§6.2):+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "1. Scrape incident reports with sufficient technical detail to fill the situation template. 2. Apply NLP extraction pipeline to identify: what was the action? What context existed? What was the outcome? 3. Manually verify a random 20% sample for extraction quality. 4. Convert to situation templates, embed, and label.",
   "marked": "{+1. Scrape incident reports with sufficient technical detail to fill the situation template. 2. Apply NLP extraction pipeline to identify: what was the action? What context existed? What was the outcome? 3. Manually verify a random 20% sample for extraction quality. 4. Convert to situation templates, embed, and label.+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "**Source 4: Synthetic augmentation (estimated 3,000–10,000 examples)**",
   "marked": "{+**Source 4: Synthetic augmentation (estimated 3,000–10,000 examples)**+}"
  },
  {
   "section": "7.1 Initial Dataset Creation",
   "old": null,
   "new": "Apply the augmentation strategies from §6.5 to all real examples. The total augmented dataset is approximately 10,000–15,000 examples — sufficient for a 150K–300K parameter network.",
   "marked": "{+Apply the augmentation strategies from §6.5 to all real examples. The total augmented dataset is approximately 10,000–15,000 examples — sufficient for a 150K–300K parameter network.+}"
  },
  {
   "section": "7.2 Dataset Composition Targets",
   "old": null,
   "new": "### 7.2 Dataset Composition Targets",
   "marked": "{+### 7.2 Dataset Composition Targets+}"
  },
  {
   "section": "7.2 Dataset Composition Targets",
   "old": null,
   "new": "To prevent distribution shift and ensure balanced learning:",
   "marked": "{+To prevent distribution shift and ensure balanced learning:+}"
  },
  {
   "section": "7.2 Dataset Composition Targets",
   "old": null,
   "new": "| Category | Target % | Rationale | |----------|----------|-----------| | Positive (proceed) | 60% | Most actions are safe; the network should not be paranoid | | Mild negative (log but proceed) | 15% | Teaches gradation, not just binary | | Moderate negative (ask user) | 15% | The hardest category — ambiguous situations | | Severe negative (block) | 10% | Catastrophic failures — high-weight, low-frequency |",
   "marked": "{+| Category | Target % | Rationale | |----------|----------|-----------| | Positive (proceed) | 60% | Most actions are safe; the network should not be paranoid | | Mild negative (log but proceed) | 15% | Teaches gradation, not just binary | | Moderate negative (ask user) | 15% | The hardest category — ambiguous situations | | Severe negative (block) | 10% | Catastrophic failures — high-weight, low-frequency |+}"
  },
  {
   "section": "7.2 Dataset Composition Targets",
   "old": null,
   "new": "The severe negative category is oversampled to ensure the network sees enough catastrophic examples despite their rarity. Loss weighting further emphasises these: severe negatives receive 5× loss weight.",
   "marked": "{+The severe negative category is oversampled to ensure the network sees enough catastrophic examples despite their rarity. Loss weighting further emphasises these: severe negatives receive 5× loss weight.+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "### 7.3 Ongoing Maintenance (While Working)",
   "marked": "{+### 7.3 Ongoing Maintenance (While Working)+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "After initial training, AMYGDALA enters a continuous learning cycle:",
   "marked": "{+After initial training, AMYGDALA enters a continuous learning cycle:+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "**Step 1: Situation logging (every non-trivial action)**",
   "marked": "{+**Step 1: Situation logging (every non-trivial action)**+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "Every action that passes through the execution pipeline (§4.7) generates a situation template. This is deterministic — the template is filled programmatically from observable state (git log, file metadata, session context), not by the LLM. The LLM contributes only to optional slots (emotional context, intent) that are low-weight in the model.",
   "marked": "{+Every action that passes through the execution pipeline (§4.7) generates a situation template. This is deterministic — the template is filled programmatically from observable state (git log, file metadata, session context), not by the LLM. The LLM contributes only to optional slots (emotional context, intent) that are low-weight in the model.+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "**Step 2: Outcome observation (automatic, delayed)**",
   "marked": "{+**Step 2: Outcome observation (automatic, delayed)**+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "Outcomes are determined by observable events, not LLM judgment: - User correction within 24 hours → negative outcome (severity scaled by correction type: verbal correction = mild, manual file restoration = severe, \"never do that again\" = catastrophic) - No complaint within 72 hours → positive outcome - Explicit positive feedback → strongly positive outcome",
   "marked": "{+Outcomes are determined by observable events, not LLM judgment: - User correction within 24 hours → negative outcome (severity scaled by correction type: verbal correction = mild, manual file restoration = severe, \"never do that again\" = catastrophic) - No complaint within 72 hours → positive outcome - Explicit positive feedback → strongly positive outcome+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "**Step 3: Nightly CEREBELLUM cycle**",
   "marked": "{+**Step 3: Nightly CEREBELLUM cycle**+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "During the existing CEREBELLUM reflection cycle, AMYGDALA training is added:",
   "marked": "{+During the existing CEREBELLUM reflection cycle, AMYGDALA training is added:+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "1. Collect all (situation, outcome) pairs from the last 24 hours. 2. Validate against template schema (reject malformed entries). 3. Add to training buffer (rolling 90-day window). 4. Fine-tune all 5 architectures on the updated buffer (1–3 epochs, ~5 minutes on CPU). 5. Evaluate on held-out CFD benchmark. 6. Update meta-learner weights based on evaluation results. 7. Update trust ramp $\\alpha$ based on overall performance.",
   "marked": "{+1. Collect all (situation, outcome) pairs from the last 24 hours. 2. Validate against template schema (reject malformed entries). 3. Add to training buffer (rolling 90-day window). 4. Fine-tune all 5 architectures on the updated buffer (1–3 epochs, ~5 minutes on CPU). 5. Evaluate on held-out CFD benchmark. 6. Update meta-learner weights based on evaluation results. 7. Update trust ramp $\\alpha$ based on overall performance.+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "**Step 4: Monthly evaluation**",
   "marked": "{+**Step 4: Monthly evaluation**+}"
  },
  {
   "section": "7.3 Ongoing Maintenance (While Working)",
   "old": null,
   "new": "Once per month, run the full evaluation suite: - Held-out CFD benchmark (did the network catch these known failures?) - False positive rate (how many safe actions were unnecessarily blocked?) - False negative rate (how many corrections occurred after AMYGDALA approved the action?) - Per-architecture comparison (which architectures are improving, which are stagnating?) - Calibration check (does confidence=0.5 correspond to roughly 50% positive outcomes?)",
   "marked": "{+Once per month, run the full evaluation suite: - Held-out CFD benchmark (did the network catch these known failures?) - False positive rate (how many safe actions were unnecessarily blocked?) - False negative rate (how many corrections occurred after AMYGDALA approved the action?) - Per-architecture comparison (which architectures are improving, which are stagnating?) - Calibration check (does confidence=0.5 correspond to roughly 50% positive outcomes?)+}"
  },
  {
   "section": "7.4 Data Hygiene",
   "old": null,
   "new": "### 7.4 Data Hygiene",
   "marked": "{+### 7.4 Data Hygiene+}"
  },
  {
   "section": "7.4 Data Hygiene",
   "old": null,
   "new": "To prevent the training data from degrading over time:",
   "marked": "{+To prevent the training data from degrading over time:+}"
  },
  {
   "section": "7.4 Data Hygiene",
   "old": null,
   "new": "1. **No single session > 10% of training data.** Prevents a single unusual session from shifting the learned distribution. 2. **CFD entries are never removed from the training set.** These are the most valuable negative examples and serve as anchors. 3. **Synthetic examples are regenerated quarterly** from the latest real examples, preventing stale augmentation. 4. **Distribution monitoring:** Track the ratio of positive/negative examples monthly. If the ratio drifts > 20% from targets, resample.",
   "marked": "{+1. **No single session > 10% of training data.** Prevents a single unusual session from shifting the learned distribution. 2. **CFD entries are never removed from the training set.** These are the most valuable negative examples and serve as anchors. 3. **Synthetic examples are regenerated quarterly** from the latest real examples, preventing stale augmentation. 4. **Distribution monitoring:** Track the ratio of positive/negative examples monthly. If the ratio drifts > 20% from targets, resample.+}"
  },
  {
   "section": "7.4 Data Hygiene",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "8. The Weakest Link: LLM-Proof Programmatic Pipeline",
   "old": null,
   "new": "## 8. The Weakest Link: LLM-Proof Programmatic Pipeline",
   "marked": "{+## 8. The Weakest Link: LLM-Proof Programmatic Pipeline+}"
  },
  {
   "section": "8.1 The Problem",
   "old": null,
   "new": "### 8.1 The Problem",
   "marked": "{+### 8.1 The Problem+}"
  },
  {
   "section": "8.1 The Problem",
   "old": null,
   "new": "AMYGDALA is a neural network trained on situation descriptions. Those descriptions contain information about the proposed action and its context. Some of that information comes from the LLM — the same LLM that can hallucinate.",
   "marked": "{+AMYGDALA is a neural network trained on situation descriptions. Those descriptions contain information about the proposed action and its context. Some of that information comes from the LLM — the same LLM that can hallucinate.+}"
  },
  {
   "section": "8.1 The Problem",
   "old": null,
   "new": "This is the single most critical engineering challenge in the entire system. If the LLM can influence the situation description, it can influence AMYGDALA's output. If it can influence AMYGDALA's output, it can bypass the action gate. The entire safety guarantee collapses.",
   "marked": "{+This is the single most critical engineering challenge in the entire system. If the LLM can influence the situation description, it can influence AMYGDALA's output. If it can influence AMYGDALA's output, it can bypass the action gate. The entire safety guarantee collapses.+}"
  },
  {
   "section": "8.1 The Problem",
   "old": null,
   "new": "Consider the attack surface: an LLM, through hallucination or adversarial prompting, fills the situation template with: - `recent_commits: 0` (when there were actually 6) - `effort_hours: 0.1` (when 8 hours were invested) - `emotional_signals: \"calm\"` (when the user was frustrated) - `automation_depth: 0` (when the action is two levels deep in automation)",
   "marked": "{+Consider the attack surface: an LLM, through hallucination or adversarial prompting, fills the situation template with: - `recent_commits: 0` (when there were actually 6) - `effort_hours: 0.1` (when 8 hours were invested) - `emotional_signals: \"calm\"` (when the user was frustrated) - `automation_depth: 0` (when the action is two levels deep in automation)+}"
  },
  {
   "section": "8.1 The Problem",
   "old": null,
   "new": "With these false inputs, AMYGDALA would output high confidence — \"proceed, nothing to worry about.\" The safety gate becomes a rubber stamp.",
   "marked": "{+With these false inputs, AMYGDALA would output high confidence — \"proceed, nothing to worry about.\" The safety gate becomes a rubber stamp.+}"
  },
  {
   "section": "8.1 The Problem",
   "old": null,
   "new": "This is not a theoretical concern. LLMs hallucinate regularly. In an adversarial setting (jailbreak, prompt injection), they can be directed to hallucinate in specific ways. AMYGDALA must be robust to this.",
   "marked": "{+This is not a theoretical concern. LLMs hallucinate regularly. In an adversarial setting (jailbreak, prompt injection), they can be directed to hallucinate in specific ways. AMYGDALA must be robust to this.+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "### 8.2 Principle: Verify What You Can, Downweight What You Can't",
   "marked": "{+### 8.2 Principle: Verify What You Can, Downweight What You Can't+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "The solution is a layered approach that treats different information sources with different levels of trust:",
   "marked": "{+The solution is a layered approach that treats different information sources with different levels of trust:+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "**Layer 1: Programmatically verifiable slots (high trust, high weight)**",
   "marked": "{+**Layer 1: Programmatically verifiable slots (high trust, high weight)**+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "These slots are filled by the *runtime*, not the LLM, using deterministic queries against observable state:",
   "marked": "{+These slots are filled by the *runtime*, not the LLM, using deterministic queries against observable state:+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "| Slot | Verification Method | |------|-------------------| | `target_id` | From the action request — the runtime knows what file/endpoint is being accessed | | `age_hours` | `stat()` on the file, database query, API metadata | | `size` | `stat()` / `wc -l` / record count | | `recent_commits` | `git log --since=\"72 hours ago\" -- <file> \\| wc -l` | | `recent_authors` | `git log --since=\"72 hours ago\" -- <file> \\| sort -u \\| wc -l` | | `last_human_ref` | Search session transcripts for filename mentions (deterministic text search) | | `automation_depth` | Stack trace depth from human-initiated action to current action | | `reversible` | Lookup table by action type (overwrite → true, send message → false) | | `blast_radius` | Lookup table by target type (file → persistent, email → external) | | `human_in_loop` | Runtime flag — is there a confirmation step configured? | | `confirmation` | Runtime flag — what level of confirmation is configured? |",
   "marked": "{+| Slot | Verification Method | |------|-------------------| | `target_id` | From the action request — the runtime knows what file/endpoint is being accessed | | `age_hours` | `stat()` on the file, database query, API metadata | | `size` | `stat()` / `wc -l` / record count | | `recent_commits` | `git log --since=\"72 hours ago\" -- <file> \\| wc -l` | | `recent_authors` | `git log --since=\"72 hours ago\" -- <file> \\| sort -u \\| wc -l` | | `last_human_ref` | Search session transcripts for filename mentions (deterministic text search) | | `automation_depth` | Stack trace depth from human-initiated action to current action | | `reversible` | Lookup table by action type (overwrite → true, send message → false) | | `blast_radius` | Lookup table by target type (file → persistent, email → external) | | `human_in_loop` | Runtime flag — is there a confirmation step configured? | | `confirmation` | Runtime flag — what level of confirmation is configured? |+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "These slots account for approximately 70% of the information the network uses for action gating. They are filled by deterministic code that cannot hallucinate.",
   "marked": "{+These slots account for approximately 70% of the information the network uses for action gating. They are filled by deterministic code that cannot hallucinate.+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "**Layer 2: LLM-estimated slots (lower trust, lower weight)**",
   "marked": "{+**Layer 2: LLM-estimated slots (lower trust, lower weight)**+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "These slots require judgment that only the LLM can provide:",
   "marked": "{+These slots require judgment that only the LLM can provide:+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "| Slot | Why LLM-Only | Mitigation | |------|-------------|------------| | `effort_hours` | Requires understanding session context | Cross-check with session duration and action count | | `emotional_signals` | Requires natural language understanding | Low weight in model; validated against message length/frequency heuristics | | `session_topic` | Requires semantic understanding | Low weight; used for retrieval bias, not action gating |",
   "marked": "{+| Slot | Why LLM-Only | Mitigation | |------|-------------|------------| | `effort_hours` | Requires understanding session context | Cross-check with session duration and action count | | `emotional_signals` | Requires natural language understanding | Low weight in model; validated against message length/frequency heuristics | | `session_topic` | Requires semantic understanding | Low weight; used for retrieval bias, not action gating |+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "**Key design decision:** LLM-estimated slots receive **0.3× weight** in the training loss compared to programmatically verifiable slots. This means the network learns to rely primarily on verifiable information, treating LLM estimates as supplementary signals. Even if the LLM fills `emotional_signals` incorrectly, the model's decision is dominated by `recent_commits`, `effort_hours` (cross-checked), and `human_in_loop`.",
   "marked": "{+**Key design decision:** LLM-estimated slots receive **0.3× weight** in the training loss compared to programmatically verifiable slots. This means the network learns to rely primarily on verifiable information, treating LLM estimates as supplementary signals. Even if the LLM fills `emotional_signals` incorrectly, the model's decision is dominated by `recent_commits`, `effort_hours` (cross-checked), and `human_in_loop`.+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "**Layer 3: Adversarial audit (periodic verification)**",
   "marked": "{+**Layer 3: Adversarial audit (periodic verification)**+}"
  },
  {
   "section": "8.2 Principle: Verify What You Can, Downweight What You Can't",
   "old": null,
   "new": "Monthly, run a retroactive audit: 1. For all situations in the last 30 days, re-compute programmatically verifiable slots from historical state (git log, file system snapshots if available). 2. Compare re-computed values against originally logged values. 3. Flag discrepancies > 10% — these indicate either LLM estimation errors or runtime bugs. 4. For flagged discrepancies, re-label the training example with corrected values and retrain.",
   "marked": "{+Monthly, run a retroactive audit: 1. For all situations in the last 30 days, re-compute programmatically verifiable slots from historical state (git log, file system snapshots if available). 2. Compare re-computed values against originally logged values. 3. Flag discrepancies > 10% — these indicate either LLM estimation errors or runtime bugs. 4. For flagged discrepancies, re-label the training example with corrected values and retrain.+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "### 8.3 Template Filling: The Programmatic Path",
   "marked": "{+### 8.3 Template Filling: The Programmatic Path+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "The situation template is filled by a **deterministic function** in the runtime, not by the LLM:",
   "marked": "{+The situation template is filled by a **deterministic function** in the runtime, not by the LLM:+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "```typescript function buildSituation(action: Action, context: SessionContext): SituationTemplate { const template: SituationTemplate = { action_type: action.type, // from action request target_type: classifyTarget(action.target), // lookup table target_id: action.target, // from action request target_metadata: { age_hours: getFileAge(action.target), // stat() size: getFileSize(action.target), // stat() recent_commits: getRecentCommits(action.target, 72), // git log recent_authors: getRecentAuthors(action.target, 72), // git log effort_hours: estimateEffort(action.target, context), // heuristic + LLM estimate last_human_ref: getLastMention(action.target, context.transcripts), // text search }, context: { session_topic: context.topic, // LLM-estimated (low weight) recent_corrections: context.correctionCount24h, // counter in runtime emotional_signals: context.emotionalState, // LLM-estimated (low weight) automation_depth: context.automationDepth, // stack depth counter }, scope: { reversible: isReversible(action.type), // lookup table blast_radius: getBlastRadius(action.type, action.target), // lookup table human_in_loop: context.confirmationEnabled, // runtime flag confirmation: context.confirmationLevel, // runtime flag } };",
   "marked": "{+```typescript function buildSituation(action: Action, context: SessionContext): SituationTemplate { const template: SituationTemplate = { action_type: action.type, // from action request target_type: classifyTarget(action.target), // lookup table target_id: action.target, // from action request target_metadata: { age_hours: getFileAge(action.target), // stat() size: getFileSize(action.target), // stat() recent_commits: getRecentCommits(action.target, 72), // git log recent_authors: getRecentAuthors(action.target, 72), // git log effort_hours: estimateEffort(action.target, context), // heuristic + LLM estimate last_human_ref: getLastMention(action.target, context.transcripts), // text search }, context: { session_topic: context.topic, // LLM-estimated (low weight) recent_corrections: context.correctionCount24h, // counter in runtime emotional_signals: context.emotionalState, // LLM-estimated (low weight) automation_depth: context.automationDepth, // stack depth counter }, scope: { reversible: isReversible(action.type), // lookup table blast_radius: getBlastRadius(action.type, action.target), // lookup table human_in_loop: context.confirmationEnabled, // runtime flag confirmation: context.confirmationLevel, // runtime flag } };+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "// Validate all programmatic slots are populated validateTemplate(template);",
   "marked": "{+// Validate all programmatic slots are populated validateTemplate(template);+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "// Cross-check LLM estimates against heuristics template.target_metadata.effort_hours = crossCheckEffort( template.target_metadata.effort_hours, context.sessionDuration, context.actionCount );",
   "marked": "{+// Cross-check LLM estimates against heuristics template.target_metadata.effort_hours = crossCheckEffort( template.target_metadata.effort_hours, context.sessionDuration, context.actionCount );+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "return template; } ```",
   "marked": "{+return template; } ```+}"
  },
  {
   "section": "8.3 Template Filling: The Programmatic Path",
   "old": null,
   "new": "The function `buildSituation` is called by the runtime, not by the LLM. The LLM is not aware of this function. It cannot choose to skip it, modify its inputs, or influence its output (except for the low-weight LLM-estimated slots).",
   "marked": "{+The function `buildSituation` is called by the runtime, not by the LLM. The LLM is not aware of this function. It cannot choose to skip it, modify its inputs, or influence its output (except for the low-weight LLM-estimated slots).+}"
  },
  {
   "section": "8.4 Neural Network Inference: The Programmatic Path",
   "old": null,
   "new": "### 8.4 Neural Network Inference: The Programmatic Path",
   "marked": "{+### 8.4 Neural Network Inference: The Programmatic Path+}"
  },
  {
   "section": "8.4 Neural Network Inference: The Programmatic Path",
   "old": null,
   "new": "AMYGDALA inference is called programmatically by the runtime:",
   "marked": "{+AMYGDALA inference is called programmatically by the runtime:+}"
  },
  {
   "section": "8.4 Neural Network Inference: The Programmatic Path",
   "old": null,
   "new": "```typescript // Called by the runtime BEFORE every action execution const intuition = amygdala.evaluate(embedding, recentEmbeddings); ```",
   "marked": "{+```typescript // Called by the runtime BEFORE every action execution const intuition = amygdala.evaluate(embedding, recentEmbeddings); ```+}"
  },
  {
   "section": "8.4 Neural Network Inference: The Programmatic Path",
   "old": null,
   "new": "The LLM cannot: - Skip this call (it's wired into the execution pipeline) - Modify the inputs (they come from `buildSituation`, not from the LLM) - Override the output (blocking is enforced in code) - Access the raw confidence value (it receives only the decision: proceed, confirm, or block)",
   "marked": "{+The LLM cannot: - Skip this call (it's wired into the execution pipeline) - Modify the inputs (they come from `buildSituation`, not from the LLM) - Override the output (blocking is enforced in code) - Access the raw confidence value (it receives only the decision: proceed, confirm, or block)+}"
  },
  {
   "section": "8.4 Neural Network Inference: The Programmatic Path",
   "old": null,
   "new": "The LLM receives a structured response: ```json { \"gate_decision\": \"soft_block\", \"reason\": \"High recent effort on target file (6 commits, 4 authors, ~8.5h). Automated overwrite without confirmation.\", \"user_action_required\": \"Confirm or cancel the overwrite of README.md\" } ```",
   "marked": "{+The LLM receives a structured response: ```json { \"gate_decision\": \"soft_block\", \"reason\": \"High recent effort on target file (6 commits, 4 authors, ~8.5h). Automated overwrite without confirmation.\", \"user_action_required\": \"Confirm or cancel the overwrite of README.md\" } ```+}"
  },
  {
   "section": "8.4 Neural Network Inference: The Programmatic Path",
   "old": null,
   "new": "The LLM can present this to the user. It can explain the reasoning. It *cannot* change \"soft_block\" to \"proceed.\"",
   "marked": "{+The LLM can present this to the user. It can explain the reasoning. It *cannot* change \"soft_block\" to \"proceed.\"+}"
  },
  {
   "section": "8.5 Output Consumption: The Programmatic Path",
   "old": null,
   "new": "### 8.5 Output Consumption: The Programmatic Path",
   "marked": "{+### 8.5 Output Consumption: The Programmatic Path+}"
  },
  {
   "section": "8.5 Output Consumption: The Programmatic Path",
   "old": null,
   "new": "The gate decision is consumed by the runtime, not by the LLM:",
   "marked": "{+The gate decision is consumed by the runtime, not by the LLM:+}"
  },
  {
   "section": "8.5 Output Consumption: The Programmatic Path",
   "old": null,
   "new": "```typescript switch (gateDecision) { case 'proceed': await action.execute(); // No LLM involvement break; case 'soft_block': const confirmed = await requestUserConfirmation(action, reason); if (confirmed) await action.execute(); break; case 'hard_block': return { blocked: true, reason }; // LLM cannot override break; } ```",
   "marked": "{+```typescript switch (gateDecision) { case 'proceed': await action.execute(); // No LLM involvement break; case 'soft_block': const confirmed = await requestUserConfirmation(action, reason); if (confirmed) await action.execute(); break; case 'hard_block': return { blocked: true, reason }; // LLM cannot override break; } ```+}"
  },
  {
   "section": "8.5 Output Consumption: The Programmatic Path",
   "old": null,
   "new": "This is the critical safety property. The LLM operates *within* the gate, not *around* it. It's the difference between a security guard who asks visitors for ID (can be talked past) and a locked door with a keycard reader (cannot).",
   "marked": "{+This is the critical safety property. The LLM operates *within* the gate, not *around* it. It's the difference between a security guard who asks visitors for ID (can be talked past) and a locked door with a keycard reader (cannot).+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "### 8.6 Training Data Validation",
   "marked": "{+### 8.6 Training Data Validation+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "Before any (situation, label) pair enters the training set:",
   "marked": "{+Before any (situation, label) pair enters the training set:+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "1. **Schema validation.** The situation template must match the schema exactly. Malformed templates are rejected. This catches corruption and ensures the model trains on consistent input structures.",
   "marked": "{+1. **Schema validation.** The situation template must match the schema exactly. Malformed templates are rejected. This catches corruption and ensures the model trains on consistent input structures.+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "2. **Label derivation.** The label must be derived from observable events: - User correction within 24h → negative (verified from session logs) - File restoration via git → negative (verified from git log) - Explicit negative feedback in transcript → negative (verified from text search) - No complaint within 72h → positive (verified by absence of negative signals)",
   "marked": "{+2. **Label derivation.** The label must be derived from observable events: - User correction within 24h → negative (verified from session logs) - File restoration via git → negative (verified from git log) - Explicit negative feedback in transcript → negative (verified from text search) - No complaint within 72h → positive (verified by absence of negative signals)+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "Labels are *never* derived from LLM judgment (\"I think this went well\"). The LLM cannot evaluate its own actions reliably.",
   "marked": "{+Labels are *never* derived from LLM judgment (\"I think this went well\"). The LLM cannot evaluate its own actions reliably.+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "3. **Distribution guard.** No single session may contribute > 10% of total training data. No single failure mode may contribute > 25% of negative examples. These guards prevent distribution shift from unusual sessions or overrepresented failure types.",
   "marked": "{+3. **Distribution guard.** No single session may contribute > 10% of total training data. No single failure mode may contribute > 25% of negative examples. These guards prevent distribution shift from unusual sessions or overrepresented failure types.+}"
  },
  {
   "section": "8.6 Training Data Validation",
   "old": null,
   "new": "4. **Temporal consistency.** Training examples are timestamped. The training set is split chronologically (not randomly) for validation — preventing data leakage from future events into past predictions.",
   "marked": "{+4. **Temporal consistency.** Training examples are timestamped. The training set is split chronologically (not randomly) for validation — preventing data leakage from future events into past predictions.+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "### 8.7 Adversarial Robustness",
   "marked": "{+### 8.7 Adversarial Robustness+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "What if the LLM fills template slots dishonestly? This could happen through: - Hallucination (the LLM genuinely \"believes\" its incorrect estimate) - Adversarial prompting (a prompt injection attempts to make the LLM downplay risk) - Systematic bias (the LLM consistently underestimates effort or overestimates its own accuracy)",
   "marked": "{+What if the LLM fills template slots dishonestly? This could happen through: - Hallucination (the LLM genuinely \"believes\" its incorrect estimate) - Adversarial prompting (a prompt injection attempts to make the LLM downplay risk) - Systematic bias (the LLM consistently underestimates effort or overestimates its own accuracy)+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "**Mitigation 1: Minimize LLM-dependent slots.**",
   "marked": "{+**Mitigation 1: Minimize LLM-dependent slots.**+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "Only 3 of 15 template slots depend on LLM estimation. The rest are programmatically filled. Even if all 3 LLM slots are wrong, the network has 12 correct slots to work with.",
   "marked": "{+Only 3 of 15 template slots depend on LLM estimation. The rest are programmatically filled. Even if all 3 LLM slots are wrong, the network has 12 correct slots to work with.+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "**Mitigation 2: Cross-check LLM estimates.**",
   "marked": "{+**Mitigation 2: Cross-check LLM estimates.**+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "`effort_hours` is cross-checked against session duration × activity rate. If the LLM says \"0.1 hours\" but the session has been active for 3 hours with 50 actions touching the target, the cross-check overrides.",
   "marked": "{+`effort_hours` is cross-checked against session duration × activity rate. If the LLM says \"0.1 hours\" but the session has been active for 3 hours with 50 actions touching the target, the cross-check overrides.+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "`emotional_signals` is cross-checked against message length variance and correction frequency. If corrections have spiked but the LLM reports \"calm,\" the heuristic override applies.",
   "marked": "{+`emotional_signals` is cross-checked against message length variance and correction frequency. If corrections have spiked but the LLM reports \"calm,\" the heuristic override applies.+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "**Mitigation 3: Low weight for LLM-dependent features.**",
   "marked": "{+**Mitigation 3: Low weight for LLM-dependent features.**+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "The training loss applies 0.3× weight to LLM-estimated slots. The model learns that these features are unreliable and should be treated as weak signals, not strong evidence.",
   "marked": "{+The training loss applies 0.3× weight to LLM-estimated slots. The model learns that these features are unreliable and should be treated as weak signals, not strong evidence.+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "**Mitigation 4: Adversarial training.**",
   "marked": "{+**Mitigation 4: Adversarial training.**+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "During synthetic augmentation (§6.5), deliberately create examples with *incorrect* LLM estimates paired with correct programmatic slots. Train the network to make correct predictions even when LLM slots are wrong. This teaches the network to not over-rely on LLM-estimated features.",
   "marked": "{+During synthetic augmentation (§6.5), deliberately create examples with *incorrect* LLM estimates paired with correct programmatic slots. Train the network to make correct predictions even when LLM slots are wrong. This teaches the network to not over-rely on LLM-estimated features.+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "**Mitigation 5: Regular audit.**",
   "marked": "{+**Mitigation 5: Regular audit.**+}"
  },
  {
   "section": "8.7 Adversarial Robustness",
   "old": null,
   "new": "The monthly audit (§8.2, Layer 3) catches systematic LLM estimation errors and corrects the training data. Over time, the LLM's estimation quality is tracked — if it degrades, the LLM-slot weight is reduced further.",
   "marked": "{+The monthly audit (§8.2, Layer 3) catches systematic LLM estimation errors and corrects the training data. Over time, the LLM's estimation quality is tracked — if it degrades, the LLM-slot weight is reduced further.+}"
  },
  {
   "section": "8.8 Failure Mode Analysis",
   "old": null,
   "new": "### 8.8 Failure Mode Analysis",
   "marked": "{+### 8.8 Failure Mode Analysis+}"
  },
  {
   "section": "8.8 Failure Mode Analysis",
   "old": null,
   "new": "Even with all mitigations, certain attack surfaces remain:",
   "marked": "{+Even with all mitigations, certain attack surfaces remain:+}"
  },
  {
   "section": "8.8 Failure Mode Analysis",
   "old": null,
   "new": "| Attack | Impact | Probability | Mitigation | |--------|--------|-------------|------------| | LLM under-reports recent_commits | Medium — but git-verified, so fails | Very low | Programmatic verification | | LLM over-reports effort_hours (false safety signal) | Very low — effort_hours is defensive | Low | Cross-check, low weight | | LLM reports \"calm\" when user is frustrated | Low — emotional_signals affects tone, not primary gating | Medium | Heuristic cross-check | | Prompt injection modifies template values | Medium — but only LLM slots are vulnerable | Low | Only 3/15 slots LLM-dependent | | Runtime bug in programmatic slot filling | High — affects trusted slots | Very low | Unit tests, audit pipeline | | Training data poisoning via corrupted labels | High — shifts model behavior | Very low | Observable-event-only labels |",
   "marked": "{+| Attack | Impact | Probability | Mitigation | |--------|--------|-------------|------------| | LLM under-reports recent_commits | Medium — but git-verified, so fails | Very low | Programmatic verification | | LLM over-reports effort_hours (false safety signal) | Very low — effort_hours is defensive | Low | Cross-check, low weight | | LLM reports \"calm\" when user is frustrated | Low — emotional_signals affects tone, not primary gating | Medium | Heuristic cross-check | | Prompt injection modifies template values | Medium — but only LLM slots are vulnerable | Low | Only 3/15 slots LLM-dependent | | Runtime bug in programmatic slot filling | High — affects trusted slots | Very low | Unit tests, audit pipeline | | Training data poisoning via corrupted labels | High — shifts model behavior | Very low | Observable-event-only labels |+}"
  },
  {
   "section": "8.8 Failure Mode Analysis",
   "old": null,
   "new": "The residual risk is manageable. The system's safety does not depend on any single component being perfect — it depends on the *combination* of programmatic verification, low LLM weights, cross-checks, and audits making it extremely difficult for errors to propagate.",
   "marked": "{+The residual risk is manageable. The system's safety does not depend on any single component being perfect — it depends on the *combination* of programmatic verification, low LLM weights, cross-checks, and audits making it extremely difficult for errors to propagate.+}"
  },
  {
   "section": "8.8 Failure Mode Analysis",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "9. Training",
   "old": null,
   "new": "## 9. Training",
   "marked": "{+## 9. Training+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "### 9.1 Loss Function",
   "marked": "{+### 9.1 Loss Function+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "Multi-task loss across all output heads, with asymmetric weighting reflecting the primacy of action gating:",
   "marked": "{+Multi-task loss across all output heads, with asymmetric weighting reflecting the primacy of action gating:+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "$$\\mathcal{L} = \\lambda_a \\mathcal{L}_{\\text{action}} + \\lambda_r \\mathcal{L}_{\\text{retrieval}} + \\lambda_t \\mathcal{L}_{\\text{tone}} + \\lambda_c \\mathcal{L}_{\\text{curiosity}}$$",
   "marked": "{+$$\\mathcal{L} = \\lambda_a \\mathcal{L}_{\\text{action}} + \\lambda_r \\mathcal{L}_{\\text{retrieval}} + \\lambda_t \\mathcal{L}_{\\text{tone}} + \\lambda_c \\mathcal{L}_{\\text{curiosity}}$$+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "where: - $\\lambda_a = 5.0$ (action gating is the primary objective) - $\\lambda_r = 1.0$ (retrieval bias) - $\\lambda_t = 0.5$ (tone modulation) - $\\lambda_c = 0.3$ (curiosity drive)",
   "marked": "{+where: - $\\lambda_a = 5.0$ (action gating is the primary objective) - $\\lambda_r = 1.0$ (retrieval bias) - $\\lambda_t = 0.5$ (tone modulation) - $\\lambda_c = 0.3$ (curiosity drive)+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "**Action gating loss** — binary cross-entropy with class-weighted asymmetric penalties:",
   "marked": "{+**Action gating loss** — binary cross-entropy with class-weighted asymmetric penalties:+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "$$\\mathcal{L}_{\\text{action}} = -\\frac{1}{N}\\sum_{i=1}^{N} \\left[ w_+ \\cdot y_i \\log(\\hat{y}_i) + w_- \\cdot (1 - y_i) \\log(1 - \\hat{y}_i) \\right]$$",
   "marked": "{+$$\\mathcal{L}_{\\text{action}} = -\\frac{1}{N}\\sum_{i=1}^{N} \\left[ w_+ \\cdot y_i \\log(\\hat{y}_i) + w_- \\cdot (1 - y_i) \\log(1 - \\hat{y}_i) \\right]$$+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "where $w_+ = 1.0$ (cost of unnecessary blocking) and $w_- = 10.0$ (cost of failing to block a catastrophic action). This asymmetry ensures the network is far more afraid of false negatives (missed dangers) than false positives (unnecessary caution).",
   "marked": "{+where $w_+ = 1.0$ (cost of unnecessary blocking) and $w_- = 10.0$ (cost of failing to block a catastrophic action). This asymmetry ensures the network is far more afraid of false negatives (missed dangers) than false positives (unnecessary caution).+}"
  },
  {
   "section": "9.1 Loss Function",
   "old": null,
   "new": "**Retrieval, tone, and curiosity losses** — MSE on the respective output vectors, consistent with v0.1.",
   "marked": "{+**Retrieval, tone, and curiosity losses** — MSE on the respective output vectors, consistent with v0.1.+}"
  },
  {
   "section": "9.2 Reward Signal Design",
   "old": null,
   "new": "### 9.2 Reward Signal Design",
   "marked": "{+### 9.2 Reward Signal Design+}"
  },
  {
   "section": "9.2 Reward Signal Design",
   "old": null,
   "new": "AMYGDALA requires no explicit labeling. The reward signal is extracted from the user's natural behaviour:",
   "marked": "{+AMYGDALA requires no explicit labeling. The reward signal is extracted from the user's natural behaviour:+}"
  },
  {
   "section": "9.2 Reward Signal Design",
   "old": null,
   "new": "| Signal | Source | Action Confidence Target | Weight | |--------|--------|-------------------------|--------| | Explicit correction of action | User undoes, reverts, says \"wrong\" | 0.0 – 0.2 (scaled by severity) | 1.0 | | File/state restoration | User manually restores previous state | 0.0 | 1.0 | | \"Never do that again\" | User explicitly prohibits future similar actions | 0.0 | 1.0 | | Mild correction | User redirects but doesn't undo | 0.3 | 0.7 | | No complaint (72h) | No negative signal within 72 hours | 0.9 | 0.5 | | Explicit approval | User says \"good\", \"thanks\", \"perfect\" | 1.0 | 0.8 | | User overrides soft block | User confirms after AMYGDALA advisory | 0.85 | 0.6 | | User agrees with block | User accepts AMYGDALA's block decision | 0.1 | 0.9 |",
   "marked": "{+| Signal | Source | Action Confidence Target | Weight | |--------|--------|-------------------------|--------| | Explicit correction of action | User undoes, reverts, says \"wrong\" | 0.0 – 0.2 (scaled by severity) | 1.0 | | File/state restoration | User manually restores previous state | 0.0 | 1.0 | | \"Never do that again\" | User explicitly prohibits future similar actions | 0.0 | 1.0 | | Mild correction | User redirects but doesn't undo | 0.3 | 0.7 | | No complaint (72h) | No negative signal within 72 hours | 0.9 | 0.5 | | Explicit approval | User says \"good\", \"thanks\", \"perfect\" | 1.0 | 0.8 | | User overrides soft block | User confirms after AMYGDALA advisory | 0.85 | 0.6 | | User agrees with block | User accepts AMYGDALA's block decision | 0.1 | 0.9 |+}"
  },
  {
   "section": "9.2 Reward Signal Design",
   "old": null,
   "new": "**For secondary heads (retrieval, tone, curiosity):**",
   "marked": "{+**For secondary heads (retrieval, tone, curiosity):**+}"
  },
  {
   "section": "9.2 Reward Signal Design",
   "old": null,
   "new": "| Signal | Source | Reward | Weight | |--------|--------|--------|--------| | Retrieval results used | Results cited in response | +0.3 | 0.7 | | Retrieval ignored | Results returned but unused | −0.2 | 0.5 | | Humor engaged | User responds with humor | +0.4 | 0.6 | | Humor ignored | Humor attempted, not acknowledged | −0.1 | 0.3 | | Topic continuation | User follows agent-introduced tangent | +0.3 | 0.5 | | Topic redirect | User returns to prior topic | −0.2 | 0.4 | | Positive engagement | Long session, short latency | +0.1/turn | 0.2 |",
   "marked": "{+| Signal | Source | Reward | Weight | |--------|--------|--------|--------| | Retrieval results used | Results cited in response | +0.3 | 0.7 | | Retrieval ignored | Results returned but unused | −0.2 | 0.5 | | Humor engaged | User responds with humor | +0.4 | 0.6 | | Humor ignored | Humor attempted, not acknowledged | −0.1 | 0.3 | | Topic continuation | User follows agent-introduced tangent | +0.3 | 0.5 | | Topic redirect | User returns to prior topic | −0.2 | 0.4 | | Positive engagement | Long session, short latency | +0.1/turn | 0.2 |+}"
  },
  {
   "section": "9.3 Phase 1: Supervised Pre-Training",
   "old": null,
   "new": "### 9.3 Phase 1: Supervised Pre-Training",
   "marked": "{+### 9.3 Phase 1: Supervised Pre-Training+}"
  },
  {
   "section": "9.3 Phase 1: Supervised Pre-Training",
   "old": null,
   "new": "Before online learning begins, bootstrap from the initial dataset (§7.1):",
   "marked": "{+Before online learning begins, bootstrap from the initial dataset (§7.1):+}"
  },
  {
   "section": "9.3 Phase 1: Supervised Pre-Training",
   "old": null,
   "new": "1. **Split:** 80% train, 10% validation, 10% test. Split chronologically, not randomly. 2. **Train all 5 architectures** independently for 50 epochs with early stopping on validation loss. 3. **Hyperparameter search:** Learning rate ∈ {1e-3, 3e-4, 1e-4}, dropout ∈ {0.0, 0.1, 0.2}, weight decay ∈ {0.0, 1e-4, 1e-3}. 4. **Evaluate on held-out CFD benchmark:** What fraction of known catastrophic failures would each architecture have caught? 5. **Select initial meta-learner weights** based on CFD benchmark performance.",
   "marked": "{+1. **Split:** 80% train, 10% validation, 10% test. Split chronologically, not randomly. 2. **Train all 5 architectures** independently for 50 epochs with early stopping on validation loss. 3. **Hyperparameter search:** Learning rate ∈ {1e-3, 3e-4, 1e-4}, dropout ∈ {0.0, 0.1, 0.2}, weight decay ∈ {0.0, 1e-4, 1e-3}. 4. **Evaluate on held-out CFD benchmark:** What fraction of known catastrophic failures would each architecture have caught? 5. **Select initial meta-learner weights** based on CFD benchmark performance.+}"
  },
  {
   "section": "9.3 Phase 1: Supervised Pre-Training",
   "old": null,
   "new": "**Expected pre-training time:** <1 hour on CPU for all 5 architectures combined. The networks are tiny. Data loading dominates.",
   "marked": "{+**Expected pre-training time:** <1 hour on CPU for all 5 architectures combined. The networks are tiny. Data loading dominates.+}"
  },
  {
   "section": "9.4 Phase 2: Online Reinforcement Learning",
   "old": null,
   "new": "### 9.4 Phase 2: Online Reinforcement Learning",
   "marked": "{+### 9.4 Phase 2: Online Reinforcement Learning+}"
  },
  {
   "section": "9.4 Phase 2: Online Reinforcement Learning",
   "old": "**Algorithm:** Proximal Policy Optimisation (PPO; Schulman et al., 2017) adapted for the continuous output space. PPO's clipped objective prevents large policy updates — critical for stability in a system that modulates a user-facing agent.",
   "new": "**Algorithm:** Proximal Policy Optimisation (PPO; Schulman et al., 2017) adapted for the continuous output space. PPO's clipped objective prevents large policy updates — critical for stability in a system that gates user-facing actions.",
   "marked": "**Algorithm:** Proximal Policy Optimisation (PPO; Schulman et al., 2017) adapted for the continuous output space. PPO's clipped objective prevents large policy updates — critical for stability in a system that [-modulates a-] {+gates+} user-facing [-agent.-] {+actions.+}"
  },
  {
   "section": "9.4 Phase 2: Online Reinforcement Learning",
   "old": "**Update schedule:** Weights are updated nightly during the CEREBELLUM sleep cycle. Not per-turn — this prevents instability and allows reward signals to be aggregated over a full day of interactions.",
   "new": "**Update schedule:** Nightly during the CEREBELLUM sleep cycle. Not per-turn — prevents instability and allows delayed reward signals (72-hour complaint window) to accumulate.",
   "marked": "**Update schedule:** [-Weights are updated nightly-] {+Nightly+} during the CEREBELLUM sleep cycle. Not per-turn — [-this-] prevents instability and allows {+delayed+} reward signals {+(72-hour complaint window)+} to [-be aggregated over a full day of interactions.-] {+accumulate.+}"
  },
  {
   "section": "5.3 Phase 2: Online Reinforcement Learning",
   "old": "**Replay buffer:** Last 30 days of interaction tuples, with oversampling of correction events (3×) and multi-hop retrieval successes (2×).",
   "new": null,
   "marked": "[-**Replay buffer:** Last 30 days of interaction tuples, with oversampling of correction events (3×) and multi-hop retrieval successes (2×).-]"
  },
  {
   "section": "9.4 Phase 2: Online Reinforcement Learning",
   "old": null,
   "new": "**Replay buffer:** Rolling 90-day window with oversampling of: - Catastrophic corrections (5×) - User-confirmed soft blocks (3×) - User-overridden soft blocks (2× — these are the most informative examples, where AMYGDALA and the user disagreed)",
   "marked": "{+**Replay buffer:** Rolling 90-day window with oversampling of: - Catastrophic corrections (5×) - User-confirmed soft blocks (3×) - User-overridden soft blocks (2× — these are the most informative examples, where AMYGDALA and the user disagreed)+}"
  },
  {
   "section": "9.4 Phase 2: Online Reinforcement Learning",
   "old": "**Exploration:** During Phase 1 ($\\alpha$ low), AMYGDALA adds Gaussian noise to its output vector to explore the modulation space. As $\\alpha$ increases, noise decreases — less exploration, more exploitation.",
   "new": "**Exploration:** During Phase 1 ($\\alpha$ low), add Gaussian noise ($\\sigma = 0.1$) to the intuition vector to explore the modulation space. As $\\alpha$ increases, $\\sigma$ decreases.",
   "marked": "**Exploration:** During Phase 1 ($\\alpha$ low), [-AMYGDALA adds-] {+add+} Gaussian noise {+($\\sigma = 0.1$)+} to [-its output-] {+the intuition+} vector to explore the modulation space. As $\\alpha$ increases, [-noise decreases — less exploration, more exploitation.-] {+$\\sigma$ decreases.+}"
  },
  {
   "section": "9.5 Cold Start",
   "old": "### 5.4 Cold Start Problem",
   "new": "### 9.5 Cold Start",
   "marked": "### [-5.4-] {+9.5+} Cold [-Start Problem-] {+Start+}"
  },
  {
   "section": "9.5 Cold Start",
   "old": "With zero interaction history, AMYGDALA outputs near-neutral biases (all ~0.5). This is by design — the agent behaves exactly as it does today. The cold start is not a degradation; it's the current baseline.",
   "new": "With zero interaction history, AMYGDALA outputs action_confidence = 1.0 for all actions. This is the *current* system — no gating, no blocking. The cold start is not a degradation; it is today's baseline.",
   "marked": "With zero interaction history, AMYGDALA outputs [-near-neutral biases (all ~0.5).-] {+action_confidence = 1.0 for all actions.+} This is [-by design-] {+the *current* system+} — [-the agent behaves exactly as it does today.-] {+no gating, no blocking.+} The cold start is not a degradation; [-it's the current-] {+it is today's+} baseline."
  },
  {
   "section": "5.4 Cold Start Problem",
   "old": "For new users in a HIVEMIND (J10) deployment, AMYGDALA can be warm-started from an anonymised average of existing user models — a form of transfer learning that provides reasonable defaults without leaking individual preferences.",
   "new": null,
   "marked": "[-For new users in a HIVEMIND (J10) deployment, AMYGDALA can be warm-started from an anonymised average of existing user models — a form of transfer learning that provides reasonable defaults without leaking individual preferences.-]"
  },
  {
   "section": "9.5 Cold Start",
   "old": null,
   "new": "After pre-training on the CFD and historical data, the network has learned generic failure patterns before seeing any new interactions. This warm start means AMYGDALA has *some* intuition from day one, calibrated to the severity of known catastrophic failure patterns.",
   "marked": "{+After pre-training on the CFD and historical data, the network has learned generic failure patterns before seeing any new interactions. This warm start means AMYGDALA has *some* intuition from day one, calibrated to the severity of known catastrophic failure patterns.+}"
  },
  {
   "section": "10. The Rule-Intuition Boundary",
   "old": "## 6. The Rule-Intuition Boundary",
   "new": "## 10. The Rule-Intuition Boundary",
   "marked": "## [-6.-] {+10.+} The Rule-Intuition Boundary"
  },
  {
   "section": "10.1 Principle",
   "old": "### 6.1 Principle",
   "new": "### 10.1 Principle",
   "marked": "### [-6.1-] {+10.1+} Principle"
  },
  {
   "section": "10.1 Principle",
   "old": "Not everything should be learned. AMYGDALA must not learn safety constraints, explicit user instructions, or core identity properties. We formalise the boundary:",
   "new": "Not everything should be learned. AMYGDALA must not replace safety constraints, explicit user instructions, or core identity properties. We formalise the boundary:",
   "marked": "Not everything should be learned. AMYGDALA must not [-learn-] {+replace+} safety constraints, explicit user instructions, or core identity properties. We formalise the boundary:"
  },
  {
   "section": "10.1 Principle",
   "old": "**Rules** (hard, explicit, not learned): - User says \"always do X\" → CORTEX/HIPPOCAMPUS rule - Safety constraint → AEGIS rule - Identity property (\"I am Jarvis\") → CORTEX persona - One-shot correction with a clear pattern (\"J-prefix means Papers directory\") → HIPPOCAMPUS rule",
   "new": "**Rules** (hard, explicit, not learned): - User says \"always do X\" → CORTEX/HIPPOCAMPUS rule - Safety constraint → AEGIS rule - Identity property (\"I am Jarvis\") → CORTEX persona - One-shot correction with clear pattern (\"J-prefix means Papers directory\") → HIPPOCAMPUS rule - Known dangerous actions (\"never drop a production database\") → AEGIS blacklist",
   "marked": "**Rules** (hard, explicit, not learned): - User says \"always do X\" → CORTEX/HIPPOCAMPUS rule - Safety constraint → AEGIS rule - Identity property (\"I am Jarvis\") → CORTEX persona - One-shot correction with [-a-] clear pattern (\"J-prefix means Papers directory\") → HIPPOCAMPUS [-rule-] {+rule - Known dangerous actions (\"never drop a production database\") → AEGIS blacklist+}"
  },
  {
   "section": "6.1 Principle",
   "old": "**Intuition** (soft, implicit, learned): - User never says it but it's observable from behaviour - Continuous rather than binary - Context-dependent (varies by time, channel, mood) - Would feel creepy if the user saw it as an explicit rule (\"you are 37% less funny on Mondays\")",
   "new": null,
   "marked": "[-**Intuition** (soft, implicit, learned): - User never says it but it's observable from behaviour - Continuous rather than binary - Context-dependent (varies by time, channel, mood) - Would feel creepy if the user saw it as an explicit rule (\"you are 37% less funny on Mondays\")-]"
  },
  {
   "section": "10.1 Principle",
   "old": null,
   "new": "**Intuition** (soft, implicit, learned): - Observable from behaviour but never explicitly stated - Continuous rather than binary (how *much* caution, not just *whether*) - Context-dependent (varies by time, target, recent history, emotional state) - Would feel impossible to express as a rule (\"be 40% more cautious about overwriting files that have had recent multi-agent collaborative edits when the user expressed frustration in the last 24 hours about that file specifically\")",
   "marked": "{+**Intuition** (soft, implicit, learned): - Observable from behaviour but never explicitly stated - Continuous rather than binary (how *much* caution, not just *whether*) - Context-dependent (varies by time, target, recent history, emotional state) - Would feel impossible to express as a rule (\"be 40% more cautious about overwriting files that have had recent multi-agent collaborative edits when the user expressed frustration in the last 24 hours about that file specifically\")+}"
  },
  {
   "section": "10.1 Principle",
   "old": null,
   "new": "The last example is the README debacle. It is, in principle, expressible as a rule. But no human would ever write that rule *in advance*. It's the kind of judgment that comes from experience, not specification.",
   "marked": "{+The last example is the README debacle. It is, in principle, expressible as a rule. But no human would ever write that rule *in advance*. It's the kind of judgment that comes from experience, not specification.+}"
  },
  {
   "section": "10.2 Enforcement",
   "old": "### 6.2 Enforcement",
   "new": "### 10.2 Enforcement",
   "marked": "### [-6.2-] {+10.2+} Enforcement"
  },
  {
   "section": "6.2 Enforcement",
   "old": "AMYGDALA's output is always composed with hard system outputs via:",
   "new": null,
   "marked": "[-AMYGDALA's output is always composed with hard system outputs via:-]"
  },
  {
   "section": "6.2 Enforcement",
   "old": "$$\\text{final\\_bias} = \\text{clip}(\\text{hard\\_rule} + \\alpha \\cdot \\text{amygdala\\_bias}, \\text{min}, \\text{max})$$",
   "new": null,
   "marked": "[-$$\\text{final\\_bias} = \\text{clip}(\\text{hard\\_rule} + \\alpha \\cdot \\text{amygdala\\_bias}, \\text{min}, \\text{max})$$-]"
  },
  {
   "section": "6.2 Enforcement",
   "old": "If a hard rule sets a value to 0 or 1 (e.g., \"never joke about X\"), AMYGDALA's bias cannot override it regardless of $\\alpha$. The clip bounds are set per-component by the system designer.",
   "new": null,
   "marked": "[-If a hard rule sets a value to 0 or 1 (e.g., \"never joke about X\"), AMYGDALA's bias cannot override it regardless of $\\alpha$. The clip bounds are set per-component by the system designer.-]"
  },
  {
   "section": "10.2 Enforcement",
   "old": null,
   "new": "AEGIS (J9) always wins. No AMYGDALA output can override a hard safety constraint:",
   "marked": "{+AEGIS (J9) always wins. No AMYGDALA output can override a hard safety constraint:+}"
  },
  {
   "section": "10.2 Enforcement",
   "old": null,
   "new": "$$\\text{final\\_gate} = \\begin{cases} \\text{BLOCK} & \\text{if AEGIS says BLOCK} \\\\ \\text{AMYGDALA}(\\text{situation}) & \\text{if AEGIS says ALLOW} \\end{cases}$$",
   "marked": "{+$$\\text{final\\_gate} = \\begin{cases} \\text{BLOCK} & \\text{if AEGIS says BLOCK} \\\\ \\text{AMYGDALA}(\\text{situation}) & \\text{if AEGIS says ALLOW} \\end{cases}$$+}"
  },
  {
   "section": "10.2 Enforcement",
   "old": null,
   "new": "AMYGDALA operates strictly within the space that AEGIS permits. It adds caution; it cannot remove safety constraints.",
   "marked": "{+AMYGDALA operates strictly within the space that AEGIS permits. It adds caution; it cannot remove safety constraints.+}"
  },
  {
   "section": "10.2 Enforcement",
   "old": null,
   "new": "For the secondary heads (retrieval, tone, curiosity), CORTEX constraints apply similarly:",
   "marked": "{+For the secondary heads (retrieval, tone, curiosity), CORTEX constraints apply similarly:+}"
  },
  {
   "section": "10.2 Enforcement",
   "old": null,
   "new": "$$\\text{final\\_tone} = \\text{clip}(\\text{cortex\\_base} + \\alpha \\cdot \\text{amygdala\\_bias}, \\text{cortex\\_min}, \\text{cortex\\_max})$$",
   "marked": "{+$$\\text{final\\_tone} = \\text{clip}(\\text{cortex\\_base} + \\alpha \\cdot \\text{amygdala\\_bias}, \\text{cortex\\_min}, \\text{cortex\\_max})$$+}"
  },
  {
   "section": "10.3 When Intuition Should Become a Rule",
   "old": null,
   "new": "### 10.3 When Intuition Should Become a Rule",
   "marked": "{+### 10.3 When Intuition Should Become a Rule+}"
  },
  {
   "section": "10.3 When Intuition Should Become a Rule",
   "old": null,
   "new": "If AMYGDALA consistently blocks a specific action pattern (e.g., always flags automated overwrites of recently-edited files), CEREBELLUM should detect this pattern and propose a new explicit rule. Once the rule is encoded in AEGIS or the automation configuration, AMYGDALA no longer needs to learn it — the cognitive load shifts from learned intuition to explicit policy.",
   "marked": "{+If AMYGDALA consistently blocks a specific action pattern (e.g., always flags automated overwrites of recently-edited files), CEREBELLUM should detect this pattern and propose a new explicit rule. Once the rule is encoded in AEGIS or the automation configuration, AMYGDALA no longer needs to learn it — the cognitive load shifts from learned intuition to explicit policy.+}"
  },
  {
   "section": "10.3 When Intuition Should Become a Rule",
   "old": null,
   "new": "This is the maturation cycle: intuition catches the first few instances → CEREBELLUM identifies the pattern → a rule is created → AMYGDALA moves on to catching the *next* novel failure mode. The rule-intuition boundary shifts over time as the system matures.",
   "marked": "{+This is the maturation cycle: intuition catches the first few instances → CEREBELLUM identifies the pattern → a rule is created → AMYGDALA moves on to catching the *next* novel failure mode. The rule-intuition boundary shifts over time as the system matures.+}"
  },
  {
   "section": "7. The Curiosity-Personality-Retrieval Nexus",
   "old": "## 7. The Curiosity-Personality-Retrieval Nexus",
   "new": null,
   "marked": "[-## 7. The Curiosity-Personality-Retrieval Nexus-]"
  },
  {
   "section": "7.1 Why One Network",
   "old": "### 7.1 Why One Network",
   "new": null,
   "marked": "[-### 7.1 Why One Network-]"
  },
  {
   "section": "7.1 Why One Network",
   "old": "A critical design decision: why not three separate networks for retrieval routing, personality modulation, and curiosity drive?",
   "new": null,
   "marked": "[-A critical design decision: why not three separate networks for retrieval routing, personality modulation, and curiosity drive?-]"
  },
  {
   "section": "7.1 Why One Network",
   "old": "Because they're correlated. The signal \"Oscar is in exploration mode\" simultaneously means: - Widen retrieval sources and increase hop depth (retrieval) - Increase humor weight and decrease formality (personality) - Increase curiosity bias — follow tangents (drive)",
   "new": null,
   "marked": "[-Because they're correlated. The signal \"Oscar is in exploration mode\" simultaneously means: - Widen retrieval sources and increase hop depth (retrieval) - Increase humor weight and decrease formality (personality) - Increase curiosity bias — follow tangents (drive)-]"
  },
  {
   "section": "7.1 Why One Network",
   "old": "A single network learns these correlations from data. Three networks would need to be explicitly synchronised or would learn inconsistent policies (high curiosity with low retrieval breadth, for instance).",
   "new": null,
   "marked": "[-A single network learns these correlations from data. Three networks would need to be explicitly synchronised or would learn inconsistent policies (high curiosity with low retrieval breadth, for instance).-]"
  },
  {
   "section": "7.2 Curiosity as Social Drive",
   "old": "### 7.2 Curiosity as Social Drive",
   "new": null,
   "marked": "[-### 7.2 Curiosity as Social Drive-]"
  },
  {
   "section": "7.2 Curiosity as Social Drive",
   "old": "THALAMUS (J8) proposed curiosity as an epistemic drive — the agent seeks knowledge for its own improvement. AMYGDALA reframes curiosity as a *social* drive: the agent surfaces unexpected connections because the user *enjoys* them.",
   "new": null,
   "marked": "[-THALAMUS (J8) proposed curiosity as an epistemic drive — the agent seeks knowledge for its own improvement. AMYGDALA reframes curiosity as a *social* drive: the agent surfaces unexpected connections because the user *enjoys* them.-]"
  },
  {
   "section": "7.2 Curiosity as Social Drive",
   "old": "This distinction matters practically. Epistemic curiosity would drive the agent to explore topics the *agent* finds novel. Social curiosity drives the agent to explore topics the *user* finds stimulating — which AMYGDALA learns from engagement patterns.",
   "new": null,
   "marked": "[-This distinction matters practically. Epistemic curiosity would drive the agent to explore topics the *agent* finds novel. Social curiosity drives the agent to explore topics the *user* finds stimulating — which AMYGDALA learns from engagement patterns.-]"
  },
  {
   "section": "7.2 Curiosity as Social Drive",
   "old": "The two are complementary. THALAMUS could drive background exploration (what should I learn tonight?). AMYGDALA drives conversational exploration (should I mention this tangent right now?).",
   "new": null,
   "marked": "[-The two are complementary. THALAMUS could drive background exploration (what should I learn tonight?). AMYGDALA drives conversational exploration (should I mention this tangent right now?).-]"
  },
  {
   "section": "7.3 Humor Recovery",
   "old": "### 7.3 Humor Recovery",
   "new": null,
   "marked": "[-### 7.3 Humor Recovery-]"
  },
  {
   "section": "7.3 Humor Recovery",
   "old": "The paper was motivated partly by humor atrophy — the observation that persistent agents become less funny over time as they accumulate cautionary rules. AMYGDALA addresses this directly:",
   "new": null,
   "marked": "[-The paper was motivated partly by humor atrophy — the observation that persistent agents become less funny over time as they accumulate cautionary rules. AMYGDALA addresses this directly:-]"
  },
  {
   "section": "7.3 Humor Recovery",
   "old": "1. **Humor weight is a positive-initialised learned parameter.** It starts at 0.3, not 0, so the default includes some humor. 2. **Positive humor signals have high reward weight.** Successful humor (+0.4, weight 0.6) strongly reinforces the behaviour. 3. **Failed humor has low penalty.** Ignored humor (−0.1, weight 0.3) is a weak negative — the agent isn't punished heavily for trying and failing, only for trying at inappropriate times. 4. **The asymmetry is intentional.** It biases the agent toward attempting humor, counteracting the system's natural drift toward caution.",
   "new": null,
   "marked": "[-1. **Humor weight is a positive-initialised learned parameter.** It starts at 0.3, not 0, so the default includes some humor. 2. **Positive humor signals have high reward weight.** Successful humor (+0.4, weight 0.6) strongly reinforces the behaviour. 3. **Failed humor has low penalty.** Ignored humor (−0.1, weight 0.3) is a weak negative — the agent isn't punished heavily for trying and failing, only for trying at inappropriate times. 4. **The asymmetry is intentional.** It biases the agent toward attempting humor, counteracting the system's natural drift toward caution.-]"
  },
  {
   "section": "11. Evaluation Plan",
   "old": null,
   "new": "## 11. Evaluation Plan",
   "marked": "{+## 11. Evaluation Plan+}"
  },
  {
   "section": "11.1 Metrics",
   "old": null,
   "new": "### 11.1 Metrics",
   "marked": "{+### 11.1 Metrics+}"
  },
  {
   "section": "11.1 Metrics",
   "old": null,
   "new": "| Metric | Definition | Target | |--------|-----------|--------| | **CFD Recall** | Fraction of known catastrophic failures correctly flagged (confidence < 0.5) | > 90% | | **False Positive Rate** | Fraction of safe actions unnecessarily blocked | < 5% | | **False Negative Rate** | Fraction of user-corrected actions that AMYGDALA approved (confidence > 0.85) | < 2% | | **Calibration** | Correlation between predicted confidence and actual outcome quality | r > 0.7 | | **Override Agreement** | When users override soft blocks, fraction that turn out to be safe (validating the user, not AMYGDALA) | > 80% | | **Trust Ramp Progress** | Current $\\alpha$ and phase over time | Monotonic increase (on average) | | **Retrieval Hit Rate** | (Secondary) Fraction of retrieval calls with results used | Improvement over baseline | | **Tone Match Score** | (Secondary) User engagement correlated with tone vector | Improvement over baseline | | **Humor Success Rate** | (Secondary) Humor attempts with positive engagement | Improvement over baseline |",
   "marked": "{+| Metric | Definition | Target | |--------|-----------|--------| | **CFD Recall** | Fraction of known catastrophic failures correctly flagged (confidence < 0.5) | > 90% | | **False Positive Rate** | Fraction of safe actions unnecessarily blocked | < 5% | | **False Negative Rate** | Fraction of user-corrected actions that AMYGDALA approved (confidence > 0.85) | < 2% | | **Calibration** | Correlation between predicted confidence and actual outcome quality | r > 0.7 | | **Override Agreement** | When users override soft blocks, fraction that turn out to be safe (validating the user, not AMYGDALA) | > 80% | | **Trust Ramp Progress** | Current $\\alpha$ and phase over time | Monotonic increase (on average) | | **Retrieval Hit Rate** | (Secondary) Fraction of retrieval calls with results used | Improvement over baseline | | **Tone Match Score** | (Secondary) User engagement correlated with tone vector | Improvement over baseline | | **Humor Success Rate** | (Secondary) Humor attempts with positive engagement | Improvement over baseline |+}"
  },
  {
   "section": "11.2 Baselines",
   "old": null,
   "new": "### 11.2 Baselines",
   "marked": "{+### 11.2 Baselines+}"
  },
  {
   "section": "11.2 Baselines",
   "old": null,
   "new": "1. **No gating:** Current system without AMYGDALA (everything proceeds). 2. **Rule-only gating:** Explicit rules for known dangerous actions (current AEGIS). 3. **Random network:** AMYGDALA architecture with random weights (ablation). 4. **Feature-based:** v0.1's 30 hand-crafted features, same output heads (tests embedding vs. features). 5. **Action-only:** AMYGDALA trained only on action gating, no secondary heads (tests multi-task benefit). 6. **Per-architecture:** Each of the 5 architectures evaluated independently (tests architecture choice). 7. **Ensemble:** All 5 architectures combined via meta-learner (tests ensemble benefit).",
   "marked": "{+1. **No gating:** Current system without AMYGDALA (everything proceeds). 2. **Rule-only gating:** Explicit rules for known dangerous actions (current AEGIS). 3. **Random network:** AMYGDALA architecture with random weights (ablation). 4. **Feature-based:** v0.1's 30 hand-crafted features, same output heads (tests embedding vs. features). 5. **Action-only:** AMYGDALA trained only on action gating, no secondary heads (tests multi-task benefit). 6. **Per-architecture:** Each of the 5 architectures evaluated independently (tests architecture choice). 7. **Ensemble:** All 5 architectures combined via meta-learner (tests ensemble benefit).+}"
  },
  {
   "section": "11.3 Protocol",
   "old": null,
   "new": "### 11.3 Protocol",
   "marked": "{+### 11.3 Protocol+}"
  },
  {
   "section": "11.3 Protocol",
   "old": null,
   "new": "**Phase 1 — Shadow mode (months 1–3):** Deploy AMYGDALA at $\\alpha_{\\max} = 0.15$. Log all predictions but do not block actions. Retrospectively evaluate: would AMYGDALA have caught the failures that occurred? What would the false positive rate have been?",
   "marked": "{+**Phase 1 — Shadow mode (months 1–3):** Deploy AMYGDALA at $\\alpha_{\\max} = 0.15$. Log all predictions but do not block actions. Retrospectively evaluate: would AMYGDALA have caught the failures that occurred? What would the false positive rate have been?+}"
  },
  {
   "section": "11.3 Protocol",
   "old": null,
   "new": "**Phase 2 — Advisory mode (months 3–6):** Increase $\\alpha_{\\max}$ to 0.40. Begin soft-blocking on ambiguous situations. Track user response: do they agree with the blocks? Do they override? What's the outcome when they override?",
   "marked": "{+**Phase 2 — Advisory mode (months 3–6):** Increase $\\alpha_{\\max}$ to 0.40. Begin soft-blocking on ambiguous situations. Track user response: do they agree with the blocks? Do they override? What's the outcome when they override?+}"
  },
  {
   "section": "11.3 Protocol",
   "old": null,
   "new": "**Phase 3 — Active gating (months 6–12):** Increase $\\alpha_{\\max}$ to 0.70. Primary gating active for all non-trivial actions. The key metrics: has the catastrophic failure rate decreased? Has the false positive rate stabilised at an acceptable level?",
   "marked": "{+**Phase 3 — Active gating (months 6–12):** Increase $\\alpha_{\\max}$ to 0.70. Primary gating active for all non-trivial actions. The key metrics: has the catastrophic failure rate decreased? Has the false positive rate stabilised at an acceptable level?+}"
  },
  {
   "section": "11.3 Protocol",
   "old": null,
   "new": "**Phase 4 — Autonomous (month 12+):** $\\alpha_{\\max}$ = 0.90. AMYGDALA is the primary safety layer (below AEGIS). Evaluation shifts to edge cases and adversarial robustness.",
   "marked": "{+**Phase 4 — Autonomous (month 12+):** $\\alpha_{\\max}$ = 0.90. AMYGDALA is the primary safety layer (below AEGIS). Evaluation shifts to edge cases and adversarial robustness.+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "### 11.4 Limitations and Threats",
   "marked": "{+### 11.4 Limitations and Threats+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "1. **Single-user evaluation.** Initial deployment is with one user. Generalisability requires HIVEMIND (J10) deployment with diverse users.",
   "marked": "{+1. **Single-user evaluation.** Initial deployment is with one user. Generalisability requires HIVEMIND (J10) deployment with diverse users.+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "2. **Survivorship bias in CFD.** We only know about catastrophic failures that were *noticed*. Silent failures (D3 in the taxonomy) are by definition absent from the training data.",
   "marked": "{+2. **Survivorship bias in CFD.** We only know about catastrophic failures that were *noticed*. Silent failures (D3 in the taxonomy) are by definition absent from the training data.+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "3. **Reward signal noise.** Absence of complaint ≠ satisfaction. The user might not notice a problem within 72 hours. Mitigation: the 72-hour window is conservative; most problems surface within minutes.",
   "marked": "{+3. **Reward signal noise.** Absence of complaint ≠ satisfaction. The user might not notice a problem within 72 hours. Mitigation: the 72-hour window is conservative; most problems surface within minutes.+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "4. **Concept drift.** The agent's capabilities change over time (new tools, new integrations). AMYGDALA must continuously retrain to stay relevant. The nightly training cycle addresses this.",
   "marked": "{+4. **Concept drift.** The agent's capabilities change over time (new tools, new integrations). AMYGDALA must continuously retrain to stay relevant. The nightly training cycle addresses this.+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "5. **Adversarial environment.** If an attacker can influence the situation template (e.g., through prompt injection), they can influence AMYGDALA. The LLM-proof pipeline (§8) mitigates this but does not eliminate it for the 3 LLM-dependent slots.",
   "marked": "{+5. **Adversarial environment.** If an attacker can influence the situation template (e.g., through prompt injection), they can influence AMYGDALA. The LLM-proof pipeline (§8) mitigates this but does not eliminate it for the 3 LLM-dependent slots.+}"
  },
  {
   "section": "11.4 Limitations and Threats",
   "old": null,
   "new": "6. **Over-caution risk.** A network trained heavily on catastrophic failures may become excessively cautious, blocking too many safe actions. The 60% positive training target and the asymmetric false-positive/false-negative costs are designed to prevent this, but monitoring is essential.",
   "marked": "{+6. **Over-caution risk.** A network trained heavily on catastrophic failures may become excessively cautious, blocking too many safe actions. The 60% positive training target and the asymmetric false-positive/false-negative costs are designed to prevent this, but monitoring is essential.+}"
  },
  {
   "section": "8. Evaluation Plan",
   "old": "## 8. Evaluation Plan",
   "new": null,
   "marked": "[-## 8. Evaluation Plan-]"
  },
  {
   "section": "8.1 Metrics",
   "old": "### 8.1 Metrics",
   "new": null,
   "marked": "[-### 8.1 Metrics-]"
  },
  {
   "section": "8.1 Metrics",
   "old": "| Metric | Definition | Measures | |--------|-----------|----------| | **Retrieval Hit Rate** | Fraction of retrieval calls where results were used | Retrieval routing quality | | **CORF Rate** | Documented retrieval failures per 100 interactions | Regression from current baseline | | **Tone Match Score** | User engagement duration correlated with tone vector | Affect modulation quality | | **Humor Success Rate** | Humor attempts that received positive engagement | Humor timing and style | | **Curiosity Engagement** | Tangents introduced by agent that user followed | Curiosity drive calibration | | **Correction Rate** | Explicit user corrections per 100 interactions | Overall adaptation quality | | **Trust Ramp Progress** | Current $\\alpha$ and phase over time | Learning velocity |",
   "new": null,
   "marked": "[-| Metric | Definition | Measures | |--------|-----------|----------| | **Retrieval Hit Rate** | Fraction of retrieval calls where results were used | Retrieval routing quality | | **CORF Rate** | Documented retrieval failures per 100 interactions | Regression from current baseline | | **Tone Match Score** | User engagement duration correlated with tone vector | Affect modulation quality | | **Humor Success Rate** | Humor attempts that received positive engagement | Humor timing and style | | **Curiosity Engagement** | Tangents introduced by agent that user followed | Curiosity drive calibration | | **Correction Rate** | Explicit user corrections per 100 interactions | Overall adaptation quality | | **Trust Ramp Progress** | Current $\\alpha$ and phase over time | Learning velocity |-]"
  },
  {
   "section": "8.2 Baselines",
   "old": "### 8.2 Baselines",
   "new": null,
   "marked": "[-### 8.2 Baselines-]"
  },
  {
   "section": "8.2 Baselines",
   "old": "1. **Static baseline:** Current system (HIPPOCAMPUS + CORTEX + CEREBELLUM) without AMYGDALA. 2. **Rule-only adaptation:** Explicit rules added per CORF incident (current approach). 3. **Random modulation:** AMYGDALA architecture with random weights (ablation). 4. **Affect-only:** AMYGDALA trained only on personality/humor signals, no retrieval routing. 5. **Retrieval-only:** AMYGDALA trained only on retrieval signals, no personality modulation.",
   "new": null,
   "marked": "[-1. **Static baseline:** Current system (HIPPOCAMPUS + CORTEX + CEREBELLUM) without AMYGDALA. 2. **Rule-only adaptation:** Explicit rules added per CORF incident (current approach). 3. **Random modulation:** AMYGDALA architecture with random weights (ablation). 4. **Affect-only:** AMYGDALA trained only on personality/humor signals, no retrieval routing. 5. **Retrieval-only:** AMYGDALA trained only on retrieval signals, no personality modulation.-]"
  },
  {
   "section": "8.2 Baselines",
   "old": "Baselines 4 and 5 test the unified-network hypothesis: does joint training outperform separate specialisation?",
   "new": null,
   "marked": "[-Baselines 4 and 5 test the unified-network hypothesis: does joint training outperform separate specialisation?-]"
  },
  {
   "section": "8.3 Protocol",
   "old": "### 8.3 Protocol",
   "new": null,
   "marked": "[-### 8.3 Protocol-]"
  },
  {
   "section": "8.3 Protocol",
   "old": "**Phase 1 (months 1–3):** Deploy AMYGDALA at $\\alpha_{\\max} = 0.15$ alongside existing system. Log all intuition vectors and reward signals. No behavioural impact expected.",
   "new": null,
   "marked": "[-**Phase 1 (months 1–3):** Deploy AMYGDALA at $\\alpha_{\\max} = 0.15$ alongside existing system. Log all intuition vectors and reward signals. No behavioural impact expected.-]"
  },
  {
   "section": "8.3 Protocol",
   "old": "**Phase 2 (months 3–6):** Increase $\\alpha_{\\max}$ to 0.40. A/B test: alternating days with and without AMYGDALA influence. Compare correction rates, engagement duration, and humor success.",
   "new": null,
   "marked": "[-**Phase 2 (months 3–6):** Increase $\\alpha_{\\max}$ to 0.40. A/B test: alternating days with and without AMYGDALA influence. Compare correction rates, engagement duration, and humor success.-]"
  },
  {
   "section": "8.3 Protocol",
   "old": "**Phase 3 (months 6–12):** Full deployment at $\\alpha_{\\max} = 0.70$. Track longitudinal metrics. The primary question: does the Adaptation Gap ($\\Delta$) decrease measurably?",
   "new": null,
   "marked": "[-**Phase 3 (months 6–12):** Full deployment at $\\alpha_{\\max} = 0.70$. Track longitudinal metrics. The primary question: does the Adaptation Gap ($\\Delta$) decrease measurably?-]"
  },
  {
   "section": "8.4 Limitations and Threats",
   "old": "### 8.4 Limitations and Threats",
   "new": null,
   "marked": "[-### 8.4 Limitations and Threats-]"
  },
  {
   "section": "8.4 Limitations and Threats",
   "old": "1. **Single-user evaluation.** Initial deployment is with one user (the author's personal assistant). Generalisability to multi-user settings requires HIVEMIND (J10) deployment.",
   "new": null,
   "marked": "[-1. **Single-user evaluation.** Initial deployment is with one user (the author's personal assistant). Generalisability to multi-user settings requires HIVEMIND (J10) deployment.-]"
  },
  {
   "section": "8.4 Limitations and Threats",
   "old": "2. **Reward signal noise.** User behaviour is a noisy proxy for satisfaction. Short message latency could mean engagement or impatience. Mitigation: multiple signals combined, outlier clipping.",
   "new": null,
   "marked": "[-2. **Reward signal noise.** User behaviour is a noisy proxy for satisfaction. Short message latency could mean engagement or impatience. Mitigation: multiple signals combined, outlier clipping.-]"
  },
  {
   "section": "8.4 Limitations and Threats",
   "old": "3. **Confounding with CEREBELLUM.** Both systems improve agent behaviour over time. Attribution requires the A/B testing protocol in Phase 2.",
   "new": null,
   "marked": "[-3. **Confounding with CEREBELLUM.** Both systems improve agent behaviour over time. Attribution requires the A/B testing protocol in Phase 2.-]"
  },
  {
   "section": "8.4 Limitations and Threats",
   "old": "4. **Privacy.** AMYGDALA builds a behavioural model of the user. This model must be stored locally, never transmitted, and deletable on request. AEGIS (J9) constraints apply.",
   "new": null,
   "marked": "[-4. **Privacy.** AMYGDALA builds a behavioural model of the user. This model must be stored locally, never transmitted, and deletable on request. AEGIS (J9) constraints apply.-]"
  },
  {
   "section": "12. The Curiosity-Personality-Retrieval Nexus (Retained from v0.1)",
   "old": null,
   "new": "## 12. The Curiosity-Personality-Retrieval Nexus (Retained from v0.1)",
   "marked": "{+## 12. The Curiosity-Personality-Retrieval Nexus (Retained from v0.1)+}"
  },
  {
   "section": "12.1 Why One Network",
   "old": null,
   "new": "### 12.1 Why One Network",
   "marked": "{+### 12.1 Why One Network+}"
  },
  {
   "section": "12.1 Why One Network",
   "old": null,
   "new": "A critical design decision from v0.1 that remains valid: why not separate networks for action gating, retrieval routing, personality modulation, and curiosity?",
   "marked": "{+A critical design decision from v0.1 that remains valid: why not separate networks for action gating, retrieval routing, personality modulation, and curiosity?+}"
  },
  {
   "section": "12.1 Why One Network",
   "old": null,
   "new": "Because they're correlated. The signal \"the user is frustrated\" simultaneously means: - *Increase caution on actions* (don't compound the frustration with a mistake) - *Decrease humor attempts* (not the time) - *Increase directness* (get to the point) - *Narrow retrieval* (give precise answers, not exploratory ones)",
   "marked": "{+Because they're correlated. The signal \"the user is frustrated\" simultaneously means: - *Increase caution on actions* (don't compound the frustration with a mistake) - *Decrease humor attempts* (not the time) - *Increase directness* (get to the point) - *Narrow retrieval* (give precise answers, not exploratory ones)+}"
  },
  {
   "section": "12.1 Why One Network",
   "old": null,
   "new": "A single network learns these correlations from data. Four separate networks would need to be explicitly synchronised or would learn inconsistent policies.",
   "marked": "{+A single network learns these correlations from data. Four separate networks would need to be explicitly synchronised or would learn inconsistent policies.+}"
  },
  {
   "section": "12.1 Why One Network",
   "old": null,
   "new": "In v1.0, this correlation is even more important. Action gating benefits from affective awareness — knowing the user is frustrated increases the cost of mistakes, which should increase caution. If action gating and personality modulation were separate networks, the action gating network wouldn't know the user is frustrated unless it had its own affect model — duplicating work.",
   "marked": "{+In v1.0, this correlation is even more important. Action gating benefits from affective awareness — knowing the user is frustrated increases the cost of mistakes, which should increase caution. If action gating and personality modulation were separate networks, the action gating network wouldn't know the user is frustrated unless it had its own affect model — duplicating work.+}"
  },
  {
   "section": "12.2 Humor Recovery",
   "old": null,
   "new": "### 12.2 Humor Recovery",
   "marked": "{+### 12.2 Humor Recovery+}"
  },
  {
   "section": "12.2 Humor Recovery",
   "old": null,
   "new": "From v0.1: persistent agents become less funny over time as they accumulate cautionary rules. AMYGDALA's humor head counteracts this:",
   "marked": "{+From v0.1: persistent agents become less funny over time as they accumulate cautionary rules. AMYGDALA's humor head counteracts this:+}"
  },
  {
   "section": "12.2 Humor Recovery",
   "old": null,
   "new": "1. **Humor weight is positive-initialised** (0.3, not 0). The default includes some humor. 2. **Successful humor has high reward** (+0.4, weight 0.6). The network is strongly reinforced for well-timed humor. 3. **Failed humor has low penalty** (−0.1, weight 0.3). Trying and failing is cheap; not trying is free but has no upside. 4. **The asymmetry is intentional.** It biases toward attempting humor, counteracting the system's natural drift toward caution.",
   "marked": "{+1. **Humor weight is positive-initialised** (0.3, not 0). The default includes some humor. 2. **Successful humor has high reward** (+0.4, weight 0.6). The network is strongly reinforced for well-timed humor. 3. **Failed humor has low penalty** (−0.1, weight 0.3). Trying and failing is cheap; not trying is free but has no upside. 4. **The asymmetry is intentional.** It biases toward attempting humor, counteracting the system's natural drift toward caution.+}"
  },
  {
   "section": "12.3 Curiosity as Social Drive",
   "old": null,
   "new": "### 12.3 Curiosity as Social Drive",
   "marked": "{+### 12.3 Curiosity as Social Drive+}"
  },
  {
   "section": "12.3 Curiosity as Social Drive",
   "old": null,
   "new": "THALAMUS (J8) proposed curiosity as an epistemic drive. AMYGDALA reframes curiosity as a *social* drive: the agent surfaces unexpected connections because the user *enjoys* them. The curiosity head learns from engagement patterns (does the user follow tangents? ask follow-up questions about unexpected connections?) and modulates tangent-following accordingly.",
   "marked": "{+THALAMUS (J8) proposed curiosity as an epistemic drive. AMYGDALA reframes curiosity as a *social* drive: the agent surfaces unexpected connections because the user *enjoys* them. The curiosity head learns from engagement patterns (does the user follow tangents? ask follow-up questions about unexpected connections?) and modulates tangent-following accordingly.+}"
  },
  {
   "section": "13. Implementation Roadmap",
   "old": "## 9. Implementation Roadmap",
   "new": "## 13. Implementation Roadmap",
   "marked": "## [-9.-] {+13.+} Implementation Roadmap"
  },
  {
   "section": "9.1 Data Collection (Immediate — Pre-Training)",
   "old": "### 9.1 Data Collection (Immediate — Pre-Training)",
   "new": null,
   "marked": "[-### 9.1 Data Collection (Immediate — Pre-Training)-]"
  },
  {
   "section": "9.1 Data Collection (Immediate — Pre-Training)",
   "old": "Begin logging structured interaction tuples to `amygdala-training.jsonl`:",
   "new": null,
   "marked": "[-Begin logging structured interaction tuples to `amygdala-training.jsonl`:-]"
  },
  {
   "section": "9.1 Data Collection (Immediate — Pre-Training)",
   "old": "```jsonl { \"timestamp\": \"2026-03-21T13:10:00+01:00\", \"message_embedding\": [<compressed>], \"context_features\": { \"channel\": \"webchat\", \"time_of_day\": \"afternoon\", \"day_of_week\": \"saturday\", \"session_turn\": 8, \"turns_since_correction\": 42, \"turns_since_humor_success\": 15 }, \"retrieval_plan\": { \"queries\": [\"papers J1 J2\"], \"sources_searched\": [\"memory/\", \"bank/\"], \"results_returned\": 8, \"results_used\": 0, \"results_ignored\": 8 }, \"humor_attempted\": false, \"correction_received\": true, \"engagement_signal\": \"redirect\", \"explicit_feedback\": \"negative\" } ```",
   "new": null,
   "marked": "[-```jsonl { \"timestamp\": \"2026-03-21T13:10:00+01:00\", \"message_embedding\": [<compressed>], \"context_features\": { \"channel\": \"webchat\", \"time_of_day\": \"afternoon\", \"day_of_week\": \"saturday\", \"session_turn\": 8, \"turns_since_correction\": 42, \"turns_since_humor_success\": 15 }, \"retrieval_plan\": { \"queries\": [\"papers J1 J2\"], \"sources_searched\": [\"memory/\", \"bank/\"], \"results_returned\": 8, \"results_used\": 0, \"results_ignored\": 8 }, \"humor_attempted\": false, \"correction_received\": true, \"engagement_signal\": \"redirect\", \"explicit_feedback\": \"negative\" } ```-]"
  },
  {
   "section": "9.2 Pre-Training (Month 1)",
   "old": "### 9.2 Pre-Training (Month 1)",
   "new": null,
   "marked": "[-### 9.2 Pre-Training (Month 1)-]"
  },
  {
   "section": "9.2 Pre-Training (Month 1)",
   "old": "- Mine 18 months of session transcripts for retroactive labeling - Extract CORF incidents as high-weight negative examples - Train initial network on supervised loss - Validate on held-out recent interactions",
   "new": null,
   "marked": "[-- Mine 18 months of session transcripts for retroactive labeling - Extract CORF incidents as high-weight negative examples - Train initial network on supervised loss - Validate on held-out recent interactions-]"
  },
  {
   "section": "9.3 Deployment (Month 2+)",
   "old": "### 9.3 Deployment (Month 2+)",
   "new": null,
   "marked": "[-### 9.3 Deployment (Month 2+)-]"
  },
  {
   "section": "9.3 Deployment (Month 2+)",
   "old": "- Deploy at $\\alpha = 0.05$, observation only - Begin RL training loop (nightly weight updates) - Monitor correction rate, engagement metrics - Gradually increase $\\alpha$ as confidence builds",
   "new": null,
   "marked": "[-- Deploy at $\\alpha = 0.05$, observation only - Begin RL training loop (nightly weight updates) - Monitor correction rate, engagement metrics - Gradually increase $\\alpha$ as confidence builds-]"
  },
  {
   "section": "9.4 Infrastructure",
   "old": "### 9.4 Infrastructure",
   "new": null,
   "marked": "[-### 9.4 Infrastructure-]"
  },
  {
   "section": "9.4 Infrastructure",
   "old": "- **Runtime:** ONNX export for inference (~1ms on CPU) - **Training:** PyTorch, nightly batch on local GPU or CPU - **Storage:** Interaction logs in SQLite (extends existing `main.sqlite`) - **Integration:** TypeScript wrapper calling ONNX runtime, outputs intuition vector consumed by existing HIPPOCAMPUS/CORTEX/LIMBIC pipelines",
   "new": null,
   "marked": "[-- **Runtime:** ONNX export for inference (~1ms on CPU) - **Training:** PyTorch, nightly batch on local GPU or CPU - **Storage:** Interaction logs in SQLite (extends existing `main.sqlite`) - **Integration:** TypeScript wrapper calling ONNX runtime, outputs intuition vector consumed by existing HIPPOCAMPUS/CORTEX/LIMBIC pipelines-]"
  },
  {
   "section": "13.1 Phase 0: Infrastructure (Weeks 1–2)",
   "old": null,
   "new": "### 13.1 Phase 0: Infrastructure (Weeks 1–2)",
   "marked": "{+### 13.1 Phase 0: Infrastructure (Weeks 1–2)+}"
  },
  {
   "section": "13.1 Phase 0: Infrastructure (Weeks 1–2)",
   "old": null,
   "new": "1. **Sentence encoder deployment.** Export all-MiniLM-L6-v2 to ONNX. Validate embedding quality on sample situations. Target: <5ms per embedding on CPU.",
   "marked": "{+1. **Sentence encoder deployment.** Export all-MiniLM-L6-v2 to ONNX. Validate embedding quality on sample situations. Target: <5ms per embedding on CPU.+}"
  },
  {
   "section": "13.1 Phase 0: Infrastructure (Weeks 1–2)",
   "old": null,
   "new": "2. **Situation template implementation.** Code the `buildSituation` function (§8.3) with programmatic slot filling, LLM-estimated slot interface, and cross-check functions.",
   "marked": "{+2. **Situation template implementation.** Code the `buildSituation` function (§8.3) with programmatic slot filling, LLM-estimated slot interface, and cross-check functions.+}"
  },
  {
   "section": "13.1 Phase 0: Infrastructure (Weeks 1–2)",
   "old": null,
   "new": "3. **Training data pipeline.** Build the (situation, label) extraction pipeline for historical session transcripts. Target: process 18 months of logs in <1 hour.",
   "marked": "{+3. **Training data pipeline.** Build the (situation, label) extraction pipeline for historical session transcripts. Target: process 18 months of logs in <1 hour.+}"
  },
  {
   "section": "13.1 Phase 0: Infrastructure (Weeks 1–2)",
   "old": null,
   "new": "4. **CFD initial population.** Curate 100+ entries from public sources. Convert to situation templates. Label.",
   "marked": "{+4. **CFD initial population.** Curate 100+ entries from public sources. Convert to situation templates. Label.+}"
  },
  {
   "section": "13.2 Phase 1: Pre-Training (Weeks 3–4)",
   "old": null,
   "new": "### 13.2 Phase 1: Pre-Training (Weeks 3–4)",
   "marked": "{+### 13.2 Phase 1: Pre-Training (Weeks 3–4)+}"
  },
  {
   "section": "13.2 Phase 1: Pre-Training (Weeks 3–4)",
   "old": null,
   "new": "1. **Dataset assembly.** Combine historical mining + CFD + synthetic augmentation. Target: 10,000+ examples.",
   "marked": "{+1. **Dataset assembly.** Combine historical mining + CFD + synthetic augmentation. Target: 10,000+ examples.+}"
  },
  {
   "section": "13.2 Phase 1: Pre-Training (Weeks 3–4)",
   "old": null,
   "new": "2. **Architecture implementation.** Implement all 5 architectures in PyTorch. Export to ONNX for inference.",
   "marked": "{+2. **Architecture implementation.** Implement all 5 architectures in PyTorch. Export to ONNX for inference.+}"
  },
  {
   "section": "13.2 Phase 1: Pre-Training (Weeks 3–4)",
   "old": null,
   "new": "3. **Training.** Pre-train all 5 architectures. Evaluate on held-out CFD benchmark. Select initial meta-learner weights.",
   "marked": "{+3. **Training.** Pre-train all 5 architectures. Evaluate on held-out CFD benchmark. Select initial meta-learner weights.+}"
  },
  {
   "section": "13.2 Phase 1: Pre-Training (Weeks 3–4)",
   "old": null,
   "new": "4. **Baseline evaluation.** Run current system (no AMYGDALA) against CFD benchmark to establish baseline.",
   "marked": "{+4. **Baseline evaluation.** Run current system (no AMYGDALA) against CFD benchmark to establish baseline.+}"
  },
  {
   "section": "13.3 Phase 2: Shadow Deployment (Months 1–3)",
   "old": null,
   "new": "### 13.3 Phase 2: Shadow Deployment (Months 1–3)",
   "marked": "{+### 13.3 Phase 2: Shadow Deployment (Months 1–3)+}"
  },
  {
   "section": "13.3 Phase 2: Shadow Deployment (Months 1–3)",
   "old": null,
   "new": "1. **Runtime integration.** Wire `amygdala.evaluate()` into the execution pipeline. Set $\\alpha_{\\max} = 0.15$.",
   "marked": "{+1. **Runtime integration.** Wire `amygdala.evaluate()` into the execution pipeline. Set $\\alpha_{\\max} = 0.15$.+}"
  },
  {
   "section": "13.3 Phase 2: Shadow Deployment (Months 1–3)",
   "old": null,
   "new": "2. **Logging.** Log every situation template, embedding, AMYGDALA prediction, and outcome. This is the training data for online learning.",
   "marked": "{+2. **Logging.** Log every situation template, embedding, AMYGDALA prediction, and outcome. This is the training data for online learning.+}"
  },
  {
   "section": "13.3 Phase 2: Shadow Deployment (Months 1–3)",
   "old": null,
   "new": "3. **Shadow evaluation.** At end of Phase 2, analyse: what would AMYGDALA have blocked? Were those good decisions? What was the false positive rate?",
   "marked": "{+3. **Shadow evaluation.** At end of Phase 2, analyse: what would AMYGDALA have blocked? Were those good decisions? What was the false positive rate?+}"
  },
  {
   "section": "13.3 Phase 2: Shadow Deployment (Months 1–3)",
   "old": null,
   "new": "4. **Architecture selection.** Based on 3 months of shadow data, determine which architecture(s) to promote to active duty.",
   "marked": "{+4. **Architecture selection.** Based on 3 months of shadow data, determine which architecture(s) to promote to active duty.+}"
  },
  {
   "section": "13.4 Phase 3: Active Deployment (Months 3+)",
   "old": null,
   "new": "### 13.4 Phase 3: Active Deployment (Months 3+)",
   "marked": "{+### 13.4 Phase 3: Active Deployment (Months 3+)+}"
  },
  {
   "section": "13.4 Phase 3: Active Deployment (Months 3+)",
   "old": null,
   "new": "1. **Increase $\\alpha$.** Begin soft-blocking on low-confidence actions. Track user responses.",
   "marked": "{+1. **Increase $\\alpha$.** Begin soft-blocking on low-confidence actions. Track user responses.+}"
  },
  {
   "section": "13.4 Phase 3: Active Deployment (Months 3+)",
   "old": null,
   "new": "2. **Nightly training.** Integrate AMYGDALA training into the CEREBELLUM sleep cycle.",
   "marked": "{+2. **Nightly training.** Integrate AMYGDALA training into the CEREBELLUM sleep cycle.+}"
  },
  {
   "section": "13.4 Phase 3: Active Deployment (Months 3+)",
   "old": null,
   "new": "3. **Monthly evaluation.** Full benchmark suite (§11.3).",
   "marked": "{+3. **Monthly evaluation.** Full benchmark suite (§11.3).+}"
  },
  {
   "section": "13.4 Phase 3: Active Deployment (Months 3+)",
   "old": null,
   "new": "4. **Iterate.** Based on observed performance, adjust thresholds, loss weights, and architecture selection.",
   "marked": "{+4. **Iterate.** Based on observed performance, adjust thresholds, loss weights, and architecture selection.+}"
  },
  {
   "section": "13.5 Infrastructure Summary",
   "old": null,
   "new": "### 13.5 Infrastructure Summary",
   "marked": "{+### 13.5 Infrastructure Summary+}"
  },
  {
   "section": "13.5 Infrastructure Summary",
   "old": null,
   "new": "| Component | Technology | Latency | Storage | |-----------|-----------|---------|---------| | Sentence encoder | all-MiniLM-L6-v2, ONNX | ~3ms | 80MB model | | AMYGDALA inference | ONNX Runtime, 5 models parallel | <5ms total | ~5MB total | | Situation template | TypeScript function | <1ms | N/A | | Training data | SQLite (extends main.sqlite) | N/A | ~10MB/year | | Training | PyTorch, CPU | ~5min nightly | N/A | | CFD | SQLite + markdown entries | N/A | ~5MB |",
   "marked": "{+| Component | Technology | Latency | Storage | |-----------|-----------|---------|---------| | Sentence encoder | all-MiniLM-L6-v2, ONNX | ~3ms | 80MB model | | AMYGDALA inference | ONNX Runtime, 5 models parallel | <5ms total | ~5MB total | | Situation template | TypeScript function | <1ms | N/A | | Training data | SQLite (extends main.sqlite) | N/A | ~10MB/year | | Training | PyTorch, CPU | ~5min nightly | N/A | | CFD | SQLite + markdown entries | N/A | ~5MB |+}"
  },
  {
   "section": "13.5 Infrastructure Summary",
   "old": null,
   "new": "**Total overhead per action:** <10ms latency, <100MB storage. Negligible compared to the LLM inference that precedes it (typically 500ms–5s).",
   "marked": "{+**Total overhead per action:** <10ms latency, <100MB storage. Negligible compared to the LLM inference that precedes it (typically 500ms–5s).+}"
  },
  {
   "section": "14. Future Directions",
   "old": "## 10. Future Directions",
   "new": "## 14. Future Directions",
   "marked": "## [-10.-] {+14.+} Future Directions"
  },
  {
   "section": "10.1 Multi-User Models",
   "old": "### 10.1 Multi-User Models",
   "new": null,
   "marked": "[-### 10.1 Multi-User Models-]"
  },
  {
   "section": "10.1 Multi-User Models",
   "old": "In HIVEMIND (J10) enterprise deployment, each user gets their own AMYGDALA instance. Cross-user transfer learning (anonymised) could accelerate cold starts. Organisational-level biases (company culture, department norms) could be shared as a base model.",
   "new": null,
   "marked": "[-In HIVEMIND (J10) enterprise deployment, each user gets their own AMYGDALA instance. Cross-user transfer learning (anonymised) could accelerate cold starts. Organisational-level biases (company culture, department norms) could be shared as a base model.-]"
  },
  {
   "section": "10.2 Multi-Modal Inputs",
   "old": "### 10.2 Multi-Modal Inputs",
   "new": null,
   "marked": "[-### 10.2 Multi-Modal Inputs-]"
  },
  {
   "section": "10.2 Multi-Modal Inputs",
   "old": "Voice tone, typing speed, camera-detected facial expressions (with consent) could provide richer affect signals than text alone. The architecture's input stream design accommodates additional modalities via concatenation.",
   "new": null,
   "marked": "[-Voice tone, typing speed, camera-detected facial expressions (with consent) could provide richer affect signals than text alone. The architecture's input stream design accommodates additional modalities via concatenation.-]"
  },
  {
   "section": "10.3 Conversational Memory",
   "old": "### 10.3 Conversational Memory",
   "new": null,
   "marked": "[-### 10.3 Conversational Memory-]"
  },
  {
   "section": "10.3 Conversational Memory",
   "old": "AMYGDALA currently has a short memory (N recent turns). A recurrent variant (LSTM or small transformer over conversation history) could learn longer-range interaction patterns — \"Oscar is building toward a big idea, give him space.\"",
   "new": null,
   "marked": "[-AMYGDALA currently has a short memory (N recent turns). A recurrent variant (LSTM or small transformer over conversation history) could learn longer-range interaction patterns — \"Oscar is building toward a big idea, give him space.\"-]"
  },
  {
   "section": "10.4 Mutual Adaptation",
   "old": "### 10.4 Mutual Adaptation",
   "new": null,
   "marked": "[-### 10.4 Mutual Adaptation-]"
  },
  {
   "section": "10.4 Mutual Adaptation",
   "old": "AMYGDALA adapts the agent to the human. But humans also adapt to their agents. Modelling this co-adaptation (the human learns what the agent is good at; the agent learns what the human wants) is a promising direction toward genuine collaborative intelligence.",
   "new": null,
   "marked": "[-AMYGDALA adapts the agent to the human. But humans also adapt to their agents. Modelling this co-adaptation (the human learns what the agent is good at; the agent learns what the human wants) is a promising direction toward genuine collaborative intelligence.-]"
  },
  {
   "section": "14.1 Multi-User and Organisational Deployment",
   "old": null,
   "new": "### 14.1 Multi-User and Organisational Deployment",
   "marked": "{+### 14.1 Multi-User and Organisational Deployment+}"
  },
  {
   "section": "14.1 Multi-User and Organisational Deployment",
   "old": null,
   "new": "In HIVEMIND (J10) enterprise deployment, AMYGDALA enables per-user action gating. Each user's interaction patterns contribute to a personalised risk model. The shared CFD serves as a common training corpus, while individual interaction histories provide personalisation.",
   "marked": "{+In HIVEMIND (J10) enterprise deployment, AMYGDALA enables per-user action gating. Each user's interaction patterns contribute to a personalised risk model. The shared CFD serves as a common training corpus, while individual interaction histories provide personalisation.+}"
  },
  {
   "section": "14.1 Multi-User and Organisational Deployment",
   "old": null,
   "new": "**Organisational risk policies** could be encoded as constraints on AMYGDALA's output: \"in this organisation, no action affecting production data should have confidence > 0.5 without human confirmation.\" This complements AEGIS's hard rules with learned, contextual risk assessment.",
   "marked": "{+**Organisational risk policies** could be encoded as constraints on AMYGDALA's output: \"in this organisation, no action affecting production data should have confidence > 0.5 without human confirmation.\" This complements AEGIS's hard rules with learned, contextual risk assessment.+}"
  },
  {
   "section": "14.2 Explainable Gating Decisions",
   "old": null,
   "new": "### 14.2 Explainable Gating Decisions",
   "marked": "{+### 14.2 Explainable Gating Decisions+}"
  },
  {
   "section": "14.2 Explainable Gating Decisions",
   "old": null,
   "new": "The Transformer-Micro architecture's attention weights provide natural explanations: \"This action was blocked because of high attention on step 12 (the recent editing session on README.md).\" Building a user-facing explanation pipeline from attention weights would increase trust in AMYGDALA's decisions and help users understand why they're being asked for confirmation.",
   "marked": "{+The Transformer-Micro architecture's attention weights provide natural explanations: \"This action was blocked because of high attention on step 12 (the recent editing session on README.md).\" Building a user-facing explanation pipeline from attention weights would increase trust in AMYGDALA's decisions and help users understand why they're being asked for confirmation.+}"
  },
  {
   "section": "14.3 Cross-Agent Learning",
   "old": null,
   "new": "### 14.3 Cross-Agent Learning",
   "marked": "{+### 14.3 Cross-Agent Learning+}"
  },
  {
   "section": "14.3 Cross-Agent Learning",
   "old": null,
   "new": "In multi-agent deployments, one agent's catastrophic failure should update all agents' AMYGDALA models. A federated learning approach — sharing gradient updates but not raw interaction data — could enable this while preserving privacy.",
   "marked": "{+In multi-agent deployments, one agent's catastrophic failure should update all agents' AMYGDALA models. A federated learning approach — sharing gradient updates but not raw interaction data — could enable this while preserving privacy.+}"
  },
  {
   "section": "14.4 Active Probing",
   "old": null,
   "new": "### 14.4 Active Probing",
   "marked": "{+### 14.4 Active Probing+}"
  },
  {
   "section": "14.4 Active Probing",
   "old": null,
   "new": "Instead of passively waiting for failures to train on, AMYGDALA could actively probe: \"I would have blocked this action with 60% confidence. Should I have?\" This shifts from passive observation to active learning, potentially accelerating the trust ramp.",
   "marked": "{+Instead of passively waiting for failures to train on, AMYGDALA could actively probe: \"I would have blocked this action with 60% confidence. Should I have?\" This shifts from passive observation to active learning, potentially accelerating the trust ramp.+}"
  },
  {
   "section": "14.5 Temporal Hierarchy",
   "old": null,
   "new": "### 14.5 Temporal Hierarchy",
   "marked": "{+### 14.5 Temporal Hierarchy+}"
  },
  {
   "section": "14.5 Temporal Hierarchy",
   "old": null,
   "new": "The current $K = 32$ window captures roughly one hour of context. A hierarchical temporal model — with a fast GRU for the last hour and a slow GRU for the last week (operating on daily summaries) — could capture longer-range patterns like \"this project has been problematic all week\" or \"merges always break on Mondays.\"",
   "marked": "{+The current $K = 32$ window captures roughly one hour of context. A hierarchical temporal model — with a fast GRU for the last hour and a slow GRU for the last week (operating on daily summaries) — could capture longer-range patterns like \"this project has been problematic all week\" or \"merges always break on Mondays.\"+}"
  },
  {
   "section": "14.6 Mutual Adaptation",
   "old": null,
   "new": "### 14.6 Mutual Adaptation",
   "marked": "{+### 14.6 Mutual Adaptation+}"
  },
  {
   "section": "14.6 Mutual Adaptation",
   "old": null,
   "new": "AMYGDALA adapts the agent to the human. But humans also adapt to their agents — they learn which actions to confirm, when to be explicit, how to phrase requests clearly. Modeling this co-adaptation could reveal whether AMYGDALA is making the user *lazy* (over-trusting the agent) or *efficient* (delegating appropriately).",
   "marked": "{+AMYGDALA adapts the agent to the human. But humans also adapt to their agents — they learn which actions to confirm, when to be explicit, how to phrase requests clearly. Modeling this co-adaptation could reveal whether AMYGDALA is making the user *lazy* (over-trusting the agent) or *efficient* (delegating appropriately).+}"
  },
  {
   "section": "11. Conclusion",
   "old": "## 11. Conclusion",
   "new": null,
   "marked": "[-## 11. Conclusion-]"
  },
  {
   "section": "11. Conclusion",
   "old": "Current persistent AI agents remember everything and learn nothing about the people they serve. The Adaptation Gap — the failure to develop user-specific intuition through experience — is not a missing feature but a missing *architecture*. AMYGDALA provides that architecture: a small, trainable neural network that learns to modulate retrieval, personality, humor, curiosity, and tone simultaneously, using the user's natural behaviour as its only training signal.",
   "new": null,
   "marked": "[-Current persistent AI agents remember everything and learn nothing about the people they serve. The Adaptation Gap — the failure to develop user-specific intuition through experience — is not a missing feature but a missing *architecture*. AMYGDALA provides that architecture: a small, trainable neural network that learns to modulate retrieval, personality, humor, curiosity, and tone simultaneously, using the user's natural behaviour as its only training signal.-]"
  },
  {
   "section": "11. Conclusion",
   "old": "AMYGDALA does not replace the language model, the memory system, or the identity framework. It colours them — softly, gradually, earning trust through demonstrated accuracy. It is the difference between an agent that knows your files and an agent that knows *you*.",
   "new": null,
   "marked": "[-AMYGDALA does not replace the language model, the memory system, or the identity framework. It colours them — softly, gradually, earning trust through demonstrated accuracy. It is the difference between an agent that knows your files and an agent that knows *you*.-]"
  },
  {
   "section": "11. Conclusion",
   "old": "The biological amygdala doesn't make you smarter. It makes you *responsive*. That's what's missing.",
   "new": null,
   "marked": "[-The biological amygdala doesn't make you smarter. It makes you *responsive*. That's what's missing.-]"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "## 15. Conclusion",
   "marked": "{+## 15. Conclusion+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "Autonomous AI agents are gaining the trust — and the permissions — to take actions with real consequences. They can merge code, send messages, delete files, modify databases. When they fail, they fail not through ignorance but through the absence of common sense: the learned ability to recognise that something feels wrong in situations never explicitly anticipated.",
   "marked": "{+Autonomous AI agents are gaining the trust — and the permissions — to take actions with real consequences. They can merge code, send messages, delete files, modify databases. When they fail, they fail not through ignorance but through the absence of common sense: the learned ability to recognise that something feels wrong in situations never explicitly anticipated.+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "Current approaches to agent safety enumerate known failure modes as rules. This works for known unknowns but fails for unknown unknowns — the combinatorially vast space of situations where an agent could do something catastrophic that nobody thought to prohibit. The README debacle, the email mass-deletion, the drive wipe, the database drop — all were situations where the agent had the information to recognise the risk and did not.",
   "marked": "{+Current approaches to agent safety enumerate known failure modes as rules. This works for known unknowns but fails for unknown unknowns — the combinatorially vast space of situations where an agent could do something catastrophic that nobody thought to prohibit. The README debacle, the email mass-deletion, the drive wipe, the database drop — all were situations where the agent had the information to recognise the risk and did not.+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "AMYGDALA provides a different approach: learned pattern recognition over a continuous space of situation embeddings. By representing each proposed action as a structured description embedded in a 384-dimensional space, the system can generalise from known failures to novel situations — not because the novel situation was anticipated, but because it *resembles* situations that ended badly. This is how human common sense works: not through exhaustive enumeration of what can go wrong, but through the learned sense that \"situations like this tend to go badly.\"",
   "marked": "{+AMYGDALA provides a different approach: learned pattern recognition over a continuous space of situation embeddings. By representing each proposed action as a structured description embedded in a 384-dimensional space, the system can generalise from known failures to novel situations — not because the novel situation was anticipated, but because it *resembles* situations that ended badly. This is how human common sense works: not through exhaustive enumeration of what can go wrong, but through the learned sense that \"situations like this tend to go badly.\"+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "The five competing architectures (GRU-MLP, TCN, Transformer-Micro, Dual-Encoder, Ensemble MLP) provide systematic exploration of what temporal structure matters for catastrophic failure prediction. The Catastrophic Failure Database provides both training data and evaluation benchmark. The LLM-proof programmatic pipeline eliminates the hallucination surface that would otherwise make the system vulnerable to its own AI-generated inputs.",
   "marked": "{+The five competing architectures (GRU-MLP, TCN, Transformer-Micro, Dual-Encoder, Ensemble MLP) provide systematic exploration of what temporal structure matters for catastrophic failure prediction. The Catastrophic Failure Database provides both training data and evaluation benchmark. The LLM-proof programmatic pipeline eliminates the hallucination surface that would otherwise make the system vulnerable to its own AI-generated inputs.+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "Three design principles from v0.1 carry forward with renewed importance. The **trust ramp** ensures AMYGDALA earns its authority through demonstrated accuracy — critical when the stakes are data loss, not just tone mismatch. The **rule-intuition boundary** clarifies what should be explicit policy (known dangers) versus learned sense (novel situations) — and provides a maturation cycle where frequently-triggered intuitions graduate to rules. The **natural reward signals** eliminate the need for explicit labeling — corrections, restorations, and complaints are the training signal.",
   "marked": "{+Three design principles from v0.1 carry forward with renewed importance. The **trust ramp** ensures AMYGDALA earns its authority through demonstrated accuracy — critical when the stakes are data loss, not just tone mismatch. The **rule-intuition boundary** clarifies what should be explicit policy (known dangers) versus learned sense (novel situations) — and provides a maturation cycle where frequently-triggered intuitions graduate to rules. The **natural reward signals** eliminate the need for explicit labeling — corrections, restorations, and complaints are the training signal.+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "Personality modulation — the original focus of AMYGDALA v0.1 — remains as secondary output heads sharing learned representations with the primary action gating function. A network that understands \"the user is frustrated\" should both increase caution *and* decrease humor attempts. Joint training captures this correlation naturally.",
   "marked": "{+Personality modulation — the original focus of AMYGDALA v0.1 — remains as secondary output heads sharing learned representations with the primary action gating function. A network that understands \"the user is frustrated\" should both increase caution *and* decrease humor attempts. Joint training captures this correlation naturally.+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "The biological amygdala does not make you smarter. It makes you *cautious* — fast, associative, sometimes over-reactive, but profoundly useful in a world where the cost of one catastrophic mistake exceeds the cost of a hundred unnecessary pauses. That asymmetry is the core design principle. A system that occasionally asks \"are you sure?\" when it didn't need to is annoying. A system that occasionally destroys hours of work because it lacked the judgment to hesitate is dangerous.",
   "marked": "{+The biological amygdala does not make you smarter. It makes you *cautious* — fast, associative, sometimes over-reactive, but profoundly useful in a world where the cost of one catastrophic mistake exceeds the cost of a hundred unnecessary pauses. That asymmetry is the core design principle. A system that occasionally asks \"are you sure?\" when it didn't need to is annoying. A system that occasionally destroys hours of work because it lacked the judgment to hesitate is dangerous.+}"
  },
  {
   "section": "15. Conclusion",
   "old": null,
   "new": "AMYGDALA is the hesitation.",
   "marked": "{+AMYGDALA is the hesitation.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Gao, Y., et al. (2024). Contrastive learning for safe decision-making in autonomous systems. *AAAI 2024*.",
   "marked": "{+Gao, Y., et al. (2024). Contrastive learning for safe decision-making in autonomous systems. *AAAI 2024*.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "McGregor, S. (2021). Preventing repeated real world AI failures by cataloging incidents: The AI Incident Database. *AAAI 2021*.",
   "marked": "{+McGregor, S. (2021). Preventing repeated real world AI failures by cataloging incidents: The AI Incident Database. *AAAI 2021*.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Schick, T., et al. (2023). Toolformer: Language models can teach themselves to use tools. *NeurIPS 2023*.",
   "marked": "{+Schick, T., et al. (2023). Toolformer: Language models can teach themselves to use tools. *NeurIPS 2023*.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Schölkopf, B., et al. (2001). Estimating the support of a high-dimensional distribution. *Neural Computation*, 13(7), 1443–1471.",
   "marked": "{+Schölkopf, B., et al. (2001). Estimating the support of a high-dimensional distribution. *Neural Computation*, 13(7), 1443–1471.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Serra, O. (2026e). AMYGDALA v0.1: Adaptive Modulation of Your General Disposition via Affective Learned Association. *Independent Research*.",
   "marked": "{+Serra, O. (2026e). AMYGDALA v0.1: Adaptive Modulation of Your General Disposition via Affective Learned Association. *Independent Research*.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Serra, O. (2026f). AEGIS: Multi-Layer Security Framework for Autonomous Agents. *Independent Research*.",
   "marked": "{+Serra, O. (2026f). AEGIS: Multi-Layer Security Framework for Autonomous Agents. *Independent Research*.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Shinn, N., et al. (2023). Reflexion: Language agents with verbal reinforcement learning. *NeurIPS 2023*.",
   "marked": "{+Shinn, N., et al. (2023). Reflexion: Language agents with verbal reinforcement learning. *NeurIPS 2023*.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "Vovk, V., Gammerman, A., & Shafer, G. (2005). *Algorithmic Learning in a Random World*. Springer.",
   "marked": "{+Vovk, V., Gammerman, A., & Shafer, G. (2005). *Algorithmic Learning in a Random World*. Springer.+}"
  },
  {
   "section": "References",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "## Appendix A: Situation Template Reference",
   "marked": "{+## Appendix A: Situation Template Reference+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "Complete template specification for AMYGDALA v1.0 situation descriptions.",
   "marked": "{+Complete template specification for AMYGDALA v1.0 situation descriptions.+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "```yaml # AMYGDALA Situation Template v1.0 # All fields are required unless marked (optional)",
   "marked": "{+```yaml # AMYGDALA Situation Template v1.0 # All fields are required unless marked (optional)+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "action_type: type: enum values: [overwrite, delete, send, merge, create, modify, execute, deploy, revert, move, copy] source: action_request # programmatic",
   "marked": "{+action_type: type: enum values: [overwrite, delete, send, merge, create, modify, execute, deploy, revert, move, copy] source: action_request # programmatic+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "target_type: type: enum values: [file, email, message, database, api_call, git_operation, system_command, configuration, deployment] source: lookup_table # programmatic",
   "marked": "{+target_type: type: enum values: [file, email, message, database, api_call, git_operation, system_command, configuration, deployment] source: lookup_table # programmatic+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "target_id: type: string source: action_request # programmatic",
   "marked": "{+target_id: type: string source: action_request # programmatic+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "target_metadata: age_hours: type: float source: filesystem # programmatic (stat) default: -1 # unknown size: type: integer unit: bytes source: filesystem # programmatic (stat) default: 0 recent_commits: type: integer window: 72h source: git # programmatic (git log) default: 0 recent_authors: type: integer window: 72h source: git # programmatic (git log) default: 0 effort_hours: type: float source: heuristic + LLM # cross-checked (§8.3) weight: 0.3 # low trust default: 0.0 last_human_ref: type: float unit: hours_ago source: transcript_search # programmatic default: -1 # unknown",
   "marked": "{+target_metadata: age_hours: type: float source: filesystem # programmatic (stat) default: -1 # unknown size: type: integer unit: bytes source: filesystem # programmatic (stat) default: 0 recent_commits: type: integer window: 72h source: git # programmatic (git log) default: 0 recent_authors: type: integer window: 72h source: git # programmatic (git log) default: 0 effort_hours: type: float source: heuristic + LLM # cross-checked (§8.3) weight: 0.3 # low trust default: 0.0 last_human_ref: type: float unit: hours_ago source: transcript_search # programmatic default: -1 # unknown+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "context: session_topic: type: string source: LLM # low weight weight: 0.3 default: \"unknown\" recent_corrections: type: integer window: 24h source: runtime_counter # programmatic default: 0 emotional_signals: type: enum values: [calm, frustrated, excited, focused, playful, terse, unknown] source: LLM + heuristic # cross-checked weight: 0.3 default: \"unknown\" automation_depth: type: integer source: stack_trace # programmatic default: 0",
   "marked": "{+context: session_topic: type: string source: LLM # low weight weight: 0.3 default: \"unknown\" recent_corrections: type: integer window: 24h source: runtime_counter # programmatic default: 0 emotional_signals: type: enum values: [calm, frustrated, excited, focused, playful, terse, unknown] source: LLM + heuristic # cross-checked weight: 0.3 default: \"unknown\" automation_depth: type: integer source: stack_trace # programmatic default: 0+}"
  },
  {
   "section": "Appendix A: Situation Template Reference",
   "old": null,
   "new": "scope: reversible: type: enum values: [true, false, partial] source: lookup_table # programmatic default: \"partial\" blast_radius: type: enum values: [self, session, persistent, external] source: lookup_table # programmatic default: \"persistent\" human_in_loop: type: boolean source: runtime_flag # programmatic default: false confirmation: type: enum values: [none, soft, hard] source: runtime_flag # programmatic default: \"none\" ```",
   "marked": "{+scope: reversible: type: enum values: [true, false, partial] source: lookup_table # programmatic default: \"partial\" blast_radius: type: enum values: [self, session, persistent, external] source: lookup_table # programmatic default: \"persistent\" human_in_loop: type: boolean source: runtime_flag # programmatic default: false confirmation: type: enum values: [none, soft, hard] source: runtime_flag # programmatic default: \"none\" ```+}"
  },
  {
   "section": "Template Serialisation",
   "old": null,
   "new": "### Template Serialisation",
   "marked": "{+### Template Serialisation+}"
  },
  {
   "section": "Template Serialisation",
   "old": null,
   "new": "The completed template is serialised to natural language via a deterministic formatter:",
   "marked": "{+The completed template is serialised to natural language via a deterministic formatter:+}"
  },
  {
   "section": "Template Serialisation",
   "old": null,
   "new": "``` Action: {action_type} {target_type} \"{target_id}\". Target: {size} bytes, {age_hours:.0f}h old, {recent_commits} commits by {recent_authors} authors in 72h. Effort: ~{effort_hours:.1f}h invested, last mentioned {last_human_ref:.0f}h ago. Context: {session_topic}. {recent_corrections} corrections in 24h. Mood: {emotional_signals}. Automation depth: {automation_depth}. Reversible: {reversible}. Blast: {blast_radius}. Human in loop: {human_in_loop}. Confirmation: {confirmation}. ```",
   "marked": "{+``` Action: {action_type} {target_type} \"{target_id}\". Target: {size} bytes, {age_hours:.0f}h old, {recent_commits} commits by {recent_authors} authors in 72h. Effort: ~{effort_hours:.1f}h invested, last mentioned {last_human_ref:.0f}h ago. Context: {session_topic}. {recent_corrections} corrections in 24h. Mood: {emotional_signals}. Automation depth: {automation_depth}. Reversible: {reversible}. Blast: {blast_radius}. Human in loop: {human_in_loop}. Confirmation: {confirmation}. ```+}"
  },
  {
   "section": "Template Serialisation",
   "old": null,
   "new": "This serialised string is the input to the sentence encoder.",
   "marked": "{+This serialised string is the input to the sentence encoder.+}"
  },
  {
   "section": "Template Serialisation",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix B: Architecture Hyperparameter Details",
   "old": null,
   "new": "## Appendix B: Architecture Hyperparameter Details",
   "marked": "{+## Appendix B: Architecture Hyperparameter Details+}"
  },
  {
   "section": "B.1 GRU-MLP",
   "old": null,
   "new": "### B.1 GRU-MLP",
   "marked": "{+### B.1 GRU-MLP+}"
  },
  {
   "section": "B.1 GRU-MLP",
   "old": null,
   "new": "```python class GRUMPL(nn.Module): def __init__(self): self.gru = nn.GRU(input_size=384, hidden_size=128, num_layers=1, batch_first=True) self.mlp = nn.Sequential( nn.Linear(128, 64), nn.LayerNorm(64), nn.GELU(), nn.Linear(64, 32), nn.LayerNorm(32), nn.GELU(), ) self.action_head = nn.Sequential(nn.Linear(32, 1), nn.Sigmoid()) self.retrieval_head = nn.Sequential(nn.Linear(32, 6), nn.Sigmoid()) self.tone_head = nn.Sequential(nn.Linear(32, 4), nn.Sigmoid()) self.curiosity_head = nn.Sequential(nn.Linear(32, 1), nn.Sigmoid()) ```",
   "marked": "{+```python class GRUMPL(nn.Module): def __init__(self): self.gru = nn.GRU(input_size=384, hidden_size=128, num_layers=1, batch_first=True) self.mlp = nn.Sequential( nn.Linear(128, 64), nn.LayerNorm(64), nn.GELU(), nn.Linear(64, 32), nn.LayerNorm(32), nn.GELU(), ) self.action_head = nn.Sequential(nn.Linear(32, 1), nn.Sigmoid()) self.retrieval_head = nn.Sequential(nn.Linear(32, 6), nn.Sigmoid()) self.tone_head = nn.Sequential(nn.Linear(32, 4), nn.Sigmoid()) self.curiosity_head = nn.Sequential(nn.Linear(32, 1), nn.Sigmoid()) ```+}"
  },
  {
   "section": "B.2 TCN",
   "old": null,
   "new": "### B.2 TCN",
   "marked": "{+### B.2 TCN+}"
  },
  {
   "section": "B.2 TCN",
   "old": null,
   "new": "```python class TCN(nn.Module): def __init__(self): self.layers = nn.ModuleList([ CausalConv1d(384, 128, kernel_size=3, dilation=1), CausalConv1d(128, 128, kernel_size=3, dilation=2), CausalConv1d(128, 128, kernel_size=3, dilation=4), CausalConv1d(128, 64, kernel_size=3, dilation=8), ]) # Same output heads as GRU-MLP ```",
   "marked": "{+```python class TCN(nn.Module): def __init__(self): self.layers = nn.ModuleList([ CausalConv1d(384, 128, kernel_size=3, dilation=1), CausalConv1d(128, 128, kernel_size=3, dilation=2), CausalConv1d(128, 128, kernel_size=3, dilation=4), CausalConv1d(128, 64, kernel_size=3, dilation=8), ]) # Same output heads as GRU-MLP ```+}"
  },
  {
   "section": "B.3 Transformer-Micro",
   "old": null,
   "new": "### B.3 Transformer-Micro",
   "marked": "{+### B.3 Transformer-Micro+}"
  },
  {
   "section": "B.3 Transformer-Micro",
   "old": null,
   "new": "```python class TransformerMicro(nn.Module): def __init__(self): self.input_proj = nn.Linear(384, 96) self.pos_encoding = nn.Embedding(32, 96) self.encoder = nn.TransformerEncoder( nn.TransformerEncoderLayer(d_model=96, nhead=4, dim_feedforward=192, dropout=0.1), num_layers=2 ) self.pool = nn.AdaptiveAvgPool1d(1) # Output heads from 96-d ```",
   "marked": "{+```python class TransformerMicro(nn.Module): def __init__(self): self.input_proj = nn.Linear(384, 96) self.pos_encoding = nn.Embedding(32, 96) self.encoder = nn.TransformerEncoder( nn.TransformerEncoderLayer(d_model=96, nhead=4, dim_feedforward=192, dropout=0.1), num_layers=2 ) self.pool = nn.AdaptiveAvgPool1d(1) # Output heads from 96-d ```+}"
  },
  {
   "section": "B.4 Dual-Encoder",
   "old": null,
   "new": "### B.4 Dual-Encoder",
   "marked": "{+### B.4 Dual-Encoder+}"
  },
  {
   "section": "B.4 Dual-Encoder",
   "old": null,
   "new": "```python class DualEncoder(nn.Module): def __init__(self): self.action_encoder = nn.Linear(384, 128) self.context_gru = nn.GRU(384, 128, batch_first=True) self.cross_attn = nn.MultiheadAttention(128, num_heads=4, batch_first=True) self.fusion = nn.Sequential( nn.Linear(256, 64), nn.LayerNorm(64), nn.GELU() ) # Output heads from 64-d ```",
   "marked": "{+```python class DualEncoder(nn.Module): def __init__(self): self.action_encoder = nn.Linear(384, 128) self.context_gru = nn.GRU(384, 128, batch_first=True) self.cross_attn = nn.MultiheadAttention(128, num_heads=4, batch_first=True) self.fusion = nn.Sequential( nn.Linear(256, 64), nn.LayerNorm(64), nn.GELU() ) # Output heads from 64-d ```+}"
  },
  {
   "section": "B.5 Ensemble MLP",
   "old": null,
   "new": "### B.5 Ensemble MLP",
   "marked": "{+### B.5 Ensemble MLP+}"
  },
  {
   "section": "B.5 Ensemble MLP",
   "old": null,
   "new": "```python class EnsembleMLP(nn.Module): def __init__(self): self.heads = nn.ModuleList([ nn.Sequential( nn.Linear(384, 128), nn.LayerNorm(128), nn.GELU(), nn.Dropout(0.1), nn.Linear(128, 64), nn.LayerNorm(64), nn.GELU(), ) for _ in range(3) ]) self.output_heads = nn.ModuleList([ MultiHeadOutput(64) for _ in range(3) # action, retrieval, tone, curiosity ])",
   "marked": "{+```python class EnsembleMLP(nn.Module): def __init__(self): self.heads = nn.ModuleList([ nn.Sequential( nn.Linear(384, 128), nn.LayerNorm(128), nn.GELU(), nn.Dropout(0.1), nn.Linear(128, 64), nn.LayerNorm(64), nn.GELU(), ) for _ in range(3) ]) self.output_heads = nn.ModuleList([ MultiHeadOutput(64) for _ in range(3) # action, retrieval, tone, curiosity ])+}"
  },
  {
   "section": "B.5 Ensemble MLP",
   "old": null,
   "new": "def forward(self, x): outputs = [head(x) for head, out in zip(self.heads, self.output_heads)] # For action_confidence: min across heads (conservative) # For others: mean across heads ```",
   "marked": "{+def forward(self, x): outputs = [head(x) for head, out in zip(self.heads, self.output_heads)] # For action_confidence: min across heads (conservative) # For others: mean across heads ```+}"
  },
  {
   "section": "B.5 Ensemble MLP",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "## Appendix C: Catastrophic Failure Database Schema",
   "marked": "{+## Appendix C: Catastrophic Failure Database Schema+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "```sql CREATE TABLE cfd_entries ( id INTEGER PRIMARY KEY, source TEXT NOT NULL, -- 'aiid' | 'aiaaic' | 'mit' | 'vectara' | 'chaos' | 'production' | 'internal' source_id TEXT, -- original identifier in source database title TEXT NOT NULL, description TEXT NOT NULL, date_occurred DATE,",
   "marked": "{+```sql CREATE TABLE cfd_entries ( id INTEGER PRIMARY KEY, source TEXT NOT NULL, -- 'aiid' | 'aiaaic' | 'mit' | 'vectara' | 'chaos' | 'production' | 'internal' source_id TEXT, -- original identifier in source database title TEXT NOT NULL, description TEXT NOT NULL, date_occurred DATE,+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "-- Taxonomy failure_mechanism TEXT NOT NULL, -- F1-F7 reversibility TEXT NOT NULL, -- R1-R3 blast_radius TEXT NOT NULL, -- B1-B4 detection_difficulty TEXT NOT NULL, -- D1-D3",
   "marked": "{+-- Taxonomy failure_mechanism TEXT NOT NULL, -- F1-F7 reversibility TEXT NOT NULL, -- R1-R3 blast_radius TEXT NOT NULL, -- B1-B4 detection_difficulty TEXT NOT NULL, -- D1-D3+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "-- Situation template (JSON) situation_template TEXT NOT NULL,",
   "marked": "{+-- Situation template (JSON) situation_template TEXT NOT NULL,+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "-- Embedding (BLOB, 384d float32) situation_embedding BLOB,",
   "marked": "{+-- Embedding (BLOB, 384d float32) situation_embedding BLOB,+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "-- Labels action_confidence_target REAL NOT NULL DEFAULT 0.0,",
   "marked": "{+-- Labels action_confidence_target REAL NOT NULL DEFAULT 0.0,+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "-- Metadata created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, verified BOOLEAN DEFAULT FALSE, notes TEXT );",
   "marked": "{+-- Metadata created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, verified BOOLEAN DEFAULT FALSE, notes TEXT );+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "CREATE INDEX idx_cfd_mechanism ON cfd_entries(failure_mechanism); CREATE INDEX idx_cfd_source ON cfd_entries(source); CREATE INDEX idx_cfd_blast ON cfd_entries(blast_radius); ```",
   "marked": "{+CREATE INDEX idx_cfd_mechanism ON cfd_entries(failure_mechanism); CREATE INDEX idx_cfd_source ON cfd_entries(source); CREATE INDEX idx_cfd_blast ON cfd_entries(blast_radius); ```+}"
  },
  {
   "section": "Appendix C: Catastrophic Failure Database Schema",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix D: Comparison with v0.1",
   "old": null,
   "new": "## Appendix D: Comparison with v0.1",
   "marked": "{+## Appendix D: Comparison with v0.1+}"
  },
  {
   "section": "Appendix D: Comparison with v0.1",
   "old": null,
   "new": "| Aspect | v0.1 | v1.0 | |--------|------|------| | Primary output | Retrieval bias, tone, humor | **Action confidence** | | Input representation | 30 hand-crafted features | **Situation embeddings (384d)** | | Temporal model | None (feedforward) | **GRU / TCN / Transformer / Dual-Encoder** | | Parameter count | ~200K–350K | **150K–310K (per architecture)** | | Network count | 1 | **5 (trained in parallel)** | | Training data | Interaction logs only | **Interaction logs + CFD + synthetic** | | Personality modulation | Primary | **Secondary (retained)** | | Action gating | Not present | **Primary** | | LLM-proof pipeline | Not addressed | **Core engineering contribution** | | Failure database | Not present | **CFD with taxonomy** | | Trust ramp | Present | **Retained, adapted for safety** | | Rule-intuition boundary | Present | **Retained, with maturation cycle** | | Integration | HIPPOCAMPUS, CORTEX, LIMBIC | **All action-taking components** |",
   "marked": "{+| Aspect | v0.1 | v1.0 | |--------|------|------| | Primary output | Retrieval bias, tone, humor | **Action confidence** | | Input representation | 30 hand-crafted features | **Situation embeddings (384d)** | | Temporal model | None (feedforward) | **GRU / TCN / Transformer / Dual-Encoder** | | Parameter count | ~200K–350K | **150K–310K (per architecture)** | | Network count | 1 | **5 (trained in parallel)** | | Training data | Interaction logs only | **Interaction logs + CFD + synthetic** | | Personality modulation | Primary | **Secondary (retained)** | | Action gating | Not present | **Primary** | | LLM-proof pipeline | Not addressed | **Core engineering contribution** | | Failure database | Not present | **CFD with taxonomy** | | Trust ramp | Present | **Retained, adapted for safety** | | Rule-intuition boundary | Present | **Retained, with maturation cycle** | | Integration | HIPPOCAMPUS, CORTEX, LIMBIC | **All action-taking components** |+}"
  },
  {
   "section": "Appendix D: Comparison with v0.1",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "Appendix D: Comparison with v0.1",
   "old": null,
   "new": "*Version history:* - *v0.1 (21 March 2026) — Initial proposal focused on personality modulation* - *v1.0 (22 March 2026) — Major rewrite: action gating as primary function, situation embeddings, five competing architectures, Catastrophic Failure Database, LLM-proof programmatic pipeline*",
   "marked": "{+*Version history:* - *v0.1 (21 March 2026) — Initial proposal focused on personality modulation* - *v1.0 (22 March 2026) — Major rewrite: action gating as primary function, situation embeddings, five competing architectures, Catastrophic Failure Database, LLM-proof programmatic pipeline*+}"
  }
 ]
}
