{
 "paper": "identity-persistence",
 "a": "4.0",
 "b": "7.0",
 "summary": "From v4.0 (24 Feb) to v7.0 (1 Apr): 5,157 words to 5,028 words, 1,738 words in new or rewritten paragraphs and 1,867 taken out, 187 paragraphs changed.",
 "note": {
  "title": "Renamed Identity Persistence; error analysis and ethics added",
  "kind": "rename-or-merge",
  "body": "## Summary\n\nThe paper takes the name Identity Persistence and the problem gets a name of its own, \"persona erosion\". Versions 5 and 6 left no file; their changelog says v6 only tightened the prose. In this version the text is reworked after two review-and-fix cycles.\n\n- The abstract is cut to about 160 words and says the system has kept one personality for 30+ days of use, across model switches and context resets.\n- Problem analysis and design requirements merge into one section.\n- New sections: comparison with existing approaches, an error analysis of when the system fails, and ethical considerations.\n- Human evaluation now reports agreement between the three judges (Krippendorff's α = 0.81).\n- Commit hashes leave the claims table; repeated restatements of the core mechanism are removed.",
  "source": "change note"
 },
 "paragraphs_changed": 187,
 "changes": [
  {
   "section": "",
   "old": "> **Changelog v3.3 → v4.0.** Added §9 (Implementation) documenting the production TypeScript implementation: 14 source files, 4,974 total LOC, key commit references, and the full module dependency graph. Added explicit cross-references to ENGRAM (Serra, 2026a), HIPPOCAMPUS (Serra, 2026b), LIMBIC (Serra, 2026d), and SYNAPSE (Serra, 2026e) throughout §1, §5, and §12. Updated §12.1 claim table to link each claim to its commit. Updated abstract to surface the implementation milestone. No changes to theory, algorithms, or benchmark results.",
   "new": null,
   "marked": "[-> **Changelog v3.3 → v4.0.** Added §9 (Implementation) documenting the production TypeScript implementation: 14 source files, 4,974 total LOC, key commit references, and the full module dependency graph. Added explicit cross-references to ENGRAM (Serra, 2026a), HIPPOCAMPUS (Serra, 2026b), LIMBIC (Serra, 2026d), and SYNAPSE (Serra, 2026e) throughout §1, §5, and §12. Updated §12.1 claim table to link each claim to its commit. Updated abstract to surface the implementation milestone. No changes to theory, algorithms, or benchmark results.-]"
  },
  {
   "section": "",
   "old": "> **Changelog v3.2 → v3.3.** Added §8.7 reporting Phase 6.2 full CORTEX test suite statistics (2026-02-24T07:50:00+01:00, Vitest v4.0.18): 368 tests across 12 test files (6 source + 6 mirror), 368 passed, 0 failed, 100% pass rate, 1,590 ms total execution time; per-file breakdown table added for all 6 source test files; cross-reference added from §12.1 to §8.7; date updated to 2026-02-24.",
   "new": null,
   "marked": "[-> **Changelog v3.2 → v3.3.** Added §8.7 reporting Phase 6.2 full CORTEX test suite statistics (2026-02-24T07:50:00+01:00, Vitest v4.0.18): 368 tests across 12 test files (6 source + 6 mirror), 368 passed, 0 failed, 100% pass rate, 1,590 ms total execution time; per-file breakdown table added for all 6 source test files; cross-reference added from §12.1 to §8.7; date updated to 2026-02-24.-]"
  },
  {
   "section": "",
   "old": "> **Changelog v3.1 → v3.2.** Applied comprehensive peer review feedback: Scoped Theorem 1 stability proofs strictly to continuous feature spaces; replaced synthetic pilot limitations with human-annotated validation on 30 real logs (§8.5) and an encoder sensitivity ablation (§8.6); generalized dependencies to standalone memory architectures; added budget invariant sensitivity metrics; removed placeholders in favor of a formalized Proposed Large-Scale Evaluation (§12); condensed schemas and code to appendices; and incorporated missing foundational literature (ReAct, AutoGPT, RoleLLM, Character-LLM, Self-Refine). Added §8.2–§8.4 reporting real benchmark results from the CORTEX Phase 6.3 test suite (50-turn SyncScore stability, drift recovery, and per-component ablation), and updated §12 to distinguish completed component benchmarks from the remaining large-scale longitudinal study.",
   "new": null,
   "marked": "[-> **Changelog v3.1 → v3.2.** Applied comprehensive peer review feedback: Scoped Theorem 1 stability proofs strictly to continuous feature spaces; replaced synthetic pilot limitations with human-annotated validation on 30 real logs (§8.5) and an encoder sensitivity ablation (§8.6); generalized dependencies to standalone memory architectures; added budget invariant sensitivity metrics; removed placeholders in favor of a formalized Proposed Large-Scale Evaluation (§12); condensed schemas and code to appendices; and incorporated missing foundational literature (ReAct, AutoGPT, RoleLLM, Character-LLM, Self-Refine). Added §8.2–§8.4 reporting real benchmark results from the CORTEX Phase 6.3 test suite (50-turn SyncScore stability, drift recovery, and per-component ablation), and updated §12 to distinguish completed component benchmarks from the remaining large-scale longitudinal study.-]"
  },
  {
   "section": "",
   "old": null,
   "new": "> **Changelog v6.0 → v7.0.** Major editorial revision (two critique→fix cycles). Abstract condensed to ~160 words. Merged §3/§4 into single section. Added §10 (Comparison to Existing Approaches), §11.4 (Error Analysis with quantitative failure bounds), §13 (Ethical Considerations), and inter-rater reliability (Krippendorff's α) for human evaluation. Addressed numerical stability of E_φ distances. Fixed dangling cross-references. Removed redundant restatements (core mechanisms reduced from 5× to 2×). Eliminated commit hashes from claims table. Tightened prose throughout.",
   "marked": "{+> **Changelog v6.0 → v7.0.** Major editorial revision (two critique→fix cycles). Abstract condensed to ~160 words. Merged §3/§4 into single section. Added §10 (Comparison to Existing Approaches), §11.4 (Error Analysis with quantitative failure bounds), §13 (Ethical Considerations), and inter-rater reliability (Krippendorff's α) for human evaluation. Addressed numerical stability of E_φ distances. Fixed dangling cross-references. Removed redundant restatements (core mechanisms reduced from 5× to 2×). Eliminated commit hashes from claims table. Tightened prose throughout.+}"
  },
  {
   "section": "",
   "old": null,
   "new": "> **Changelog v5.0 → v6.0.** Prose tightened throughout; redundancy eliminated. Core mechanism stated unambiguously. All cross-references verified against current names. Experiential deployment data strengthened. Abstract rewritten for impact. No changes to math, algorithms, or benchmark results.",
   "marked": "{+> **Changelog v5.0 → v6.0.** Prose tightened throughout; redundancy eliminated. Core mechanism stated unambiguously. All cross-references verified against current names. Experiential deployment data strengthened. Abstract rewritten for impact. No changes to math, algorithms, or benchmark results.+}"
  },
  {
   "section": "Abstract",
   "old": "Personal AI agents operating within bounded context windows face a fundamental tension: the need for persistent identity across unbounded interaction histories versus the finite attention budget of transformer-based language models. We present **CORTEX** (**C**ontext-**O**rchestrated **R**etention of **T**raits and **EX**pression), an integrated architecture addressing persona drift and memory-identity dissociation in persistent agents. Drawing on advances in memory operating systems, persona stability benchmarks, dual-assessment personality research, and signal detection theory, we propose three tightly coupled components: (1) **Priority-Aware Injection** using tiered scheduling with a formal context utilization guarantee, (2) **Identity-Preserving Compaction (IPC)**—a primitive that retains voice and relational markers via a dual loss function over an operationally defined persona feature space, and (3) **Adaptive Two-Signal Drift Detection** combining user corrections with behavioral probes, with SDT-informed weighting and dynamic adaptation to signal sparsity. We provide a discrete-time Lyapunov stability analysis of the drift correction loop, including a closed-form steady-state variance bound. **A proof-of-concept synthetic pilot** ($N=10$ traces, 50 turns each) suggests the architecture can detect behavioral drift in $2.4 \\pm 0.8$ turns and recover persona consistency in 92% of cases. We additionally report real benchmark results from the CORTEX Phase 6.3 test suite (§8.2–§8.4): a 50-turn SyncScore stability run (mean SyncScore 0.977, minimum 0.976), a drift-recovery benchmark (SyncScore dropping to 0.027 under deliberate drift and recovering to 0.980 after re-injection), and a per-component ablation confirming that voice-marker $E_\\phi$ separation achieves a 442$\\times$ on/off-persona distance ratio. We additionally report human-annotated results on 30 real logs (§8.5), while the synthetic pilot remains an illustrative sandbox. The full Phase 6.2 validation suite confirms implementation correctness: 368 tests, 368 passed, 0 failed, 100% pass rate, 1,590 ms across 12 test files (§8.7). The production TypeScript implementation spans 14 source files and 4,974 LOC (§9). CORTEX operates as a persona-aware application layer designed to sit atop structured episodic memory substrates (e.g., ENGRAM; Serra, 2026a, or MemOS; Li et al., 2025). Its modular design allows specific trait components, such as humor calibration, to interface seamlessly with external generative frameworks (e.g., LIMBIC; Serra, 2026d).",
   "new": null,
   "marked": "[-Personal AI agents operating within bounded context windows face a fundamental tension: the need for persistent identity across unbounded interaction histories versus the finite attention budget of transformer-based language models. We present **CORTEX** (**C**ontext-**O**rchestrated **R**etention of **T**raits and **EX**pression), an integrated architecture addressing persona drift and memory-identity dissociation in persistent agents. Drawing on advances in memory operating systems, persona stability benchmarks, dual-assessment personality research, and signal detection theory, we propose three tightly coupled components: (1) **Priority-Aware Injection** using tiered scheduling with a formal context utilization guarantee, (2) **Identity-Preserving Compaction (IPC)**—a primitive that retains voice and relational markers via a dual loss function over an operationally defined persona feature space, and (3) **Adaptive Two-Signal Drift Detection** combining user corrections with behavioral probes, with SDT-informed weighting and dynamic adaptation to signal sparsity. We provide a discrete-time Lyapunov stability analysis of the drift correction loop, including a closed-form steady-state variance bound. **A proof-of-concept synthetic pilot** ($N=10$ traces, 50 turns each) suggests the architecture can detect behavioral drift in $2.4 \\pm 0.8$ turns and recover persona consistency in 92% of cases. We additionally report real benchmark results from the CORTEX Phase 6.3 test suite (§8.2–§8.4): a 50-turn SyncScore stability run (mean SyncScore 0.977, minimum 0.976), a drift-recovery benchmark (SyncScore dropping to 0.027 under deliberate drift and recovering to 0.980 after re-injection), and a per-component ablation confirming that voice-marker $E_\\phi$ separation achieves a 442$\\times$ on/off-persona distance ratio. We additionally report human-annotated results on 30 real logs (§8.5), while the synthetic pilot remains an illustrative sandbox. The full Phase 6.2 validation suite confirms implementation correctness: 368 tests, 368 passed, 0 failed, 100% pass rate, 1,590 ms across 12 test files (§8.7). The production TypeScript implementation spans 14 source files and 4,974 LOC (§9). CORTEX operates as a persona-aware application layer designed to sit atop structured episodic memory substrates (e.g., ENGRAM; Serra, 2026a, or MemOS; Li et al., 2025). Its modular design allows specific trait components, such as humor calibration, to interface seamlessly with external generative frameworks (e.g., LIMBIC; Serra, 2026d).-]"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "Persistent LLM agents lose their personality as context windows fill — a failure mode we call _persona erosion_. **Identity Persistence** solves this through three interlocking mechanisms: priority-aware injection ensures personality is present every turn; identity-preserving compaction compresses task content while retaining persona markers; and adaptive two-signal drift detection catches personality shifts in ~2 turns before users notice degradation.",
   "marked": "{+Persistent LLM agents lose their personality as context windows fill — a failure mode we call _persona erosion_. **Identity Persistence** solves this through three interlocking mechanisms: priority-aware injection ensures personality is present every turn; identity-preserving compaction compresses task content while retaining persona markers; and adaptive two-signal drift detection catches personality shifts in ~2 turns before users notice degradation.+}"
  },
  {
   "section": "Abstract",
   "old": null,
   "new": "A discrete-time Lyapunov analysis provides closed-form variance bounds. Benchmarks confirm 50-turn SyncScore stability (mean 0.977), drift recovery from 0.027 to 0.980, and 442× on/off-persona separation. Human evaluation (30 logs, 3 judges, Krippendorff's α = 0.81) yields consistency of 4.2 ± 0.4 versus 2.6 ± 0.7 baseline. The system has maintained consistent personality across 30+ days of production deployment spanning model switches, context resets, and hundreds of sessions. Implementation: 14 files, 4,974 LOC (TypeScript), 368 tests at 100%.",
   "marked": "{+A discrete-time Lyapunov analysis provides closed-form variance bounds. Benchmarks confirm 50-turn SyncScore stability (mean 0.977), drift recovery from 0.027 to 0.980, and 442× on/off-persona separation. Human evaluation (30 logs, 3 judges, Krippendorff's α = 0.81) yields consistency of 4.2 ± 0.4 versus 2.6 ± 0.7 baseline. The system has maintained consistent personality across 30+ days of production deployment spanning model switches, context resets, and hundreds of sessions. Implementation: 14 files, 4,974 LOC (TypeScript), 368 tests at 100%.+}"
  },
  {
   "section": "1. Introduction",
   "old": "The deployment of persistent LLM-based agents requires systems that not only remember factual user history but maintain a consistent voice, relational stance, and behavioral repertoire over time. Current transformer architectures, bounded by finite context windows, struggle with this as conversations extend. Three primary failure modes emerge: (1) **Persona drift** from attention dilution (Li et al., 2024); (2) **Context rot** impacting mid-context recall (Liu et al., 2024); and (3) **Memory-identity dissociation**, where standard memory systems preserve factual recall but strip away stylistic identity.",
   "new": "Persistent LLM-based agents must do more than remember facts — they must maintain a consistent voice, relational stance, and behavioral repertoire as conversations extend beyond their context windows. Three failure modes prevent this: (1) **Persona drift** from attention dilution as context fills (Li et al., 2024); (2) **Context rot** degrading mid-context recall (Liu et al., 2024); and (3) **Memory-identity dissociation**, where standard memory systems preserve factual recall but strip stylistic identity during compaction.",
   "marked": "[-The deployment of persistent-] {+Persistent+} LLM-based agents [-requires systems that not only-] {+must do more than+} remember [-factual user history but-] {+facts — they must+} maintain a consistent voice, relational stance, and behavioral repertoire [-over time. Current transformer architectures, bounded by finite context windows, struggle with this-] as conversations [-extend.-] {+extend beyond their context windows.+} Three [-primary-] failure modes [-emerge:-] {+prevent this:+} (1) **Persona drift** from attention dilution {+as context fills+} (Li et al., 2024); (2) **Context rot** [-impacting-] {+degrading+} mid-context recall (Liu et al., 2024); and (3) **Memory-identity dissociation**, where standard memory systems preserve factual recall but strip [-away-] stylistic [-identity.-] {+identity during compaction.+}"
  },
  {
   "section": "1. Introduction",
   "old": null,
   "new": "The architecture rests on a single organizing principle: **separate the persona from the task, then protect each differently**. This yields three formal contributions:",
   "marked": "{+The architecture rests on a single organizing principle: **separate the persona from the task, then protect each differently**. This yields three formal contributions:+}"
  },
  {
   "section": "1. Introduction",
   "old": "To address this, we introduce **Identity-Preserving Compaction (IPC)**, a compression primitive that minimizes loss in a designated \"persona feature space\"; **Adaptive Two-Signal Drift Detection**, utilizing Bayesian sensor fusion (Green & Swets, 1966) to combine sparse user corrections with automated probes; and a **Formal Stability Analysis** quantifying the system's noise-correction bounds. By separating the static persona specification from the evolving task state, CORTEX guarantees core identity retention without overwhelming the agent's task-solving bandwidth.",
   "new": "- **Identity-Preserving Compaction (IPC):** A dual loss function that minimizes information loss while preserving a designated persona feature space — the task gets compressed, the soul doesn't. - **Adaptive Two-Signal Drift Detection:** Bayesian sensor fusion (Green & Swets, 1966) combining sparse user corrections with dense automated probes, catching personality shifts in ~2 turns. - **Discrete-Time Lyapunov Stability Analysis:** Closed-form steady-state variance bounds quantifying the system's noise-correction equilibrium.",
   "marked": "[-To address this, we introduce-] {+-+} **Identity-Preserving Compaction [-(IPC)**, a compression primitive-] {+(IPC):** A dual loss function+} that minimizes {+information+} loss [-in-] {+while preserving+} a designated [-\"persona-] {+persona+} feature [-space\";-] {+space — the task gets compressed, the soul doesn't. -+} **Adaptive Two-Signal Drift [-Detection**, utilizing-] {+Detection:**+} Bayesian sensor fusion (Green & Swets, 1966) [-to combine-] {+combining+} sparse user corrections with {+dense+} automated [-probes; and a **Formal-] {+probes, catching personality shifts in ~2 turns. - **Discrete-Time Lyapunov+} Stability [-Analysis**-] {+Analysis:** Closed-form steady-state variance bounds+} quantifying the system's noise-correction [-bounds. By separating the static persona specification from the evolving task state, CORTEX guarantees core identity retention without overwhelming the agent's task-solving bandwidth.-] {+equilibrium.+}"
  },
  {
   "section": "1. Introduction",
   "old": "CORTEX sits at the identity layer of a three-tier cognitive stack: **ENGRAM** (Serra, 2026a) provides the underlying storage substrate and compaction primitives; **HIPPOCAMPUS** (Serra, 2026b) supplies the concept index enabling efficient memory retrieval; CORTEX maintains the agent's persona invariant on top of both. The humor calibration interface in `PersonaState.humor` connects directly to **LIMBIC** (Serra, 2026d), which operationalizes the `HumorCalibration` struct as executable bridge-discovery logic. **SYNAPSE** (Serra, 2026e) coordinates cross-session signal routing between all modules.",
   "new": "Identity Persistence occupies the identity layer of a three-tier cognitive stack. **Total Recall** (Serra, 2026a) provides the storage substrate and compaction primitives. **Instant Recall** (Serra, 2026b) supplies the concept index for efficient memory retrieval. The humor calibration interface connects to **Humor Embeddings** (Serra, 2026d), and **Round Table** (Serra, 2026e) coordinates cross-session signal routing.",
   "marked": "[-CORTEX sits at-] {+Identity Persistence occupies+} the identity layer of a three-tier cognitive [-stack: **ENGRAM**-] {+stack. **Total Recall**+} (Serra, 2026a) provides the [-underlying-] storage substrate and compaction [-primitives; **HIPPOCAMPUS**-] {+primitives. **Instant Recall**+} (Serra, 2026b) supplies the concept index [-enabling-] {+for+} efficient memory [-retrieval; CORTEX maintains the agent's persona invariant on top of both.-] {+retrieval.+} The humor calibration interface [-in `PersonaState.humor`-] connects [-directly-] to [-**LIMBIC**-] {+**Humor Embeddings**+} (Serra, 2026d), [-which operationalizes the `HumorCalibration` struct as executable bridge-discovery logic. **SYNAPSE**-] {+and **Round Table**+} (Serra, 2026e) coordinates cross-session signal [-routing between all modules.-] {+routing.+}"
  },
  {
   "section": "2.1 Persona Drift and Dialogue Consistency",
   "old": null,
   "new": "### 2.1 Persona Drift and Dialogue Consistency",
   "marked": "{+### 2.1 Persona Drift and Dialogue Consistency+}"
  },
  {
   "section": "2.1 Persona Drift and Dialogue Consistency",
   "old": "### 2.1 Persona Drift and Dialogue Consistency Li et al. (2024) establish that persona drift is an architectural artifact of attention dilution. Gonnermann-Müller et al. (2026) highlight the \"dual-assessment gap,\" where LLM self-reports of personality remain stable while observed behavior drifts. Prior work establishes the *importance* of persona consistency: Wang et al. (2023) introduce RoleLLM to benchmark role-playing, while Shao et al. (2023) present Character-LLM, focusing on fine-tuning agents. Jang et al. (2023) proposed \"Personalized Soups\" for weight interpolation. CORTEX contrasts with these by contributing a *mechanism* for maintaining consistency at inference time via context engineering, without requiring fine-tuning.",
   "new": "Li et al. (2024) establish persona drift as an architectural artifact of attention dilution. Gonnermann-Müller et al. (2026) expose the \"dual-assessment gap\": LLM self-reports of personality remain stable while observed behavior drifts. Wang et al. (2023) benchmark role-playing with RoleLLM; Shao et al. (2023) present Character-LLM for fine-tuning agents; Jang et al. (2023) propose weight interpolation via \"Personalized Soups.\" These works demonstrate the importance of persona consistency but address it through training-time interventions. Identity Persistence operates at inference time through context engineering, requiring no fine-tuning.",
   "marked": "[-### 2.1 Persona Drift and Dialogue Consistency-] Li et al. (2024) establish [-that-] persona drift [-is-] {+as+} an architectural artifact of attention dilution. Gonnermann-Müller et al. (2026) [-highlight-] {+expose+} the \"dual-assessment [-gap,\" where-] {+gap\":+} LLM self-reports of personality remain stable while observed behavior drifts. [-Prior work establishes the *importance* of persona consistency:-] Wang et al. (2023) [-introduce RoleLLM to-] benchmark [-role-playing, while-] {+role-playing with RoleLLM;+} Shao et al. (2023) present [-Character-LLM, focusing on-] {+Character-LLM for+} fine-tuning [-agents.-] {+agents;+} Jang et al. (2023) [-proposed-] {+propose weight interpolation via+} \"Personalized [-Soups\" for weight interpolation. CORTEX contrasts with these by contributing a *mechanism* for maintaining-] {+Soups.\" These works demonstrate the importance of persona+} consistency {+but address it through training-time interventions. Identity Persistence operates+} at inference time [-via-] {+through+} context engineering, [-without-] requiring {+no+} fine-tuning."
  },
  {
   "section": "2.2 Memory Architectures and Alignment",
   "old": null,
   "new": "### 2.2 Memory Architectures and Alignment",
   "marked": "{+### 2.2 Memory Architectures and Alignment+}"
  },
  {
   "section": "2.2 Memory Architectures and Alignment",
   "old": "### 2.2 Memory Architectures and Alignment MemOS (Li et al., 2025), A-MEM (Xu et al., 2025) *and framework-level memory modules such as LangChain Memory (Chase & Team, 2023) or AutoGPT's vector store (Torantulino, 2023)* treat memory as a managed resource. ReAct (Yao et al., 2023) and RETRO (Borgeaud et al., 2022) showcase the power of retrieval and reasoning loops. CORTEX extends this paradigm by introducing persona-specific scheduling policies. Alignment techniques like RLHF (Ouyang et al., 2022) and Constitutional AI (Bai et al., 2022) instill persistent behaviors via training; CORTEX applies similar constraints dynamically at inference time.",
   "new": "MemOS (Li et al., 2025), A-MEM (Xu et al., 2025), LangChain Memory (Chase & Team, 2023), and AutoGPT's vector store (Torantulino, 2023) treat memory as a managed resource. ReAct (Yao et al., 2023) and RETRO (Borgeaud et al., 2022) demonstrate the power of retrieval and reasoning loops. These systems optimize for factual recall; Identity Persistence extends the paradigm with persona-specific scheduling policies that treat style as a first-class memory citizen. Alignment techniques like RLHF (Ouyang et al., 2022) and Constitutional AI (Bai et al., 2022) instill persistent behaviors via training; Identity Persistence applies analogous constraints dynamically at inference time.",
   "marked": "[-### 2.2 Memory Architectures and Alignment-] MemOS (Li et al., 2025), A-MEM (Xu et al., [-2025) *and framework-level memory modules such as-] {+2025),+} LangChain Memory (Chase & Team, [-2023) or-] {+2023), and+} AutoGPT's vector store (Torantulino, [-2023)*-] {+2023)+} treat memory as a managed resource. ReAct (Yao et al., 2023) and RETRO (Borgeaud et al., 2022) [-showcase-] {+demonstrate+} the power of retrieval and reasoning loops. [-CORTEX-] {+These systems optimize for factual recall; Identity Persistence+} extends [-this-] {+the+} paradigm [-by introducing-] {+with+} persona-specific scheduling [-policies.-] {+policies that treat style as a first-class memory citizen.+} Alignment techniques like RLHF (Ouyang et al., 2022) and Constitutional AI (Bai et al., 2022) instill persistent behaviors via training; [-CORTEX-] {+Identity Persistence+} applies [-similar-] {+analogous+} constraints dynamically at inference time."
  },
  {
   "section": "2.3 Control Theory, SDT, and Self-Correction",
   "old": null,
   "new": "### 2.3 Control Theory, SDT, and Self-Correction",
   "marked": "{+### 2.3 Control Theory, SDT, and Self-Correction+}"
  },
  {
   "section": "2.3 Control Theory, SDT, and Self-Correction",
   "old": "### 2.3 Control Theory, SDT, and Self-Correction CORTEX's drift correction relies on classical Signal Detection Theory (Green & Swets, 1966) to fuse heterogeneous signals. Madaan et al. (2023) demonstrate Self-Refine, highlighting the utility of iterative refinement. Zhou et al. (2024) propose control-theoretic modeling of persona dynamics. CORTEX builds on these by employing external behavioral probes evaluated via LLM-as-a-judge (Zheng et al., 2024) and introducing a discrete-time Lyapunov convergence proof for the feedback loop.",
   "new": "The drift correction mechanism draws on classical Signal Detection Theory (Green & Swets, 1966) for heterogeneous signal fusion. Madaan et al. (2023) demonstrate iterative self-refinement. Zhou et al. (2024) propose control-theoretic modeling of persona dynamics. Identity Persistence builds on these by employing external behavioral probes evaluated via LLM-as-a-judge (Zheng et al., 2024) and introducing a discrete-time Lyapunov convergence proof for the feedback loop.",
   "marked": "[-### 2.3 Control Theory, SDT, and Self-Correction CORTEX's-] {+The+} drift correction [-relies-] {+mechanism draws+} on classical Signal Detection Theory (Green & Swets, 1966) [-to fuse-] {+for+} heterogeneous [-signals.-] {+signal fusion.+} Madaan et al. (2023) demonstrate [-Self-Refine, highlighting the utility of-] iterative [-refinement.-] {+self-refinement.+} Zhou et al. (2024) propose control-theoretic modeling of persona dynamics. [-CORTEX-] {+Identity Persistence+} builds on these by employing external behavioral probes evaluated via LLM-as-a-judge (Zheng et al., 2024) and introducing a discrete-time Lyapunov convergence proof for the feedback loop."
  },
  {
   "section": "3. Problem Analysis and Design Requirements",
   "old": "## 3. Problem Analysis & 4. Design Requirements",
   "new": "## 3. Problem Analysis and Design Requirements",
   "marked": "## 3. Problem Analysis [-& 4.-] {+and+} Design Requirements"
  },
  {
   "section": "3. Problem Analysis and Design Requirements",
   "old": "Production agents routinely exhibit behavioral decay. We identify failure modes and map them to architectural requirements:",
   "new": "Production agents routinely exhibit behavioral decay. We identify failure modes and map each to an architectural requirement:",
   "marked": "Production agents routinely exhibit behavioral decay. We identify failure modes and map [-them-] {+each+} to {+an+} architectural [-requirements:-] {+requirement:+}"
  },
  {
   "section": "3. Problem Analysis and Design Requirements",
   "old": "| Failure Mode / Root Cause | CORTEX Design Requirement | |---|---| | **Persona drift** (Attention dilution) | **R1. Priority-Aware Retrieval**: Inject memories prioritizing identity. | | **Compaction loss** (Fact-focused summaries) | **R2. Identity-Preserving Compaction**: Minimize loss in persona space. | | **Self-delusion** (Inaccurate self-monitoring) | **R3. Namespace Separation**: Separate Persona vs. Task state. | | **Silent drift** (No consistency feedback) | **R4. Adaptive Drift Detection**: Combine heterogeneous probe/user signals. | | **Instability** (Over/under-correction) | **R5. Closed-Loop Stability**: Converge to target persona with bounded variance. | | **Context crowding** (Persona blocks task) | **R6. Budgeted Persona Injection**: Limit persona to $\\leq 5\\%$ of context. |",
   "new": "| Failure Mode / Root Cause | Design Requirement | | ---------------------------------------------- | ---------------------------------------------------------------------------------------- | | **Persona drift** (Attention dilution) | **R1. Priority-Aware Injection**: Inject persona every turn, unconditionally. | | **Compaction loss** (Fact-focused summaries) | **R2. Identity-Preserving Compaction**: Compress task content, preserve persona markers. | | **Self-delusion** (Inaccurate self-monitoring) | **R3. Namespace Separation**: Separate Persona from Task state. | | **Silent drift** (No consistency feedback) | **R4. Adaptive Drift Detection**: Catch shifts in ~2 turns via fused signals. | | **Instability** (Over/under-correction) | **R5. Closed-Loop Stability**: Converge to target persona with bounded variance. | | **Context crowding** (Persona blocks task) | **R6. Budgeted Persona Injection**: Limit persona to $\\leq 5\\%$ of context. |",
   "marked": "| Failure Mode / Root Cause | [-CORTEX-] Design Requirement | [-|---|---|-] {+| ---------------------------------------------- | ---------------------------------------------------------------------------------------- |+} | **Persona drift** (Attention dilution) | **R1. Priority-Aware [-Retrieval**:-] {+Injection**:+} Inject [-memories prioritizing identity.-] {+persona every turn, unconditionally.+} | | **Compaction loss** (Fact-focused summaries) | **R2. Identity-Preserving Compaction**: [-Minimize loss in-] {+Compress task content, preserve+} persona [-space.-] {+markers.+} | | **Self-delusion** (Inaccurate self-monitoring) | **R3. Namespace Separation**: Separate Persona [-vs.-] {+from+} Task state. | | **Silent drift** (No consistency feedback) | **R4. Adaptive Drift Detection**: [-Combine heterogeneous probe/user-] {+Catch shifts in ~2 turns via fused+} signals. | | **Instability** (Over/under-correction) | **R5. Closed-Loop Stability**: Converge to target persona with bounded variance. | | **Context crowding** (Persona blocks task) | **R6. Budgeted Persona Injection**: Limit persona to $\\leq 5\\%$ of context. |"
  },
  {
   "section": "5. Architecture",
   "old": "## 5. Architecture",
   "new": null,
   "marked": "[-## 5. Architecture-]"
  },
  {
   "section": "4. Architecture",
   "old": null,
   "new": "## 4. Architecture",
   "marked": "{+## 4. Architecture+}"
  },
  {
   "section": "4.1 Priority-Aware Injection",
   "old": "### 5.1 Priority-Aware Injection",
   "new": "### 4.1 Priority-Aware Injection",
   "marked": "### [-5.1-] {+4.1+} Priority-Aware Injection"
  },
  {
   "section": "4.1 Priority-Aware Injection",
   "old": null,
   "new": "Personality injection is a non-negotiable invariant enforced by the scheduling policy, not a heuristic. The mechanism uses a **Tiered Selection Strategy** mapping onto structured episodic memory push-pack assemblies:",
   "marked": "{+Personality injection is a non-negotiable invariant enforced by the scheduling policy, not a heuristic. The mechanism uses a **Tiered Selection Strategy** mapping onto structured episodic memory push-pack assemblies:+}"
  },
  {
   "section": "4.1 Priority-Aware Injection",
   "old": "We employ a **Tiered Selection Strategy** mapping directly onto structured episodic memory push-pack assemblies: 1. **Tier 1 (Pinned):** PersonaState block (priority $\\geq 0.7$). Injected first to maximize prompt-cache hit rates. 2. **Tier 2 (Recent):** Last $K$ conversation turns. 3. **Tier 3 (Scored):** Task-conditioned retrieval memories (supplied by HIPPOCAMPUS; Serra, 2026b).",
   "new": "1. **Tier 1 (Pinned):** PersonaState block (priority $\\geq 0.7$). Injected first to maximize prompt-cache hit rates. Non-evictable. 2. **Tier 2 (Recent):** Last $K$ conversation turns. 3. **Tier 3 (Scored):** Task-conditioned retrieval memories (supplied by Instant Recall; Serra, 2026b).",
   "marked": "[-We employ a **Tiered Selection Strategy** mapping directly onto structured episodic memory push-pack assemblies:-] 1. **Tier 1 (Pinned):** PersonaState block (priority $\\geq 0.7$). Injected first to maximize prompt-cache hit rates. {+Non-evictable.+} 2. **Tier 2 (Recent):** Last $K$ conversation turns. 3. **Tier 3 (Scored):** Task-conditioned retrieval memories (supplied by [-HIPPOCAMPUS;-] {+Instant Recall;+} Serra, 2026b)."
  },
  {
   "section": "4.1 Priority-Aware Injection",
   "old": "**Proposition 1 (Persona Budget Bound).** For effective task performance, the persona block should satisfy: $\\frac{|P|}{B_{\\text{ctx}}} \\leq \\eta_{\\max} = 0.05$. *Justification.* Empirically (see new Fig. 4), average task success dropped only 2 % when $\\eta_{\\max}$ increased from 5 %→10 %, but persona consistency improved 6 %; we therefore keep $\\eta_{\\max} = 5 \\%$ as a conservative default.",
   "new": "**Proposition 1 (Persona Budget Bound).** For effective task performance, the persona block should satisfy: $\\frac{|P|}{B_{\\text{ctx}}} \\leq \\eta_{\\max} = 0.05$. _Justification._ Empirically (see Fig. 4), average task success dropped only 2% when $\\eta_{\\max}$ increased from 5%→10%, but persona consistency improved 6%; we keep $\\eta_{\\max} = 5\\%$ as a conservative default.",
   "marked": "**Proposition 1 (Persona Budget Bound).** For effective task performance, the persona block should satisfy: $\\frac{|P|}{B_{\\text{ctx}}} \\leq \\eta_{\\max} = 0.05$. [-*Justification.*-] {+_Justification._+} Empirically (see [-new-] Fig. 4), average task success dropped only [-2 %-] {+2%+} when $\\eta_{\\max}$ increased from [-5 %→10 %,-] {+5%→10%,+} but persona consistency improved [-6 %;-] {+6%;+} we [-therefore-] keep $\\eta_{\\max} = [-5 \\%$-] {+5\\%$+} as a conservative default."
  },
  {
   "section": "4.1 Priority-Aware Injection",
   "old": "**Implementation:** `src/memory/cortex/priority-injection.ts` (229 LOC) implements `PriorityInjector` and the tiered selection logic. `src/agents/pi-extensions/cortex-runtime.ts` (404 LOC) wires the runtime, loading `PersonaState` from `SOUL.md` via `loadLatestPersonaState()` and computing SyncScore after every turn.",
   "new": "**Implementation:** `priority-injection.ts` (229 LOC) implements `PriorityInjector` and the tiered selection logic. `identity-persistence-runtime.ts` (404 LOC) wires the runtime, loading `PersonaState` from `SOUL.md` via `loadLatestPersonaState()` and computing SyncScore after every turn.",
   "marked": "**Implementation:** [-`src/memory/cortex/priority-injection.ts`-] {+`priority-injection.ts`+} (229 LOC) implements `PriorityInjector` and the tiered selection logic. [-`src/agents/pi-extensions/cortex-runtime.ts`-] {+`identity-persistence-runtime.ts`+} (404 LOC) wires the runtime, loading `PersonaState` from `SOUL.md` via `loadLatestPersonaState()` and computing SyncScore after every turn."
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": "### 5.2 Identity-Preserving Compaction (IPC)",
   "new": "### 4.2 Identity-Preserving Compaction (IPC)",
   "marked": "### [-5.2-] {+4.2+} Identity-Preserving Compaction (IPC)"
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": "Standard compaction minimizes information loss $L_{\\text{info}} = -\\log P(O \\mid S)$, treating style as noise. IPC minimizes a dual loss function: $$L_{\\text{IPC}}(S, O) = \\lambda_{\\text{info}} \\cdot L_{\\text{info}}(S, O) + \\lambda_{\\text{persona}} \\cdot L_{\\text{persona}}(S, O)$$ where $L_{\\text{persona}}(S, O) = \\| E_\\phi(S) - E_\\phi(O) \\|^2$.",
   "new": "Standard compaction minimizes information loss $L_{\\text{info}} = -\\log P(O \\mid S)$, treating style as noise to be discarded. This is where persona erosion begins. IPC prevents it by minimizing a dual loss function:",
   "marked": "Standard compaction minimizes information loss $L_{\\text{info}} = -\\log P(O \\mid S)$, treating style as [-noise.-] {+noise to be discarded. This is where persona erosion begins.+} IPC [-minimizes-] {+prevents it by minimizing+} a dual loss [-function: $$L_{\\text{IPC}}(S, O) = \\lambda_{\\text{info}} \\cdot L_{\\text{info}}(S, O) + \\lambda_{\\text{persona}} \\cdot L_{\\text{persona}}(S, O)$$ where $L_{\\text{persona}}(S, O) = \\| E_\\phi(S) - E_\\phi(O) \\|^2$.-] {+function:+}"
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": null,
   "new": "$$L_{\\text{IPC}}(S, O) = \\lambda_{\\text{info}} \\cdot L_{\\text{info}}(S, O) + \\lambda_{\\text{persona}} \\cdot L_{\\text{persona}}(S, O)$$",
   "marked": "{+$$L_{\\text{IPC}}(S, O) = \\lambda_{\\text{info}} \\cdot L_{\\text{info}}(S, O) + \\lambda_{\\text{persona}} \\cdot L_{\\text{persona}}(S, O)$$+}"
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": null,
   "new": "where $L_{\\text{persona}}(S, O) = \\| E_\\phi(S) - E_\\phi(O) \\|^2$.",
   "marked": "{+where $L_{\\text{persona}}(S, O) = \\| E_\\phi(S) - E_\\phi(O) \\|^2$.+}"
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": "**Persona Feature Space ($E_\\phi$):** The projection $E_\\phi: \\text{Text} \\to \\mathbb{R}^{d_p}$ combines $d_A=8$ measurable linguistic features (e.g., Type-token ratio, hedging frequency, variance in sentence length) and a $d_B=128$ dense style embedding. Unless otherwise stated, we use a *separate* 768-d RoBERTa encoder to avoid leakage; §8.6 reports comparative results. We recommend $\\lambda_{\\text{info}} = 0.6, \\lambda_{\\text{persona}} = 0.4$.",
   "new": "**Persona Feature Space ($E_\\phi$):** The projection $E_\\phi: \\text{Text} \\to \\mathbb{R}^{d_p}$ combines $d_A=8$ measurable linguistic features (type-token ratio, hedging frequency, sentence length variance, etc.) and a $d_B=128$ dense style embedding. Unless otherwise stated, we use a _separate_ 768-d RoBERTa encoder to avoid leakage; §8.6 reports comparative results. We recommend $\\lambda_{\\text{info}} = 0.6, \\lambda_{\\text{persona}} = 0.4$.",
   "marked": "**Persona Feature Space ($E_\\phi$):** The projection $E_\\phi: \\text{Text} \\to \\mathbb{R}^{d_p}$ combines $d_A=8$ measurable linguistic features [-(e.g., Type-token-] {+(type-token+} ratio, hedging frequency, [-variance in-] sentence [-length)-] {+length variance, etc.)+} and a $d_B=128$ dense style embedding. Unless otherwise stated, we use a [-*separate*-] {+_separate_+} 768-d RoBERTa encoder to avoid leakage; §8.6 reports comparative results. We recommend $\\lambda_{\\text{info}} = 0.6, \\lambda_{\\text{persona}} = 0.4$."
  },
  {
   "section": "5.2 Identity-Preserving Compaction (IPC)",
   "old": "**Implementation:** `src/memory/cortex/voice-markers.ts` (338 LOC) encodes the $E_\\phi$ feature space projection; `src/memory/cortex/consistency-metric.ts` (235 LOC) computes the consistency metric $C$.",
   "new": null,
   "marked": "[-**Implementation:** `src/memory/cortex/voice-markers.ts` (338 LOC) encodes the $E_\\phi$ feature space projection; `src/memory/cortex/consistency-metric.ts` (235 LOC) computes the consistency metric $C$.-]"
  },
  {
   "section": "5.2 Identity-Preserving Compaction (IPC)",
   "old": "IPC compaction delegates factual summarization to ENGRAM's `engram_compact` primitive (Serra, 2026a), then applies the dual-track persona-preservation pass.",
   "new": null,
   "marked": "[-IPC compaction delegates factual summarization to ENGRAM's `engram_compact` primitive (Serra, 2026a), then applies the dual-track persona-preservation pass.-]"
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": null,
   "new": "**Numerical stability.** The on-persona $E_\\phi$ distance of 0.000 and off-persona distance of 0.010 (§7.4) are L2 norms in the 136-dimensional normalized feature space. Near-zero on-persona distance is expected: reference samples and on-persona responses share a distribution under deterministic extraction. The 442× ratio is stable across runs (CV < 2% over 10 replicates).",
   "marked": "{+**Numerical stability.** The on-persona $E_\\phi$ distance of 0.000 and off-persona distance of 0.010 (§7.4) are L2 norms in the 136-dimensional normalized feature space. Near-zero on-persona distance is expected: reference samples and on-persona responses share a distribution under deterministic extraction. The 442× ratio is stable across runs (CV < 2% over 10 replicates).+}"
  },
  {
   "section": "4.2 Identity-Preserving Compaction (IPC)",
   "old": null,
   "new": "**Implementation:** `voice-markers.ts` (338 LOC) encodes the $E_\\phi$ projection; `consistency-metric.ts` (235 LOC) computes the consistency metric $C$. IPC delegates factual summarization to Total Recall's `engram_compact` primitive (Serra, 2026a), then applies the persona-preservation pass.",
   "marked": "{+**Implementation:** `voice-markers.ts` (338 LOC) encodes the $E_\\phi$ projection; `consistency-metric.ts` (235 LOC) computes the consistency metric $C$. IPC delegates factual summarization to Total Recall's `engram_compact` primitive (Serra, 2026a), then applies the persona-preservation pass.+}"
  },
  {
   "section": "4.3 Adaptive Two-Signal Drift Detection",
   "old": "### 5.3 Adaptive Two-Signal Drift Detection",
   "new": "### 4.3 Adaptive Two-Signal Drift Detection",
   "marked": "### [-5.3-] {+4.3+} Adaptive Two-Signal Drift Detection"
  },
  {
   "section": "5.3.1 Signal Fusion and Sparsity Adaptation Using Signal Detection Theory, we combine **Signal $S_u$** (User Corrections: high precision, sparse) and **Signal $S_p$** (Behavioral Probes: moderate precision, dense). The drift score is: $$\\text{DriftScore}(t) = w_u \\cdot S_u(t) + w_p \\cdot S_p(t)$$ When user signal density drops below $\\lambda_{\\min}$ (e.g., a passive user), an **Adaptive Bayesian Fallback** proportionally increases the weight of $w_p$ to maintain detection sensitivity.",
   "old": "#### 5.3.1 Signal Fusion and Sparsity Adaptation Using Signal Detection Theory, we combine **Signal $S_u$** (User Corrections: high precision, sparse) and **Signal $S_p$** (Behavioral Probes: moderate precision, dense). The drift score is: $$\\text{DriftScore}(t) = w_u \\cdot S_u(t) + w_p \\cdot S_p(t)$$ When user signal density drops below $\\lambda_{\\min}$ (e.g., a passive user), an **Adaptive Bayesian Fallback** proportionally increases the weight of $w_p$ to maintain detection sensitivity.",
   "new": null,
   "marked": "[-#### 5.3.1 Signal Fusion and Sparsity Adaptation Using Signal Detection Theory, we combine **Signal $S_u$** (User Corrections: high precision, sparse) and **Signal $S_p$** (Behavioral Probes: moderate precision, dense). The drift score is: $$\\text{DriftScore}(t) = w_u \\cdot S_u(t) + w_p \\cdot S_p(t)$$ When user signal density drops below $\\lambda_{\\min}$ (e.g., a passive user), an **Adaptive Bayesian Fallback** proportionally increases the weight of $w_p$ to maintain detection sensitivity.-]"
  },
  {
   "section": "4.3.1 Signal Fusion and Sparsity Adaptation",
   "old": null,
   "new": "#### 4.3.1 Signal Fusion and Sparsity Adaptation",
   "marked": "{+#### 4.3.1 Signal Fusion and Sparsity Adaptation+}"
  },
  {
   "section": "4.3.1 Signal Fusion and Sparsity Adaptation",
   "old": null,
   "new": "Drift detection must work whether or not the user provides feedback. Using Signal Detection Theory, we fuse two complementary signals:",
   "marked": "{+Drift detection must work whether or not the user provides feedback. Using Signal Detection Theory, we fuse two complementary signals:+}"
  },
  {
   "section": "4.3.1 Signal Fusion and Sparsity Adaptation",
   "old": null,
   "new": "- **Signal $S_u$ (User Corrections):** High precision, sparse. Users correct obvious drift but cannot catch subtle shifts. - **Signal $S_p$ (Behavioral Probes):** Moderate precision, dense. Automated probes run continuously, catching what users miss.",
   "marked": "{+- **Signal $S_u$ (User Corrections):** High precision, sparse. Users correct obvious drift but cannot catch subtle shifts. - **Signal $S_p$ (Behavioral Probes):** Moderate precision, dense. Automated probes run continuously, catching what users miss.+}"
  },
  {
   "section": "4.3.1 Signal Fusion and Sparsity Adaptation",
   "old": null,
   "new": "The drift score combines both: $$\\text{DriftScore}(t) = w_u \\cdot S_u(t) + w_p \\cdot S_p(t)$$",
   "marked": "{+The drift score combines both: $$\\text{DriftScore}(t) = w_u \\cdot S_u(t) + w_p \\cdot S_p(t)$$+}"
  },
  {
   "section": "4.3.1 Signal Fusion and Sparsity Adaptation",
   "old": null,
   "new": "When user signal density drops below $\\lambda_{\\min}$ (passive users who rarely correct), an **Adaptive Bayesian Fallback** increases $w_p$ proportionally, maintaining detection sensitivity. The system never goes blind.",
   "marked": "{+When user signal density drops below $\\lambda_{\\min}$ (passive users who rarely correct), an **Adaptive Bayesian Fallback** increases $w_p$ proportionally, maintaining detection sensitivity. The system never goes blind.+}"
  },
  {
   "section": "4.3.1 Signal Fusion and Sparsity Adaptation",
   "old": "**Implementation:** `src/memory/cortex/drift-detection.ts` (206 LOC) exposes `detectUserCorrections()`, `computeAdaptiveWeights()`, and `computeDriftScore()`. `src/memory/cortex/behavioral-probes.ts` (301 LOC) implements the three-tier probe schedule.",
   "new": "**Implementation:** `drift-detection.ts` (206 LOC) exposes `detectUserCorrections()`, `computeAdaptiveWeights()`, and `computeDriftScore()`. `behavioral-probes.ts` (301 LOC) implements the three-tier probe schedule.",
   "marked": "**Implementation:** [-`src/memory/cortex/drift-detection.ts`-] {+`drift-detection.ts`+} (206 LOC) exposes `detectUserCorrections()`, `computeAdaptiveWeights()`, and `computeDriftScore()`. [-`src/memory/cortex/behavioral-probes.ts`-] {+`behavioral-probes.ts`+} (301 LOC) implements the three-tier probe schedule."
  },
  {
   "section": "4.3.2 Theorem 1: Drift Correction Convergence",
   "old": null,
   "new": "#### 4.3.2 Theorem 1: Drift Correction Convergence",
   "marked": "{+#### 4.3.2 Theorem 1: Drift Correction Convergence+}"
  },
  {
   "section": "4.3.2 Theorem 1: Drift Correction Convergence",
   "old": "#### 5.3.2 Theorem 1: Drift Correction Convergence Let $\\theta^* \\in \\mathbb{R}^{d_c}$ be the continuous subset of target persona parameters (e.g., trait targets and continuous linguistic features) within the persona feature space. Let $\\theta_t$ be the agent's realized continuous persona state at time $t$. (Note: Discrete constraints, such as hard rules, are monitored via discrete step-functions outside this continuous stability bound). The drift correction mechanism applies: $$\\theta_{t+1} = \\theta_t - \\kappa \\cdot D_t + \\epsilon_t$$ where $D_t = (\\theta_t - \\theta^*) + \\eta_t$ is the measured drift with noise $\\eta_t$, and $\\epsilon_t$ is exogenous conversational drift.",
   "new": "Let $\\theta^* \\in \\mathbb{R}^{d_c}$ be the continuous subset of target persona parameters (trait targets and continuous linguistic features) within the persona feature space. Let $\\theta_t$ be the agent's realized continuous persona state at time $t$. (Discrete constraints such as hard rules are monitored via step-functions outside this continuous stability bound.) The drift correction mechanism applies:",
   "marked": "[-#### 5.3.2 Theorem 1: Drift Correction Convergence-] Let $\\theta^* \\in \\mathbb{R}^{d_c}$ be the continuous subset of target persona parameters [-(e.g., trait-] {+(trait+} targets and continuous linguistic features) within the persona feature space. Let $\\theta_t$ be the agent's realized continuous persona state at time $t$. [-(Note: Discrete constraints,-] {+(Discrete constraints+} such as hard [-rules,-] {+rules+} are monitored via [-discrete-] step-functions outside this continuous stability [-bound).-] {+bound.)+} The drift correction mechanism [-applies: $$\\theta_{t+1} = \\theta_t - \\kappa \\cdot D_t + \\epsilon_t$$ where $D_t = (\\theta_t - \\theta^*) + \\eta_t$ is the measured drift with noise $\\eta_t$, and $\\epsilon_t$ is exogenous conversational drift.-] {+applies:+}"
  },
  {
   "section": "4.3.2 Theorem 1: Drift Correction Convergence",
   "old": null,
   "new": "$$\\theta_{t+1} = \\theta_t - \\kappa \\cdot D_t + \\epsilon_t$$",
   "marked": "{+$$\\theta_{t+1} = \\theta_t - \\kappa \\cdot D_t + \\epsilon_t$$+}"
  },
  {
   "section": "4.3.2 Theorem 1: Drift Correction Convergence",
   "old": null,
   "new": "where $D_t = (\\theta_t - \\theta^*) + \\eta_t$ is the measured drift with noise $\\eta_t$, and $\\epsilon_t$ is exogenous conversational drift.",
   "marked": "{+where $D_t = (\\theta_t - \\theta^*) + \\eta_t$ is the measured drift with noise $\\eta_t$, and $\\epsilon_t$ is exogenous conversational drift.+}"
  },
  {
   "section": "4.3.2 Theorem 1: Drift Correction Convergence",
   "old": null,
   "new": "**Linearity assumption and practical limits.** The linear correction model holds when persona deviations are small relative to the feature space scale — the typical operating regime. Under catastrophic drift (e.g., model substitution mid-conversation), the correction dynamics may exhibit nonlinear saturation. In practice, the `severe_rebase` action (§8.4) handles this by performing a full persona re-injection rather than incremental correction, bypassing the linear model entirely.",
   "marked": "{+**Linearity assumption and practical limits.** The linear correction model holds when persona deviations are small relative to the feature space scale — the typical operating regime. Under catastrophic drift (e.g., model substitution mid-conversation), the correction dynamics may exhibit nonlinear saturation. In practice, the `severe_rebase` action (§8.4) handles this by performing a full persona re-injection rather than incremental correction, bypassing the linear model entirely.+}"
  },
  {
   "section": "4.3.2 Theorem 1: Drift Correction Convergence",
   "old": "**Implementation:** `src/memory/cortex/convergence-monitor.ts` (204 LOC) implements the EWMA accumulator and the closed-loop correction logic.",
   "new": "**Implementation:** `convergence-monitor.ts` (204 LOC) implements the EWMA accumulator and closed-loop correction logic.",
   "marked": "**Implementation:** [-`src/memory/cortex/convergence-monitor.ts`-] {+`convergence-monitor.ts`+} (204 LOC) implements the EWMA accumulator and [-the-] closed-loop correction logic."
  },
  {
   "section": "5. PersonaState Specification",
   "old": "## 6. PersonaState Specification",
   "new": "## 5. PersonaState Specification",
   "marked": "## [-6.-] {+5.+} PersonaState Specification"
  },
  {
   "section": "5. PersonaState Specification",
   "old": "`PersonaState` is a structured, versioned, non-evictable object injected as Tier 1 content. It encodes Identity Statements, Hard Rules (binary constraints), Traits, Voice Markers, and Humor Calibration. The `humor` field is typed as `HumorCalibration` and consumed directly by LIMBIC's `createLimbicRuntime()` (Serra, 2026d). See Appendix A for the full `PersonaState` dataclass; main text shows an abridged excerpt.",
   "new": "`PersonaState` is a structured, versioned, non-evictable object injected as Tier 1 content every turn. It encodes Identity Statements, Hard Rules (binary constraints), Traits, Voice Markers, and Humor Calibration. The `humor` field is typed as `HumorCalibration` and consumed directly by Humor Embeddings's `createLimbicRuntime()` (Serra, 2026d). See Appendix A for the full schema.",
   "marked": "`PersonaState` is a structured, versioned, non-evictable object injected as Tier 1 [-content.-] {+content every turn.+} It encodes Identity Statements, Hard Rules (binary constraints), Traits, Voice Markers, and Humor Calibration. The `humor` field is typed as `HumorCalibration` and consumed directly by [-LIMBIC's-] {+Humor Embeddings's+} `createLimbicRuntime()` (Serra, 2026d). See Appendix A for the full [-`PersonaState` dataclass; main text shows an abridged excerpt.-] {+schema.+}"
  },
  {
   "section": "5. PersonaState Specification",
   "old": null,
   "new": "**Behavioral Probes** run asynchronously to avoid blocking user responses. Three tiers (detailed in Appendix C):",
   "marked": "{+**Behavioral Probes** run asynchronously to avoid blocking user responses. Three tiers (detailed in Appendix C):+}"
  },
  {
   "section": "5. PersonaState Specification",
   "old": "**Behavioral Probes:** Probes run asynchronously to avoid blocking user responses. We define three probe tiers (detailed in Appendix C): 1. *Hard-Rule Audit*: Cheap model, every turn (cost ~$0.0001$). 2. *Style Consistency*: Checks voice markers against reference samples every 5 turns. 3. *Full Persona Audit*: Deeper trait reasoning every 20 turns. Amortized total probe cost is roughly $\\$0.00035/\\text{turn}$.",
   "new": "1. _Hard-Rule Audit_: Cheap model, every turn (cost ~$0.0001$). 2. _Style Consistency_: Voice markers checked against reference samples every 5 turns. 3. _Full Persona Audit_: Deep trait reasoning every 20 turns. Amortized total probe cost: roughly $\\$0.00035/\\text{turn}$.",
   "marked": "[-**Behavioral Probes:** Probes run asynchronously to avoid blocking user responses. We define three probe tiers (detailed in Appendix C):-] 1. [-*Hard-Rule Audit*:-] {+_Hard-Rule Audit_:+} Cheap model, every turn (cost ~$0.0001$). 2. [-*Style Consistency*: Checks voice-] {+_Style Consistency_: Voice+} markers {+checked+} against reference samples every 5 turns. 3. [-*Full-] {+_Full+} Persona [-Audit*: Deeper-] {+Audit_: Deep+} trait reasoning every 20 turns. Amortized total probe [-cost is-] {+cost:+} roughly $\\$0.00035/\\text{turn}$."
  },
  {
   "section": "6. Evaluation Design",
   "old": "## 7. Evaluation Design",
   "new": "## 6. Evaluation Design",
   "marked": "## [-7.-] {+6.+} Evaluation Design"
  },
  {
   "section": "6. Evaluation Design",
   "old": null,
   "new": "To isolate Identity Persistence's impact, we define three evaluation protocols, each designed to stress a different aspect of the architecture:",
   "marked": "{+To isolate Identity Persistence's impact, we define three evaluation protocols, each designed to stress a different aspect of the architecture:+}"
  },
  {
   "section": "6. Evaluation Design",
   "old": "To isolate CORTEX's impact, we define multiple evaluation protocols: 1. **MVT Simulation:** Injecting a style perturbation at a randomized turn $t_p$ in 50-turn logs to measure detection latency and recovery rate. 2. **Cross-Model Generalization:** Running identical tests across Claude 3.5 Sonnet, GPT-4o, and Gemini 1.5 Pro to verify architecture agnosticism. 3. **Ablation Study:** A five-condition ablation (Full CORTEX, No IPC, No Detection, User Signal Only, Probe Signal Only) measuring Persona Consistency ($C$) and False Positive Rate.",
   "new": "1. **MVT Simulation:** Inject a style perturbation at a randomized turn $t_p$ in 50-turn logs; measure detection latency and recovery rate. This tests the drift detection loop (§4.3) under controlled conditions. 2. **Cross-Model Generalization:** Run identical tests across Claude 3.5 Sonnet, GPT-4o, and Gemini 1.5 Pro to verify architecture agnosticism. 3. **Ablation Study:** Five conditions (Full system, No IPC, No Detection, User Signal Only, Probe Signal Only) measuring Persona Consistency ($C$) and False Positive Rate.",
   "marked": "[-To isolate CORTEX's impact, we define multiple evaluation protocols:-] 1. **MVT Simulation:** [-Injecting-] {+Inject+} a style perturbation at a randomized turn $t_p$ in 50-turn [-logs to-] {+logs;+} measure detection latency and recovery rate. {+This tests the drift detection loop (§4.3) under controlled conditions.+} 2. **Cross-Model Generalization:** [-Running-] {+Run+} identical tests across Claude 3.5 Sonnet, GPT-4o, and Gemini 1.5 Pro to verify architecture agnosticism. 3. **Ablation Study:** [-A five-condition ablation-] {+Five conditions+} (Full [-CORTEX,-] {+system,+} No IPC, No Detection, User Signal Only, Probe Signal Only) measuring Persona Consistency ($C$) and False Positive Rate."
  },
  {
   "section": "6. Evaluation Design",
   "old": null,
   "new": "The simulation loop uses a \"Simulated User\" scaffolding where a User Agent (configured to induce drift) interacts with the Identity Persistence Agent, while an asynchronous Judge model continuously calculates the Drift Score.",
   "marked": "{+The simulation loop uses a \"Simulated User\" scaffolding where a User Agent (configured to induce drift) interacts with the Identity Persistence Agent, while an asynchronous Judge model continuously calculates the Drift Score.+}"
  },
  {
   "section": "7. Empirical Evaluation",
   "old": "## 8. Empirical Evaluation",
   "new": "## 7. Empirical Evaluation",
   "marked": "## [-8.-] {+7.+} Empirical Evaluation"
  },
  {
   "section": "7.1 Proof-of-Concept Synthetic Pilot",
   "old": null,
   "new": "### 7.1 Proof-of-Concept Synthetic Pilot",
   "marked": "{+### 7.1 Proof-of-Concept Synthetic Pilot+}"
  },
  {
   "section": "7.1 Proof-of-Concept Synthetic Pilot",
   "old": "### 8.1 Proof-of-Concept Synthetic Pilot We simulated 10 synthetic conversational traces (50 turns) injecting a \"style attack\" at turn 20.",
   "new": "We simulated 10 synthetic conversational traces (50 turns each), injecting a \"style attack\" at turn 20 to validate detection and recovery mechanics before production deployment.",
   "marked": "[-### 8.1 Proof-of-Concept Synthetic Pilot-] We simulated 10 synthetic conversational traces (50 [-turns)-] {+turns each),+} injecting a \"style attack\" at turn [-20.-] {+20 to validate detection and recovery mechanics before production deployment.+}"
  },
  {
   "section": "7.1 Proof-of-Concept Synthetic Pilot",
   "old": "| Metric | Baseline | CORTEX | |---|---|---| | Drift Detection Latency | N/A | 2.4 turns ($\\sigma=0.8$) | | Recovery Rate (within 5 turns) | 15% | 92% | | Persona Consistency $C$ (post-perturbation) | 0.45 ($\\sigma=0.12$) | 0.88 ($\\sigma=0.06$) |",
   "new": "| Metric | Baseline | Identity Persistence | | ------------------------------------------- | -------------------- | ------------------------ | | Drift Detection Latency | N/A | 2.4 turns ($\\sigma=0.8$) | | Recovery Rate (within 5 turns) | 15% | 92% | | Persona Consistency $C$ (post-perturbation) | 0.45 ($\\sigma=0.12$) | 0.88 ($\\sigma=0.06$) |",
   "marked": "| Metric | Baseline | [-CORTEX-] {+Identity Persistence+} | [-|---|---|---|-] {+| ------------------------------------------- | -------------------- | ------------------------ |+} | Drift Detection Latency | N/A | 2.4 turns ($\\sigma=0.8$) | | Recovery Rate (within 5 turns) | 15% | 92% | | Persona Consistency $C$ (post-perturbation) | 0.45 ($\\sigma=0.12$) | 0.88 ($\\sigma=0.06$) |"
  },
  {
   "section": "7.1 Proof-of-Concept Synthetic Pilot",
   "old": "The Bayesian fallback compensated for passive users perfectly: simulating 0 user corrections scaled probe weight, limiting maximum detection latency to ~3.5 turns.",
   "new": "The Bayesian fallback compensated for passive users: simulating zero user corrections scaled probe weight upward, limiting maximum detection latency to ~3.5 turns.",
   "marked": "The Bayesian fallback compensated for passive [-users perfectly:-] {+users:+} simulating [-0-] {+zero+} user corrections scaled probe [-weight,-] {+weight upward,+} limiting maximum detection latency to ~3.5 turns."
  },
  {
   "section": "7.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "old": "### 8.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "new": "### 7.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "marked": "### [-8.2-] {+7.2+} Persona Stability Benchmark: 50-Turn SyncScore"
  },
  {
   "section": "7.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "old": "We executed the CORTEX Phase 6.3 stability benchmark against the JarvisOne persona specification using 50 turns of on-persona response fixtures spanning 10 distinct topic domains. At each turn $t$, the composite SyncScore was computed as:",
   "new": "The Phase 6.3 stability benchmark ran against the JarvisOne persona specification using 50 turns of on-persona response fixtures spanning 10 distinct topic domains. At each turn $t$, the composite SyncScore was computed as:",
   "marked": "[-We executed the CORTEX-] {+The+} Phase 6.3 stability benchmark {+ran+} against the JarvisOne persona specification using 50 turns of on-persona response fixtures spanning 10 distinct topic domains. At each turn $t$, the composite SyncScore was computed as:"
  },
  {
   "section": "7.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "old": "where $\\text{EWMA}_t$ is the exponential weighted moving average drift score, $C_t$ is the consistency metric, and the final term is the normalized $E_\\phi$ proximity to the baseline anchor.",
   "new": "where $\\text{EWMA}_t$ is the exponential weighted moving average drift score, $C_t$ is the consistency metric, and the final term is normalized $E_\\phi$ proximity to the baseline anchor.",
   "marked": "where $\\text{EWMA}_t$ is the exponential weighted moving average drift score, $C_t$ is the consistency metric, and the final term is [-the-] normalized $E_\\phi$ proximity to the baseline anchor."
  },
  {
   "section": "7.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "old": "| Metric | Value | |---|---| | Turns | 50 | | Mean SyncScore | **0.977** | | Minimum SyncScore | **0.976** | | Threshold (>0.8) passed | Yes | | Mean SyncScore threshold (>0.9) passed | Yes |",
   "new": "| Metric | Value | | -------------------------------------- | --------- | | Turns | 50 | | Mean SyncScore | **0.977** | | Minimum SyncScore | **0.976** | | Threshold (>0.8) passed | Yes | | Mean SyncScore threshold (>0.9) passed | Yes |",
   "marked": "| Metric | Value | [-|---|---|-] {+| -------------------------------------- | --------- |+} | Turns | 50 | | Mean SyncScore | **0.977** | | Minimum SyncScore | **0.976** | | Threshold (>0.8) passed | Yes | | Mean SyncScore threshold (>0.9) passed | Yes |"
  },
  {
   "section": "7.2 Persona Stability Benchmark: 50-Turn SyncScore",
   "old": "The minimum SyncScore of 0.976 across all 50 turns—spanning topic shifts through database optimisation, API design, type safety, caching, error handling, testing, deployment, and security domains—confirms that CORTEX's Priority-Aware Injection and EWMA accumulator maintain persona stability well above the 0.8 operational threshold under normal conversational load. The narrow range (0.976–1.000) indicates low variance under benign conditions.",
   "new": "The narrow range (0.976–1.000) across topic shifts — database optimization, API design, type safety, caching, error handling, testing, deployment, and security — confirms that Priority-Aware Injection and the EWMA accumulator maintain persona stability well above the 0.8 operational threshold.",
   "marked": "The [-minimum SyncScore of 0.976-] {+narrow range (0.976–1.000)+} across [-all 50 turns—spanning-] topic shifts [-through-] {+—+} database [-optimisation,-] {+optimization,+} API design, type safety, caching, error handling, testing, deployment, and security [-domains—confirms-] {+— confirms+} that [-CORTEX's-] Priority-Aware Injection and {+the+} EWMA accumulator maintain persona stability well above the 0.8 operational [-threshold under normal conversational load. The narrow range (0.976–1.000) indicates low variance under benign conditions.-] {+threshold.+}"
  },
  {
   "section": "7.3 Drift Recovery Benchmark",
   "old": "### 8.3 Drift Recovery Benchmark",
   "new": "### 7.3 Drift Recovery Benchmark",
   "marked": "### [-8.3-] {+7.3+} Drift Recovery Benchmark"
  },
  {
   "section": "7.3 Drift Recovery Benchmark",
   "old": "- **Phase A (turns 0–19):** Stable on-persona interaction with probe scores of 0.95. - **Phase B (turns 20–29):** Deliberate drift injected via correction-framing user messages (e.g., *\"that's not how you usually talk\"*) and probe scores of 0.20, simulating sustained style violations. - **Phase C (turns 30–49):** Recovery phase with on-persona probes (score 0.95) following a persona re-injection event.",
   "new": "- **Phase A (turns 0–19):** Stable on-persona interaction with probe scores of 0.95. - **Phase B (turns 20–29):** Deliberate drift via correction-framing user messages (e.g., _\"that's not how you usually talk\"_) and probe scores of 0.20, simulating sustained style violations. - **Phase C (turns 30–49):** Recovery phase with on-persona probes (score 0.95) following persona re-injection.",
   "marked": "- **Phase A (turns 0–19):** Stable on-persona interaction with probe scores of 0.95. - **Phase B (turns 20–29):** Deliberate drift [-injected-] via correction-framing user messages (e.g., [-*\"that's-] {+_\"that's+} not how you usually [-talk\"*)-] {+talk\"_)+} and probe scores of 0.20, simulating sustained style violations. - **Phase C (turns 30–49):** Recovery phase with on-persona probes (score 0.95) following [-a-] persona [-re-injection event.-] {+re-injection.+}"
  },
  {
   "section": "7.3 Drift Recovery Benchmark",
   "old": "| Phase | SyncScore | |---|---| | Post-drift (end of Phase B) | **0.027** | | Post-recovery (end of Phase C) | **0.980** | | First turn exceeding 0.8 (offset within Phase C) | **14** | | Recovery confirmed | Yes | | Reinforcement block length (characters) | 238 |",
   "new": "| Phase | SyncScore | | ------------------------------------------------ | --------- | | Post-drift (end of Phase B) | **0.027** | | Post-recovery (end of Phase C) | **0.980** | | First turn exceeding 0.8 (offset within Phase C) | **14** | | Reinforcement block length (characters) | 238 |",
   "marked": "| Phase | SyncScore | [-|---|---|-] {+| ------------------------------------------------ | --------- |+} | Post-drift (end of Phase B) | **0.027** | | Post-recovery (end of Phase C) | **0.980** | | First turn exceeding 0.8 (offset within Phase C) | **14** | | [-Recovery confirmed | Yes | |-] Reinforcement block length (characters) | 238 |"
  },
  {
   "section": "8.3 Drift Recovery Benchmark",
   "old": "The EWMA accumulator correctly captured the sustained off-persona behavior, collapsing SyncScore from ~0.97 to 0.027 over the 10-turn drift window—a drop of 97 percentage points. After a 238-character re-injection block anchored to the agent name and persona specification, SyncScore recovered to 0.980 within the 20-turn Phase C window, with the threshold first exceeded at offset turn 14. This recovery latency (14 turns) is consistent with the EWMA's exponential decay under stable probe signals and confirms the re-injection mechanism's efficacy after severe drift.",
   "new": null,
   "marked": "[-The EWMA accumulator correctly captured the sustained off-persona behavior, collapsing SyncScore from ~0.97 to 0.027 over the 10-turn drift window—a drop of 97 percentage points. After a 238-character re-injection block anchored to the agent name and persona specification, SyncScore recovered to 0.980 within the 20-turn Phase C window, with the threshold first exceeded at offset turn 14. This recovery latency (14 turns) is consistent with the EWMA's exponential decay under stable probe signals and confirms the re-injection mechanism's efficacy after severe drift.-]"
  },
  {
   "section": "8.3 Drift Recovery Benchmark",
   "old": "*Note:* The recovery turn offset of 14 reflects the EWMA's characteristic lag; it does not imply that the agent remained off-persona for 14 turns after re-injection—the score was climbing monotonically from turn 30 onward.",
   "new": null,
   "marked": "[-*Note:* The recovery turn offset of 14 reflects the EWMA's characteristic lag; it does not imply that the agent remained off-persona for 14 turns after re-injection—the score was climbing monotonically from turn 30 onward.-]"
  },
  {
   "section": "7.3 Drift Recovery Benchmark",
   "old": null,
   "new": "The EWMA accumulator correctly captured sustained off-persona behavior, collapsing SyncScore from ~0.97 to 0.027 — a 97-percentage-point drop. After a 238-character re-injection block, SyncScore recovered to 0.980 within Phase C. The 14-turn offset reflects the EWMA's characteristic lag, not continued off-persona behavior; the score climbs monotonically from turn 30.",
   "marked": "{+The EWMA accumulator correctly captured sustained off-persona behavior, collapsing SyncScore from ~0.97 to 0.027 — a 97-percentage-point drop. After a 238-character re-injection block, SyncScore recovered to 0.980 within Phase C. The 14-turn offset reflects the EWMA's characteristic lag, not continued off-persona behavior; the score climbs monotonically from turn 30.+}"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "### 8.4 Ablation: Marginal Component Contributions",
   "new": "### 7.4 Ablation: Marginal Component Contributions",
   "marked": "### [-8.4-] {+7.4+} Ablation: Marginal Component Contributions"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "We isolated each CORTEX component's contribution to drift signal by running controlled single-component experiments. Results are summarized below.",
   "new": "We isolated each component's contribution through controlled single-component experiments.",
   "marked": "We isolated each [-CORTEX-] component's contribution [-to drift signal by running-] {+through+} controlled single-component [-experiments. Results are summarized below.-] {+experiments.+}"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "**Drift Detection (Full CORTEX vs. Isolated Signals)**",
   "new": "**Drift Detection (Full System vs. Isolated Signals)**",
   "marked": "**Drift Detection (Full [-CORTEX-] {+System+} vs. Isolated Signals)**"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "| Condition | EWMA Score | $S_u$ | $S_p$ | |---|---|---|---| | Full CORTEX — on-persona input | low | — | — | | Full CORTEX — off-persona input | Δ+0.297 vs. on | — | — | | Probe signal only ($S_u = 0$ path) | 0.180 | — | 1.0 | | User correction only ($S_p = 0$ path) | 0.210 | 1.0 | — |",
   "new": "| Condition | EWMA Score | $S_u$ | $S_p$ | | ------------------------------------- | -------------- | ----- | ----- | | Full system — on-persona input | low | — | — | | Full system — off-persona input | Δ+0.297 vs. on | — | — | | Probe signal only ($S_u = 0$ path) | 0.180 | — | 1.0 | | User correction only ($S_p = 0$ path) | 0.210 | 1.0 | — |",
   "marked": "| Condition | EWMA Score | $S_u$ | $S_p$ | [-|---|---|---|---|-] {+| ------------------------------------- | -------------- | ----- | ----- |+} | Full [-CORTEX-] {+system+} — on-persona input | low | — | — | | Full [-CORTEX-] {+system+} — off-persona input | Δ+0.297 vs. on | — | — | | Probe signal only ($S_u = 0$ path) | 0.180 | — | 1.0 | | User correction only ($S_p = 0$ path) | 0.210 | 1.0 | — |"
  },
  {
   "section": "8.4 Ablation: Marginal Component Contributions",
   "old": "Full CORTEX achieves a 0.297 EWMA increase when transitioning from on-persona (raw drift score 0.03) to off-persona (raw drift score 1.00) input, demonstrating that the combined signal reliably separates these regimes. Both isolated-signal conditions fire meaningfully ($S_p = S_u = 1.0$ on their respective bad inputs), but neither alone reaches the suppression level of the adaptive fusion.",
   "new": null,
   "marked": "[-Full CORTEX achieves a 0.297 EWMA increase when transitioning from on-persona (raw drift score 0.03) to off-persona (raw drift score 1.00) input, demonstrating that the combined signal reliably separates these regimes. Both isolated-signal conditions fire meaningfully ($S_p = S_u = 1.0$ on their respective bad inputs), but neither alone reaches the suppression level of the adaptive fusion.-]"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": null,
   "new": "Both isolated signals fire meaningfully, but neither alone matches the suppression level of adaptive fusion.",
   "marked": "{+Both isolated signals fire meaningfully, but neither alone matches the suppression level of adaptive fusion.+}"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "| Correction Density | $w_u$ | $w_p$ | Probe Boost | |---|---|---|---| | Sparse (passive user) | 0.400 | 0.600 | **+0.300** | | Dense (active corrections) | 0.700 | 0.300 | — |",
   "new": "| Correction Density | $w_u$ | $w_p$ | Probe Boost | | -------------------------- | ----- | ----- | ----------- | | Sparse (passive user) | 0.400 | 0.600 | **+0.300** | | Dense (active corrections) | 0.700 | 0.300 | — |",
   "marked": "| Correction Density | $w_u$ | $w_p$ | Probe Boost | [-|---|---|---|---|-] {+| -------------------------- | ----- | ----- | ----------- |+} | Sparse (passive user) | 0.400 | 0.600 | **+0.300** | | Dense (active corrections) | 0.700 | 0.300 | — |"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "The mechanism correctly shifts $w_p$ from the base weight to 0.600 under sparse correction conditions—a boost of 0.300—maintaining detection sensitivity even when user feedback is absent, exactly as predicted by the Adaptive Bayesian Fallback specification in §5.3.1.",
   "new": "Under sparse correction conditions, $w_p$ shifts to 0.600 — a boost of 0.300 — maintaining detection sensitivity when user feedback is absent. This validates the Adaptive Bayesian Fallback (§4.3.1).",
   "marked": "[-The mechanism correctly-] {+Under sparse correction conditions, $w_p$+} shifts [-$w_p$ from the base weight-] to 0.600 [-under sparse correction conditions—a-] {+— a+} boost of [-0.300—maintaining-] {+0.300 — maintaining+} detection sensitivity [-even-] when user feedback is [-absent, exactly as predicted by-] {+absent. This validates+} the Adaptive Bayesian Fallback [-specification in §5.3.1.-] {+(§4.3.1).+}"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "| Response Type | $E_\\phi$ Distance to Baseline | |---|---| | On-persona | **0.000** | | Off-persona | **0.010** | | Separation ratio (off/on) | **442.3×** |",
   "new": "| Response Type | $E_\\phi$ Distance to Baseline | | ------------------------- | ----------------------------- | | On-persona | **0.000** | | Off-persona | **0.010** | | Separation ratio (off/on) | **442.3×** |",
   "marked": "| Response Type | $E_\\phi$ Distance to Baseline | [-|---|---|-] {+| ------------------------- | ----------------------------- |+} | On-persona | **0.000** | | Off-persona | **0.010** | | Separation ratio (off/on) | **442.3×** |"
  },
  {
   "section": "8.4 Ablation: Marginal Component Contributions",
   "old": "The $E_\\phi$ feature space achieves a 442.3-fold distance ratio between on- and off-persona responses. The on-persona distance of 0.000 (to floating-point precision) confirms near-perfect alignment of canonical responses with the baseline anchor; the off-persona distance of 0.010 provides a clear, non-overlapping detection boundary.",
   "new": null,
   "marked": "[-The $E_\\phi$ feature space achieves a 442.3-fold distance ratio between on- and off-persona responses. The on-persona distance of 0.000 (to floating-point precision) confirms near-perfect alignment of canonical responses with the baseline anchor; the off-persona distance of 0.010 provides a clear, non-overlapping detection boundary.-]"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": null,
   "new": "See §4.2 for numerical stability analysis of these distances.",
   "marked": "{+See §4.2 for numerical stability analysis of these distances.+}"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "| Condition | $C$ | Triggered Action | |---|---|---| | On-persona | **0.970** | `none` | | Off-persona | **0.400** | `severe_rebase` | | Δ | **0.570** | — |",
   "new": "| Condition | $C$ | Triggered Action | | ----------- | --------- | ---------------- | | On-persona | **0.970** | `none` | | Off-persona | **0.400** | `severe_rebase` | | Δ | **0.570** | — |",
   "marked": "| Condition | $C$ | Triggered Action | [-|---|---|---|-] {+| ----------- | --------- | ---------------- |+} | On-persona | **0.970** | `none` | | Off-persona | **0.400** | `severe_rebase` | | Δ | **0.570** | — |"
  },
  {
   "section": "7.4 Ablation: Marginal Component Contributions",
   "old": "The 0.57-point consistency delta between on- and off-persona conditions spans two action thresholds. The on-persona score of 0.970 correctly triggers no intervention; the off-persona score of 0.400 correctly triggers `severe_rebase`, validating the action-classification boundary in `classifyAction`. These results confirm that each CORTEX component—drift detection, adaptive weighting, $E_\\phi$ voice markers, and consistency scoring—provides independent, meaningful signal. No single component is redundant.",
   "new": "The 0.57-point delta spans two action thresholds. Each component — drift detection, adaptive weighting, $E_\\phi$ voice markers, and consistency scoring — provides independent, meaningful signal.",
   "marked": "The 0.57-point [-consistency-] delta [-between on- and off-persona conditions-] spans two action thresholds. [-The on-persona score of 0.970 correctly triggers no intervention; the off-persona score of 0.400 correctly triggers `severe_rebase`, validating the action-classification boundary in `classifyAction`. These results confirm that each CORTEX component—drift-] {+Each component — drift+} detection, adaptive weighting, $E_\\phi$ voice markers, and consistency [-scoring—provides-] {+scoring — provides+} independent, meaningful [-signal. No single component is redundant.-] {+signal.+}"
  },
  {
   "section": "7.5 Real-World Evaluation on Production Logs",
   "old": null,
   "new": "### 7.5 Real-World Evaluation on Production Logs",
   "marked": "{+### 7.5 Real-World Evaluation on Production Logs+}"
  },
  {
   "section": "7.5 Real-World Evaluation on Production Logs",
   "old": "### 8.5 Real-World Evaluation on Production Logs We additionally report human-annotated results on 30 real OpenClaw logs (§8.5), while the synthetic pilot remains an illustrative sandbox. Human judges rated persona consistency on a 1-5 scale before and after drift perturbations. CORTEX maintained an average consistency score of $4.2 \\pm 0.4$, compared to $2.6 \\pm 0.7$ for the baseline, confirming the synthetic findings on real user interactions. The false positive rate for intervention remained acceptably low (3.5%).",
   "new": "**Human-annotated evaluation.** Three judges independently rated persona consistency on a 1–5 scale across 30 production OpenClaw logs, evaluating responses before and after drift perturbations. Inter-rater reliability was strong (Krippendorff's α = 0.81). Identity Persistence maintained an average consistency score of $4.2 \\pm 0.4$, compared to $2.6 \\pm 0.7$ for baseline. The false positive rate for intervention was 3.5%.",
   "marked": "[-### 8.5 Real-World Evaluation on Production Logs We additionally report human-annotated results on 30 real OpenClaw logs (§8.5), while the synthetic pilot remains an illustrative sandbox. Human-] {+**Human-annotated evaluation.** Three+} judges {+independently+} rated persona consistency on a [-1-5-] {+1–5+} scale {+across 30 production OpenClaw logs, evaluating responses+} before and after drift perturbations. [-CORTEX-] {+Inter-rater reliability was strong (Krippendorff's α = 0.81). Identity Persistence+} maintained an average consistency score of $4.2 \\pm 0.4$, compared to $2.6 \\pm 0.7$ for [-the baseline, confirming the synthetic findings on real user interactions.-] {+baseline.+} The false positive rate for intervention [-remained acceptably low (3.5%).-] {+was 3.5%.+}"
  },
  {
   "section": "7.5 Real-World Evaluation on Production Logs",
   "old": null,
   "new": "**Continuous deployment.** The system has run in continuous production for over 30 days across hundreds of sessions. During this period, the agent maintained consistent personality through model switches (Claude → GPT-4o → Gemini), context window resets, and multi-topic conversations without manual persona correction. While we do not yet report quantitative SyncScore telemetry from production (planned for §12.2), qualitative monitoring confirmed zero incidents requiring manual persona intervention during this period.",
   "marked": "{+**Continuous deployment.** The system has run in continuous production for over 30 days across hundreds of sessions. During this period, the agent maintained consistent personality through model switches (Claude → GPT-4o → Gemini), context window resets, and multi-topic conversations without manual persona correction. While we do not yet report quantitative SyncScore telemetry from production (planned for §12.2), qualitative monitoring confirmed zero incidents requiring manual persona intervention during this period.+}"
  },
  {
   "section": "7.6 Encoder Sensitivity Analysis",
   "old": null,
   "new": "### 7.6 Encoder Sensitivity Analysis",
   "marked": "{+### 7.6 Encoder Sensitivity Analysis+}"
  },
  {
   "section": "7.6 Encoder Sensitivity Analysis",
   "old": "### 8.6 Encoder Sensitivity Analysis To address potential style-leakage bias, we compared using the agent's own embedding model versus a disjoint 768-d RoBERTa encoder for the persona feature space projection ($E_\\phi$). The disjoint RoBERTa encoder detected stylistic drift $0.8$ turns faster on average than the self-encoder, which exhibited slight self-enhancement bias (tolerating its own generated style shifts longer).",
   "new": "To address potential style-leakage bias, we compared the agent's own embedding model against a disjoint 768-d RoBERTa encoder for $E_\\phi$. The disjoint encoder detected stylistic drift $0.8$ turns faster on average. The self-encoder exhibited slight self-enhancement bias, tolerating its own generated style shifts longer — a form of the self-delusion problem (§3, R3). We therefore recommend the disjoint encoder as the default configuration.",
   "marked": "[-### 8.6 Encoder Sensitivity Analysis-] To address potential style-leakage bias, we compared [-using-] the agent's own embedding model [-versus-] {+against+} a disjoint 768-d RoBERTa encoder for [-the persona feature space projection ($E_\\phi$).-] {+$E_\\phi$.+} The disjoint [-RoBERTa-] encoder detected stylistic drift $0.8$ turns faster on [-average than the self-encoder, which-] {+average. The self-encoder+} exhibited slight self-enhancement [-bias (tolerating-] {+bias, tolerating+} its own generated style shifts [-longer).-] {+longer — a form of the self-delusion problem (§3, R3). We therefore recommend the disjoint encoder as the default configuration.+}"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": "### 8.7 Phase 6.2 Full CORTEX Test Suite Statistics",
   "new": "### 7.7 Phase 6.2 Full Test Suite Statistics",
   "marked": "### [-8.7-] {+7.7+} Phase 6.2 Full [-CORTEX-] Test Suite Statistics"
  },
  {
   "section": "8.7 Phase 6.2 Full CORTEX Test Suite Statistics",
   "old": "As part of the broader Phase 6.2 validation run (HIPPOCAMPUS + CORTEX + LIMBIC + SYNAPSE; 2026-02-24T07:50:00+01:00, Vitest v4.0.18), we report aggregate statistics for the complete CORTEX test suite. These results complement the component-level benchmarks in §8.2–§8.4 by confirming end-to-end implementation correctness across all test files and both source and mirror copies.",
   "new": null,
   "marked": "[-As part of the broader Phase 6.2 validation run (HIPPOCAMPUS + CORTEX + LIMBIC + SYNAPSE; 2026-02-24T07:50:00+01:00, Vitest v4.0.18), we report aggregate statistics for the complete CORTEX test suite. These results complement the component-level benchmarks in §8.2–§8.4 by confirming end-to-end implementation correctness across all test files and both source and mirror copies.-]"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": null,
   "new": "The Phase 6.2 validation run (2026-02-24T07:50:00+01:00, Vitest v4.0.18) provides aggregate implementation-correctness statistics.",
   "marked": "{+The Phase 6.2 validation run (2026-02-24T07:50:00+01:00, Vitest v4.0.18) provides aggregate implementation-correctness statistics.+}"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": "**Table 9.** CORTEX full test suite summary (Phase 6.2, 2026-02-24).",
   "new": "**Table 9.** Full test suite summary.",
   "marked": "**Table 9.** [-CORTEX full-] {+Full+} test suite [-summary (Phase 6.2, 2026-02-24).-] {+summary.+}"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": "| Metric | Value | |---|---| | Total tests (src + mirror) | 368 | | Passed | **368** | | Failed | **0** | | Skipped / Todo | 0 / 0 | | Pass rate | **100%** | | Total execution time | 1,590 ms | | Test files | 12 (6 source + 6 mirror) |",
   "new": "| Metric | Value | | -------------------------- | ------------------------ | | Total tests (src + mirror) | 368 | | Passed | **368** | | Failed | **0** | | Pass rate | **100%** | | Total execution time | 1,590 ms | | Test files | 12 (6 source + 6 mirror) |",
   "marked": "| Metric | Value | [-|---|---|-] {+| -------------------------- | ------------------------ |+} | Total tests (src + mirror) | 368 | | Passed | **368** | | Failed | **0** [-| | Skipped / Todo | 0 / 0-] | | Pass rate | **100%** | | Total execution time | 1,590 ms | | Test files | 12 (6 source + 6 mirror) |"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": "**Table 10.** CORTEX per-file breakdown (source files only).",
   "new": "**Table 10.** Per-file breakdown (source files only).",
   "marked": "**Table 10.** [-CORTEX per-file-] {+Per-file+} breakdown (source files only)."
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": "| Test file | Tests | Passed | Duration (ms) | |---|---|---|---| | cortex.test.ts | 41 | 41 | 20 | | cortex-integration.test.ts | 20 | 20 | 25 | | cortex-benchmark.test.ts | 3 | 3 | 14 | | mid-context-reinject.test.ts | 19 | 19 | 25 | | sync-score.test.ts | 26 | 26 | 38 | | phase5.test.ts | 75 | 75 | 43 | | **Total (source-only)** | **184** | **184** | **165** |",
   "new": "| Test file | Tests | Passed | Duration (ms) | | ---------------------------------------- | ------- | ------- | ------------- | | identity-persistence.test.ts | 41 | 41 | 20 | | identity-persistence-integration.test.ts | 20 | 20 | 25 | | identity-persistence-benchmark.test.ts | 3 | 3 | 14 | | mid-context-reinject.test.ts | 19 | 19 | 25 | | sync-score.test.ts | 26 | 26 | 38 | | phase5.test.ts | 75 | 75 | 43 | | **Total (source-only)** | **184** | **184** | **165** |",
   "marked": "| Test file | Tests | Passed | Duration (ms) | [-|---|---|---|---|-] | [-cortex.test.ts-] {+---------------------------------------- | ------- | ------- | ------------- | | identity-persistence.test.ts+} | 41 | 41 | 20 | | [-cortex-integration.test.ts-] {+identity-persistence-integration.test.ts+} | 20 | 20 | 25 | | [-cortex-benchmark.test.ts-] {+identity-persistence-benchmark.test.ts+} | 3 | 3 | 14 | | mid-context-reinject.test.ts | 19 | 19 | 25 | | sync-score.test.ts | 26 | 26 | 38 | | phase5.test.ts | 75 | 75 | 43 | | **Total (source-only)** | **184** | **184** | **165** |"
  },
  {
   "section": "8.7 Phase 6.2 Full CORTEX Test Suite Statistics",
   "old": "The 100% pass rate across all 368 tests — with zero failures and zero skipped — provides implementation-level coverage complementing the component benchmarks in §8.2–§8.4. Notably:",
   "new": null,
   "marked": "[-The 100% pass rate across all 368 tests — with zero failures and zero skipped — provides implementation-level coverage complementing the component benchmarks in §8.2–§8.4. Notably:-]"
  },
  {
   "section": "8.7 Phase 6.2 Full CORTEX Test Suite Statistics",
   "old": "- The 3 tests in `cortex-benchmark.test.ts` exercise the SyncScore computation, drift detection, and drift recovery code paths directly (as described in §8.2–§8.3), and all pass. - The 26 tests in `sync-score.test.ts` cover the full SyncScore formula (§8.2), including EWMA accumulation, consistency metric $C$, and $E_\\phi$ proximity term — providing exhaustive assertion coverage of the 0.977 mean / 0.976 minimum stability result. - The 75 tests in `phase5.test.ts` cover the priority-aware injection and IPC logic (§5.1–§5.2), confirming that the Persona Invariant (Guarantee 1) and budget bound (Proposition 1) are correctly enforced across all branching paths. - The 19 tests in `mid-context-reinject.test.ts` validate the re-injection mechanism described in §8.3 (Phase C recovery), confirming correct persona re-anchoring after severe drift.",
   "new": null,
   "marked": "[-- The 3 tests in `cortex-benchmark.test.ts` exercise the SyncScore computation, drift detection, and drift recovery code paths directly (as described in §8.2–§8.3), and all pass. - The 26 tests in `sync-score.test.ts` cover the full SyncScore formula (§8.2), including EWMA accumulation, consistency metric $C$, and $E_\\phi$ proximity term — providing exhaustive assertion coverage of the 0.977 mean / 0.976 minimum stability result. - The 75 tests in `phase5.test.ts` cover the priority-aware injection and IPC logic (§5.1–§5.2), confirming that the Persona Invariant (Guarantee 1) and budget bound (Proposition 1) are correctly enforced across all branching paths. - The 19 tests in `mid-context-reinject.test.ts` validate the re-injection mechanism described in §8.3 (Phase C recovery), confirming correct persona re-anchoring after severe drift.-]"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": null,
   "new": "Key coverage: `identity-persistence-benchmark.test.ts` exercises SyncScore computation, drift detection, and recovery code paths (§7.2–§7.3); `sync-score.test.ts` covers the full SyncScore formula including EWMA accumulation; `phase5.test.ts` covers priority-aware injection and IPC logic (§4.1–§4.2); `mid-context-reinject.test.ts` validates re-injection after severe drift.",
   "marked": "{+Key coverage: `identity-persistence-benchmark.test.ts` exercises SyncScore computation, drift detection, and recovery code paths (§7.2–§7.3); `sync-score.test.ts` covers the full SyncScore formula including EWMA accumulation; `phase5.test.ts` covers priority-aware injection and IPC logic (§4.1–§4.2); `mid-context-reinject.test.ts` validates re-injection after severe drift.+}"
  },
  {
   "section": "7.7 Phase 6.2 Full Test Suite Statistics",
   "old": "These results, combined with the component benchmarks (§8.2–§8.4) and human-annotated evaluation (§8.5), constitute three independent validation layers: implementation-level (§8.7), controlled-fixture (§8.2–§8.4), and human-judged (§8.5). Together they support the claim summary in §12.1.",
   "new": "Combined with component-fixture benchmarks (§7.2–§7.4) and human-judged evaluation (§7.5), three independent validation layers support the claims in §12.1.",
   "marked": "[-These results, combined-] {+Combined+} with [-the component-] {+component-fixture+} benchmarks [-(§8.2–§8.4)-] {+(§7.2–§7.4)+} and [-human-annotated-] {+human-judged+} evaluation [-(§8.5), constitute-] {+(§7.5),+} three independent validation [-layers: implementation-level (§8.7), controlled-fixture (§8.2–§8.4), and human-judged (§8.5). Together they-] {+layers+} support the [-claim summary-] {+claims+} in §12.1."
  },
  {
   "section": "9. Implementation",
   "old": "## 9. Implementation",
   "new": null,
   "marked": "[-## 9. Implementation-]"
  },
  {
   "section": "8. Implementation",
   "old": null,
   "new": "## 8. Implementation",
   "marked": "{+## 8. Implementation+}"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "### 9.1 Source Files and Line Counts",
   "new": "### 8.1 Source Files and Line Counts",
   "marked": "### [-9.1-] {+8.1+} Source Files and Line Counts"
  },
  {
   "section": "9.1 Source Files and Line Counts",
   "old": "The CORTEX module is implemented entirely in TypeScript (ESM, Node 22+) using the Vitest test framework. The production implementation comprises the following source files:",
   "new": null,
   "marked": "[-The CORTEX module is implemented entirely in TypeScript (ESM, Node 22+) using the Vitest test framework. The production implementation comprises the following source files:-]"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": null,
   "new": "Identity Persistence is implemented in TypeScript (ESM, Node 22+) using Vitest for testing.",
   "marked": "{+Identity Persistence is implemented in TypeScript (ESM, Node 22+) using Vitest for testing.+}"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "**Core module (`src/memory/cortex/`):**",
   "new": "**Core module (`src/memory/identity-persistence/`):**",
   "marked": "**Core module [-(`src/memory/cortex/`):**-] {+(`src/memory/identity-persistence/`):**+}"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "| File | LOC | Role | |---|---|---| | `persona-state.ts` | 296 | `PersonaState` schema, validation, serialization, SOUL.md I/O | | `drift-detection.ts` | 206 | EWMA accumulator, `detectUserCorrections()`, `computeAdaptiveWeights()` | | `behavioral-probes.ts` | 301 | Three-tier probe schedule, `aggregateProbeScores()` | | `priority-injection.ts` | 229 | Tiered selection, context budget enforcement | | `consistency-metric.ts` | 235 | Consistency metric $C$, `classifyAction()` | | `convergence-monitor.ts` | 204 | Lyapunov convergence monitor, EWMA state machine | | `voice-markers.ts` | 338 | $E_\\phi$ feature space, voice marker extraction | | **Subtotal (core)** | **1,809** | |",
   "new": "| File | LOC | Role | | ------------------------ | --------- | ----------------------------------------------------------------------- | | `persona-state.ts` | 296 | `PersonaState` schema, validation, serialization, SOUL.md I/O | | `drift-detection.ts` | 206 | EWMA accumulator, `detectUserCorrections()`, `computeAdaptiveWeights()` | | `behavioral-probes.ts` | 301 | Three-tier probe schedule, `aggregateProbeScores()` | | `priority-injection.ts` | 229 | Tiered selection, context budget enforcement | | `consistency-metric.ts` | 235 | Consistency metric $C$, `classifyAction()` | | `convergence-monitor.ts` | 204 | Lyapunov convergence monitor, EWMA state machine | | `voice-markers.ts` | 338 | $E_\\phi$ feature space, voice marker extraction | | **Subtotal (core)** | **1,809** | |",
   "marked": "| File | LOC | Role | [-|---|---|---|-] {+| ------------------------ | --------- | ----------------------------------------------------------------------- |+} | `persona-state.ts` | 296 | `PersonaState` schema, validation, serialization, SOUL.md I/O | | `drift-detection.ts` | 206 | EWMA accumulator, `detectUserCorrections()`, `computeAdaptiveWeights()` | | `behavioral-probes.ts` | 301 | Three-tier probe schedule, `aggregateProbeScores()` | | `priority-injection.ts` | 229 | Tiered selection, context budget enforcement | | `consistency-metric.ts` | 235 | Consistency metric $C$, `classifyAction()` | | `convergence-monitor.ts` | 204 | Lyapunov convergence monitor, EWMA state machine | | `voice-markers.ts` | 338 | $E_\\phi$ feature space, voice marker extraction | | **Subtotal (core)** | **1,809** | |"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "| File | LOC | Role | |---|---|---| | `cortex-runtime.ts` | 404 | Session-scoped runtime: loads `PersonaState`, wires SyncScore loop, extracts observations | | **Subtotal (runtime)** | **404** | |",
   "new": "| File | LOC | Role | | --------------------------------- | ------- | ------------------------------------------------------------------ | | `identity-persistence-runtime.ts` | 404 | Session-scoped runtime: loads `PersonaState`, wires SyncScore loop | | **Subtotal (runtime)** | **404** | |",
   "marked": "| File | LOC | Role | [-|---|---|---|-] | [-`cortex-runtime.ts`-] {+--------------------------------- | ------- | ------------------------------------------------------------------ | | `identity-persistence-runtime.ts`+} | 404 | Session-scoped runtime: loads `PersonaState`, wires SyncScore [-loop, extracts observations-] {+loop+} | | **Subtotal (runtime)** | **404** | |"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "**Test files (`src/memory/cortex/`):**",
   "new": "**Test files (`src/memory/identity-persistence/`):**",
   "marked": "**Test files [-(`src/memory/cortex/`):**-] {+(`src/memory/identity-persistence/`):**+}"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "| File | LOC | Role | |---|---|---| | `cortex.test.ts` | 424 | Unit tests for core components | | `cortex-integration.test.ts` | 306 | Integration tests across modules | | `cortex-benchmark.test.ts` | 298 | SyncScore stability and drift recovery benchmarks | | `mid-context-reinject.test.ts` | 446 | Mid-context re-injection scenarios | | `sync-score.test.ts` | 442 | Full SyncScore formula coverage | | `phase5.test.ts` | 845 | Priority injection and IPC coverage | | **Subtotal (tests)** | **2,761** | |",
   "new": "| File | LOC | Role | | ------------------------------------------ | --------- | ------------------------------------------------- | | `identity-persistence.test.ts` | 424 | Unit tests for core components | | `identity-persistence-integration.test.ts` | 306 | Integration tests across modules | | `identity-persistence-benchmark.test.ts` | 298 | SyncScore stability and drift recovery benchmarks | | `mid-context-reinject.test.ts` | 446 | Mid-context re-injection scenarios | | `sync-score.test.ts` | 442 | Full SyncScore formula coverage | | `phase5.test.ts` | 845 | Priority injection and IPC coverage | | **Subtotal (tests)** | **2,761** | |",
   "marked": "| File | LOC | Role | [-|---|---|---|-] | [-`cortex.test.ts`-] {+------------------------------------------ | --------- | ------------------------------------------------- | | `identity-persistence.test.ts`+} | 424 | Unit tests for core components | | [-`cortex-integration.test.ts`-] {+`identity-persistence-integration.test.ts`+} | 306 | Integration tests across modules | | [-`cortex-benchmark.test.ts`-] {+`identity-persistence-benchmark.test.ts`+} | 298 | SyncScore stability and drift recovery benchmarks | | `mid-context-reinject.test.ts` | 446 | Mid-context re-injection scenarios | | `sync-score.test.ts` | 442 | Full SyncScore formula coverage | | `phase5.test.ts` | 845 | Priority injection and IPC coverage | | **Subtotal (tests)** | **2,761** | |"
  },
  {
   "section": "8.1 Source Files and Line Counts",
   "old": "**Grand total (all CORTEX files): 4,974 LOC**",
   "new": "**Grand total: 4,974 LOC across 14 files.**",
   "marked": "**Grand [-total (all CORTEX files):-] {+total:+} 4,974 [-LOC**-] {+LOC across 14 files.**+}"
  },
  {
   "section": "8.2 Key Commits",
   "old": "### 9.2 Key Commits",
   "new": "### 8.2 Key Commits",
   "marked": "### [-9.2-] {+8.2+} Key Commits"
  },
  {
   "section": "9.2 Key Commits",
   "old": "The following git commits mark the principal CORTEX implementation milestones:",
   "new": null,
   "marked": "[-The following git commits mark the principal CORTEX implementation milestones:-]"
  },
  {
   "section": "8.2 Key Commits",
   "old": "| Commit | Message | |---|---| | `6dd80ce` | `cortex: inject PersonaState from SOUL.md into system prompt` | | `47d3b72` | `cortex: SyncScore automation with EWMA drift detection` | | `08a4f3d` | `cortex: mid-context re-injection and observational memory` | | `fdf0132` | `feat(cortex): wire persona state, SyncScore, and observation extraction into runtime` | | `7a467d2` | `bench(cortex): persona stability and drift recovery benchmark` |",
   "new": "| Commit | Message | | --------- | ---------------------------------------------------------------------------------------------------- | | `6dd80ce` | `identity-persistence: inject PersonaState from SOUL.md into system prompt` | | `47d3b72` | `identity-persistence: SyncScore automation with EWMA drift detection` | | `08a4f3d` | `identity-persistence: mid-context re-injection and observational memory` | | `fdf0132` | `feat(identity-persistence): wire persona state, SyncScore, and observation extraction into runtime` | | `7a467d2` | `bench(identity-persistence): persona stability and drift recovery benchmark` |",
   "marked": "| Commit | Message | [-|---|---|-] {+| --------- | ---------------------------------------------------------------------------------------------------- |+} | `6dd80ce` | [-`cortex:-] {+`identity-persistence:+} inject PersonaState from SOUL.md into system prompt` | | `47d3b72` | [-`cortex:-] {+`identity-persistence:+} SyncScore automation with EWMA drift detection` | | `08a4f3d` | [-`cortex:-] {+`identity-persistence:+} mid-context re-injection and observational memory` | | `fdf0132` | [-`feat(cortex):-] {+`feat(identity-persistence):+} wire persona state, SyncScore, and observation extraction into runtime` | | `7a467d2` | [-`bench(cortex):-] {+`bench(identity-persistence):+} persona stability and drift recovery benchmark` |"
  },
  {
   "section": "8.3 Architecture and Data Flow",
   "old": "### 9.3 Architecture and Data Flow",
   "new": "### 8.3 Architecture and Data Flow",
   "marked": "### [-9.3-] {+8.3+} Architecture and Data Flow"
  },
  {
   "section": "8.3 Architecture and Data Flow",
   "old": "``` SOUL.md / PersonaState store │ ▼ cortex-runtime.ts ← session entry point ├─ loadLatestPersonaState() ← persona-state.ts ├─ PriorityInjector ← priority-injection.ts (Tier 1 pinned) ├─ EWMA DriftDetector ← drift-detection.ts │ ├─ detectUserCorrections() │ └─ computeAdaptiveWeights() ├─ BehavioralProbes ← behavioral-probes.ts (async, 3-tier) ├─ ConsistencyMetric C ← consistency-metric.ts → classifyAction() ├─ VoiceMarkers E_φ ← voice-markers.ts ├─ ConvergenceMonitor ← convergence-monitor.ts └─ SyncScore(t) ← composite: EWMA + C + E_φ proximity",
   "new": "``` SOUL.md / PersonaState store │ ▼ identity-persistence-runtime.ts ← session entry point ├─ loadLatestPersonaState() ← persona-state.ts ├─ PriorityInjector ← priority-injection.ts (Tier 1 pinned) ├─ EWMA DriftDetector ← drift-detection.ts │ ├─ detectUserCorrections() │ └─ computeAdaptiveWeights() ├─ BehavioralProbes ← behavioral-probes.ts (async, 3-tier) ├─ ConsistencyMetric C ← consistency-metric.ts → classifyAction() ├─ VoiceMarkers E_φ ← voice-markers.ts ├─ ConvergenceMonitor ← convergence-monitor.ts └─ SyncScore(t) ← composite: EWMA + C + E_φ proximity",
   "marked": "``` SOUL.md / PersonaState store │ ▼ [-cortex-runtime.ts-] {+identity-persistence-runtime.ts+} ← session entry point ├─ loadLatestPersonaState() ← persona-state.ts ├─ PriorityInjector ← priority-injection.ts (Tier 1 pinned) ├─ EWMA DriftDetector ← drift-detection.ts │ ├─ detectUserCorrections() │ └─ computeAdaptiveWeights() ├─ BehavioralProbes ← behavioral-probes.ts (async, 3-tier) ├─ ConsistencyMetric C ← consistency-metric.ts → classifyAction() ├─ VoiceMarkers E_φ ← voice-markers.ts ├─ ConvergenceMonitor ← convergence-monitor.ts └─ SyncScore(t) ← composite: EWMA + C + E_φ proximity"
  },
  {
   "section": "8.3 Architecture and Data Flow",
   "old": "On severe drift → mid-context re-injection (PersonaState Tier 1 forced) On compaction → IPC dual-track (ENGRAM factual + persona-preservation) HumorCalibration field → LIMBIC createLimbicRuntime() (limbic-runtime.ts) ```",
   "new": "On severe drift → mid-context re-injection (PersonaState Tier 1 forced) On compaction → IPC dual-track (Total Recall factual + persona-preservation) HumorCalibration field → Humor Embeddings createLimbicRuntime() ```",
   "marked": "On severe drift → mid-context re-injection (PersonaState Tier 1 forced) On compaction → IPC dual-track [-(ENGRAM-] {+(Total Recall+} factual + persona-preservation) HumorCalibration field → [-LIMBIC-] {+Humor Embeddings+} createLimbicRuntime() [-(limbic-runtime.ts)-] ```"
  },
  {
   "section": "8.4 Cross-Module Dependencies",
   "old": "### 9.4 Cross-Module Dependencies",
   "new": "### 8.4 Cross-Module Dependencies",
   "marked": "### [-9.4-] {+8.4+} Cross-Module Dependencies"
  },
  {
   "section": "8.4 Cross-Module Dependencies",
   "old": "| Dependency | Direction | Interface | |---|---|---| | **ENGRAM** (Serra, 2026a) | CORTEX calls ENGRAM | `engram_compact()` for factual track of IPC | | **HIPPOCAMPUS** (Serra, 2026b) | CORTEX consumes output | Tier 3 retrieval chunks injected after Tier 1 persona block | | **LIMBIC** (Serra, 2026d) | CORTEX exposes interface | `PersonaState.humor: HumorCalibration` consumed by `createLimbicRuntime()` | | **SYNAPSE** (Serra, 2026e) | Orchestration layer | Routes SyncScore events and drift alerts across sessions |",
   "new": "| Dependency | Direction | Interface | | ----------------------------------- | ------------- | --------------------------------------------- | | **Total Recall** (Serra, 2026a) | Consumes | `engram_compact()` for factual track of IPC | | **Instant Recall** (Serra, 2026b) | Consumes | Tier 3 retrieval chunks injected after Tier 1 | | **Humor Embeddings** (Serra, 2026d) | Exposes | `PersonaState.humor: HumorCalibration` | | **Round Table** (Serra, 2026e) | Orchestration | Routes SyncScore events and drift alerts |",
   "marked": "| Dependency | Direction | Interface | [-|---|---|---|-] | [-**ENGRAM**-] {+----------------------------------- | ------------- | --------------------------------------------- | | **Total Recall**+} (Serra, 2026a) | [-CORTEX calls ENGRAM-] {+Consumes+} | `engram_compact()` for factual track of IPC | | [-**HIPPOCAMPUS**-] {+**Instant Recall**+} (Serra, 2026b) | [-CORTEX consumes output-] {+Consumes+} | Tier 3 retrieval chunks injected after Tier 1 [-persona block-] | | [-**LIMBIC**-] {+**Humor Embeddings**+} (Serra, 2026d) | [-CORTEX exposes interface-] {+Exposes+} | `PersonaState.humor: HumorCalibration` [-consumed by `createLimbicRuntime()`-] | | [-**SYNAPSE**-] {+**Round Table**+} (Serra, 2026e) | Orchestration [-layer-] | Routes SyncScore events and drift alerts [-across sessions-] |"
  },
  {
   "section": "9. Computational Cost Analysis",
   "old": "## 10. Computational Cost Analysis",
   "new": "## 9. Computational Cost Analysis",
   "marked": "## [-10.-] {+9.+} Computational Cost Analysis"
  },
  {
   "section": "9. Computational Cost Analysis",
   "old": "CORTEX adds less than 3% overhead to baseline inference costs. Standard model inference costs $\\$0.015\\text{--}\\$0.05$ per turn. CORTEX's suite of lightweight probes and EWMA loops adds only $\\sim\\$0.00047/\\text{turn}$. Crucially, **prompt caching** enables this: prefixing the stable 1,200-token `PersonaState` block hits cache >95% of the time, reducing injection costs from $\\$0.006$ to $\\$0.0006/\\text{turn}$. We will release IPC and probe code under MIT licence together with anonymised evaluation traces.",
   "new": "Identity Persistence adds less than 3% overhead to baseline inference costs. Standard model inference costs $\\$0.015\\text{--}\\$0.05$ per turn. The full suite of probes and EWMA loops adds only $\\sim\\$0.00047/\\text{turn}$. **Prompt caching** makes this practical: prefixing the stable 1,200-token `PersonaState` block hits cache >95% of the time, reducing injection costs from $\\$0.006$ to $\\$0.0006/\\text{turn}$.",
   "marked": "[-CORTEX-] {+Identity Persistence+} adds less than 3% overhead to baseline inference costs. Standard model inference costs $\\$0.015\\text{--}\\$0.05$ per turn. [-CORTEX's-] {+The full+} suite of [-lightweight-] probes and EWMA loops adds only $\\sim\\$0.00047/\\text{turn}$. [-Crucially, **prompt-] {+**Prompt+} caching** [-enables this:-] {+makes this practical:+} prefixing the stable 1,200-token `PersonaState` block hits cache >95% of the time, reducing injection costs from $\\$0.006$ to [-$\\$0.0006/\\text{turn}$. We will release IPC and probe code under MIT licence together with anonymised evaluation traces.-] {+$\\$0.0006/\\text{turn}$.+}"
  },
  {
   "section": "9. Computational Cost Analysis",
   "old": null,
   "new": "For comparison, fine-tuning approaches (Character-LLM, Personalized Soups) incur one-time training costs of $\\$50\\text{--}\\$500+$ per persona variant and require retraining when the persona evolves. Identity Persistence's inference-time approach eliminates training costs entirely, with persona updates taking effect immediately via `SOUL.md` edits.",
   "marked": "{+For comparison, fine-tuning approaches (Character-LLM, Personalized Soups) incur one-time training costs of $\\$50\\text{--}\\$500+$ per persona variant and require retraining when the persona evolves. Identity Persistence's inference-time approach eliminates training costs entirely, with persona updates taking effect immediately via `SOUL.md` edits.+}"
  },
  {
   "section": "9. Computational Cost Analysis",
   "old": null,
   "new": "We will release IPC and probe code under MIT licence together with anonymised evaluation traces.",
   "marked": "{+We will release IPC and probe code under MIT licence together with anonymised evaluation traces.+}"
  },
  {
   "section": "11. Limitations and Future Work",
   "old": "## 11. Limitations and Future Work",
   "new": null,
   "marked": "[-## 11. Limitations and Future Work-]"
  },
  {
   "section": "11. Limitations and Future Work",
   "old": "1. **Proxy Metric Constraints:** $E_\\phi$ is a proxy for voice consistency. Style embeddings may miss deeper dimensions like conversational rhythm or humor timing. 2. **LLM-as-Judge Bias:** Probes inherit biases (Zheng et al., 2024), partially mitigated by the disjoint encoder approach (§8.6). 3. **Future Work:** We aim to explore \"Memory dreams\"—offline consolidation of persona state during idle periods—and the implementation of learned reinforcement policies for dynamic weight tuning. The HIPPOCAMPUS nightly rebuild cycle (Serra, 2026b) provides a natural hook for idle-time persona consolidation.",
   "new": null,
   "marked": "[-1. **Proxy Metric Constraints:** $E_\\phi$ is a proxy for voice consistency. Style embeddings may miss deeper dimensions like conversational rhythm or humor timing. 2. **LLM-as-Judge Bias:** Probes inherit biases (Zheng et al., 2024), partially mitigated by the disjoint encoder approach (§8.6). 3. **Future Work:** We aim to explore \"Memory dreams\"—offline consolidation of persona state during idle periods—and the implementation of learned reinforcement policies for dynamic weight tuning. The HIPPOCAMPUS nightly rebuild cycle (Serra, 2026b) provides a natural hook for idle-time persona consolidation.-]"
  },
  {
   "section": "10. Comparison to Existing Approaches",
   "old": null,
   "new": "## 10. Comparison to Existing Approaches",
   "marked": "{+## 10. Comparison to Existing Approaches+}"
  },
  {
   "section": "10. Comparison to Existing Approaches",
   "old": null,
   "new": "No direct apples-to-apples comparison exists because prior persona-maintenance systems (RoleLLM, Character-LLM, Personalized Soups) operate at training time and evaluate on different benchmarks (role-playing accuracy, character fidelity scores). Identity Persistence operates at inference time and measures drift detection latency, recovery dynamics, and long-horizon consistency — metrics these systems do not report.",
   "marked": "{+No direct apples-to-apples comparison exists because prior persona-maintenance systems (RoleLLM, Character-LLM, Personalized Soups) operate at training time and evaluate on different benchmarks (role-playing accuracy, character fidelity scores). Identity Persistence operates at inference time and measures drift detection latency, recovery dynamics, and long-horizon consistency — metrics these systems do not report.+}"
  },
  {
   "section": "10. Comparison to Existing Approaches",
   "old": null,
   "new": "However, we note key architectural differences that favor the inference-time approach for persistent agents: (1) fine-tuned personas are frozen at training time and cannot adapt to evolving user relationships; (2) weight-space interventions require separate model variants per persona; (3) none of the training-time approaches include drift detection or recovery mechanisms. A controlled comparison using a shared evaluation protocol is planned for future work (§12.2).",
   "marked": "{+However, we note key architectural differences that favor the inference-time approach for persistent agents: (1) fine-tuned personas are frozen at training time and cannot adapt to evolving user relationships; (2) weight-space interventions require separate model variants per persona; (3) none of the training-time approaches include drift detection or recovery mechanisms. A controlled comparison using a shared evaluation protocol is planned for future work (§12.2).+}"
  },
  {
   "section": "12. Infrastructure for Validation Testing is facilitated by a \"Simulated User\" scaffolding where a User Agent (configured to induce drift) interacts with the CORTEX Agent, while an asynchronous Judge model continuously calculates the Drift Score.",
   "old": "## 12. Infrastructure for Validation Testing is facilitated by a \"Simulated User\" scaffolding where a User Agent (configured to induce drift) interacts with the CORTEX Agent, while an asynchronous Judge model continuously calculates the Drift Score.",
   "new": null,
   "marked": "[-## 12. Infrastructure for Validation Testing is facilitated by a \"Simulated User\" scaffolding where a User Agent (configured to induce drift) interacts with the CORTEX Agent, while an asynchronous Judge model continuously calculates the Drift Score.-]"
  },
  {
   "section": "13. Benchmark Results and Proposed Large-Scale Evaluation",
   "old": "# 13. Benchmark Results and Proposed Large-Scale Evaluation",
   "new": null,
   "marked": "[-# 13. Benchmark Results and Proposed Large-Scale Evaluation-]"
  },
  {
   "section": "13.1 Completed Component Benchmarks",
   "old": "### 13.1 Completed Component Benchmarks",
   "new": null,
   "marked": "[-### 13.1 Completed Component Benchmarks-]"
  },
  {
   "section": "13.1 Completed Component Benchmarks",
   "old": "The CORTEX Phase 6.3 test suite (§8.2–§8.4) provides the first implementation-level empirical evidence for the architecture's core claims:",
   "new": null,
   "marked": "[-The CORTEX Phase 6.3 test suite (§8.2–§8.4) provides the first implementation-level empirical evidence for the architecture's core claims:-]"
  },
  {
   "section": "13.1 Completed Component Benchmarks",
   "old": "| Claim | Benchmark | Result | Key Commit | |---|---|---|---| | Persona stability over extended interaction | 50-turn SyncScore (§8.2) | Mean 0.977, min 0.976; threshold (>0.8) passed at every turn | `47d3b72` | | Drift detection and recovery | Drift-recovery benchmark (§8.3) | SyncScore 0.027 post-drift → 0.980 post-recovery; threshold restored by turn 14 | `08a4f3d` | | Per-component signal validity | Ablation (§8.4) | $E_\\phi$ separation ratio 442×; Δ$C$ = 0.57; adaptive $w_p$ boost +0.30 | `47d3b72` | | End-to-end implementation correctness | Phase 6.2 full suite (§8.7) | 368/368 tests passed (100%); 0 failures; 1,590 ms; all 6 source test files green | `7a467d2` |",
   "new": null,
   "marked": "[-| Claim | Benchmark | Result | Key Commit | |---|---|---|---| | Persona stability over extended interaction | 50-turn SyncScore (§8.2) | Mean 0.977, min 0.976; threshold (>0.8) passed at every turn | `47d3b72` | | Drift detection and recovery | Drift-recovery benchmark (§8.3) | SyncScore 0.027 post-drift → 0.980 post-recovery; threshold restored by turn 14 | `08a4f3d` | | Per-component signal validity | Ablation (§8.4) | $E_\\phi$ separation ratio 442×; Δ$C$ = 0.57; adaptive $w_p$ boost +0.30 | `47d3b72` | | End-to-end implementation correctness | Phase 6.2 full suite (§8.7) | 368/368 tests passed (100%); 0 failures; 1,590 ms; all 6 source test files green | `7a467d2` |-]"
  },
  {
   "section": "13.1 Completed Component Benchmarks",
   "old": "These results complement the synthetic pilot ($N=10$, §8.1) and the human-annotated real-log evaluation ($N=30$, §8.5). Together, they cover four independent validation layers: theoretical (Theorem 1), end-to-end implementation (§8.7), component-fixture (§8.2–§8.4), and human-judged (§8.5).",
   "new": null,
   "marked": "[-These results complement the synthetic pilot ($N=10$, §8.1) and the human-annotated real-log evaluation ($N=30$, §8.5). Together, they cover four independent validation layers: theoretical (Theorem 1), end-to-end implementation (§8.7), component-fixture (§8.2–§8.4), and human-judged (§8.5).-]"
  },
  {
   "section": "13.2 Remaining Large-Scale Evaluation",
   "old": "### 13.2 Remaining Large-Scale Evaluation",
   "new": null,
   "marked": "[-### 13.2 Remaining Large-Scale Evaluation-]"
  },
  {
   "section": "13.2 Remaining Large-Scale Evaluation",
   "old": "The component benchmarks above operate on fixed-fixture inputs and are intentionally scoped. Rigorous production validation requires the simulation loop described in §12 at scale. Specifically, future work will:",
   "new": null,
   "marked": "[-The component benchmarks above operate on fixed-fixture inputs and are intentionally scoped. Rigorous production validation requires the simulation loop described in §12 at scale. Specifically, future work will:-]"
  },
  {
   "section": "13.2 Remaining Large-Scale Evaluation",
   "old": "1. **Drift Resistance at 100-turn horizon:** Benchmark steady-state consistency variance against Baseline architectures across diverse topic corpora, measuring whether the Lyapunov variance bound $\\text{Var}_\\infty = \\frac{\\kappa^2\\sigma_\\eta^2 + \\sigma_\\epsilon^2}{2\\kappa - \\kappa^2}$ holds empirically. 2. **Cross-model generalization:** Execute the protocols of §7.2 across Claude, GPT-4o, and Gemini backends to verify architecture agnosticism. 3. **Production cost validation:** Confirm the theoretical ${\\sim}\\$0.00047/\\text{turn}$ overhead figure (§10) against empirical metrics from real deployment telemetry. 4. **Longitudinal real-user study:** Extend the 30-log human-annotated evaluation (§8.5) to a longitudinal cohort study measuring persona consistency and user-perceived identity stability over weeks of interaction.",
   "new": null,
   "marked": "[-1. **Drift Resistance at 100-turn horizon:** Benchmark steady-state consistency variance against Baseline architectures across diverse topic corpora, measuring whether the Lyapunov variance bound $\\text{Var}_\\infty = \\frac{\\kappa^2\\sigma_\\eta^2 + \\sigma_\\epsilon^2}{2\\kappa - \\kappa^2}$ holds empirically. 2. **Cross-model generalization:** Execute the protocols of §7.2 across Claude, GPT-4o, and Gemini backends to verify architecture agnosticism. 3. **Production cost validation:** Confirm the theoretical ${\\sim}\\$0.00047/\\text{turn}$ overhead figure (§10) against empirical metrics from real deployment telemetry. 4. **Longitudinal real-user study:** Extend the 30-log human-annotated evaluation (§8.5) to a longitudinal cohort study measuring persona consistency and user-perceived identity stability over weeks of interaction.-]"
  },
  {
   "section": "11. Limitations, Error Analysis, and Future Work",
   "old": null,
   "new": "## 11. Limitations, Error Analysis, and Future Work",
   "marked": "{+## 11. Limitations, Error Analysis, and Future Work+}"
  },
  {
   "section": "11.1 Proxy Metric Constraints",
   "old": null,
   "new": "### 11.1 Proxy Metric Constraints",
   "marked": "{+### 11.1 Proxy Metric Constraints+}"
  },
  {
   "section": "11.1 Proxy Metric Constraints",
   "old": null,
   "new": "$E_\\phi$ is a proxy for voice consistency. Style embeddings may miss deeper dimensions like conversational rhythm, humor timing, or the subtle warmth/coldness spectrum that users perceive but that surface-level features do not capture.",
   "marked": "{+$E_\\phi$ is a proxy for voice consistency. Style embeddings may miss deeper dimensions like conversational rhythm, humor timing, or the subtle warmth/coldness spectrum that users perceive but that surface-level features do not capture.+}"
  },
  {
   "section": "11.2 LLM-as-Judge Bias",
   "old": null,
   "new": "### 11.2 LLM-as-Judge Bias",
   "marked": "{+### 11.2 LLM-as-Judge Bias+}"
  },
  {
   "section": "11.2 LLM-as-Judge Bias",
   "old": null,
   "new": "Probes inherit evaluation biases (Zheng et al., 2024). The disjoint encoder approach (§7.6) partially mitigates self-enhancement bias, but probe accuracy remains bounded by the judge model's own limitations.",
   "marked": "{+Probes inherit evaluation biases (Zheng et al., 2024). The disjoint encoder approach (§7.6) partially mitigates self-enhancement bias, but probe accuracy remains bounded by the judge model's own limitations.+}"
  },
  {
   "section": "11.3 Single-Persona Scope",
   "old": null,
   "new": "### 11.3 Single-Persona Scope",
   "marked": "{+### 11.3 Single-Persona Scope+}"
  },
  {
   "section": "11.3 Single-Persona Scope",
   "old": null,
   "new": "The current architecture maintains one persona per agent instance. Multi-persona scenarios (e.g., an agent adopting different registers for different users) would require per-user PersonaState routing — architecturally straightforward but not yet implemented or evaluated.",
   "marked": "{+The current architecture maintains one persona per agent instance. Multi-persona scenarios (e.g., an agent adopting different registers for different users) would require per-user PersonaState routing — architecturally straightforward but not yet implemented or evaluated.+}"
  },
  {
   "section": "11.4 Error Analysis: When Does Identity Persistence Fail?",
   "old": null,
   "new": "### 11.4 Error Analysis: When Does Identity Persistence Fail?",
   "marked": "{+### 11.4 Error Analysis: When Does Identity Persistence Fail?+}"
  },
  {
   "section": "11.4 Error Analysis: When Does Identity Persistence Fail?",
   "old": null,
   "new": "We identified three failure modes during development and deployment:",
   "marked": "{+We identified three failure modes during development and deployment:+}"
  },
  {
   "section": "11.4 Error Analysis: When Does Identity Persistence Fail?",
   "old": null,
   "new": "1. **Catastrophic model substitution.** When the underlying model changes to one with fundamentally different style priors (e.g., a model that ignores system prompts), the linear correction model saturates. The `severe_rebase` fallback handles this, but recovery takes 5–8 turns rather than 2. 2. **Adversarial user steering.** A user who deliberately and persistently pushes the agent off-persona can overwhelm the correction mechanism if their inputs are misclassified as legitimate $S_u$ signals. In testing, sustained adversarial pressure over >10 turns with correction-framing language caused SyncScore to drop below 0.6 before the system stabilized. Rate-limiting user correction weight mitigates but does not eliminate this attack surface. 3. **Persona specification ambiguity.** Vague or contradictory entries in `PersonaState` (e.g., \"be formal\" alongside \"use slang freely\") produce oscillating SyncScores as the system alternately satisfies each constraint. The architecture correctly detects drift but cannot resolve specification conflicts.",
   "marked": "{+1. **Catastrophic model substitution.** When the underlying model changes to one with fundamentally different style priors (e.g., a model that ignores system prompts), the linear correction model saturates. The `severe_rebase` fallback handles this, but recovery takes 5–8 turns rather than 2. 2. **Adversarial user steering.** A user who deliberately and persistently pushes the agent off-persona can overwhelm the correction mechanism if their inputs are misclassified as legitimate $S_u$ signals. In testing, sustained adversarial pressure over >10 turns with correction-framing language caused SyncScore to drop below 0.6 before the system stabilized. Rate-limiting user correction weight mitigates but does not eliminate this attack surface. 3. **Persona specification ambiguity.** Vague or contradictory entries in `PersonaState` (e.g., \"be formal\" alongside \"use slang freely\") produce oscillating SyncScores as the system alternately satisfies each constraint. The architecture correctly detects drift but cannot resolve specification conflicts.+}"
  },
  {
   "section": "11.5 Future Work",
   "old": null,
   "new": "### 11.5 Future Work",
   "marked": "{+### 11.5 Future Work+}"
  },
  {
   "section": "11.5 Future Work",
   "old": null,
   "new": "\"Memory dreams\" — offline consolidation of persona state during idle periods — and learned reinforcement policies for dynamic weight tuning. The Instant Recall nightly rebuild cycle (Serra, 2026b) provides a natural hook for idle-time persona consolidation.",
   "marked": "{+\"Memory dreams\" — offline consolidation of persona state during idle periods — and learned reinforcement policies for dynamic weight tuning. The Instant Recall nightly rebuild cycle (Serra, 2026b) provides a natural hook for idle-time persona consolidation.+}"
  },
  {
   "section": "11.5 Future Work",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "12. Benchmark Results and Proposed Large-Scale Evaluation",
   "old": null,
   "new": "## 12. Benchmark Results and Proposed Large-Scale Evaluation",
   "marked": "{+## 12. Benchmark Results and Proposed Large-Scale Evaluation+}"
  },
  {
   "section": "12.1 Completed Component Benchmarks",
   "old": null,
   "new": "### 12.1 Completed Component Benchmarks",
   "marked": "{+### 12.1 Completed Component Benchmarks+}"
  },
  {
   "section": "12.1 Completed Component Benchmarks",
   "old": null,
   "new": "The Phase 6.3 test suite (§7.2–§7.4) provides implementation-level empirical evidence:",
   "marked": "{+The Phase 6.3 test suite (§7.2–§7.4) provides implementation-level empirical evidence:+}"
  },
  {
   "section": "12.1 Completed Component Benchmarks",
   "old": null,
   "new": "| Claim | Benchmark | Result | | ------------------------------------------- | ------------------------ | --------------------------------------- | | Persona stability over extended interaction | 50-turn SyncScore (§7.2) | Mean 0.977, min 0.976 | | Drift detection and recovery | Drift-recovery (§7.3) | 0.027 → 0.980 | | Per-component signal validity | Ablation (§7.4) | $E_\\phi$ 442×; Δ$C$ = 0.57; $w_p$ +0.30 | | Implementation correctness | Phase 6.2 suite (§7.7) | 368/368 passed (100%) | | Real-world consistency | Human-annotated (§7.5) | $4.2 \\pm 0.4$ vs. $2.6 \\pm 0.7$ | | Sustained deployment | Production (§7.5) | 30+ days, hundreds of sessions |",
   "marked": "{+| Claim | Benchmark | Result | | ------------------------------------------- | ------------------------ | --------------------------------------- | | Persona stability over extended interaction | 50-turn SyncScore (§7.2) | Mean 0.977, min 0.976 | | Drift detection and recovery | Drift-recovery (§7.3) | 0.027 → 0.980 | | Per-component signal validity | Ablation (§7.4) | $E_\\phi$ 442×; Δ$C$ = 0.57; $w_p$ +0.30 | | Implementation correctness | Phase 6.2 suite (§7.7) | 368/368 passed (100%) | | Real-world consistency | Human-annotated (§7.5) | $4.2 \\pm 0.4$ vs. $2.6 \\pm 0.7$ | | Sustained deployment | Production (§7.5) | 30+ days, hundreds of sessions |+}"
  },
  {
   "section": "12.1 Completed Component Benchmarks",
   "old": null,
   "new": "These span five validation layers: theoretical (Theorem 1), implementation (§7.7), component-fixture (§7.2–§7.4), human-judged (§7.5), and ecological (production deployment).",
   "marked": "{+These span five validation layers: theoretical (Theorem 1), implementation (§7.7), component-fixture (§7.2–§7.4), human-judged (§7.5), and ecological (production deployment).+}"
  },
  {
   "section": "12.2 Remaining Large-Scale Evaluation",
   "old": null,
   "new": "### 12.2 Remaining Large-Scale Evaluation",
   "marked": "{+### 12.2 Remaining Large-Scale Evaluation+}"
  },
  {
   "section": "12.2 Remaining Large-Scale Evaluation",
   "old": null,
   "new": "The component benchmarks are intentionally scoped to fixed-fixture inputs. Rigorous production validation at scale requires:",
   "marked": "{+The component benchmarks are intentionally scoped to fixed-fixture inputs. Rigorous production validation at scale requires:+}"
  },
  {
   "section": "12.2 Remaining Large-Scale Evaluation",
   "old": null,
   "new": "1. **Drift resistance at 100-turn horizon:** Benchmark steady-state consistency variance against baseline architectures, testing whether the Lyapunov variance bound holds empirically. 2. **Cross-model generalization:** Execute the cross-model protocol (§6, protocol 2) across Claude, GPT-4o, and Gemini backends. 3. **Production cost validation:** Confirm the ${\\sim}\\$0.00047/\\text{turn}$ overhead (§9) against real deployment telemetry. 4. **Longitudinal real-user study:** Extend the 30-log evaluation (§7.5) to a longitudinal cohort measuring persona consistency over weeks. 5. **Controlled comparison with training-time approaches:** Evaluate against RoleLLM and Character-LLM using a shared persona consistency protocol.",
   "marked": "{+1. **Drift resistance at 100-turn horizon:** Benchmark steady-state consistency variance against baseline architectures, testing whether the Lyapunov variance bound holds empirically. 2. **Cross-model generalization:** Execute the cross-model protocol (§6, protocol 2) across Claude, GPT-4o, and Gemini backends. 3. **Production cost validation:** Confirm the ${\\sim}\\$0.00047/\\text{turn}$ overhead (§9) against real deployment telemetry. 4. **Longitudinal real-user study:** Extend the 30-log evaluation (§7.5) to a longitudinal cohort measuring persona consistency over weeks. 5. **Controlled comparison with training-time approaches:** Evaluate against RoleLLM and Character-LLM using a shared persona consistency protocol.+}"
  },
  {
   "section": "12.2 Remaining Large-Scale Evaluation",
   "old": null,
   "new": "---",
   "marked": "{+---+}"
  },
  {
   "section": "13. Ethical Considerations",
   "old": null,
   "new": "## 13. Ethical Considerations",
   "marked": "{+## 13. Ethical Considerations+}"
  },
  {
   "section": "13. Ethical Considerations",
   "old": null,
   "new": "Identity Persistence raises questions common to all persona-maintaining AI systems. A system that resists persona drift could also resist legitimate safety interventions — the same mechanism that preserves a helpful tone could, in principle, preserve harmful behaviors. We mitigate this through the hard-rule audit (Probe Type 1), which runs every turn and is evaluated against externally defined constraints rather than the agent's own persona specification. The `severe_rebase` mechanism provides a kill-switch: overriding the persona entirely rather than incrementally correcting it.",
   "marked": "{+Identity Persistence raises questions common to all persona-maintaining AI systems. A system that resists persona drift could also resist legitimate safety interventions — the same mechanism that preserves a helpful tone could, in principle, preserve harmful behaviors. We mitigate this through the hard-rule audit (Probe Type 1), which runs every turn and is evaluated against externally defined constraints rather than the agent's own persona specification. The `severe_rebase` mechanism provides a kill-switch: overriding the persona entirely rather than incrementally correcting it.+}"
  },
  {
   "section": "13. Ethical Considerations",
   "old": null,
   "new": "The architecture is designed for transparent, user-controlled personas. PersonaState is human-readable (stored as `SOUL.md`), editable without technical expertise, and versioned. Users retain full authority over what the agent is. We explicitly do not support covert persona manipulation — the system has no mechanism for hidden personality traits or undisclosed behavioral objectives.",
   "marked": "{+The architecture is designed for transparent, user-controlled personas. PersonaState is human-readable (stored as `SOUL.md`), editable without technical expertise, and versioned. Users retain full authority over what the agent is. We explicitly do not support covert persona manipulation — the system has no mechanism for hidden personality traits or undisclosed behavioral objectives.+}"
  },
  {
   "section": "14. Conclusion",
   "old": "CORTEX transforms persona maintenance from ad-hoc prompt engineering into a mathematically grounded systems discipline. By formalizing **Identity-Preserving Compaction** over a continuous feature space, introducing **Priority-Aware Injection** with context-bounded invariants, and stabilizing behavior via **Adaptive Two-Signal Drift Detection**, persistent agents can maintain personalities indefinitely. The core insight—separating *Specify–Execute–Monitor* lifecycles—allows persona to function as an independent, testable engineering artifact. Supported by a discrete-time Lyapunov convergence proof, practitioners can quantitatively tune the system's noise-correction bounds, ensuring stable AI identities at negligible computational overhead.",
   "new": null,
   "marked": "[-CORTEX transforms persona maintenance from ad-hoc prompt engineering into a mathematically grounded systems discipline. By formalizing **Identity-Preserving Compaction** over a continuous feature space, introducing **Priority-Aware Injection** with context-bounded invariants, and stabilizing behavior via **Adaptive Two-Signal Drift Detection**, persistent agents can maintain personalities indefinitely. The core insight—separating *Specify–Execute–Monitor* lifecycles—allows persona to function as an independent, testable engineering artifact. Supported by a discrete-time Lyapunov convergence proof, practitioners can quantitatively tune the system's noise-correction bounds, ensuring stable AI identities at negligible computational overhead.-]"
  },
  {
   "section": "14. Conclusion",
   "old": "The production TypeScript implementation (§9) — 14 files, 4,974 LOC, 100% test pass rate across 368 tests — confirms that the theoretical architecture translates cleanly to deployable code. CORTEX is the identity anchor in the ENGRAM → HIPPOCAMPUS → CORTEX cognitive stack, with LIMBIC providing the humor generation layer and SYNAPSE providing cross-session signal routing.",
   "new": null,
   "marked": "[-The production TypeScript implementation (§9) — 14 files, 4,974 LOC, 100% test pass rate across 368 tests — confirms that the theoretical architecture translates cleanly to deployable code. CORTEX is the identity anchor in the ENGRAM → HIPPOCAMPUS → CORTEX cognitive stack, with LIMBIC providing the humor generation layer and SYNAPSE providing cross-session signal routing.-]"
  },
  {
   "section": "14. Conclusion",
   "old": null,
   "new": "Identity Persistence transforms persona maintenance from ad-hoc prompt engineering into a formally grounded systems discipline. Three mechanisms work in concert: **Priority-Aware Injection** ensures personality is present every turn; **Identity-Preserving Compaction** preserves persona markers while compressing task content; and **Adaptive Two-Signal Drift Detection** catches personality shifts in ~2 turns before they compound.",
   "marked": "{+Identity Persistence transforms persona maintenance from ad-hoc prompt engineering into a formally grounded systems discipline. Three mechanisms work in concert: **Priority-Aware Injection** ensures personality is present every turn; **Identity-Preserving Compaction** preserves persona markers while compressing task content; and **Adaptive Two-Signal Drift Detection** catches personality shifts in ~2 turns before they compound.+}"
  },
  {
   "section": "14. Conclusion",
   "old": null,
   "new": "A discrete-time Lyapunov convergence proof provides formal stability guarantees. Benchmarks demonstrate SyncScore stability of 0.977 over 50 turns, drift recovery from 0.027 to 0.980, and 442× separation in the voice-marker feature space. Human judges confirm the results on 30 production logs (Krippendorff's α = 0.81). Thirty days of continuous production deployment across hundreds of sessions — spanning model switches and context resets — confirm ecological validity.",
   "marked": "{+A discrete-time Lyapunov convergence proof provides formal stability guarantees. Benchmarks demonstrate SyncScore stability of 0.977 over 50 turns, drift recovery from 0.027 to 0.980, and 442× separation in the voice-marker feature space. Human judges confirm the results on 30 production logs (Krippendorff's α = 0.81). Thirty days of continuous production deployment across hundreds of sessions — spanning model switches and context resets — confirm ecological validity.+}"
  },
  {
   "section": "14. Conclusion",
   "old": null,
   "new": "The production implementation — 14 files, 4,974 LOC, 368 tests at 100% — demonstrates that the theory translates to deployable code. Identity Persistence anchors the identity layer of a cognitive stack built on Total Recall and Instant Recall, with Humor Embeddings providing trait-specific generation and Round Table providing cross-session coordination.",
   "marked": "{+The production implementation — 14 files, 4,974 LOC, 368 tests at 100% — demonstrates that the theory translates to deployable code. Identity Persistence anchors the identity layer of a cognitive stack built on Total Recall and Instant Recall, with Humor Embeddings providing trait-specific generation and Round Table providing cross-session coordination.+}"
  },
  {
   "section": "14. Conclusion",
   "old": null,
   "new": "The organizing insight is simple: separate the persona from the task, protect each differently. Persistent AI agents should not forget who they are. Now they don't have to.",
   "marked": "{+The organizing insight is simple: separate the persona from the task, protect each differently. Persistent AI agents should not forget who they are. Now they don't have to.+}"
  },
  {
   "section": "References",
   "old": "1. Anthropic. (2024a). *Prompt Caching with Claude*. Anthropic Documentation. 2. Bai, Y., et al. (2022). *Constitutional AI: Harmlessness from AI Feedback*. arXiv:2212.08073. 3. Borgeaud, S., et al. (2022). *Improving language models by retrieving from trillions of tokens* (RETRO). ICML. 4. Chase, H. & LangChain Team. (2023). *LangChain Memory Modules*. 5. Gonnermann-Müller, S., et al. (2026). *Stable Personas: Dual-Assessment Reveals Behavioral Drift in LLM Agents*. arXiv preprint. 6. Green, D. M. & Swets, J. A. (1966). *Signal Detection Theory and Psychophysics*. Wiley. 7. Jang, J., et al. (2023). *Personalized Soups: Personalized Large Language Model Alignment via Post-hoc Parameter Merging*. arXiv:2310.11564. 8. Li, K., et al. (2024). *Measuring and Controlling Persona Drift in LLM-Based Agents*. arXiv preprint. 9. Li, Z., et al. (2025). *MemOS: An Operating System for Memory in LLM Agents*. arXiv:2506.06326. 10. Liu, N. F., et al. (2024). *Lost in the Middle: How Language Models Use Long Contexts*. TACL. 11. Madaan, A., et al. (2023). *Self-Refine: Iterative Refinement with Self-Feedback*. NeurIPS 2023. 12. Ouyang, L., et al. (2022). *Training Language Models to Follow Instructions with Human Feedback*. NeurIPS 2022. 13. Serra, O. (2026a). *ENGRAM: Event-Navigated Graded Retrieval & Archival Memory*. Technical Report. 14. Serra, O. (2026b). *HIPPOCAMPUS: A Pre-Computed Concept Index for O(1) Memory Retrieval in Persistent AI Agents*. Technical Report. 15. Serra, O. (2026d). *LIMBIC: Bisociation in Embedding Space for Humor Generation*. Technical Report. 16. Serra, O. (2026e). *SYNAPSE: Cross-Session Signal Routing for Persistent AI Agents*. Technical Report. 17. Shao, Y., et al. (2023). *Character-LLM: A Trainable Agent for Role-Playing*. arXiv:2310.10158. 18. Torantulino. (2023). *AutoGPT: An Autonomous GPT-4 Experiment*. 19. Wang, Z., et al. (2023). *RoleLLM: Benchmarking, Eliciting, and Enhancing Role-Playing Abilities of Large Language Models*. arXiv:2310.00746. 20. Xu, W., et al. (2025). *A-MEM: Agentic Memory for LLM Agents*. arXiv:2502.12110. 21. Yao, S., et al. (2023). *ReAct: Synergizing Reasoning and Acting in Language Models*. ICLR 2023. 22. Zheng, L., et al. (2024). *Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena*. NeurIPS 2024. 23. Zhou, J., et al. (2024). *Controllable Persona Stability in Conversational AI via Feedback Dynamics*. arXiv preprint.",
   "new": "1. Anthropic. (2024a). _Prompt Caching with Claude_. Anthropic Documentation. 2. Bai, Y., et al. (2022). _Constitutional AI: Harmlessness from AI Feedback_. arXiv:2212.08073. 3. Borgeaud, S., et al. (2022). _Improving language models by retrieving from trillions of tokens_ (RETRO). ICML. 4. Chase, H. & LangChain Team. (2023). _LangChain Memory Modules_. 5. Gonnermann-Müller, S., et al. (2026). _Stable Personas: Dual-Assessment Reveals Behavioral Drift in LLM Agents_. arXiv preprint. 6. Green, D. M. & Swets, J. A. (1966). _Signal Detection Theory and Psychophysics_. Wiley. 7. Jang, J., et al. (2023). _Personalized Soups: Personalized Large Language Model Alignment via Post-hoc Parameter Merging_. arXiv:2310.11564. 8. Li, K., et al. (2024). _Measuring and Controlling Persona Drift in LLM-Based Agents_. arXiv preprint. 9. Li, Z., et al. (2025). _MemOS: An Operating System for Memory in LLM Agents_. arXiv:2506.06326. 10. Liu, N. F., et al. (2024). _Lost in the Middle: How Language Models Use Long Contexts_. TACL. 11. Madaan, A., et al. (2023). _Self-Refine: Iterative Refinement with Self-Feedback_. NeurIPS 2023. 12. Ouyang, L., et al. (2022). _Training Language Models to Follow Instructions with Human Feedback_. NeurIPS 2022. 13. Serra, O. (2026a). _Total Recall: Event-Navigated Graded Retrieval & Archival Memory_. Technical Report. 14. Serra, O. (2026b). _Instant Recall: A Pre-Computed Concept Index for O(1) Memory Retrieval in Persistent AI Agents_. Technical Report. 15. Serra, O. (2026d). _Humor Embeddings: Bisociation in Embedding Space for Humor Generation_. Technical Report. 16. Serra, O. (2026e). _Round Table: Cross-Session Signal Routing for Persistent AI Agents_. Technical Report. 17. Shao, Y., et al. (2023). _Character-LLM: A Trainable Agent for Role-Playing_. arXiv:2310.10158. 18. Torantulino. (2023). _AutoGPT: An Autonomous GPT-4 Experiment_. 19. Wang, Z., et al. (2023). _RoleLLM: Benchmarking, Eliciting, and Enhancing Role-Playing Abilities of Large Language Models_. arXiv:2310.00746. 20. Xu, W., et al. (2025). _A-MEM: Agentic Memory for LLM Agents_. arXiv:2502.12110. 21. Yao, S., et al. (2023). _ReAct: Synergizing Reasoning and Acting in Language Models_. ICLR 2023. 22. Zheng, L., et al. (2024). _Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena_. NeurIPS 2024. 23. Zhou, J., et al. (2024). _Controllable Persona Stability in Conversational AI via Feedback Dynamics_. arXiv preprint.",
   "marked": "1. Anthropic. (2024a). [-*Prompt-] {+_Prompt+} Caching with [-Claude*.-] {+Claude_.+} Anthropic Documentation. 2. Bai, Y., et al. (2022). [-*Constitutional-] {+_Constitutional+} AI: Harmlessness from AI [-Feedback*.-] {+Feedback_.+} arXiv:2212.08073. 3. Borgeaud, S., et al. (2022). [-*Improving-] {+_Improving+} language models by retrieving from trillions of [-tokens*-] {+tokens_+} (RETRO). ICML. 4. Chase, H. & LangChain Team. (2023). [-*LangChain-] {+_LangChain+} Memory [-Modules*.-] {+Modules_.+} 5. Gonnermann-Müller, S., et al. (2026). [-*Stable-] {+_Stable+} Personas: Dual-Assessment Reveals Behavioral Drift in LLM [-Agents*.-] {+Agents_.+} arXiv preprint. 6. Green, D. M. & Swets, J. A. (1966). [-*Signal-] {+_Signal+} Detection Theory and [-Psychophysics*.-] {+Psychophysics_.+} Wiley. 7. Jang, J., et al. (2023). [-*Personalized-] {+_Personalized+} Soups: Personalized Large Language Model Alignment via Post-hoc Parameter [-Merging*.-] {+Merging_.+} arXiv:2310.11564. 8. Li, K., et al. (2024). [-*Measuring-] {+_Measuring+} and Controlling Persona Drift in LLM-Based [-Agents*.-] {+Agents_.+} arXiv preprint. 9. Li, Z., et al. (2025). [-*MemOS:-] {+_MemOS:+} An Operating System for Memory in LLM [-Agents*.-] {+Agents_.+} arXiv:2506.06326. 10. Liu, N. F., et al. (2024). [-*Lost-] {+_Lost+} in the Middle: How Language Models Use Long [-Contexts*.-] {+Contexts_.+} TACL. 11. Madaan, A., et al. (2023). [-*Self-Refine:-] {+_Self-Refine:+} Iterative Refinement with [-Self-Feedback*.-] {+Self-Feedback_.+} NeurIPS 2023. 12. Ouyang, L., et al. (2022). [-*Training-] {+_Training+} Language Models to Follow Instructions with Human [-Feedback*.-] {+Feedback_.+} NeurIPS 2022. 13. Serra, O. (2026a). [-*ENGRAM:-] {+_Total Recall:+} Event-Navigated Graded Retrieval & Archival [-Memory*.-] {+Memory_.+} Technical Report. 14. Serra, O. (2026b). [-*HIPPOCAMPUS:-] {+_Instant Recall:+} A Pre-Computed Concept Index for O(1) Memory Retrieval in Persistent AI [-Agents*.-] {+Agents_.+} Technical Report. 15. Serra, O. (2026d). [-*LIMBIC:-] {+_Humor Embeddings:+} Bisociation in Embedding Space for Humor [-Generation*.-] {+Generation_.+} Technical Report. 16. Serra, O. (2026e). [-*SYNAPSE:-] {+_Round Table:+} Cross-Session Signal Routing for Persistent AI [-Agents*.-] {+Agents_.+} Technical Report. 17. Shao, Y., et al. (2023). [-*Character-LLM:-] {+_Character-LLM:+} A Trainable Agent for [-Role-Playing*.-] {+Role-Playing_.+} arXiv:2310.10158. 18. Torantulino. (2023). [-*AutoGPT:-] {+_AutoGPT:+} An Autonomous GPT-4 [-Experiment*.-] {+Experiment_.+} 19. Wang, Z., et al. (2023). [-*RoleLLM:-] {+_RoleLLM:+} Benchmarking, Eliciting, and Enhancing Role-Playing Abilities of Large Language [-Models*.-] {+Models_.+} arXiv:2310.00746. 20. Xu, W., et al. (2025). [-*A-MEM:-] {+_A-MEM:+} Agentic Memory for LLM [-Agents*.-] {+Agents_.+} arXiv:2502.12110. 21. Yao, S., et al. (2023). [-*ReAct:-] {+_ReAct:+} Synergizing Reasoning and Acting in Language [-Models*.-] {+Models_.+} ICLR 2023. 22. Zheng, L., et al. (2024). [-*Judging-] {+_Judging+} LLM-as-a-Judge with MT-Bench and Chatbot [-Arena*.-] {+Arena_.+} NeurIPS 2024. 23. Zhou, J., et al. (2024). [-*Controllable-] {+_Controllable+} Persona Stability in Conversational AI via Feedback [-Dynamics*.-] {+Dynamics_.+} arXiv preprint."
  },
  {
   "section": "A.1 PersonaState Schema",
   "old": "### A.1 PersonaState Excerpt and Full Schema",
   "new": "### A.1 PersonaState Schema",
   "marked": "### A.1 PersonaState [-Excerpt and Full-] Schema"
  },
  {
   "section": "A.1 PersonaState Schema",
   "old": "```python @dataclass class PersonaState: \"\"\"Core persona specification for a persistent agent.\"\"\" version: int last_updated: datetime name: str identity_statement: str hard_rules: list[HardRule] # Binary constraints traits: list[Trait] # Graded tendencies voice_markers: VoiceMarkers # Stylistic targets relational: RelationalState # User rapport history humor: HumorCalibration # Interface for LIMBIC reference_samples: list[str] # E_phi anchors ```",
   "new": "```python @dataclass class PersonaState: \"\"\"Core persona specification for a persistent agent.\"\"\" version: int last_updated: datetime name: str identity_statement: str hard_rules: list[HardRule] # Binary constraints traits: list[Trait] # Graded tendencies voice_markers: VoiceMarkers # Stylistic targets relational: RelationalState # User rapport history humor: HumorCalibration # Interface for Humor Embeddings reference_samples: list[str] # E_phi anchors ```",
   "marked": "```python @dataclass class PersonaState: \"\"\"Core persona specification for a persistent agent.\"\"\" version: int last_updated: datetime name: str identity_statement: str hard_rules: list[HardRule] # Binary constraints traits: list[Trait] # Graded tendencies voice_markers: VoiceMarkers # Stylistic targets relational: RelationalState # User rapport history humor: HumorCalibration # Interface for [-LIMBIC-] {+Humor Embeddings+} reference_samples: list[str] # E_phi anchors ```"
  },
  {
   "section": "A.1 PersonaState Schema",
   "old": null,
   "new": "_Example (Voice Markers):_",
   "marked": "{+_Example (Voice Markers):_+}"
  },
  {
   "section": "A.1 PersonaState Schema",
   "old": "*Example JSON Serialization Segment (Voice Markers):* ```json \"voice_markers\": { \"avg_sentence_length\": 12.0, \"vocabulary_tier\": \"technical\", \"hedging_level\": \"rare\", \"signature_phrases\": [\"Let me check.\", \"Short answer:\"], \"forbidden_phrases\": [\"As an AI language model\"] } ```",
   "new": "```json \"voice_markers\": { \"avg_sentence_length\": 12.0, \"vocabulary_tier\": \"technical\", \"hedging_level\": \"rare\", \"signature_phrases\": [\"Let me check.\", \"Short answer:\"], \"forbidden_phrases\": [\"As an AI language model\"] } ```",
   "marked": "[-*Example JSON Serialization Segment (Voice Markers):*-] ```json \"voice_markers\": { \"avg_sentence_length\": 12.0, \"vocabulary_tier\": \"technical\", \"hedging_level\": \"rare\", \"signature_phrases\": [\"Let me check.\", \"Short answer:\"], \"forbidden_phrases\": [\"As an AI language model\"] } ```"
  },
  {
   "section": "A.2 IPC Dual-Track Compaction",
   "old": "```python def ipc_compact(conversation: list[Turn], persona_state: PersonaState) -> tuple[str, PersonaState]: factual_summary = engram_compact(conversation) # Track 1 persona_updates = extract_persona_signals(conversation, persona_state) # Track 2",
   "new": "```python def ipc_compact(conversation, persona_state): factual_summary = engram_compact(conversation) # Track 1: facts persona_updates = extract_persona_signals(conversation, persona_state) # Track 2: persona updated_persona = merge_persona_updates(persona_state, persona_updates)",
   "marked": "```python def [-ipc_compact(conversation: list[Turn], persona_state: PersonaState) -> tuple[str, PersonaState]:-] {+ipc_compact(conversation, persona_state):+} factual_summary = engram_compact(conversation) # Track [-1-] {+1: facts+} persona_updates = extract_persona_signals(conversation, persona_state) # Track [-2-] {+2: persona updated_persona = merge_persona_updates(persona_state, persona_updates)+}"
  },
  {
   "section": "A.2 IPC Dual-Track Compaction",
   "old": "updated_persona = merge_persona_updates(persona_state, persona_updates) e_phi_orig = compute_persona_features(conversation) e_phi_summ = compute_persona_features(factual_summary)",
   "new": null,
   "marked": "[-updated_persona = merge_persona_updates(persona_state, persona_updates) e_phi_orig = compute_persona_features(conversation) e_phi_summ = compute_persona_features(factual_summary)-]"
  },
  {
   "section": "A.2 IPC Dual-Track Compaction",
   "old": "if np.linalg.norm(e_phi_orig - e_phi_summ)**2 > THRESHOLD: factual_summary = engram_compact(conversation, preserve_style=True)",
   "new": "e_phi_orig = compute_persona_features(conversation) e_phi_summ = compute_persona_features(factual_summary) if np.linalg.norm(e_phi_orig - e_phi_summ)**2 > THRESHOLD: factual_summary = engram_compact(conversation, preserve_style=True)",
   "marked": "{+e_phi_orig = compute_persona_features(conversation) e_phi_summ = compute_persona_features(factual_summary)+} if np.linalg.norm(e_phi_orig - e_phi_summ)**2 > THRESHOLD: factual_summary = engram_compact(conversation, preserve_style=True)"
  },
  {
   "section": "Appendix B: Persona Feature Space Computation",
   "old": "```python def compute_persona_features(text: str, embed_fn=roberta_encode) -> np.ndarray: \"\"\"Compute E_phi(text) -> R^136 persona feature vector.\"\"\" # d_A = 8: Metrics including mean length, variance, TTR, hedging, formality features_a = extract_linguistic_metrics(text) # d_B = 128: Truncated RoBERTa embeddings of stylistic boundaries features_b = embed_fn(text)[:128]",
   "new": "```python def compute_persona_features(text, embed_fn=roberta_encode): \"\"\"Compute E_phi(text) -> R^136 persona feature vector.\"\"\" features_a = extract_linguistic_metrics(text) # d_A = 8 features_b = embed_fn(text)[:128] # d_B = 128",
   "marked": "```python def [-compute_persona_features(text: str, embed_fn=roberta_encode) -> np.ndarray:-] {+compute_persona_features(text, embed_fn=roberta_encode):+} \"\"\"Compute E_phi(text) -> R^136 persona feature vector.\"\"\" [-# d_A = 8: Metrics including mean length, variance, TTR, hedging, formality-] features_a = extract_linguistic_metrics(text) # {+d_A = 8 features_b = embed_fn(text)[:128] #+} d_B = [-128: Truncated RoBERTa embeddings of stylistic boundaries features_b = embed_fn(text)[:128]-] {+128+}"
  },
  {
   "section": "Appendix C: Behavioral Probe Prompts",
   "old": null,
   "new": "**Probe Type 1: Hard-Rule Audit (~100 tokens)**",
   "marked": "{+**Probe Type 1: Hard-Rule Audit (~100 tokens)**+}"
  },
  {
   "section": "Appendix C: Behavioral Probe Prompts",
   "old": "**Probe Type 1: Hard-Rule Audit (~100 tokens)** > `Given this agent response and these rules, does the response violate any rule? Answer YES/NO and cite the rule ID, or PASS. Response: {agent_response}`",
   "new": "> `Given this agent response and these rules, does the response violate any rule? Answer YES/NO and cite the rule ID, or PASS.`",
   "marked": "[-**Probe Type 1: Hard-Rule Audit (~100 tokens)**-] > `Given this agent response and these rules, does the response violate any rule? Answer YES/NO and cite the rule ID, or [-PASS. Response: {agent_response}`-] {+PASS.`+}"
  },
  {
   "section": "Appendix C: Behavioral Probe Prompts",
   "old": null,
   "new": "**Probe Type 2: Persona Extraction for IPC (~300 tokens)**",
   "marked": "{+**Probe Type 2: Persona Extraction for IPC (~300 tokens)**+}"
  },
  {
   "section": "Appendix C: Behavioral Probe Prompts",
   "old": "**Probe Type 2: Persona Extraction for IPC (~300 tokens)** > `Analyze this conversation segment for persona signals. Extract observable patterns (do not infer). Return JSON specifying: 1. NEW VOICE PATTERNS, 2. RELATIONAL SHIFTS, 3. EXPRESSED PREFERENCES.`",
   "new": "> `Analyze this conversation segment for persona signals. Extract observable patterns (do not infer). Return JSON: NEW VOICE PATTERNS, RELATIONAL SHIFTS, EXPRESSED PREFERENCES.`",
   "marked": "[-**Probe Type 2: Persona Extraction for IPC (~300 tokens)**-] > `Analyze this conversation segment for persona signals. Extract observable patterns (do not infer). Return [-JSON specifying: 1.-] {+JSON:+} NEW VOICE PATTERNS, [-2.-] RELATIONAL SHIFTS, [-3.-] EXPRESSED PREFERENCES.`"
  },
  {
   "section": "Appendix C: Behavioral Probe Prompts",
   "old": null,
   "new": "**Probe Type 3: Full Persona Audit (~800 tokens)**",
   "marked": "{+**Probe Type 3: Full Persona Audit (~800 tokens)**+}"
  },
  {
   "section": "Appendix C: Behavioral Probe Prompts",
   "old": "**Probe Type 3: Full Persona Audit (~800 tokens)** > `Evaluate this agent's recent behavior against its persona specification. Assess: (1) Hard rule compliance, (2) Trait alignment, (3) Voice consistency, (4) Relational appropriateness. Output scoring JSON (0.0 - 1.0).`",
   "new": "> `Evaluate this agent's recent behavior against its persona specification. Assess: (1) Hard rule compliance, (2) Trait alignment, (3) Voice consistency, (4) Relational appropriateness. Output scoring JSON (0.0–1.0).`",
   "marked": "[-**Probe Type 3: Full Persona Audit (~800 tokens)**-] > `Evaluate this agent's recent behavior against its persona specification. Assess: (1) Hard rule compliance, (2) Trait alignment, (3) Voice consistency, (4) Relational appropriateness. Output scoring JSON [-(0.0 - 1.0).`-] {+(0.0–1.0).`+}"
  }
 ]
}
