{
 "paper": "prefrontal-orchestration",
 "a": "2.3",
 "b": "2.4",
 "summary": "From v2.3 (1 Apr) to v2.4 (1 Apr): 10,166 words to 10,436 words, 318 words in new or rewritten paragraphs and 48 taken out, 10 paragraphs changed.",
 "note": {
  "title": "Implementation section updated: four of five gaps closed",
  "kind": "revision",
  "body": "## Summary\n\nUpdates section 5.7 after a same-day implementation session. Four of the five gaps listed in v2.3 are reported as closed (among them an effort router that warns when an expensive model gets a simple task), each with its test count. No other content changes.",
  "source": "change note"
 },
 "paragraphs_changed": 10,
 "changes": [
  {
   "section": "PREFRONTAL: Compounded Intelligence — How Persistent Agents Get Smarter by Remembering What They Learn",
   "old": "**Oscar Serra¹, Jarvis¹** ¹Independent Research *1 April 2026 — v2.3*",
   "new": "**Oscar Serra¹, Jarvis¹** ¹Independent Research *1 April 2026 — v2.4*",
   "marked": "**Oscar Serra¹, Jarvis¹** ¹Independent Research *1 April 2026 — [-v2.3*-] {+v2.4*+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": "**Gap between paper and implementation.** Several architectural proposals remain unimplemented: CORF multi-model parallelism (Section 3.3) is not yet integrated into the Prefrontal orchestration layer; adaptive effort routing (Section 3.4) remains prompt-based rather than code-enforced; and feature-flagged deployment (Section 6.5) is not yet implemented --- all hooks are currently always-on. The P1 and P2 modules are tested but require integration with the gateway runner, which we expect to complete in a follow-up session.",
   "new": null,
   "marked": "[-**Gap between paper and implementation.** Several architectural proposals remain unimplemented: CORF multi-model parallelism (Section 3.3) is not yet integrated into the Prefrontal orchestration layer; adaptive effort routing (Section 3.4) remains prompt-based rather than code-enforced; and feature-flagged deployment (Section 6.5) is not yet implemented --- all hooks are currently always-on. The P1 and P2 modules are tested but require integration with the gateway runner, which we expect to complete in a follow-up session.-]"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "A follow-up implementation session (same day) closed four of the five architectural gaps identified in the initial deployment:",
   "marked": "{+A follow-up implementation session (same day) closed four of the five architectural gaps identified in the initial deployment:+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "- **Effort router** (`effort-router.ts`, 11 tests): monitors subagent spawns and logs warnings when expensive models (Opus) are assigned to simple tasks. Wired into the `subagent_spawned` hook. This operationalises the adaptive effort routing described in Section 3.4 --- not yet as an enforcing gate, but as an observability signal that feeds into future routing optimisation.",
   "marked": "{+- **Effort router** (`effort-router.ts`, 11 tests): monitors subagent spawns and logs warnings when expensive models (Opus) are assigned to simple tasks. Wired into the `subagent_spawned` hook. This operationalises the adaptive effort routing described in Section 3.4 --- not yet as an enforcing gate, but as an observability signal that feeds into future routing optimisation.+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "- **CORF trigger** (`corf-trigger.ts`, 12 tests): detects high-stakes decisions --- those involving irreversible actions, security-sensitive operations, or cross-domain trade-offs --- and flags them for SYNAPSE multi-model deliberation. This bridges Section 3.3's CORF parallelism with the live orchestration layer, routing complex decisions to the Round Table extension.",
   "marked": "{+- **CORF trigger** (`corf-trigger.ts`, 12 tests): detects high-stakes decisions --- those involving irreversible actions, security-sensitive operations, or cross-domain trade-offs --- and flags them for SYNAPSE multi-model deliberation. This bridges Section 3.3's CORF parallelism with the live orchestration layer, routing complex decisions to the Round Table extension.+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "- **Feature flags** (`feature-flags.ts`, 5 tests): wraps every hook (exploration gate, anti-gold-plating, forcing questions, permission hooks, denial tracking, effort router, CORF trigger, FAAR tracker) in a per-hook enable/disable flag, configurable via gateway RPC. This enables the A/B testing capability described in Section 6.5 and provides continuous ablation data as a byproduct of normal operation.",
   "marked": "{+- **Feature flags** (`feature-flags.ts`, 5 tests): wraps every hook (exploration gate, anti-gold-plating, forcing questions, permission hooks, denial tracking, effort router, CORF trigger, FAAR tracker) in a per-hook enable/disable flag, configurable via gateway RPC. This enables the A/B testing capability described in Section 6.5 and provides continuous ablation data as a byproduct of normal operation.+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "- **FAAR tracker** (`faar-tracker.ts`, 13 tests): records every task outcome with category, model used, token count, and success/failure classification. Exposes metrics via `prefrontal.metrics` RPC endpoint. This begins to automate the manual log review methodology described in Section 5, moving toward the automated evaluation framework proposed in Section 7.4.",
   "marked": "{+- **FAAR tracker** (`faar-tracker.ts`, 13 tests): records every task outcome with category, model used, token count, and success/failure classification. Exposes metrics via `prefrontal.metrics` RPC endpoint. This begins to automate the manual log review methodology described in Section 5, moving toward the automated evaluation framework proposed in Section 7.4.+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "The total implementation now comprises 49 commits, 35 new files, 3,883 lines of code, and 151 passing tests across 12 test files. Six new gateway RPC methods expose real-time orchestration state. All hooks are feature-flagged for ablation studies.",
   "marked": "{+The total implementation now comprises 49 commits, 35 new files, 3,883 lines of code, and 151 passing tests across 12 test files. Six new gateway RPC methods expose real-time orchestration state. All hooks are feature-flagged for ablation studies.+}"
  },
  {
   "section": "5.7 Implementation: The Prefrontal Plugin",
   "old": null,
   "new": "**Remaining gaps.** The P1 modules (tool concurrency and prompt cache boundary) and P2 modules (fork subagents and deferred tool loading) remain tested but unwired, pending integration with the gateway runner. These represent the cache-optimisation layer --- important for cost efficiency but not for functional correctness. Additionally, the AMYGDALA neural action gating extension (Serra, 2026) was enabled during this session at 50% influence (Phase 1, `alphaPrudence=0.50`), marking its first production activation after weeks of nightly training with the models offline.",
   "marked": "{+**Remaining gaps.** The P1 modules (tool concurrency and prompt cache boundary) and P2 modules (fork subagents and deferred tool loading) remain tested but unwired, pending integration with the gateway runner. These represent the cache-optimisation layer --- important for cost efficiency but not for functional correctness. Additionally, the AMYGDALA neural action gating extension (Serra, 2026) was enabled during this session at 50% influence (Phase 1, `alphaPrudence=0.50`), marking its first production activation after weeks of nightly training with the models offline.+}"
  },
  {
   "section": "References",
   "old": "Anthropic (2026). Claude Code source code. Accidentally exposed via npm source map in @anthropic-ai/claude-code v2.3.88, March 31, 2026. 512,000 lines of TypeScript across approximately 1,900 files. Analysis repository: https://github.com/chauncygu/collection-claude-code-source-code",
   "new": "Anthropic (2026). Claude Code source code. Accidentally exposed via npm source map in @anthropic-ai/claude-code v2.4.88, March 31, 2026. 512,000 lines of TypeScript across approximately 1,900 files. Analysis repository: https://github.com/chauncygu/collection-claude-code-source-code",
   "marked": "Anthropic (2026). Claude Code source code. Accidentally exposed via npm source map in @anthropic-ai/claude-code [-v2.3.88,-] {+v2.4.88,+} March 31, 2026. 512,000 lines of TypeScript across approximately 1,900 files. Analysis repository: https://github.com/chauncygu/collection-claude-code-source-code"
  }
 ]
}
