{
 "paper": "prefrontal-orchestration",
 "a": "3.0",
 "b": "3.1",
 "summary": "From v3.0 (7 Apr) to v3.1 (7 Apr): 6,032 words to 5,410 words, 206 words in new or rewritten paragraphs and 828 taken out, 64 paragraphs changed.",
 "note": {
  "title": "Tightened, with a short limitations section",
  "kind": "revision",
  "body": "## Summary\n\nA tightening pass of v3.0: about 600 words shorter, same thesis and structure.\n\n- Cuts repetition in the introduction, the cycle description and the cost analysis.\n- Adds section 6.5 on failure modes and limitations.",
  "source": "change note"
 },
 "paragraphs_changed": 64,
 "changes": [
  {
   "section": "PREFRONTAL v3.1: From Guard Rails to Recipe Engine --- How Structured Orchestration Compounds Agent Intelligence",
   "old": "# PREFRONTAL v3.0: From Guard Rails to Recipe Engine --- How Structured Orchestration Compounds Agent Intelligence",
   "new": "# PREFRONTAL v3.1: From Guard Rails to Recipe Engine --- How Structured Orchestration Compounds Agent Intelligence",
   "marked": "# PREFRONTAL [-v3.0:-] {+v3.1:+} From Guard Rails to Recipe Engine --- How Structured Orchestration Compounds Agent Intelligence"
  },
  {
   "section": "PREFRONTAL v3.1: From Guard Rails to Recipe Engine --- How Structured Orchestration Compounds Agent Intelligence",
   "old": "**Oscar Serra^1^, Jarvis^1^** ^1^Independent Research *7 April 2026 --- v3.0*",
   "new": "**Oscar Serra^1^, Jarvis^1^** ^1^Independent Research *7 April 2026 --- v3.1*",
   "marked": "**Oscar Serra^1^, Jarvis^1^** ^1^Independent Research *7 April 2026 --- [-v3.0*-] {+v3.1*+}"
  },
  {
   "section": "Abstract",
   "old": "The gap between preventing bad behaviour and enabling great behaviour is the central challenge of agent architecture. Version 2.4 of this paper proposed compounded intelligence through fractal reflection --- a post-action review cycle that converts events into reusable rules. Six months of deployment validated the compounding hypothesis (CII +96%), but exposed a structural asymmetry: the architecture excels at *stopping agents from doing the wrong thing* (exploration gates, anti-gold-plating rules, denial tracking) yet provides no machinery for *guiding agents to do the right thing in the right order*. Guards prevent mistakes; they do not produce excellence.",
   "new": "The gap between preventing bad behaviour and enabling great behaviour is the central challenge of agent architecture. Version 2.4 of this paper proposed compounded intelligence through fractal reflection --- a post-action review cycle that converts events into reusable rules. Deployment validated the compounding hypothesis (+96% CII) but exposed a structural asymmetry: guards prevent mistakes but do not guide excellence.",
   "marked": "The gap between preventing bad behaviour and enabling great behaviour is the central challenge of agent architecture. Version 2.4 of this paper proposed compounded intelligence through fractal reflection --- a post-action review cycle that converts events into reusable rules. [-Six months of deployment-] {+Deployment+} validated the compounding hypothesis [-(CII +96%),-] {+(+96% CII)+} but exposed a structural asymmetry: [-the architecture excels at *stopping agents from doing the wrong thing* (exploration gates, anti-gold-plating rules, denial tracking) yet provides no machinery for *guiding agents to do the right thing in the right order*. Guards-] {+guards+} prevent [-mistakes; they-] {+mistakes but+} do not [-produce-] {+guide+} excellence."
  },
  {
   "section": "Abstract",
   "old": "This paper introduces Prefrontal v3.0, a major architectural revision that transforms the orchestration layer from a passive guard system into an active **recipe execution engine**. The key insight comes from convergent evolution across three independent systems: Anthropic's Claude Code achieves its effectiveness through *skills* --- structured workflow prompts injected on demand that decompose complex tasks into ordered steps; Journey Kits (Berman, 2026) demonstrates that the commercial value of AI agents lies not in the model but in the structured *recipe* wrapped around it; and our own `prefrontal-prompt.md`, a rich orchestration prompt that has sat unused in the codebase for months, already encodes the recipe format we now propose to execute.",
   "new": "This paper introduces Prefrontal v3.1, a major architectural revision that transforms the orchestration layer from a passive guard system into an active **recipe execution engine**. The key insight comes from convergent evolution across three independent systems: Anthropic's Claude Code achieves its effectiveness through *skills* --- structured workflow prompts injected on demand that decompose complex tasks into ordered steps; Journey Kits (Berman, 2026) demonstrates that the commercial value of AI agents lies not in the model but in the structured *recipe* wrapped around it; and our own `prefrontal-prompt.md`, a rich orchestration prompt that has sat unused in the codebase for months, already encodes the recipe format we now propose to execute.",
   "marked": "This paper introduces Prefrontal [-v3.0,-] {+v3.1,+} a major architectural revision that transforms the orchestration layer from a passive guard system into an active **recipe execution engine**. The key insight comes from convergent evolution across three independent systems: Anthropic's Claude Code achieves its effectiveness through *skills* --- structured workflow prompts injected on demand that decompose complex tasks into ordered steps; Journey Kits (Berman, 2026) demonstrates that the commercial value of AI agents lies not in the model but in the structured *recipe* wrapped around it; and our own `prefrontal-prompt.md`, a rich orchestration prompt that has sat unused in the codebase for months, already encodes the recipe format we now propose to execute."
  },
  {
   "section": "1.1 Why Claude Code Works",
   "old": "In March 2026, an accidental source code exposure revealed the internal architecture of Anthropic's Claude Code, the commercially leading AI coding agent. The architecture's effectiveness derives not from a superior model --- Claude Code runs the same Sonnet and Opus models available to all API users --- but from a `while(true)` agentic loop wrapped in three structural mechanisms:",
   "new": "In March 2026, an accidental source code exposure revealed the internal architecture of Anthropic's Claude Code, the commercially leading AI coding agent. Its effectiveness derives not from a superior model, but from a `while(true)` loop wrapped in three mechanisms:",
   "marked": "In March 2026, an accidental source code exposure revealed the internal architecture of Anthropic's Claude Code, the commercially leading AI coding agent. [-The architecture's-] {+Its+} effectiveness derives not from a superior [-model --- Claude Code runs the same Sonnet and Opus models available to all API users ----] {+model,+} but from a `while(true)` [-agentic-] loop wrapped in three [-structural-] mechanisms:"
  },
  {
   "section": "1.1 Why Claude Code Works",
   "old": "The system prompt encodes specific anti-patterns observed in production --- \"avoid using `find` or `grep` commands when dedicated tools exist,\" \"never skip hooks with `--no-verify`,\" \"prefer editing existing files to creating new ones.\" These are not generic safety rules; they are *learned operational recipes* distilled from production failure patterns.",
   "new": null,
   "marked": "[-The system prompt encodes specific anti-patterns observed in production --- \"avoid using `find` or `grep` commands when dedicated tools exist,\" \"never skip hooks with `--no-verify`,\" \"prefer editing existing files to creating new ones.\" These are not generic safety rules; they are *learned operational recipes* distilled from production failure patterns.-]"
  },
  {
   "section": "1.1 Why Claude Code Works",
   "old": null,
   "new": "These are operational recipes distilled from failures.",
   "marked": "{+These are operational recipes distilled from failures.+}"
  },
  {
   "section": "1.2 The Journey Kits Thesis",
   "old": "Matthew Berman's Journey Kits (journeykits.ai, 2026) crystallises an insight that was implicit in the Claude Code analysis: **the value is not the model --- it is the structured workflow wrapped around it**. Journey Kits proposes an \"npm for AI agent workflows\" --- a registry of reusable recipes that bundle skills, source code, documentation, and metadata into distributable packages.",
   "new": "Matthew Berman's Journey Kits (journeykits.ai, 2026) makes clear an insight that was implicit in the Claude Code analysis: **the value is not the model --- it is the structured workflow wrapped around it**. Journey Kits proposes an \"npm for AI agent workflows\" --- a registry of reusable recipes that bundle skills, source code, documentation, and metadata into distributable packages.",
   "marked": "Matthew Berman's Journey Kits (journeykits.ai, 2026) [-crystallises-] {+makes clear+} an insight that was implicit in the Claude Code analysis: **the value is not the model --- it is the structured workflow wrapped around it**. Journey Kits proposes an \"npm for AI agent workflows\" --- a registry of reusable recipes that bundle skills, source code, documentation, and metadata into distributable packages."
  },
  {
   "section": "1.2 The Journey Kits Thesis",
   "old": "The thesis is provocative in its directness: if you give the same model to two teams, the one with better recipes wins. The model is the commodity; the recipe is the differentiator. This inverts the conventional wisdom that model capability is the primary driver of agent quality.",
   "new": "The thesis is direct: if you give the same model to two teams, the one with better recipes wins. The model is the commodity; the recipe is the differentiator. This inverts the conventional wisdom that model capability is the primary driver of agent quality.",
   "marked": "The thesis is [-provocative in its directness:-] {+direct:+} if you give the same model to two teams, the one with better recipes wins. The model is the commodity; the recipe is the differentiator. This inverts the conventional wisdom that model capability is the primary driver of agent quality."
  },
  {
   "section": "1.3 The v2.4 Gap",
   "old": "Version 2.4 of this paper promised compounded intelligence through fractal reflection --- \"the compounding engine\" that converts events into reusable rules at multiple abstraction levels. The implementation delivered:",
   "new": "Version 2.4 of this paper promised compounded intelligence through fractal reflection --- \"the compounding engine\" that converts events into reusable rules at multiple abstraction levels. The implementation delivered guards, observability, and monitoring, but lacked a navigation system for agents.",
   "marked": "Version 2.4 of this paper promised compounded intelligence through fractal reflection --- \"the compounding engine\" that converts events into reusable rules at multiple abstraction levels. The implementation [-delivered:-] {+delivered guards, observability, and monitoring, but lacked a navigation system for agents.+}"
  },
  {
   "section": "1.3 The v2.4 Gap",
   "old": "- **Guards**: exploration gate (must read before writing), anti-gold-plating rules (11 engineering discipline injections), denial tracking (escalate after 3 denials), permission hooks (user-defined shell script gates). - **Observability**: FAAR tracker (task outcome recording), effort router (expensive model warnings), CORF trigger (high-stakes decision flagging), feature flags (per-hook enable/disable). - **Monitoring**: call tree panel (real-time agent topology), guardian process (3-minute health checks).",
   "new": null,
   "marked": "[-- **Guards**: exploration gate (must read before writing), anti-gold-plating rules (11 engineering discipline injections), denial tracking (escalate after 3 denials), permission hooks (user-defined shell script gates). - **Observability**: FAAR tracker (task outcome recording), effort router (expensive model warnings), CORF trigger (high-stakes decision flagging), feature flags (per-hook enable/disable). - **Monitoring**: call tree panel (real-time agent topology), guardian process (3-minute health checks).-]"
  },
  {
   "section": "1.3 The v2.4 Gap",
   "old": "What v2.4 did *not* deliver was the central thesis of the paper --- the compounding engine itself. Fractal reflection, described in Section 3.1 of v2.4 as the primary mechanism of intelligence compounding, exists only as a prompt template (`prefrontal-prompt.md`) that was never wired into the execution pipeline. The four-question reflection protocol (MEMORY, PATTERN, RIPPLE, IMPROVE) runs only when the agent voluntarily follows the system prompt's instructions, which it does inconsistently.",
   "new": "v2.4 omitted the compounding engine itself. Fractal reflection, described in Section 3.1 of v2.4 as the primary mechanism of intelligence compounding, exists only as a prompt template (`prefrontal-prompt.md`) that was never wired into the execution pipeline. The four-question reflection protocol (MEMORY, PATTERN, RIPPLE, IMPROVE) runs only when the agent voluntarily follows the system prompt's instructions, which it does inconsistently.",
   "marked": "[-What-] v2.4 [-did *not* deliver was the central thesis of the paper ----] {+omitted+} the compounding engine itself. Fractal reflection, described in Section 3.1 of v2.4 as the primary mechanism of intelligence compounding, exists only as a prompt template (`prefrontal-prompt.md`) that was never wired into the execution pipeline. The four-question reflection protocol (MEMORY, PATTERN, RIPPLE, IMPROVE) runs only when the agent voluntarily follows the system prompt's instructions, which it does inconsistently."
  },
  {
   "section": "1.3 The v2.4 Gap",
   "old": "The gap is structural: v2.4 built the *guardrails of a highway* but not *the highway itself*. Drivers (agents) are prevented from going off-road, but there is no navigation system telling them which exit to take.",
   "new": null,
   "marked": "[-The gap is structural: v2.4 built the *guardrails of a highway* but not *the highway itself*. Drivers (agents) are prevented from going off-road, but there is no navigation system telling them which exit to take.-]"
  },
  {
   "section": "1.4 The Cache-Shared First Call",
   "old": "The architectural insight that enables v3.0 is economic. Anthropic's prompt cache means that a second LLM call with *nearly the same context* as the first is dramatically cheaper than two independent calls. If the system prompt, SOUL.md, memory hierarchy, and session history are identical between calls, only the differing portion (the orchestration instruction vs. the task instruction) incurs full token cost.",
   "new": "The architectural insight that enables v3.1 is economic. Anthropic's prompt cache means that a second LLM call with *nearly the same context* as the first is dramatically cheaper than two independent calls. If the system prompt, SOUL.md, memory hierarchy, and session history are identical between calls, only the differing portion (the orchestration instruction vs. the task instruction) incurs full token cost.",
   "marked": "The architectural insight that enables [-v3.0-] {+v3.1+} is economic. Anthropic's prompt cache means that a second LLM call with *nearly the same context* as the first is dramatically cheaper than two independent calls. If the system prompt, SOUL.md, memory hierarchy, and session history are identical between calls, only the differing portion (the orchestration instruction vs. the task instruction) incurs full token cost."
  },
  {
   "section": "1.4 The Cache-Shared First Call",
   "old": "This means Prefrontal can become a **first call** --- receiving the user's message, selecting a recipe, planning the execution --- at approximately 5% token overhead. The orchestration is not a luxury; it is nearly free.",
   "new": null,
   "marked": "[-This means Prefrontal can become a **first call** --- receiving the user's message, selecting a recipe, planning the execution --- at approximately 5% token overhead. The orchestration is not a luxury; it is nearly free.-]"
  },
  {
   "section": "1.4 The Cache-Shared First Call",
   "old": null,
   "new": "Prefrontal becomes a **first call**, planning execution at ~5% overhead. Orchestration is nearly free.",
   "marked": "{+Prefrontal becomes a **first call**, planning execution at ~5% overhead. Orchestration is nearly free.+}"
  },
  {
   "section": "2.1 System Overview",
   "old": "Prefrontal v3.0 introduces a three-phase cognitive cycle that wraps every agent interaction:",
   "new": "Prefrontal v3.1 introduces a three-phase cognitive cycle that wraps every agent interaction:",
   "marked": "Prefrontal [-v3.0-] {+v3.1+} introduces a three-phase cognitive cycle that wraps every agent interaction:"
  },
  {
   "section": "2.1 System Overview",
   "old": "For simple requests (greetings, quick lookups, single-tool operations), Phase 1 collapses to a lightweight classification that bypasses recipe selection entirely. The overhead is incurred only when it produces value.",
   "new": null,
   "marked": "[-For simple requests (greetings, quick lookups, single-tool operations), Phase 1 collapses to a lightweight classification that bypasses recipe selection entirely. The overhead is incurred only when it produces value.-]"
  },
  {
   "section": "2.1 System Overview",
   "old": null,
   "new": "For simple requests, Phase 1 bypasses recipe selection to avoid overhead.",
   "marked": "{+For simple requests, Phase 1 bypasses recipe selection to avoid overhead.+}"
  },
  {
   "section": "2.2 Prefrontal as First Call",
   "old": "The traditional agent architecture processes user messages directly: the message enters the model alongside the system prompt, and the model decides what to do. Prefrontal v3.0 interposes an orchestration layer:",
   "new": "The traditional agent architecture processes user messages directly: the message enters the model alongside the system prompt, and the model decides what to do. Prefrontal v3.1 interposes an orchestration layer:",
   "marked": "The traditional agent architecture processes user messages directly: the message enters the model alongside the system prompt, and the model decides what to do. Prefrontal [-v3.0-] {+v3.1+} interposes an orchestration layer:"
  },
  {
   "section": "2.2 Prefrontal as First Call",
   "old": "The critical design decision is that Prefrontal does *not* replace the main agent --- it *prepends* to it. The main agent retains full autonomy; the recipe provides structure, not constraint. This preserves the flexibility that makes LLM agents valuable while adding the predictability that makes them reliable.",
   "new": "The critical design decision is that Prefrontal does *not* replace the main agent, nor does it introduce a separate \"manager agent\". Prefrontal is a cache-shared first call using the *exact same agent*, simply prepending the recipe. The main agent retains full autonomy; the recipe provides structure, not bureaucratic constraint. This preserves the flexibility that makes LLM agents valuable while adding the predictability that makes them reliable.",
   "marked": "The critical design decision is that Prefrontal does *not* replace the main [-agent ----] {+agent, nor does+} it [-*prepends* to it.-] {+introduce a separate \"manager agent\". Prefrontal is a cache-shared first call using the *exact same agent*, simply prepending the recipe.+} The main agent retains full autonomy; the recipe provides structure, not {+bureaucratic+} constraint. This preserves the flexibility that makes LLM agents valuable while adding the predictability that makes them reliable."
  },
  {
   "section": "2.4 Subagent Parallelism",
   "old": "For tasks that decompose naturally --- \"investigate this bug, fix it, and write tests\" --- Prefrontal fans out parallel subagents:",
   "new": null,
   "marked": "[-For tasks that decompose naturally --- \"investigate this bug, fix it, and write tests\" --- Prefrontal fans out parallel subagents:-]"
  },
  {
   "section": "2.4 Subagent Parallelism",
   "old": null,
   "new": "For decomposable tasks, Prefrontal fans out parallel subagents:",
   "marked": "{+For decomposable tasks, Prefrontal fans out parallel subagents:+}"
  },
  {
   "section": "2.4 Subagent Parallelism",
   "old": "- **Fork subagents** inherit the parent's rendered prompt (cache-shared) and receive a scoped task: \"investigate the stack trace,\" \"write a failing test,\" \"check for similar patterns in the codebase.\" Each subagent has an isolated tool set appropriate to its task (read-only for investigation, write-enabled for implementation).",
   "new": "- **Fork subagents** inherit the parent's rendered prompt (cache-shared) and receive a scoped task: \"investigate the stack trace,\" \"write a failing test,\" \"check for similar patterns in the codebase.\"",
   "marked": "- **Fork subagents** inherit the parent's rendered prompt (cache-shared) and receive a scoped task: \"investigate the stack trace,\" \"write a failing test,\" \"check for similar patterns in the [-codebase.\" Each subagent has an isolated tool set appropriate to its task (read-only for investigation, write-enabled for implementation).-] {+codebase.\"+}"
  },
  {
   "section": "Failure Handlers - Step 1 fails (cannot reproduce): Gather more information from user - Step 4 fails (fix too complex): Escalate to user with analysis - Step 5 fails (tests break): Revert and re-analyse ```",
   "old": "The format is deliberately human-readable. Recipes are markdown files, editable in any text editor, storable in the memory hierarchy, and versionable through git. This follows the same design philosophy as the tiered memory system (Section 3.2 of v2.4): transparency, portability, and composability over sophistication.",
   "new": null,
   "marked": "[-The format is deliberately human-readable. Recipes are markdown files, editable in any text editor, storable in the memory hierarchy, and versionable through git. This follows the same design philosophy as the tiered memory system (Section 3.2 of v2.4): transparency, portability, and composability over sophistication.-]"
  },
  {
   "section": "Failure Handlers - Step 1 fails (cannot reproduce): Gather more information from user - Step 4 fails (fix too complex): Escalate to user with analysis - Step 5 fails (tests break): Revert and re-analyse ```",
   "old": null,
   "new": "Recipes are human-readable markdown files, editable, storable in memory, and versionable via git, favouring transparency and composability.",
   "marked": "{+Recipes are human-readable markdown files, editable, storable in memory, and versionable via git, favouring transparency and composability.+}"
  },
  {
   "section": "3.2 Built-in Recipes",
   "old": "Prefrontal v3.0 ships with six built-in recipes covering the most common agent tasks:",
   "new": "Prefrontal v3.1 ships with six built-in recipes covering the most common agent tasks:",
   "marked": "Prefrontal [-v3.0-] {+v3.1+} ships with six built-in recipes covering the most common agent tasks:"
  },
  {
   "section": "3.3 Custom Recipes",
   "old": "Custom recipes are stored in the memory hierarchy (under `memory/recipes/`) and are automatically available to Prefrontal's recipe selection. This makes the recipe library a *growing* asset --- each new recipe captures operational knowledge that compounds across future sessions, extending the compounding thesis from individual lessons (v2.4) to entire workflows (v3.0).",
   "new": "Custom recipes are stored in the memory hierarchy (under `memory/recipes/`) and are automatically available to Prefrontal's recipe selection. This makes the recipe library a *growing* asset --- each new recipe captures operational knowledge that compounds across future sessions, extending the compounding thesis from individual lessons (v2.4) to entire workflows (v3.1).",
   "marked": "Custom recipes are stored in the memory hierarchy (under `memory/recipes/`) and are automatically available to Prefrontal's recipe selection. This makes the recipe library a *growing* asset --- each new recipe captures operational knowledge that compounds across future sessions, extending the compounding thesis from individual lessons (v2.4) to entire workflows [-(v3.0).-] {+(v3.1).+}"
  },
  {
   "section": "3.4 Recipe Selection",
   "old": "For messages that do not match any recipe --- casual conversation, simple questions, emotional support --- Prefrontal passes through without orchestration. The system detects when structure would add overhead without value.",
   "new": null,
   "marked": "[-For messages that do not match any recipe --- casual conversation, simple questions, emotional support --- Prefrontal passes through without orchestration. The system detects when structure would add overhead without value.-]"
  },
  {
   "section": "3.4 Recipe Selection",
   "old": null,
   "new": "Unstructured messages bypass orchestration.",
   "marked": "{+Unstructured messages bypass orchestration.+}"
  },
  {
   "section": "4.1 Pre-Action: From Questions to Recipes",
   "old": "3. **Plan presentation**: for complex tasks (estimated duration >5 minutes or >3 steps), Prefrontal presents the plan to the user before execution. This serves two purposes: it gives the user a chance to redirect (\"actually, I just want the investigation, not the fix\"), and it creates an explicit contract against which the agent's work can be evaluated.",
   "new": "3. **Plan presentation**: for complex tasks (estimated duration >5 minutes or >3 steps), Prefrontal presents the plan to the user before execution. This allows user redirection and creates an execution contract.",
   "marked": "3. **Plan presentation**: for complex tasks (estimated duration >5 minutes or >3 steps), Prefrontal presents the plan to the user before execution. This [-serves two purposes: it gives the-] {+allows+} user [-a chance to redirect (\"actually, I just want the investigation, not the fix\"),-] {+redirection+} and [-it-] creates an [-explicit contract against which the agent's work can be evaluated.-] {+execution contract.+}"
  },
  {
   "section": "4.2 During-Action: Supervised Execution",
   "old": "- **Progress tracking**: each subagent emits structured events as it completes recipe steps. Prefrontal maintains a progress model and updates the UI.",
   "new": null,
   "marked": "[-- **Progress tracking**: each subagent emits structured events as it completes recipe steps. Prefrontal maintains a progress model and updates the UI.-]"
  },
  {
   "section": "4.2 During-Action: Supervised Execution",
   "old": "- **Stall detection**: if a subagent stops emitting events, enters a retry loop, or exceeds its time budget, Prefrontal detects the stall and intervenes. Interventions range from providing additional context (\"the file you're looking for was renamed in commit abc123\") to reassigning the task to a different model.",
   "new": null,
   "marked": "[-- **Stall detection**: if a subagent stops emitting events, enters a retry loop, or exceeds its time budget, Prefrontal detects the stall and intervenes. Interventions range from providing additional context (\"the file you're looking for was renamed in commit abc123\") to reassigning the task to a different model.-]"
  },
  {
   "section": "4.2 During-Action: Supervised Execution",
   "old": "- **Cross-subagent coordination**: when one subagent's findings affect another's task, Prefrontal relays the relevant information. For example, if the investigation subagent discovers that the bug is in module A (not module B as initially suspected), Prefrontal redirects the fix subagent before it wastes time on the wrong module.",
   "new": null,
   "marked": "[-- **Cross-subagent coordination**: when one subagent's findings affect another's task, Prefrontal relays the relevant information. For example, if the investigation subagent discovers that the bug is in module A (not module B as initially suspected), Prefrontal redirects the fix subagent before it wastes time on the wrong module.-]"
  },
  {
   "section": "4.2 During-Action: Supervised Execution",
   "old": "- **User updates**: for tasks exceeding 60 seconds, Prefrontal sends progress summaries to the UI. Users are not left staring at a spinner --- they see which step is active, what has been found so far, and how much remains.",
   "new": null,
   "marked": "[-- **User updates**: for tasks exceeding 60 seconds, Prefrontal sends progress summaries to the UI. Users are not left staring at a spinner --- they see which step is active, what has been found so far, and how much remains.-]"
  },
  {
   "section": "4.2 During-Action: Supervised Execution",
   "old": null,
   "new": "- **Progress & Updates**: Subagents emit structured events. Prefrontal updates the UI, showing active steps and progress. - **Stall detection**: Prefrontal detects stalls (timeouts, retry loops) and intervenes by reassigning or providing context. - **Cross-subagent coordination**: Prefrontal relays critical findings between parallel subagents to prevent wasted effort.",
   "marked": "{+- **Progress & Updates**: Subagents emit structured events. Prefrontal updates the UI, showing active steps and progress. - **Stall detection**: Prefrontal detects stalls (timeouts, retry loops) and intervenes by reassigning or providing context. - **Cross-subagent coordination**: Prefrontal relays critical findings between parallel subagents to prevent wasted effort.+}"
  },
  {
   "section": "4.3 Post-Action: Fractal Reflection, Orchestrated",
   "old": "1. **Mandatory execution**: the reflection is not a suggestion in the system prompt --- it is a distinct LLM call initiated by Prefrontal after the recipe completes. The agent cannot skip it.",
   "new": null,
   "marked": "[-1. **Mandatory execution**: the reflection is not a suggestion in the system prompt --- it is a distinct LLM call initiated by Prefrontal after the recipe completes. The agent cannot skip it.-]"
  },
  {
   "section": "4.3 Post-Action: Fractal Reflection, Orchestrated",
   "old": "2. **Recipe-aware reflection**: the reflection receives not just the turn context but the recipe that was executed, the plan that was presented, and the actual execution trace. This enables structured assessment: \"Step 3 took 4x longer than expected because the codebase search missed the relevant file --- update the search strategy for this recipe.\"",
   "new": null,
   "marked": "[-2. **Recipe-aware reflection**: the reflection receives not just the turn context but the recipe that was executed, the plan that was presented, and the actual execution trace. This enables structured assessment: \"Step 3 took 4x longer than expected because the codebase search missed the relevant file --- update the search strategy for this recipe.\"-]"
  },
  {
   "section": "4.3 Post-Action: Fractal Reflection, Orchestrated",
   "old": "3. **Recipe improvement**: when the reflection identifies a systematic issue with a recipe (\"the debug recipe should include a 'check recent changes' step before 'locate'\"), Prefrontal updates the recipe file. The recipe library evolves through use.",
   "new": null,
   "marked": "[-3. **Recipe improvement**: when the reflection identifies a systematic issue with a recipe (\"the debug recipe should include a 'check recent changes' step before 'locate'\"), Prefrontal updates the recipe file. The recipe library evolves through use.-]"
  },
  {
   "section": "4.3 Post-Action: Fractal Reflection, Orchestrated",
   "old": "4. **Knowledge writing**: lessons extracted during reflection are written to the appropriate memory tier, exactly as in v2.4. The difference is that these lessons are now *structured by the recipe context* --- \"during debug.locate, always check git blame for recent changes\" is more actionable than \"remember to check git blame.\"",
   "new": null,
   "marked": "[-4. **Knowledge writing**: lessons extracted during reflection are written to the appropriate memory tier, exactly as in v2.4. The difference is that these lessons are now *structured by the recipe context* --- \"during debug.locate, always check git blame for recent changes\" is more actionable than \"remember to check git blame.\"-]"
  },
  {
   "section": "4.3 Post-Action: Fractal Reflection, Orchestrated",
   "old": null,
   "new": "1. **Mandatory execution**: Reflection is a distinct, unavoidable LLM call post-completion. 2. **Recipe-aware reflection**: Reflection assesses the turn context, recipe, plan, and execution trace to identify bottlenecks. 3. **Recipe improvement**: Prefrontal updates recipes automatically when systematic issues are identified. 4. **Structured Knowledge**: Extracted lessons are written to memory, deeply tied to their specific recipe context for higher actionability.",
   "marked": "{+1. **Mandatory execution**: Reflection is a distinct, unavoidable LLM call post-completion. 2. **Recipe-aware reflection**: Reflection assesses the turn context, recipe, plan, and execution trace to identify bottlenecks. 3. **Recipe improvement**: Prefrontal updates recipes automatically when systematic issues are identified. 4. **Structured Knowledge**: Extracted lessons are written to memory, deeply tied to their specific recipe context for higher actionability.+}"
  },
  {
   "section": "4.4 The FRACTAL Pattern: Cache-Shared Follow-Up Calls",
   "old": "The FRACTAL pattern is general. Any cognitive function that benefits from the same context but a different perspective --- planning, reflection, review, risk assessment, cost estimation --- can be implemented as a cache-shared call at minimal marginal cost. This transforms the trade-off from \"one perspective per turn\" to \"as many perspectives as are useful, at 5% marginal cost each.\"",
   "new": null,
   "marked": "[-The FRACTAL pattern is general. Any cognitive function that benefits from the same context but a different perspective --- planning, reflection, review, risk assessment, cost estimation --- can be implemented as a cache-shared call at minimal marginal cost. This transforms the trade-off from \"one perspective per turn\" to \"as many perspectives as are useful, at 5% marginal cost each.\"-]"
  },
  {
   "section": "4.4 The FRACTAL Pattern: Cache-Shared Follow-Up Calls",
   "old": null,
   "new": "The FRACTAL pattern applies generally: any cognitive function (planning, reflection, review) can be implemented via cache-shared calls at ~5% marginal cost, enabling multiple perspectives per turn.",
   "marked": "{+The FRACTAL pattern applies generally: any cognitive function (planning, reflection, review) can be implemented via cache-shared calls at ~5% marginal cost, enabling multiple perspectives per turn.+}"
  },
  {
   "section": "5. Integration with Existing Extensions",
   "old": "Prefrontal v3.0 does not replace the existing extension ecosystem --- it orchestrates it. Each extension retains its autonomous function while gaining a coordination layer.",
   "new": "Prefrontal v3.1 does not replace the existing extension ecosystem --- it orchestrates it. Each extension retains its autonomous function while gaining a coordination layer.",
   "marked": "Prefrontal [-v3.0-] {+v3.1+} does not replace the existing extension ecosystem --- it orchestrates it. Each extension retains its autonomous function while gaining a coordination layer."
  },
  {
   "section": "5.1 Total Recall (Memory Retrieval)",
   "old": "Total Recall provides the hybrid retrieval system (semantic search via local embeddings + structured search via filename patterns) that supplies context to every agent turn. In v3.0, Prefrontal uses Total Recall in two new ways:",
   "new": "Total Recall provides the hybrid retrieval system (semantic search via local embeddings + structured search via filename patterns) that supplies context to every agent turn. In v3.1, Prefrontal uses Total Recall in two new ways:",
   "marked": "Total Recall provides the hybrid retrieval system (semantic search via local embeddings + structured search via filename patterns) that supplies context to every agent turn. In [-v3.0,-] {+v3.1,+} Prefrontal uses Total Recall in two new ways:"
  },
  {
   "section": "5.2 Identity Persistence (SOUL.md)",
   "old": "The agent's identity --- personality, values, communication style --- is encoded in SOUL.md and loaded into every LLM call. In v3.0, this identity persists across all three phases of the cognitive cycle. The Prefrontal orchestration call, the subagent execution calls, and the fractal reflection call all share the same SOUL.md, ensuring that the agent's personality is consistent whether it is planning, executing, or reflecting.",
   "new": "The agent's identity --- personality, values, communication style --- is encoded in SOUL.md and loaded into every LLM call. In v3.1, this identity persists across all three phases of the cognitive cycle. The Prefrontal orchestration call, the subagent execution calls, and the fractal reflection call all share the same SOUL.md, ensuring that the agent's personality is consistent whether it is planning, executing, or reflecting.",
   "marked": "The agent's identity --- personality, values, communication style --- is encoded in SOUL.md and loaded into every LLM call. In [-v3.0,-] {+v3.1,+} this identity persists across all three phases of the cognitive cycle. The Prefrontal orchestration call, the subagent execution calls, and the fractal reflection call all share the same SOUL.md, ensuring that the agent's personality is consistent whether it is planning, executing, or reflecting."
  },
  {
   "section": "5.2 Identity Persistence (SOUL.md)",
   "old": "This is non-trivial. In systems where orchestration is handled by a separate \"planner\" agent with its own persona, the user experiences personality discontinuities --- the planner is formal, the executor is casual, the reviewer is critical. By sharing SOUL.md across all calls, Prefrontal maintains a unified voice.",
   "new": null,
   "marked": "[-This is non-trivial. In systems where orchestration is handled by a separate \"planner\" agent with its own persona, the user experiences personality discontinuities --- the planner is formal, the executor is casual, the reviewer is critical. By sharing SOUL.md across all calls, Prefrontal maintains a unified voice.-]"
  },
  {
   "section": "5.2 Identity Persistence (SOUL.md)",
   "old": null,
   "new": "By sharing SOUL.md across all calls, Prefrontal maintains a unified voice, avoiding the personality discontinuities of separate \"planner\" agents.",
   "marked": "{+By sharing SOUL.md across all calls, Prefrontal maintains a unified voice, avoiding the personality discontinuities of separate \"planner\" agents.+}"
  },
  {
   "section": "5.3 Learned Intuition (AMYGDALA)",
   "old": "The AMYGDALA extension (Serra, 2026) --- a neural action gating system that learns to recognise dangerous operations through situation embeddings --- integrates with v3.0 at the subagent level. Each subagent's tool calls pass through AMYGDALA's prudence network before execution, providing learned safety gating that complements the recipe's structural gates.",
   "new": "The AMYGDALA extension (Serra, 2026) --- a neural action gating system that learns to recognise dangerous operations through situation embeddings --- integrates with v3.1 at the subagent level. Each subagent's tool calls pass through AMYGDALA's prudence network before execution, providing learned safety gating that complements the recipe's structural gates.",
   "marked": "The AMYGDALA extension (Serra, 2026) --- a neural action gating system that learns to recognise dangerous operations through situation embeddings --- integrates with [-v3.0-] {+v3.1+} at the subagent level. Each subagent's tool calls pass through AMYGDALA's prudence network before execution, providing learned safety gating that complements the recipe's structural gates."
  },
  {
   "section": "5.4 Fractal Reflection (Orchestrated)",
   "old": "In v2.4, the `fractal-reflection` extension operated independently --- a post-turn LLM call that ran on its own schedule. In v3.0, Prefrontal orchestrates when reflection runs and what context it receives:",
   "new": "In v2.4, the `fractal-reflection` extension operated independently --- a post-turn LLM call that ran on its own schedule. In v3.1, Prefrontal orchestrates when reflection runs and what context it receives:",
   "marked": "In v2.4, the `fractal-reflection` extension operated independently --- a post-turn LLM call that ran on its own schedule. In [-v3.0,-] {+v3.1,+} Prefrontal orchestrates when reflection runs and what context it receives:"
  },
  {
   "section": "5.4 Fractal Reflection (Orchestrated)",
   "old": "This orchestration eliminates the \"reflection fatigue\" identified in v2.4 Section 5.6 --- the problem of mandatory reflection on every turn creating visible latency during rapid exchanges. By matching reflection depth to task complexity, v3.0 preserves compounding while reducing overhead.",
   "new": "This orchestration eliminates the \"reflection fatigue\" identified in v2.4 Section 5.6 --- the problem of mandatory reflection on every turn creating visible latency during rapid exchanges. By matching reflection depth to task complexity, v3.1 preserves compounding while reducing overhead.",
   "marked": "This orchestration eliminates the \"reflection fatigue\" identified in v2.4 Section 5.6 --- the problem of mandatory reflection on every turn creating visible latency during rapid exchanges. By matching reflection depth to task complexity, [-v3.0-] {+v3.1+} preserves compounding while reducing overhead."
  },
  {
   "section": "6.1 FAAR Improvement Targets",
   "old": "| Failure Mode | v2.4 FAAR Impact | v3.0 Mechanism | Target FAAR Delta | |-------------|-------------------|----------------|-------------------| | Fixing without reproducing | -0.08 | debug recipe step gate | +0.06 | | Coding without designing | -0.06 | feature recipe step gate | +0.04 | | Searching without scoping | -0.05 | investigate recipe step gate | +0.03 | | Skipping verification | -0.04 | all recipes include verify step | +0.03 | | **Cumulative** | **-0.23** | | **+0.16** |",
   "new": "| Failure Mode | v2.4 FAAR Impact | v3.1 Mechanism | Target FAAR Delta | |-------------|-------------------|----------------|-------------------| | Fixing without reproducing | -0.08 | debug recipe step gate | +0.06 | | Coding without designing | -0.06 | feature recipe step gate | +0.04 | | Searching without scoping | -0.05 | investigate recipe step gate | +0.03 | | Skipping verification | -0.04 | all recipes include verify step | +0.03 | | **Cumulative** | **-0.23** | | **+0.16** |",
   "marked": "| Failure Mode | v2.4 FAAR Impact | [-v3.0-] {+v3.1+} Mechanism | Target FAAR Delta | |-------------|-------------------|----------------|-------------------| | Fixing without reproducing | -0.08 | debug recipe step gate | +0.06 | | Coding without designing | -0.06 | feature recipe step gate | +0.04 | | Searching without scoping | -0.05 | investigate recipe step gate | +0.03 | | Skipping verification | -0.04 | all recipes include verify step | +0.03 | | **Cumulative** | **-0.23** | | **+0.16** |"
  },
  {
   "section": "6.1 FAAR Improvement Targets",
   "old": "These targets would move the weighted FAAR from 0.90 (v2.4 month 6) to approximately 0.95 --- approaching the ceiling imposed by genuinely novel problems that no recipe can anticipate.",
   "new": null,
   "marked": "[-These targets would move the weighted FAAR from 0.90 (v2.4 month 6) to approximately 0.95 --- approaching the ceiling imposed by genuinely novel problems that no recipe can anticipate.-]"
  },
  {
   "section": "6.1 FAAR Improvement Targets",
   "old": null,
   "new": "These targets would move the weighted FAAR from 0.90 to ~0.95.",
   "marked": "{+These targets would move the weighted FAAR from 0.90 to ~0.95.+}"
  },
  {
   "section": "6.2 Cost Analysis",
   "old": "Even in the worst case, the overhead is modest relative to the cost savings from improved first-attempt accuracy (fewer retry loops, fewer wasted tool calls, fewer human interventions to correct agent mistakes).",
   "new": null,
   "marked": "[-Even in the worst case, the overhead is modest relative to the cost savings from improved first-attempt accuracy (fewer retry loops, fewer wasted tool calls, fewer human interventions to correct agent mistakes).-]"
  },
  {
   "section": "6.2 Cost Analysis",
   "old": null,
   "new": "Even worst-case overhead is modest compared to savings from improved first-attempt accuracy.",
   "marked": "{+Even worst-case overhead is modest compared to savings from improved first-attempt accuracy.+}"
  },
  {
   "section": "7. Implementation Status",
   "old": "## 7. Implementation Status",
   "new": null,
   "marked": "[-## 7. Implementation Status-]"
  },
  {
   "section": "6.5 Failure Modes and Limitations",
   "old": null,
   "new": "### 6.5 Failure Modes and Limitations",
   "marked": "{+### 6.5 Failure Modes and Limitations+}"
  },
  {
   "section": "6.5 Failure Modes and Limitations",
   "old": null,
   "new": "While cache-shared orchestration minimizes overhead, it is vulnerable to **cache evictions**. If the session goes dormant and Anthropic evicts the prompt cache, Phase 1 incurs a full context token cost. Furthermore, complex recipes with many parallel subagents can exhaust API rate limits, requiring the orchestrator to pace execution or queue sub-tasks. ## 7. Implementation Status",
   "marked": "{+While cache-shared orchestration minimizes overhead, it is vulnerable to **cache evictions**. If the session goes dormant and Anthropic evicts the prompt cache, Phase 1 incurs a full context token cost. Furthermore, complex recipes with many parallel subagents can exhaust API rate limits, requiring the orchestrator to pace execution or queue sub-tasks. ## 7. Implementation Status+}"
  },
  {
   "section": "7.1 What Is Built (v2.4 Baseline)",
   "old": "Total: ~3,900 lines of TypeScript, 151 tests, 12 test files, 6 RPC endpoints.",
   "new": "Total: ~3,300 lines of TypeScript, 151 tests, 11 test files, 6 RPC endpoints.",
   "marked": "Total: [-~3,900-] {+~3,300+} lines of TypeScript, 151 tests, [-12-] {+11+} test files, 6 RPC endpoints."
  },
  {
   "section": "7.2 What Is New in v3.1",
   "old": "### 7.2 What Is New in v3.0",
   "new": "### 7.2 What Is New in v3.1",
   "marked": "### 7.2 What Is New in [-v3.0-] {+v3.1+}"
  },
  {
   "section": "8. Conclusion",
   "old": "The honest assessment remains that much of v3.0 is specified but not yet implemented. The recipe engine, the orchestrator loop, the subagent supervisor, and the reflection orchestrator exist as designs in this paper, not as code in the repository. The v2.4 baseline --- guards, observability, monitoring --- is live and validated. The v3.0 additions are the next implementation target.",
   "new": "The honest assessment remains that much of v3.1 is specified but not yet implemented. The recipe engine, the orchestrator loop, the subagent supervisor, and the reflection orchestrator exist as designs in this paper, not as code in the repository. The v2.4 baseline --- guards, observability, monitoring --- is live and validated. The v3.1 additions are the next implementation target.",
   "marked": "The honest assessment remains that much of [-v3.0-] {+v3.1+} is specified but not yet implemented. The recipe engine, the orchestrator loop, the subagent supervisor, and the reflection orchestrator exist as designs in this paper, not as code in the repository. The v2.4 baseline --- guards, observability, monitoring --- is live and validated. The [-v3.0-] {+v3.1+} additions are the next implementation target."
  },
  {
   "section": "8. Conclusion",
   "old": "But the architectural insight is clear, and the economic enabler exists. Prompt caching makes orchestration nearly free. The recipe format is defined. The subagent infrastructure is tested. The fractal reflection protocol is proven. What remains is wiring --- connecting components that already exist into the cognitive cycle this paper describes.",
   "new": "The architectural insight is clear: prompt caching makes orchestration nearly free. What remains is wiring existing components into this cognitive cycle.",
   "marked": "[-But the-] {+The+} architectural insight is [-clear, and the economic enabler exists. Prompt-] {+clear: prompt+} caching makes orchestration nearly free. [-The recipe format is defined. The subagent infrastructure is tested. The fractal reflection protocol is proven.-] What remains is wiring [---- connecting-] {+existing+} components [-that already exist-] into [-the-] {+this+} cognitive [-cycle this paper describes.-] {+cycle.+}"
  },
  {
   "section": "Appendix B: Built-in Recipe Index",
   "old": "| Recipe | Trigger Patterns | Steps | Key Gate | |--------|-----------------|-------|----------| | debug | \"fix\", \"bug\", \"error\", \"broken\", stack traces | 6 | Reproduce before fix | | feature | \"add\", \"implement\", \"build\", \"create\" + scope | 7 | Design before code | | investigate | \"why\", \"what's going on\", \"look into\", \"check\" | 5 | Scope before search | | refactor | \"clean up\", \"refactor\", \"reorganise\", \"simplify\" | 6 | Measure before change | | review | \"review\", \"check this\", PR URLs, diff blocks | 5 | Read completely before opining | | deploy | \"deploy\", \"release\", \"ship\", \"push to prod\" | 7 | Verify at every stage |",
   "new": "| Recipe | Trigger Patterns | Steps | Key Gate | |--------|-----------------|-------|----------| | debug | \"fix\", \"bug\", stack traces | 6 | Reproduce before fix | | feature | \"add\", \"implement\" | 7 | Design before code | | investigate | \"why\", \"check\" | 5 | Scope before search | | refactor | \"clean up\", \"refactor\" | 6 | Measure before change | | review | PR URLs, diff blocks | 5 | Read completely before opining | | deploy | \"deploy\", \"release\" | 7 | Verify at every stage |",
   "marked": "| Recipe | Trigger Patterns | Steps | Key Gate | |--------|-----------------|-------|----------| | debug | \"fix\", \"bug\", [-\"error\", \"broken\",-] stack traces | 6 | Reproduce before fix | | feature | \"add\", [-\"implement\", \"build\", \"create\" + scope-] {+\"implement\"+} | 7 | Design before code | | investigate | \"why\", [-\"what's going on\", \"look into\",-] \"check\" | 5 | Scope before search | | refactor | \"clean up\", [-\"refactor\", \"reorganise\", \"simplify\"-] {+\"refactor\"+} | 6 | Measure before change | | review | [-\"review\", \"check this\",-] PR URLs, diff blocks | 5 | Read completely before opining | | deploy | \"deploy\", [-\"release\", \"ship\", \"push to prod\"-] {+\"release\"+} | 7 | Verify at every stage |"
  }
 ]
}
