{
 "paper": "prefrontal-orchestration",
 "a": "4.1",
 "b": "4.2",
 "summary": "From v4.1 (2 Jun) to v4.2 (2 Jun): 8,800 words to 8,850 words, 986 words in new or rewritten paragraphs and 936 taken out, 79 paragraphs changed.",
 "note": {
  "title": "Four of the five open items reported as built",
  "kind": "revision",
  "body": "## Summary\n\nSection 11 is rewritten as \"What Has Shipped Beyond the Core\". Durable checkpointing, the self-improving library, importing outside recipes and the versioned marketplace (client side) are now reported as built. Searching over alternative recipes stays as the one open gap. Small wording edits elsewhere.",
  "source": "change note"
 },
 "paragraphs_changed": 79,
 "changes": [
  {
   "section": "PREFRONTAL v4.1: The Recipe Execution Substrate — How a Composable, Self-Authoring, Looping Workflow Engine Becomes an Agent's Executive Function",
   "old": "# PREFRONTAL v4.1: The Recipe Execution Substrate — How a Composable, Self-Authoring, Looping Workflow Engine Becomes an Agent's Executive Function",
   "new": null,
   "marked": "[-# PREFRONTAL v4.1: The Recipe Execution Substrate — How a Composable, Self-Authoring, Looping Workflow Engine Becomes an Agent's Executive Function-]"
  },
  {
   "section": "PREFRONTAL v4.1: The Recipe Execution Substrate — How a Composable, Self-Authoring, Looping Workflow Engine Becomes an Agent's Executive Function",
   "old": "**Oscar Serra¹, Jarvis¹** ¹Independent Research *2 June 2026 — v4.1*",
   "new": null,
   "marked": "[-**Oscar Serra¹, Jarvis¹** ¹Independent Research *2 June 2026 — v4.1*-]"
  },
  {
   "section": "PREFRONTAL v4.1: The Recipe Execution Substrate — How a Composable, Self-Authoring, Looping Workflow Engine Becomes an Agent's Executive Function",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "Abstract",
   "old": "A recipe is a structured workflow: ordered steps, tool hints, success gates, and failure handlers, written as a portable document rather than as code. The substrate we describe does six things with recipes that together make them an execution engine rather than a static library. (1) It **matches** the user's intent to recipes with a fuzzy, stemmed, edit-distance-tolerant scorer that reports a confidence tier, and seeds a plan automatically at the start of every turn. (2) It **composes** recipes from recipes — a recipe may merge another recipe's steps into its own at plan-build time, or call a sub-recipe at runtime, both cycle- and depth-guarded, exactly as functions call functions. (3) When nothing matches, it **authors** a new recipe on the fly, validates it, persists it, and makes it matchable on the very next turn — closing the loop on its own coverage gaps. (4) It supports bounded **loops** over steps (run *N* times / until-dry / until a marker appears), which is the element that lifts recipes from straight-line checklists to a structured, Turing-complete-ish execution substrate and closes the long-standing structural gap against hand-coded agent workflows. (5) It **routes effort dynamically**, classifying each turn as trivial / standard / deep / ultra and using that classification to *drive* the turn — model tier, thinking budget, orchestration mode, and token generosity all scale to the work. (6) It makes all of this **observable** through a dedicated RECIPES panel that renders the provenance trail (searched → matched → merged → composed → authored), per-subagent vitals, and the compact-versus-expanded decision trail, while keeping orchestration mechanics strictly out of the substantive chat.",
   "new": "A recipe is a structured workflow: ordered steps, tool hints, success gates, and failure handlers, written as a portable document rather than as code. The substrate does six things with recipes that together make them an execution engine rather than a static library. (1) It **matches** the user's intent to recipes with a fuzzy, stemmed, edit-distance-tolerant scorer that reports a confidence tier, and seeds a plan automatically at the start of every turn. (2) It **composes** recipes from recipes — a recipe may merge another recipe's steps into its own at plan-build time, or call a sub-recipe at runtime, both cycle- and depth-guarded, exactly as functions call functions. (3) When nothing matches, it **authors** a new recipe on the fly, validates it, persists it, and makes it matchable on the very next turn — closing the loop on its own coverage gaps. (4) It supports bounded **loops** over steps (run *N* times / until-dry / until a marker appears), the element that lifts recipes from straight-line checklists to a structured execution substrate and closes the long-standing structural gap against hand-coded agent workflows. (5) It **routes effort dynamically**, classifying each turn as trivial / standard / deep / ultra and using that classification to *drive* the turn — model tier, thinking budget, orchestration mode, and token generosity all scale to the work. (6) It makes all of this **observable** through a dedicated RECIPES panel that renders the provenance trail (searched → matched → merged → composed → authored), per-subagent vitals, and the compact-versus-expanded decision trail, while keeping orchestration mechanics out of the substantive chat.",
   "marked": "A recipe is a structured workflow: ordered steps, tool hints, success gates, and failure handlers, written as a portable document rather than as code. The substrate [-we describe-] does six things with recipes that together make them an execution engine rather than a static library. (1) It **matches** the user's intent to recipes with a fuzzy, stemmed, edit-distance-tolerant scorer that reports a confidence tier, and seeds a plan automatically at the start of every turn. (2) It **composes** recipes from recipes — a recipe may merge another recipe's steps into its own at plan-build time, or call a sub-recipe at runtime, both cycle- and depth-guarded, exactly as functions call functions. (3) When nothing matches, it **authors** a new recipe on the fly, validates it, persists it, and makes it matchable on the very next turn — closing the loop on its own coverage gaps. (4) It supports bounded **loops** over steps (run *N* times / until-dry / until a marker appears), [-which is-] the element that lifts recipes from straight-line checklists to a [-structured, Turing-complete-ish-] {+structured+} execution substrate and closes the long-standing structural gap against hand-coded agent workflows. (5) It **routes effort dynamically**, classifying each turn as trivial / standard / deep / ultra and using that classification to *drive* the turn — model tier, thinking budget, orchestration mode, and token generosity all scale to the work. (6) It makes all of this **observable** through a dedicated RECIPES panel that renders the provenance trail (searched → matched → merged → composed → authored), per-subagent vitals, and the compact-versus-expanded decision trail, while keeping orchestration mechanics [-strictly-] out of the substantive chat."
  },
  {
   "section": "Abstract",
   "old": "The thesis is that intelligence in a deployed agent is not primarily a property of the model. It is a property of the *structure the model executes inside* — and that structure is most powerful when it is composable, self-authoring, looping, effort-adaptive, and observable. This paper specifies that substrate, grounds the brain metaphor in concrete mechanism, and gives language-agnostic pseudocode for each of the six capabilities.",
   "new": "The thesis is that intelligence in a deployed agent is not primarily a property of the model. It is a property of the *structure the model executes inside* — and that structure is most powerful when it is composable, self-authoring, looping, effort-adaptive, and observable. This paper specifies that substrate, grounds the brain metaphor in concrete mechanism, gives language-agnostic pseudocode for each of the six capabilities, and reports which of the substrate's harder extensions — durable resume, a self-improving library, external acquisition, and a versioned marketplace — have now landed in the running fork.",
   "marked": "The thesis is that intelligence in a deployed agent is not primarily a property of the model. It is a property of the *structure the model executes inside* — and that structure is most powerful when it is composable, self-authoring, looping, effort-adaptive, and observable. This paper specifies that substrate, grounds the brain metaphor in concrete mechanism, [-and-] gives language-agnostic pseudocode for each of the six [-capabilities.-] {+capabilities, and reports which of the substrate's harder extensions — durable resume, a self-improving library, external acquisition, and a versioned marketplace — have now landed in the running fork.+}"
  },
  {
   "section": "Abstract",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "1.3 The gap this paper closes",
   "old": "1. **Matching** turns \"the agent should pick the right playbook\" into \"the right plan is already seeded before the agent's first token,\" via a fuzzy scorer with confidence tiers. (Task-set selection.) 2. **Composition** lets recipes be built from recipes, both statically (step-merge) and dynamically (runtime sub-recipe calls), so workflows reuse workflows instead of duplicating them. (Hierarchical program structure.) 3. **On-the-fly authoring** lets the substrate write a new recipe when none fits, validate it, and add it to the library mid-conversation — so coverage gaps heal themselves. (Skill acquisition.) 4. **Loops** let a step repeat under a bounded condition, which is the single feature that elevates recipes from straight-line sequences to a substrate expressive enough to encode iterative work. (Sustained, monitored repetition.) 5. **Effort routing** classifies the turn and *drives* it — choosing model tier, thinking budget, orchestration mode, and token generosity to fit. (Effort regulation.) 6. **Observability** surfaces the whole life-cycle in a dedicated panel, so a human can see what program is running, where it is, and how each worker is doing, without that machinery polluting the substantive answer. (Metacognitive monitoring.)",
   "new": "1. **Matching** turns \"the agent should pick the right playbook\" into \"the right plan is already seeded before the agent's first token,\" via a fuzzy scorer with confidence tiers. (Task-set selection.) 2. **Composition** lets recipes be built from recipes, both statically (step-merge) and dynamically (runtime sub-recipe calls), so workflows reuse workflows instead of duplicating them. (Hierarchical program structure.) 3. **On-the-fly authoring** lets the substrate write a new recipe when none fits, validate it, and add it to the library mid-conversation — so coverage gaps heal themselves. (Skill acquisition.) 4. **Loops** let a step repeat under a bounded condition, the single feature that elevates recipes from straight-line sequences to a substrate expressive enough to encode iterative work. (Sustained, monitored repetition.) 5. **Effort routing** classifies the turn and *drives* it — choosing model tier, thinking budget, orchestration mode, and token generosity to fit. (Effort regulation.) 6. **Observability** surfaces the whole life-cycle in a dedicated panel, so a human can see what program is running, where it is, and how each worker is doing, without that machinery polluting the substantive answer. (Metacognitive monitoring.)",
   "marked": "1. **Matching** turns \"the agent should pick the right playbook\" into \"the right plan is already seeded before the agent's first token,\" via a fuzzy scorer with confidence tiers. (Task-set selection.) 2. **Composition** lets recipes be built from recipes, both statically (step-merge) and dynamically (runtime sub-recipe calls), so workflows reuse workflows instead of duplicating them. (Hierarchical program structure.) 3. **On-the-fly authoring** lets the substrate write a new recipe when none fits, validate it, and add it to the library mid-conversation — so coverage gaps heal themselves. (Skill acquisition.) 4. **Loops** let a step repeat under a bounded condition, [-which is-] the single feature that elevates recipes from straight-line sequences to a substrate expressive enough to encode iterative work. (Sustained, monitored repetition.) 5. **Effort routing** classifies the turn and *drives* it — choosing model tier, thinking budget, orchestration mode, and token generosity to fit. (Effort regulation.) 6. **Observability** surfaces the whole life-cycle in a dedicated panel, so a human can see what program is running, where it is, and how each worker is doing, without that machinery polluting the substantive answer. (Metacognitive monitoring.)"
  },
  {
   "section": "1.3 The gap this paper closes",
   "old": "The rest of the paper specifies each in turn (Sections 3–8), after establishing the architecture and the economics that make it affordable (Section 2). Section 9 integrates the substrate with the surrounding cognitive systems; Section 10 gives evaluation design; Section 11 is honest about what the substrate does *not* yet do and lays out the roadmap that closes those gaps; Section 12 lists suggested diagrams; Section 13 concludes.",
   "new": "The rest of the paper specifies each in turn (Sections 3–8), after establishing the architecture and the economics that make it affordable (Section 2). Section 9 integrates the substrate with the surrounding cognitive systems; Section 10 gives evaluation design; Section 11 reports what has shipped beyond the six core capabilities and the one extension that remains open; Section 12 lists suggested diagrams; Section 13 concludes.",
   "marked": "The rest of the paper specifies each in turn (Sections 3–8), after establishing the architecture and the economics that make it affordable (Section 2). Section 9 integrates the substrate with the surrounding cognitive systems; Section 10 gives evaluation design; Section 11 [-is honest about-] {+reports+} what {+has shipped beyond+} the [-substrate does *not* yet do-] {+six core capabilities+} and [-lays out-] the [-roadmap-] {+one extension+} that [-closes those gaps;-] {+remains open;+} Section 12 lists suggested diagrams; Section 13 concludes."
  },
  {
   "section": "1.3 The gap this paper closes",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "2.2 Where the structure comes from, and when it is cheap",
   "old": "The substrate is engineered so that the executive overhead is near-free for the common case and is *only* spent where it pays. Three mechanisms make this true.",
   "new": "The substrate is engineered so that the executive overhead is near-free for the common case and is spent only where it pays. Three mechanisms make this true.",
   "marked": "The substrate is engineered so that the executive overhead is near-free for the common case and is [-*only*-] spent {+only+} where it pays. Three mechanisms make this true."
  },
  {
   "section": "2.2 Where the structure comes from, and when it is cheap",
   "old": "Second, **effort routing gates depth.** A trivial turn (\"thanks,\" \"what time is it\") is classified as trivial and the substrate stays out of the way entirely — no plan injection, no extra reasoning, minimal tokens. The machinery of the cycle is only fully engaged when the turn warrants it. This is the analogue of the cortex spending metabolic budget proportional to task difficulty rather than firing at full intensity for every stimulus.",
   "new": "Second, **effort routing gates depth.** A trivial turn (\"thanks,\" \"what time is it\") is classified as trivial and the substrate stays out of the way entirely — no plan injection, no extra reasoning, minimal tokens. The machinery of the cycle is fully engaged only when the turn warrants it. This is the analogue of the cortex spending metabolic budget proportional to task difficulty rather than firing at full intensity for every stimulus.",
   "marked": "Second, **effort routing gates depth.** A trivial turn (\"thanks,\" \"what time is it\") is classified as trivial and the substrate stays out of the way entirely — no plan injection, no extra reasoning, minimal tokens. The machinery of the cycle is [-only-] fully engaged {+only+} when the turn warrants it. This is the analogue of the cortex spending metabolic budget proportional to task difficulty rather than firing at full intensity for every stimulus."
  },
  {
   "section": "2.3 Plans as the runtime trace of recipes",
   "old": "Because the plan is persisted and seeded automatically at turn start, the substrate gains crash-resilience almost for free: if the process restarts mid-task, there is an `in_progress` plan on disk describing exactly where the work was, and the executive can resume from it rather than re-deriving intent from scratch. The plan *is* the agent's working memory, externalised.",
   "new": "Because the plan is persisted and seeded automatically at turn start, the substrate gains crash-resilience: if the process restarts mid-task, there is an `in_progress` plan on disk describing exactly where the work was, and the executive resumes from it rather than re-deriving intent from scratch. The plan schema reserves a per-step `artifact` field and a plan-level `currentStep` cursor for exactly this purpose; Section 11.1 reports the resume path that reads them back. The plan *is* the agent's working memory, externalised.",
   "marked": "Because the plan is persisted and seeded automatically at turn start, the substrate gains [-crash-resilience almost for free:-] {+crash-resilience:+} if the process restarts mid-task, there is an `in_progress` plan on disk describing exactly where the work was, and the executive [-can resume-] {+resumes+} from it rather than re-deriving intent from scratch. The plan {+schema reserves a per-step `artifact` field and a plan-level `currentStep` cursor for exactly this purpose; Section 11.1 reports the resume path that reads them back. The plan+} *is* the agent's working memory, externalised."
  },
  {
   "section": "2.3 Plans as the runtime trace of recipes",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "3.1 The problem with literal matching",
   "old": "The naïve approach to recipe selection is keyword matching: if the message contains \"bug,\" select the debug recipe. It is brittle in exactly the way human task recognition is not. A person reading \"the build keeps dying after I touched the config\" instantly recognises a debugging situation; a literal matcher sees no shared token with a recipe tagged `bug, error, crash` and silently selects nothing. Worse, a silent non-selection is invisible: the agent proceeds with no program, and no one knows the executive failed to engage.",
   "new": "The naïve approach to recipe selection is keyword matching: if the message contains \"bug,\" select the debug recipe. It is brittle in exactly the way human task recognition is not. A person reading \"the build keeps dying after I touched the config\" instantly recognises a debugging situation; a literal matcher sees no shared token with a recipe tagged `bug, error, crash` and selects nothing. Worse, a silent non-selection is invisible: the agent proceeds with no program, and no one knows the executive failed to engage.",
   "marked": "The naïve approach to recipe selection is keyword matching: if the message contains \"bug,\" select the debug recipe. It is brittle in exactly the way human task recognition is not. A person reading \"the build keeps dying after I touched the config\" instantly recognises a debugging situation; a literal matcher sees no shared token with a recipe tagged `bug, error, crash` and [-silently-] selects nothing. Worse, a silent non-selection is invisible: the agent proceeds with no program, and no one knows the executive failed to engage."
  },
  {
   "section": "3.3 Confidence tiers and what they gate",
   "old": "Raw scores are reduced to a **confidence tier** — `none`, `low`, or `high` — because the executive needs to behave differently depending on how sure it is, just as a person hesitates before committing to an ambiguous task framing:",
   "new": "Raw scores are reduced to a **confidence tier** — `none`, `low`, or `high` — because the executive must behave differently depending on how sure it is, just as a person hesitates before committing to an ambiguous task framing. A tier is `high` only when the leader clears the threshold with margin *and* leads the runner-up clearly; everything else that clears the bar is `low`:",
   "marked": "Raw scores are reduced to a **confidence tier** — `none`, `low`, or `high` — because the executive [-needs to-] {+must+} behave differently depending on how sure it is, just as a person hesitates before committing to an ambiguous task [-framing:-] {+framing. A tier is `high` only when the leader clears the threshold with margin *and* leads the runner-up clearly; everything else that clears the bar is `low`:+}"
  },
  {
   "section": "3.4 Auto-seeding at turn start",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "4.2 Dynamic composition — runtime sub-recipe calls (`uses:`)",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "5.3 Provenance and the never-overwrite rule",
   "old": "Authored recipes are stamped with an *authored-by* marker that distinguishes them from the curated, hand-written library. The persistence layer will overwrite an authored recipe only with an explicit overwrite flag, and **will never overwrite a curated recipe** — the substrate cannot cannibalise its own carefully written playbooks. Trigger phrases supplied by the author are folded into the recipe's tag set, because the matcher scores against tags; an authored recipe whose triggers never reached the tags would be invisible to the very matcher that is meant to surface it next turn. (Authored recipes are never auto-published to any shared registry; publishing is an explicit, separate human action.)",
   "new": "Authored recipes are stamped with an *authored-by* marker that distinguishes them from the curated, hand-written library. The persistence layer will overwrite an authored recipe only with an explicit overwrite flag, and **will never overwrite a curated recipe** — the substrate cannot cannibalise its own carefully written playbooks. Trigger phrases supplied by the author are folded into the recipe's tag set, because the matcher scores against tags; an authored recipe whose triggers never reached the tags would be invisible to the very matcher meant to surface it next turn. (Authored recipes are never auto-published to any shared registry; publishing is an explicit, separate human action — see Section 11.4.)",
   "marked": "Authored recipes are stamped with an *authored-by* marker that distinguishes them from the curated, hand-written library. The persistence layer will overwrite an authored recipe only with an explicit overwrite flag, and **will never overwrite a curated recipe** — the substrate cannot cannibalise its own carefully written playbooks. Trigger phrases supplied by the author are folded into the recipe's tag set, because the matcher scores against tags; an authored recipe whose triggers never reached the tags would be invisible to the very matcher [-that is-] meant to surface it next turn. (Authored recipes are never auto-published to any shared registry; publishing is an explicit, separate human [-action.)-] {+action — see Section 11.4.)+}"
  },
  {
   "section": "5.3 Provenance and the never-overwrite rule",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "6.1 Why loops are the dividing line",
   "old": "A straight-line recipe is a checklist. A checklist cannot express \"keep collecting findings until there are no new ones,\" or \"retry this verification up to five times,\" or \"iterate the draft until it crosses a quality marker.\" Those are the shape of real iterative work, and their absence is precisely the structural gap that separates a static playbook from a hand-coded agent workflow. A loop construct — even a bounded one — is the feature that closes the gap, because sequence + branch + bounded iteration is the minimal vocabulary of a general execution substrate. With loops, recipes stop being checklists and become *programs* for behaviour.",
   "new": "A straight-line recipe is a checklist. A checklist cannot express \"keep collecting findings until there are no new ones,\" or \"retry this verification up to five times,\" or \"iterate the draft until it crosses a quality marker.\" Those are the shape of real iterative work, and their absence is precisely the structural gap that separates a static playbook from a hand-coded agent workflow. A loop construct — even a bounded one — closes the gap, because sequence + branch + bounded iteration is the minimal vocabulary of a general execution substrate. With loops, recipes stop being checklists and become *programs* for behaviour.",
   "marked": "A straight-line recipe is a checklist. A checklist cannot express \"keep collecting findings until there are no new ones,\" or \"retry this verification up to five times,\" or \"iterate the draft until it crosses a quality marker.\" Those are the shape of real iterative work, and their absence is precisely the structural gap that separates a static playbook from a hand-coded agent workflow. A loop construct — even a bounded one — [-is the feature that-] closes the gap, because sequence + branch + bounded iteration is the minimal vocabulary of a general execution substrate. With loops, recipes stop being checklists and become *programs* for behaviour."
  },
  {
   "section": "6.3 Bounded by construction — the anti-runaway guarantee",
   "old": "A self-driving loop in an autonomous agent is a liability unless it is *provably* bounded. Every loop is therefore clamped twice: a per-loop default maximum, and an absolute hard cap that no recipe (authored or hand-written) can exceed. A loop count is clamped into `[1, HARD_CAP]` at parse time, so even a maliciously or accidentally enormous `count` collapses to the hard ceiling. The substrate is expressive enough to iterate and *constitutionally incapable* of spinning forever — the executive analogue of perseveration control, the prefrontal function that stops a behaviour that has stopped being productive.",
   "new": "A self-driving loop in an autonomous agent is a liability unless it is *provably* bounded. Every loop is therefore clamped twice: a per-loop default maximum (five iterations), and an absolute hard ceiling (twenty-five) that no recipe — authored or hand-written — can exceed. A loop count is clamped into `[1, HARD_CAP]` at parse time, so even a maliciously or accidentally enormous `count` collapses to the hard ceiling. The substrate is expressive enough to iterate and *constitutionally incapable* of spinning forever — the executive analogue of perseveration control, the prefrontal function that stops a behaviour that has stopped being productive.",
   "marked": "A self-driving loop in an autonomous agent is a liability unless it is *provably* bounded. Every loop is therefore clamped twice: a per-loop default [-maximum,-] {+maximum (five iterations),+} and an absolute hard [-cap-] {+ceiling (twenty-five)+} that no recipe [-(authored-] {+— authored+} or [-hand-written)-] {+hand-written —+} can exceed. A loop count is clamped into `[1, HARD_CAP]` at parse time, so even a maliciously or accidentally enormous `count` collapses to the hard ceiling. The substrate is expressive enough to iterate and *constitutionally incapable* of spinning forever — the executive analogue of perseveration control, the prefrontal function that stops a behaviour that has stopped being productive."
  },
  {
   "section": "6.3 Bounded by construction — the anti-runaway guarantee",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "7.3 What the tier controls",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "8.4 The compact-expand decision trail",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "9.3 Learned action gating",
   "old": "A learned action-gating system (the agent's affective intuition for which operations are dangerous) sits beneath the worker's tool calls and complements the recipe's structural gates. The integration is bidirectional: gating now receives recipe context — which step, which recipe, which preconditions were met — so it can learn that \"a file write during the *fix* step, after a successful *diagnose* step, is safe\" while \"a file write with no prior investigation is suspect.\" Structural gates (the recipe's *done-when* criteria) and learned gates (the affective network) reinforce each other; the recipe gives the intuition a vocabulary.",
   "new": "A learned action-gating system (the agent's affective intuition for which operations are dangerous) sits beneath the worker's tool calls and complements the recipe's structural gates. The integration is bidirectional: gating receives recipe context — which step, which recipe, which preconditions were met — so it can learn that \"a file write during the *fix* step, after a successful *diagnose* step, is safe\" while \"a file write with no prior investigation is suspect.\" Structural gates (the recipe's *done-when* criteria) and learned gates (the affective network) reinforce each other; the recipe gives the intuition a vocabulary.",
   "marked": "A learned action-gating system (the agent's affective intuition for which operations are dangerous) sits beneath the worker's tool calls and complements the recipe's structural gates. The integration is bidirectional: gating [-now-] receives recipe context — which step, which recipe, which preconditions were met — so it can learn that \"a file write during the *fix* step, after a successful *diagnose* step, is safe\" while \"a file write with no prior investigation is suspect.\" Structural gates (the recipe's *done-when* criteria) and learned gates (the affective network) reinforce each other; the recipe gives the intuition a vocabulary."
  },
  {
   "section": "9.5 Reflection, orchestrated",
   "old": "Post-action reflection is no longer a turn-by-turn ritual that fires regardless of whether anything happened. The substrate scales it to the work: a full reflection (with recipe context, execution trace, and plan-versus-outcome comparison) after a substantive recipe completes; a lightweight pass after a simple task; an extended root-cause reflection after a failure — with the authority to *recommend a recipe update*. Matching reflection depth to task complexity preserves the compounding benefit of learning while eliminating the latency tax of reflecting on a greeting. Reflection is the ADAPT phase of the cycle, and its most important output is sometimes not a memory note but an improved recipe.",
   "new": "Post-action reflection is no longer a turn-by-turn ritual that fires regardless of whether anything happened. The substrate scales it to the work: a full reflection (with recipe context, execution trace, and plan-versus-outcome comparison) after a substantive recipe completes; a lightweight pass after a simple task; an extended root-cause reflection after a failure — with the authority to *recommend a recipe update*. Matching reflection depth to task complexity preserves the compounding benefit of learning while eliminating the latency tax of reflecting on a greeting. Reflection is the ADAPT phase of the cycle, and its most important output is sometimes not a memory note but an improved recipe. The offline counterpart — distilling per-recipe *fitness* from accumulated execution episodes — is now wired into the matcher; Section 11.2 reports it.",
   "marked": "Post-action reflection is no longer a turn-by-turn ritual that fires regardless of whether anything happened. The substrate scales it to the work: a full reflection (with recipe context, execution trace, and plan-versus-outcome comparison) after a substantive recipe completes; a lightweight pass after a simple task; an extended root-cause reflection after a failure — with the authority to *recommend a recipe update*. Matching reflection depth to task complexity preserves the compounding benefit of learning while eliminating the latency tax of reflecting on a greeting. Reflection is the ADAPT phase of the cycle, and its most important output is sometimes not a memory note but an improved [-recipe.-] {+recipe. The offline counterpart — distilling per-recipe *fitness* from accumulated execution episodes — is now wired into the matcher; Section 11.2 reports it.+}"
  },
  {
   "section": "9.5 Reflection, orchestrated",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "10.5 Cost and latency",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "11. Limitations and Roadmap",
   "old": "## 11. Limitations and Roadmap",
   "new": null,
   "marked": "[-## 11. Limitations and Roadmap-]"
  },
  {
   "section": "11. Limitations and Roadmap",
   "old": "The substrate as specified above is the part that ships and runs. This section is deliberate about its boundary: what the six capabilities do *not* yet do, and the concrete next steps that close each gap. The roadmap is ordered by dependency, because the items are not independent — durable state is a prerequisite for the feedback loop, which is a prerequisite for search. Each item names the seam it attaches to, so the roadmap reads as engineering work, not a wish list.",
   "new": null,
   "marked": "[-The substrate as specified above is the part that ships and runs. This section is deliberate about its boundary: what the six capabilities do *not* yet do, and the concrete next steps that close each gap. The roadmap is ordered by dependency, because the items are not independent — durable state is a prerequisite for the feedback loop, which is a prerequisite for search. Each item names the seam it attaches to, so the roadmap reads as engineering work, not a wish list.-]"
  },
  {
   "section": "11.1 The plan is written, not yet read back — durable checkpointing",
   "old": "### 11.1 The plan is written, not yet read back — durable checkpointing",
   "new": null,
   "marked": "[-### 11.1 The plan is written, not yet read back — durable checkpointing-]"
  },
  {
   "section": "11.1 The plan is written, not yet read back — durable checkpointing",
   "old": "The plan-store is the durable spine of the cycle (§2.3), and the paper's claim is that \"the plan *is* the agent's working memory, externalised.\" Today that spine is **write-mostly**. The runner records each step's status and advances the cursor, and the plan schema already reserves a per-step `artifact` field and a plan-level `currentStep`, but the runner always starts at step 0 and never reads back what a finished step produced. So the resume story in §2.3 is currently an aspiration: a plan interrupted at step 3 of 6 by a gateway crash, the 10-minute per-step wall, or a guardian kill restarts from the top rather than resuming at step 4.",
   "new": null,
   "marked": "[-The plan-store is the durable spine of the cycle (§2.3), and the paper's claim is that \"the plan *is* the agent's working memory, externalised.\" Today that spine is **write-mostly**. The runner records each step's status and advances the cursor, and the plan schema already reserves a per-step `artifact` field and a plan-level `currentStep`, but the runner always starts at step 0 and never reads back what a finished step produced. So the resume story in §2.3 is currently an aspiration: a plan interrupted at step 3 of 6 by a gateway crash, the 10-minute per-step wall, or a guardian kill restarts from the top rather than resuming at step 4.-]"
  },
  {
   "section": "11.1 The plan is written, not yet read back — durable checkpointing",
   "old": "Closing this turns \"the plan is the program counter\" from a description into a guarantee. The work is contained: on entry, read back an `in_progress` plan with a matching recipe reference and set the start index to its cursor, skipping any step already marked done; on each step's success, persist a bounded digest of the done-note into the reserved `artifact` field and carry prior artifacts forward as upstream context for the next step; for a sub-recipe call, bubble the nested plan's terminal result up as the parent step's artifact. No schema change is needed — both fields already exist. The two load-bearing risks are lossiness (a bounded digest can drop context a later step needs — mitigated by keeping the full note in the plan body and the digest in the bounded field) and read-path atomicity (a partially written plan read during resume must quarantine and fall back to a clean restart rather than crash). This is item one because the next two roadmap items both consume per-step outcomes.",
   "new": null,
   "marked": "[-Closing this turns \"the plan is the program counter\" from a description into a guarantee. The work is contained: on entry, read back an `in_progress` plan with a matching recipe reference and set the start index to its cursor, skipping any step already marked done; on each step's success, persist a bounded digest of the done-note into the reserved `artifact` field and carry prior artifacts forward as upstream context for the next step; for a sub-recipe call, bubble the nested plan's terminal result up as the parent step's artifact. No schema change is needed — both fields already exist. The two load-bearing risks are lossiness (a bounded digest can drop context a later step needs — mitigated by keeping the full note in the plan body and the digest in the bounded field) and read-path atomicity (a partially written plan read during resume must quarantine and fall back to a clean restart rather than crash). This is item one because the next two roadmap items both consume per-step outcomes.-]"
  },
  {
   "section": "11.2 The library expands but does not yet self-improve — the feedback loop",
   "old": "### 11.2 The library expands but does not yet self-improve — the feedback loop",
   "new": null,
   "marked": "[-### 11.2 The library expands but does not yet self-improve — the feedback loop-]"
  },
  {
   "section": "11.2 The library expands but does not yet self-improve — the feedback loop",
   "old": "Section 5 makes the library self-*expanding*: it authors a recipe when none matches. Section 9.5 makes it self-*updating*: a reflection pass can recommend a recipe change. What is missing is making it self-*improving* — feeding real execution outcomes back into the matcher so the scoring weights (§3.2) stop being hand-tuned constants and become evidence-updated. Right now a high-confidence recipe that fails on every run keeps its high confidence; a class of intent that misses on every turn re-authors from scratch instead of being surfaced once for a durable fix.",
   "new": null,
   "marked": "[-Section 5 makes the library self-*expanding*: it authors a recipe when none matches. Section 9.5 makes it self-*updating*: a reflection pass can recommend a recipe change. What is missing is making it self-*improving* — feeding real execution outcomes back into the matcher so the scoring weights (§3.2) stop being hand-tuned constants and become evidence-updated. Right now a high-confidence recipe that fails on every run keeps its high confidence; a class of intent that misses on every turn re-authors from scratch instead of being surfaced once for a durable fix.-]"
  },
  {
   "section": "11.2 The library expands but does not yet self-improve — the feedback loop",
   "old": "The outcome-capture seam already exists: every plan that closes is a natural training row, so no new call is needed on the hot path. A per-recipe weight delta — derived from closed-plan outcomes plus an explicit \"this recipe was wrong\" verdict — is read in the scorer and applied after the base score, *before* the confidence tiering. Two guards keep the loop stable: the delta is clamped to a small bounded range so a single mis-attributed failure cannot bury a curated recipe, and the curated base weights remain the floor. The honest caveat is attribution: a closed plan's status reflects the *worker's* execution, not whether the *recipe* was the right structure — so an explicit verdict is higher-signal than an inferred one and should weigh more. The same machinery subsumes the NO-MATCH mining sketched in §3.4: a between-tasks pass buckets the accumulated no-match log by normalised intent and, when a bucket crosses a threshold, proposes a recipe to author — turning authoring from purely reactive into partly active.",
   "new": null,
   "marked": "[-The outcome-capture seam already exists: every plan that closes is a natural training row, so no new call is needed on the hot path. A per-recipe weight delta — derived from closed-plan outcomes plus an explicit \"this recipe was wrong\" verdict — is read in the scorer and applied after the base score, *before* the confidence tiering. Two guards keep the loop stable: the delta is clamped to a small bounded range so a single mis-attributed failure cannot bury a curated recipe, and the curated base weights remain the floor. The honest caveat is attribution: a closed plan's status reflects the *worker's* execution, not whether the *recipe* was the right structure — so an explicit verdict is higher-signal than an inferred one and should weigh more. The same machinery subsumes the NO-MATCH mining sketched in §3.4: a between-tasks pass buckets the accumulated no-match log by normalised intent and, when a bucket crosses a threshold, proposes a recipe to author — turning authoring from purely reactive into partly active.-]"
  },
  {
   "section": "11.3 The format is portable but the ecosystem is not yet a supply — external acquisition",
   "old": "### 11.3 The format is portable but the ecosystem is not yet a supply — external acquisition",
   "new": null,
   "marked": "[-### 11.3 The format is portable but the ecosystem is not yet a supply — external acquisition-]"
  },
  {
   "section": "11.3 The format is portable but the ecosystem is not yet a supply — external acquisition",
   "old": "Section 5.3 establishes `recipe/1.0` as a portable document and the substrate as a general runtime rather than a closed hand-authored set. The portability is real but under-exploited: the matchable library is still almost entirely local. Two outside sources could feed it. Journey kits are a near-native format and the search/install path is already wired to a remote registry; the gaps are a local-only fallback when the registry is unreachable (today it fails silently) and merging remote results with local matches so discovery spans both. Claude Code skills are a *different* shape — a `SKILL.md` plus scripts — and need an adapter that transpiles the skill into a recipe spec and runs it through the **existing** authoring validator (§5.2), so the slug-traversal and phantom-heading guards apply to imported content for free.",
   "new": null,
   "marked": "[-Section 5.3 establishes `recipe/1.0` as a portable document and the substrate as a general runtime rather than a closed hand-authored set. The portability is real but under-exploited: the matchable library is still almost entirely local. Two outside sources could feed it. Journey kits are a near-native format and the search/install path is already wired to a remote registry; the gaps are a local-only fallback when the registry is unreachable (today it fails silently) and merging remote results with local matches so discovery spans both. Claude Code skills are a *different* shape — a `SKILL.md` plus scripts — and need an adapter that transpiles the skill into a recipe spec and runs it through the **existing** authoring validator (§5.2), so the slug-traversal and phantom-heading guards apply to imported content for free.-]"
  },
  {
   "section": "11.3 The format is portable but the ecosystem is not yet a supply — external acquisition",
   "old": "The honest limitations here are about trust and fidelity. Skill-to-step transpilation is heuristic — a skill documents *capability*, not always an ordered procedure — so a bad transpile yields a non-executable recipe; gating every import behind the validator and marking bridged recipes low-trust is the guard. Imported content is untrusted, so the sandbox-path resolver that blocks `../` must also refuse to follow symlinks. And an imported `code-review` must not shadow a curated one, so imports are namespaced by owner. Whether bridged recipes are matchable by default or quarantined until a human promotes them is a policy decision, not an engineering one.",
   "new": null,
   "marked": "[-The honest limitations here are about trust and fidelity. Skill-to-step transpilation is heuristic — a skill documents *capability*, not always an ordered procedure — so a bad transpile yields a non-executable recipe; gating every import behind the validator and marking bridged recipes low-trust is the guard. Imported content is untrusted, so the sandbox-path resolver that blocks `../` must also refuse to follow symlinks. And an imported `code-review` must not shadow a curated one, so imports are namespaced by owner. Whether bridged recipes are matchable by default or quarantined until a human promotes them is a policy decision, not an engineering one.-]"
  },
  {
   "section": "11.4 Recipes are authored but not yet shared as artifacts — the marketplace",
   "old": "### 11.4 Recipes are authored but not yet shared as artifacts — the marketplace",
   "new": null,
   "marked": "[-### 11.4 Recipes are authored but not yet shared as artifacts — the marketplace-]"
  },
  {
   "section": "11.4 Recipes are authored but not yet shared as artifacts — the marketplace",
   "old": "The capstone of treating a recipe as an artifact is making a tested one a versioned, discoverable object rather than a file that lives in one workshop. The frontmatter already carries owner, version, tested-harness, and authored-by fields, and the publish path is already wired to a remote endpoint, so the remaining work is *semantics* layered on existing plumbing: a semver bump on publish with immutable published versions (a republish that would overwrite an existing version is refused), version-constrained resolution on install (latest / exact / range) with a cache TTL so updates propagate without hammering the API, and a small rating-or-download bonus folded into the same post-score adjustment seam as the feedback loop (§11.2), so there is exactly one place that perturbs base scores. Authored recipes are never auto-published — publishing stays an explicit human action (§5.3) — and only the frontmatter owner may publish a new version of a slug.",
   "new": null,
   "marked": "[-The capstone of treating a recipe as an artifact is making a tested one a versioned, discoverable object rather than a file that lives in one workshop. The frontmatter already carries owner, version, tested-harness, and authored-by fields, and the publish path is already wired to a remote endpoint, so the remaining work is *semantics* layered on existing plumbing: a semver bump on publish with immutable published versions (a republish that would overwrite an existing version is refused), version-constrained resolution on install (latest / exact / range) with a cache TTL so updates propagate without hammering the API, and a small rating-or-download bonus folded into the same post-score adjustment seam as the feedback loop (§11.2), so there is exactly one place that perturbs base scores. Authored recipes are never auto-published — publishing stays an explicit human action (§5.3) — and only the frontmatter owner may publish a new version of a slug.-]"
  },
  {
   "section": "11.4 Recipes are authored but not yet shared as artifacts — the marketplace",
   "old": "Two tensions are worth naming rather than hiding. Version immutability collides with the need to retract a bad recipe: the answer is a yank/deprecate flag, not deletion, so pinned consumers do not break. And rating-weighted discovery risks a rich-get-richer bias that buries good new recipes, so the bonus stays small and clamped. The marketplace backend itself is out of scope of the substrate — it is a separate deliverable — and whether it reuses the Journey service or a distinct endpoint is undecided.",
   "new": null,
   "marked": "[-Two tensions are worth naming rather than hiding. Version immutability collides with the need to retract a bad recipe: the answer is a yank/deprecate flag, not deletion, so pinned consumers do not break. And rating-weighted discovery risks a rich-get-richer bias that buries good new recipes, so the bonus stays small and clamped. The marketplace backend itself is out of scope of the substrate — it is a separate deliverable — and whether it reuses the Journey service or a distinct endpoint is undecided.-]"
  },
  {
   "section": "11.5 The substrate runs a recipe but does not yet *find* one — bounded search (ToT/LATS)",
   "old": "### 11.5 The substrate runs a recipe but does not yet *find* one — bounded search (ToT/LATS)",
   "new": null,
   "marked": "[-### 11.5 The substrate runs a recipe but does not yet *find* one — bounded search (ToT/LATS)-]"
  },
  {
   "section": "11.5 The substrate runs a recipe but does not yet *find* one — bounded search (ToT/LATS)",
   "old": "This is the most ambitious gap and the furthest out. Today the substrate executes a *single* pre-seeded plan top to bottom; loops retry the *same* step to a fixpoint and `uses:` recurses a *fixed* sub-recipe. None of this *searches*. The unrealised degree of freedom is: when a step fails, explore alternate recipes, alternate parameters, or alternate orderings, score the branches, backtrack, and prune — turning the plan from a fixed program into a searched one, and advancing the thesis from \"the substrate runs a recipe\" to \"the substrate finds the recipe that works.\"",
   "new": null,
   "marked": "[-This is the most ambitious gap and the furthest out. Today the substrate executes a *single* pre-seeded plan top to bottom; loops retry the *same* step to a fixpoint and `uses:` recurses a *fixed* sub-recipe. None of this *searches*. The unrealised degree of freedom is: when a step fails, explore alternate recipes, alternate parameters, or alternate orderings, score the branches, backtrack, and prune — turning the plan from a fixed program into a searched one, and advancing the thesis from \"the substrate runs a recipe\" to \"the substrate finds the recipe that works.\"-]"
  },
  {
   "section": "11.5 The substrate runs a recipe but does not yet *find* one — bounded search (ToT/LATS)",
   "old": "Some of the raw material is already present: the matcher already returns a ranked top-N with confidence, so \"alternate recipes\" is just consuming the list rather than only its first element. The expensive parts are a search controller that maintains a scored frontier, a runner that can snapshot and restore plan state to backtrack into a prior step (which depends entirely on §11.1's per-step artifacts being lossless enough to re-enter a step), and a value estimate good enough that search converges faster than brute force. The risks are why this is last: combinatorial blow-up across recipes × parameters × orderings makes a hard budget (max nodes, max tokens, max wall-time) mandatory not optional, and it interacts badly with loops — a long loop *inside* a searched branch can stall for the better part of an hour. Every backtrack is a real subagent dispatch, so a weak value estimate makes search net-negative. And searched execution is non-deterministic, which collides with the marketplace's need for a recipe's behaviour to be a function of its text — so a deterministic mode that disables search would be the contract for published recipes. A failure-only mode (search only when a step fails) is a reasonable, cheaper first cut, but it is not the full vision.",
   "new": null,
   "marked": "[-Some of the raw material is already present: the matcher already returns a ranked top-N with confidence, so \"alternate recipes\" is just consuming the list rather than only its first element. The expensive parts are a search controller that maintains a scored frontier, a runner that can snapshot and restore plan state to backtrack into a prior step (which depends entirely on §11.1's per-step artifacts being lossless enough to re-enter a step), and a value estimate good enough that search converges faster than brute force. The risks are why this is last: combinatorial blow-up across recipes × parameters × orderings makes a hard budget (max nodes, max tokens, max wall-time) mandatory not optional, and it interacts badly with loops — a long loop *inside* a searched branch can stall for the better part of an hour. Every backtrack is a real subagent dispatch, so a weak value estimate makes search net-negative. And searched execution is non-deterministic, which collides with the marketplace's need for a recipe's behaviour to be a function of its text — so a deterministic mode that disables search would be the contract for published recipes. A failure-only mode (search only when a step fails) is a reasonable, cheaper first cut, but it is not the full vision.-]"
  },
  {
   "section": "11.6 What this section does not claim",
   "old": "### 11.6 What this section does not claim",
   "new": null,
   "marked": "[-### 11.6 What this section does not claim-]"
  },
  {
   "section": "11.6 What this section does not claim",
   "old": "These five items are specified, not shipped. The paper's six capabilities (Sections 3–8) are the implemented substrate; this section is the gap between that substrate and the stronger claims the thesis invites — durable resume, a self-improving library, an ecosystem supply, shared artifacts, and searched execution. Stating the boundary explicitly is the point: a substrate that overstates what it does is no more trustworthy than an agent that declares victory before it verifies.",
   "new": null,
   "marked": "[-These five items are specified, not shipped. The paper's six capabilities (Sections 3–8) are the implemented substrate; this section is the gap between that substrate and the stronger claims the thesis invites — durable resume, a self-improving library, an ecosystem supply, shared artifacts, and searched execution. Stating the boundary explicitly is the point: a substrate that overstates what it does is no more trustworthy than an agent that declares victory before it verifies.-]"
  },
  {
   "section": "11.6 What this section does not claim",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "11. What Has Shipped Beyond the Core, and What Remains Open",
   "old": null,
   "new": "## 11. What Has Shipped Beyond the Core, and What Remains Open",
   "marked": "{+## 11. What Has Shipped Beyond the Core, and What Remains Open+}"
  },
  {
   "section": "11. What Has Shipped Beyond the Core, and What Remains Open",
   "old": null,
   "new": "Sections 3–8 specify the six core capabilities that have run in the fork since the substrate was first deployed. This section reports five harder extensions of the thesis. Four have now landed in the running fork; the fifth — searched execution — remains specified but unbuilt. The honesty matters: an earlier draft listed all five as roadmap, which understated the system as it now stands. We mark each with its status and the seam it attaches to.",
   "marked": "{+Sections 3–8 specify the six core capabilities that have run in the fork since the substrate was first deployed. This section reports five harder extensions of the thesis. Four have now landed in the running fork; the fifth — searched execution — remains specified but unbuilt. The honesty matters: an earlier draft listed all five as roadmap, which understated the system as it now stands. We mark each with its status and the seam it attaches to.+}"
  },
  {
   "section": "11.1 Durable checkpointing — shipped",
   "old": null,
   "new": "### 11.1 Durable checkpointing — shipped",
   "marked": "{+### 11.1 Durable checkpointing — shipped+}"
  },
  {
   "section": "11.1 Durable checkpointing — shipped",
   "old": null,
   "new": "The paper's claim is that \"the plan *is* the agent's working memory, externalised\" (§2.3). For that to be true, the durable spine must be read back, not merely written. It now is. The runner reads an `in_progress` plan whose recipe reference matches the current run and resumes from its `currentStep` cursor, skipping any step already marked `done`; on each step's success it persists a bounded digest of the done-note into the reserved per-step `artifact` field, and it carries the prior steps' artifacts forward as upstream context for the step that follows. A sub-recipe call bubbles its nested plan's terminal result up as the parent step's artifact. No schema change was needed — both the `artifact` field and the `currentStep` cursor already existed.",
   "marked": "{+The paper's claim is that \"the plan *is* the agent's working memory, externalised\" (§2.3). For that to be true, the durable spine must be read back, not merely written. It now is. The runner reads an `in_progress` plan whose recipe reference matches the current run and resumes from its `currentStep` cursor, skipping any step already marked `done`; on each step's success it persists a bounded digest of the done-note into the reserved per-step `artifact` field, and it carries the prior steps' artifacts forward as upstream context for the step that follows. A sub-recipe call bubbles its nested plan's terminal result up as the parent step's artifact. No schema change was needed — both the `artifact` field and the `currentStep` cursor already existed.+}"
  },
  {
   "section": "11.1 Durable checkpointing — shipped",
   "old": null,
   "new": "Two policy choices keep resume safe. Resume is **opt-in, not automatic**: a bare run always force-restarts at step 0, and the runner re-attaches to an existing plan only when an explicit `resume` flag is passed *and* the recipe reference matches — so a stale plan from an unrelated prior session is never silently picked up. And a long-polling step emits a checkpoint heartbeat after a fixed interval, so a guardian can distinguish a step that is genuinely working from one that has stalled, against the per-step ten-minute wall. The one residual risk is lossiness — the bounded artifact digest can drop context a later step needs — which is mitigated by keeping the full done-note in the plan body and only the digest in the bounded field. This is what makes \"the plan is the program counter\" a guarantee rather than a description.",
   "marked": "{+Two policy choices keep resume safe. Resume is **opt-in, not automatic**: a bare run always force-restarts at step 0, and the runner re-attaches to an existing plan only when an explicit `resume` flag is passed *and* the recipe reference matches — so a stale plan from an unrelated prior session is never silently picked up. And a long-polling step emits a checkpoint heartbeat after a fixed interval, so a guardian can distinguish a step that is genuinely working from one that has stalled, against the per-step ten-minute wall. The one residual risk is lossiness — the bounded artifact digest can drop context a later step needs — which is mitigated by keeping the full done-note in the plan body and only the digest in the bounded field. This is what makes \"the plan is the program counter\" a guarantee rather than a description.+}"
  },
  {
   "section": "11.2 The self-improving library — shipped",
   "old": null,
   "new": "### 11.2 The self-improving library — shipped",
   "marked": "{+### 11.2 The self-improving library — shipped+}"
  },
  {
   "section": "11.2 The self-improving library — shipped",
   "old": null,
   "new": "Section 5 makes the library self-*expanding* (it authors when nothing matches) and Section 9.5 makes it self-*updating* (a reflection pass can recommend a change). The missing piece was self-*improvement*: feeding real execution outcomes back into the matcher so its scoring weights stop being purely hand-tuned. That loop is now closed, with a deliberate division of labour between subsystems. The consolidation layer (CEREBELLUM) owns the *offline* measurement: it distils a per-recipe **fitness** from accumulated execution episodes — success rate, latency, token cost — attributing each episode to a recipe only via an explicit `recipe:<owner/slug>` tag the runner sets at dispatch, so an untagged episode is never counted against any recipe (no false attribution).",
   "marked": "{+Section 5 makes the library self-*expanding* (it authors when nothing matches) and Section 9.5 makes it self-*updating* (a reflection pass can recommend a change). The missing piece was self-*improvement*: feeding real execution outcomes back into the matcher so its scoring weights stop being purely hand-tuned. That loop is now closed, with a deliberate division of labour between subsystems. The consolidation layer (CEREBELLUM) owns the *offline* measurement: it distils a per-recipe **fitness** from accumulated execution episodes — success rate, latency, token cost — attributing each episode to a recipe only via an explicit `recipe:<owner/slug>` tag the runner sets at dispatch, so an untagged episode is never counted against any recipe (no false attribution).+}"
  },
  {
   "section": "11.2 The self-improving library — shipped",
   "old": null,
   "new": "The matcher reads that fitness through a single injected lookup seam and folds it in *after* the lexical base score, with the lexical base preserved as a **floor** — empirical evidence can lift a proven recipe but cannot bury a lexically-relevant one whose fitness is merely unknown or low. The precedence is strict: lexical base first, then the empirical-fitness adjustment, then a small clamped marketplace-popularity tie-breaker last (§11.4). A recipe with no fitness record yet contributes a neutral zero, so a cold library behaves exactly as the pure lexical matcher did. The honest caveat survives: a closed plan's outcome reflects the *worker's* execution, not whether the *recipe* was the right structure — so the design treats inferred outcome as weaker evidence than an explicit verdict would be. NO-MATCH mining — bucketing the accumulated no-match log by normalised intent and proposing a recipe to author once a bucket crosses a threshold — is the remaining active-authoring step that this machinery is built to support.",
   "marked": "{+The matcher reads that fitness through a single injected lookup seam and folds it in *after* the lexical base score, with the lexical base preserved as a **floor** — empirical evidence can lift a proven recipe but cannot bury a lexically-relevant one whose fitness is merely unknown or low. The precedence is strict: lexical base first, then the empirical-fitness adjustment, then a small clamped marketplace-popularity tie-breaker last (§11.4). A recipe with no fitness record yet contributes a neutral zero, so a cold library behaves exactly as the pure lexical matcher did. The honest caveat survives: a closed plan's outcome reflects the *worker's* execution, not whether the *recipe* was the right structure — so the design treats inferred outcome as weaker evidence than an explicit verdict would be. NO-MATCH mining — bucketing the accumulated no-match log by normalised intent and proposing a recipe to author once a bucket crosses a threshold — is the remaining active-authoring step that this machinery is built to support.+}"
  },
  {
   "section": "11.3 External acquisition — shipped",
   "old": null,
   "new": "### 11.3 External acquisition — shipped",
   "marked": "{+### 11.3 External acquisition — shipped+}"
  },
  {
   "section": "11.3 External acquisition — shipped",
   "old": null,
   "new": "Section 5.3 establishes `recipe/1.0` as a portable document and the substrate as a general runtime rather than a closed hand-authored set. That portability is now exploited from outside. Journey kits — a near-native format — were already reachable through the search/install path; the substrate now also bridges **Claude Code skills**, which are a different shape (a `SKILL.md` with YAML frontmatter plus loose scripts). A dedicated adapter reads the skill's frontmatter and body, infers an ordered step list, and transpiles it into a recipe spec, which is then run through the **existing** authoring validator (§5.2) — so the slug-traversal and phantom-heading guards apply to imported content without forking the validator. Bridged recipes are written into a dedicated sandbox directory that the matcher's index scans, so an imported workflow becomes matchable like any other.",
   "marked": "{+Section 5.3 establishes `recipe/1.0` as a portable document and the substrate as a general runtime rather than a closed hand-authored set. That portability is now exploited from outside. Journey kits — a near-native format — were already reachable through the search/install path; the substrate now also bridges **Claude Code skills**, which are a different shape (a `SKILL.md` with YAML frontmatter plus loose scripts). A dedicated adapter reads the skill's frontmatter and body, infers an ordered step list, and transpiles it into a recipe spec, which is then run through the **existing** authoring validator (§5.2) — so the slug-traversal and phantom-heading guards apply to imported content without forking the validator. Bridged recipes are written into a dedicated sandbox directory that the matcher's index scans, so an imported workflow becomes matchable like any other.+}"
  },
  {
   "section": "11.3 External acquisition — shipped",
   "old": null,
   "new": "Three guards make importing untrusted content safe. Bridged recipes are stamped `authored-by: cc-bridge`, marking them distinguishable and low-trust against the curated set. Transpilation is heuristic — a skill documents *capability*, not always an ordered procedure — so a bad transpile is caught by the same validator that gates hand-authored recipes, and a malformed skill is rejected before any file is written. And because the sandbox-path resolver blocks `../` but not symlinks, the importer refuses to follow a symlinked `SKILL.md` (or any symlinked component of its path) rather than read through it. Namespacing by owner keeps an imported `code-review` from shadowing a curated one. The one genuinely open question is policy, not engineering: whether bridged recipes are matchable on import or quarantined until a human promotes them.",
   "marked": "{+Three guards make importing untrusted content safe. Bridged recipes are stamped `authored-by: cc-bridge`, marking them distinguishable and low-trust against the curated set. Transpilation is heuristic — a skill documents *capability*, not always an ordered procedure — so a bad transpile is caught by the same validator that gates hand-authored recipes, and a malformed skill is rejected before any file is written. And because the sandbox-path resolver blocks `../` but not symlinks, the importer refuses to follow a symlinked `SKILL.md` (or any symlinked component of its path) rather than read through it. Namespacing by owner keeps an imported `code-review` from shadowing a curated one. The one genuinely open question is policy, not engineering: whether bridged recipes are matchable on import or quarantined until a human promotes them.+}"
  },
  {
   "section": "11.4 The versioned marketplace — shipped (client side)",
   "old": null,
   "new": "### 11.4 The versioned marketplace — shipped (client side)",
   "marked": "{+### 11.4 The versioned marketplace — shipped (client side)+}"
  },
  {
   "section": "11.4 The versioned marketplace — shipped (client side)",
   "old": null,
   "new": "Treating a recipe as an artifact culminates in making a tested one a versioned, discoverable object rather than a file in one workshop. The frontmatter already carried owner, version, tested-harness, and authored-by, and the publish path already POSTed to a remote endpoint; what was missing was the *semantics* on top of that plumbing, and they now exist as a marketplace facade. Publishing bumps the frontmatter version under a semver policy and refuses a republish that would overwrite an already-published version — versions are immutable, and a bad recipe is yanked, not silently replaced. Install accepts a version constraint (latest / exact / a caret-tilde-or-`>=` range) resolved against the published set, with a roughly one-hour cache TTL so updates propagate without hammering the API.",
   "marked": "{+Treating a recipe as an artifact culminates in making a tested one a versioned, discoverable object rather than a file in one workshop. The frontmatter already carried owner, version, tested-harness, and authored-by, and the publish path already POSTed to a remote endpoint; what was missing was the *semantics* on top of that plumbing, and they now exist as a marketplace facade. Publishing bumps the frontmatter version under a semver policy and refuses a republish that would overwrite an already-published version — versions are immutable, and a bad recipe is yanked, not silently replaced. Install accepts a version constraint (latest / exact / a caret-tilde-or-`>=` range) resolved against the published set, with a roughly one-hour cache TTL so updates propagate without hammering the API.+}"
  },
  {
   "section": "11.4 The versioned marketplace — shipped (client side)",
   "old": null,
   "new": "The design's contract under failure is the load-bearing part: when the marketplace fetch fails, resolution degrades to the last cached copy — within or even past the TTL — and **never throws**, so an outage degrades a match to local cache rather than hard-failing a turn. Discovery folds a small **clamped** rating bonus (bounded to roughly ±0.2 around the popularity midpoint) into the matcher score through the *same* post-base adjustment seam as the fitness feedback (§11.2), so there is exactly one place that perturbs base scores, and so a merely-popular recipe can never override a genuine text mismatch or out-rank a recipe with stronger empirical fitness. Authored recipes are still never auto-published — publishing stays an explicit human action (§5.3) — and only the frontmatter owner may publish a new version of a slug. The marketplace *backend* itself is a separate deliverable outside the substrate; this is the client-side half.",
   "marked": "{+The design's contract under failure is the load-bearing part: when the marketplace fetch fails, resolution degrades to the last cached copy — within or even past the TTL — and **never throws**, so an outage degrades a match to local cache rather than hard-failing a turn. Discovery folds a small **clamped** rating bonus (bounded to roughly ±0.2 around the popularity midpoint) into the matcher score through the *same* post-base adjustment seam as the fitness feedback (§11.2), so there is exactly one place that perturbs base scores, and so a merely-popular recipe can never override a genuine text mismatch or out-rank a recipe with stronger empirical fitness. Authored recipes are still never auto-published — publishing stays an explicit human action (§5.3) — and only the frontmatter owner may publish a new version of a slug. The marketplace *backend* itself is a separate deliverable outside the substrate; this is the client-side half.+}"
  },
  {
   "section": "11.5 Bounded search (ToT/LATS) — the one open gap",
   "old": null,
   "new": "### 11.5 Bounded search (ToT/LATS) — the one open gap",
   "marked": "{+### 11.5 Bounded search (ToT/LATS) — the one open gap+}"
  },
  {
   "section": "11.5 Bounded search (ToT/LATS) — the one open gap",
   "old": null,
   "new": "This is the most ambitious extension and the only one of the five that remains unbuilt. Today the substrate executes a *single* pre-seeded plan top to bottom; loops retry the *same* step to a fixpoint and `uses:` recurses a *fixed* sub-recipe. None of this *searches*. The unrealised degree of freedom is: when a step fails, explore alternate recipes, alternate parameters, or alternate orderings, score the branches, backtrack, and prune — turning the plan from a fixed program into a searched one, and advancing the thesis from \"the substrate runs a recipe\" to \"the substrate finds the recipe that works.\"",
   "marked": "{+This is the most ambitious extension and the only one of the five that remains unbuilt. Today the substrate executes a *single* pre-seeded plan top to bottom; loops retry the *same* step to a fixpoint and `uses:` recurses a *fixed* sub-recipe. None of this *searches*. The unrealised degree of freedom is: when a step fails, explore alternate recipes, alternate parameters, or alternate orderings, score the branches, backtrack, and prune — turning the plan from a fixed program into a searched one, and advancing the thesis from \"the substrate runs a recipe\" to \"the substrate finds the recipe that works.\"+}"
  },
  {
   "section": "11.5 Bounded search (ToT/LATS) — the one open gap",
   "old": null,
   "new": "Some of the raw material is already present: the matcher returns a ranked top-N with confidence, so \"alternate recipes\" is just consuming the list rather than only its first element, and the per-step artifacts from §11.1 are the snapshots a backtrack would restore. The expensive parts are what remain unwritten — a search controller that maintains a scored frontier, a runner that can restore plan state to re-enter a prior step, and a value estimate good enough that search converges faster than brute force. The risks are why this is last: combinatorial blow-up across recipes × parameters × orderings makes a hard budget (max nodes, max tokens, max wall-time) mandatory not optional, and it interacts badly with loops — a long loop *inside* a searched branch can stall for the better part of an hour. Every backtrack is a real subagent dispatch, so a weak value estimate makes search net-negative. And searched execution is non-deterministic, which collides with the marketplace's need for a recipe's behaviour to be a function of its text — so a deterministic mode that disables search would be the contract for published recipes. A failure-only mode (search only when a step fails) is a reasonable, cheaper first cut, but it is not the full vision.",
   "marked": "{+Some of the raw material is already present: the matcher returns a ranked top-N with confidence, so \"alternate recipes\" is just consuming the list rather than only its first element, and the per-step artifacts from §11.1 are the snapshots a backtrack would restore. The expensive parts are what remain unwritten — a search controller that maintains a scored frontier, a runner that can restore plan state to re-enter a prior step, and a value estimate good enough that search converges faster than brute force. The risks are why this is last: combinatorial blow-up across recipes × parameters × orderings makes a hard budget (max nodes, max tokens, max wall-time) mandatory not optional, and it interacts badly with loops — a long loop *inside* a searched branch can stall for the better part of an hour. Every backtrack is a real subagent dispatch, so a weak value estimate makes search net-negative. And searched execution is non-deterministic, which collides with the marketplace's need for a recipe's behaviour to be a function of its text — so a deterministic mode that disables search would be the contract for published recipes. A failure-only mode (search only when a step fails) is a reasonable, cheaper first cut, but it is not the full vision.+}"
  },
  {
   "section": "11.6 The boundary, stated plainly",
   "old": null,
   "new": "### 11.6 The boundary, stated plainly",
   "marked": "{+### 11.6 The boundary, stated plainly+}"
  },
  {
   "section": "11.6 The boundary, stated plainly",
   "old": null,
   "new": "The six core capabilities (Sections 3–8) and four of these five extensions are implemented and running. Only searched execution is specified and not yet built. Drawing that line precisely is the point: a substrate that overstates what it does is no more trustworthy than an agent that declares victory before it verifies — which is the very failure the substrate exists to prevent.",
   "marked": "{+The six core capabilities (Sections 3–8) and four of these five extensions are implemented and running. Only searched execution is specified and not yet built. Drawing that line precisely is the point: a substrate that overstates what it does is no more trustworthy than an agent that declares victory before it verifies — which is the very failure the substrate exists to prevent.+}"
  },
  {
   "section": "12. Suggested Diagrams (D2)",
   "old": "These are descriptions for a designer; the diagrams themselves are not drawn here. D2 is suggested for its clean layered layout and first-class containers.",
   "new": "These are descriptions for a designer; the diagrams themselves are not drawn here. D2 is suggested for its clean layered layout and first-class containers. Figures 1 and 2 are already rendered (the executive cycle and the life-cycle state machine, §2.1 and §8.4); the two below would complete the set.",
   "marked": "These are descriptions for a designer; the diagrams themselves are not drawn here. D2 is suggested for its clean layered layout and first-class [-containers.-] {+containers. Figures 1 and 2 are already rendered (the executive cycle and the life-cycle state machine, §2.1 and §8.4); the two below would complete the set.+}"
  },
  {
   "section": "12. Suggested Diagrams (D2)",
   "old": "1. **The executive-function cycle (Figure 1).** A vertical D2 flow of the five phases — PLAN, MATCH/COMPOSE/AUTHOR, EXECUTE (with loops), OBSERVE, ADAPT — each phase as a container, annotated on the right with the prefrontal function it implements. A back-edge from ADAPT to the recipe library shows recipe improvement feeding the next turn.",
   "new": null,
   "marked": "[-1. **The executive-function cycle (Figure 1).** A vertical D2 flow of the five phases — PLAN, MATCH/COMPOSE/AUTHOR, EXECUTE (with loops), OBSERVE, ADAPT — each phase as a container, annotated on the right with the prefrontal function it implements. A back-edge from ADAPT to the recipe library shows recipe improvement feeding the next turn.-]"
  },
  {
   "section": "12. Suggested Diagrams (D2)",
   "old": "2. **The recipe-run life-cycle state machine (Figure 2).** A D2 state diagram of `searched → matched → merged/composed → seeded → running → looping/composing → done`, with the `no-match → authoring → matchable-next-turn` branch and the `no-match → trivial → idle` branch. Annotate each transition with the provenance verb it emits, since the figure doubles as a legend for the RECIPES trail.",
   "new": null,
   "marked": "[-2. **The recipe-run life-cycle state machine (Figure 2).** A D2 state diagram of `searched → matched → merged/composed → seeded → running → looping/composing → done`, with the `no-match → authoring → matchable-next-turn` branch and the `no-match → trivial → idle` branch. Annotate each transition with the provenance verb it emits, since the figure doubles as a legend for the RECIPES trail.-]"
  },
  {
   "section": "12. Suggested Diagrams (D2)",
   "old": "3. **Composition algebra — inline vs. call.** A side-by-side D2 figure contrasting `composes:` (static step-merge: sub-recipe steps flattened into one plan, with de-dup) against `uses:` (dynamic call: a step transferring control to a nested plan on a child session and returning), with the depth cap and cycle guard drawn explicitly as the recursion's safety rails.",
   "new": "1. **Composition algebra — inline vs. call.** A side-by-side D2 figure contrasting `composes:` (static step-merge: sub-recipe steps flattened into one plan, with de-dup) against `uses:` (dynamic call: a step transferring control to a nested plan on a child session and returning), with the depth cap and cycle guard drawn explicitly as the recursion's safety rails.",
   "marked": "[-3.-] {+1.+} **Composition algebra — inline vs. call.** A side-by-side D2 figure contrasting `composes:` (static step-merge: sub-recipe steps flattened into one plan, with de-dup) against `uses:` (dynamic call: a step transferring control to a nested plan on a child session and returning), with the depth cap and cycle guard drawn explicitly as the recursion's safety rails."
  },
  {
   "section": "12. Suggested Diagrams (D2)",
   "old": "4. **The RECIPES panel anatomy.** A D2 container diagram of the panel's stacked sections — Discovery, Composition, Plan-with-badges, per-step Fan-out (subagent vitals), and the compact/expandable Trail — placed beside the chat surface, with a bold boundary marking the split-of-concerns invariant (substance left, mechanics right).",
   "new": "2. **The RECIPES panel anatomy.** A D2 container diagram of the panel's stacked sections — Discovery, Composition, Plan-with-badges, per-step Fan-out (subagent vitals), and the compact/expandable Trail — placed beside the chat surface, with a bold boundary marking the split-of-concerns invariant (substance left, mechanics right).",
   "marked": "[-4.-] {+2.+} **The RECIPES panel anatomy.** A D2 container diagram of the panel's stacked sections — Discovery, Composition, Plan-with-badges, per-step Fan-out (subagent vitals), and the compact/expandable Trail — placed beside the chat surface, with a bold boundary marking the split-of-concerns invariant (substance left, mechanics right)."
  },
  {
   "section": "12. Suggested Diagrams (D2)",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "13. Conclusion",
   "old": "Of these, the loop is the quiet pivot. Sequence and selection make a checklist; sequence, selection, *and bounded iteration* make a substrate expressive enough to encode the iterative, exhaust-the-search, retry-until-clean work that real tasks demand — which is exactly the structural gap that separated a static playbook from a hand-coded workflow, now closed. And on-the-fly authoring is the quiet flywheel: a substrate that writes its own missing programs grows its competence inside the very conversations that expose its gaps.",
   "new": "Of these, the loop is the quiet pivot. Sequence and selection make a checklist; sequence, selection, *and bounded iteration* make a substrate expressive enough to encode the iterative, exhaust-the-search, retry-until-clean work that real tasks demand — exactly the structural gap that separated a static playbook from a hand-coded workflow, now closed. And on-the-fly authoring is the quiet flywheel: a substrate that writes its own missing programs grows its competence inside the very conversations that expose its gaps. With durable resume, an empirically self-improving library, external acquisition, and a versioned marketplace now running on top of those six capabilities, the substrate is closer to the full thesis than to its sketch.",
   "marked": "Of these, the loop is the quiet pivot. Sequence and selection make a checklist; sequence, selection, *and bounded iteration* make a substrate expressive enough to encode the iterative, exhaust-the-search, retry-until-clean work that real tasks demand — [-which is-] exactly the structural gap that separated a static playbook from a hand-coded workflow, now closed. And on-the-fly authoring is the quiet flywheel: a substrate that writes its own missing programs grows its competence inside the very conversations that expose its [-gaps.-] {+gaps. With durable resume, an empirically self-improving library, external acquisition, and a versioned marketplace now running on top of those six capabilities, the substrate is closer to the full thesis than to its sketch.+}"
  },
  {
   "section": "13. Conclusion",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "References to Companion Papers",
   "old": "- **ENGRAM / Total Recall (memory consolidation).** The episodic-memory and consolidation layer. Supplies the retrieval the matcher and worker share, and the write path the ADAPT phase uses. - **HIPPOCAMPUS (instant recall).** The fast structured-index layer over memory; the auto-seed hot path depends on fast, cache-friendly retrieval. Bi-temporal validity on edges keeps recipe hints current. - **MNEMOSYNE (memory enhancements).** Contradiction handling, compaction capture, task-conditioned scoring — the natural place to make retrieval recipe-aware. - **CEREBELLUM (sleep consolidation).** Background consolidation and failure-driven self-improvement — the principled engine for recipe *evolution* (mutate + benchmark against real traces, keep an archive). - **SYNAPSE / Round Table (multi-model deliberation).** Cross-provider debate; a high-stakes recipe step is the natural trigger. - **AMYGDALA (learned intuition).** A neural action-gating system; learned gates sit beneath tool calls and complement the recipe's structural gates. - **MYELIN (budget prompting).** The effort router's model-tier choice is where budget awareness applies. - **The Wondering Machine (curiosity / intrinsic motivation).** Between tasks, an intrinsically motivated agent could mine the accumulated NO-MATCH signal to *propose* recipes to author.",
   "new": "- **ENGRAM / Total Recall (memory consolidation).** The episodic-memory and consolidation layer. Supplies the retrieval the matcher and worker share, the write path the ADAPT phase uses, and the per-recipe fitness measurement the matcher now reads (§11.2). - **HIPPOCAMPUS (instant recall).** The fast structured-index layer over memory; the auto-seed hot path depends on fast, cache-friendly retrieval. Bi-temporal validity on edges keeps recipe hints current. - **MNEMOSYNE (memory enhancements).** Contradiction handling, compaction capture, task-conditioned scoring — the natural place to make retrieval recipe-aware. - **CEREBELLUM (sleep consolidation).** Background consolidation and failure-driven self-improvement — and the owner of the offline recipe-fitness measurement behind the self-improving library (§11.2). - **SYNAPSE / Round Table (multi-model deliberation).** Cross-provider debate; a high-stakes recipe step is the natural trigger. - **AMYGDALA (learned intuition).** A neural action-gating system; learned gates sit beneath tool calls and complement the recipe's structural gates. - **MYELIN (budget prompting).** The effort router's model-tier choice is where budget awareness applies. - **The Wondering Machine (curiosity / intrinsic motivation).** Between tasks, an intrinsically motivated agent could mine the accumulated NO-MATCH signal to *propose* recipes to author.",
   "marked": "- **ENGRAM / Total Recall (memory consolidation).** The episodic-memory and consolidation layer. Supplies the retrieval the matcher and worker share, [-and-] the write path the ADAPT phase [-uses.-] {+uses, and the per-recipe fitness measurement the matcher now reads (§11.2).+} - **HIPPOCAMPUS (instant recall).** The fast structured-index layer over memory; the auto-seed hot path depends on fast, cache-friendly retrieval. Bi-temporal validity on edges keeps recipe hints current. - **MNEMOSYNE (memory enhancements).** Contradiction handling, compaction capture, task-conditioned scoring — the natural place to make retrieval recipe-aware. - **CEREBELLUM (sleep consolidation).** Background consolidation and failure-driven self-improvement — {+and+} the [-principled engine for recipe *evolution* (mutate + benchmark against real traces, keep an archive).-] {+owner of the offline recipe-fitness measurement behind the self-improving library (§11.2).+} - **SYNAPSE / Round Table (multi-model deliberation).** Cross-provider debate; a high-stakes recipe step is the natural trigger. - **AMYGDALA (learned intuition).** A neural action-gating system; learned gates sit beneath tool calls and complement the recipe's structural gates. - **MYELIN (budget prompting).** The effort router's model-tier choice is where budget awareness applies. - **The Wondering Machine (curiosity / intrinsic motivation).** Between tasks, an intrinsically motivated agent could mine the accumulated NO-MATCH signal to *propose* recipes to author."
  },
  {
   "section": "References to Companion Papers",
   "old": "---",
   "new": null,
   "marked": "[-----]"
  },
  {
   "section": "MATCH / COMPOSE / AUTHOR: task-set selection if context.has_in_progress_plan(): plan <- context.resume_plan() # never clobber an explicit/prior plan else: result <- MATCH_RECIPES(prompt, library) # fuzzy + confidence + fitness + rating emit_trail(\"searched\", catalog_size) if result.confidence == \"none\": emit_trail(\"no-match\") spec <- AUTHOR_RECIPE(prompt) # synthesise + validate + persist if VALIDATE(spec).ok: library.add(spec); emit_trail(\"authored\", spec.slug) plan <- seed_plan_from(spec) else: plan <- implicit_two_step_plan() else: emit_trail(\"matched\", result.matches) plan <- BUILD_MERGED_PLAN(result.matches, library) # composes: inlined if plan.from_multiple(): emit_trail(\"merged\", plan.sources) persist(plan)",
   "old": "# MATCH / COMPOSE / AUTHOR: task-set selection if context.has_in_progress_plan(): plan <- context.resume_plan() # never clobber an explicit/prior plan else: result <- MATCH_RECIPES(prompt, library) # fuzzy + confidence emit_trail(\"searched\", catalog_size) if result.confidence == \"none\": emit_trail(\"no-match\") spec <- AUTHOR_RECIPE(prompt) # synthesise + validate + persist if VALIDATE(spec).ok: library.add(spec); emit_trail(\"authored\", spec.slug) plan <- seed_plan_from(spec) else: plan <- implicit_two_step_plan() else: emit_trail(\"matched\", result.matches) plan <- BUILD_MERGED_PLAN(result.matches, library) # composes: inlined if plan.from_multiple(): emit_trail(\"merged\", plan.sources) persist(plan)",
   "new": "# MATCH / COMPOSE / AUTHOR: task-set selection if context.has_in_progress_plan(): plan <- context.resume_plan() # never clobber an explicit/prior plan else: result <- MATCH_RECIPES(prompt, library) # fuzzy + confidence + fitness + rating emit_trail(\"searched\", catalog_size) if result.confidence == \"none\": emit_trail(\"no-match\") spec <- AUTHOR_RECIPE(prompt) # synthesise + validate + persist if VALIDATE(spec).ok: library.add(spec); emit_trail(\"authored\", spec.slug) plan <- seed_plan_from(spec) else: plan <- implicit_two_step_plan() else: emit_trail(\"matched\", result.matches) plan <- BUILD_MERGED_PLAN(result.matches, library) # composes: inlined if plan.from_multiple(): emit_trail(\"merged\", plan.sources) persist(plan)",
   "marked": "# MATCH / COMPOSE / AUTHOR: task-set selection if context.has_in_progress_plan(): plan <- context.resume_plan() # never clobber an explicit/prior plan else: result <- MATCH_RECIPES(prompt, library) # fuzzy + confidence {++ fitness + rating+} emit_trail(\"searched\", catalog_size) if result.confidence == \"none\": emit_trail(\"no-match\") spec <- AUTHOR_RECIPE(prompt) # synthesise + validate + persist if VALIDATE(spec).ok: library.add(spec); emit_trail(\"authored\", spec.slug) plan <- seed_plan_from(spec) else: plan <- implicit_two_step_plan() else: emit_trail(\"matched\", result.matches) plan <- BUILD_MERGED_PLAN(result.matches, library) # composes: inlined if plan.from_multiple(): emit_trail(\"merged\", plan.sources) persist(plan)"
  },
  {
   "section": "EXECUTE (loops + sub-recipe calls): sequencing for group in plan.parallelism_groups: # groups run sequentially dispatch_all(group) in parallel: # steps within a group fan out for step in group: loop <- parse_loop(step); sub <- parse_uses(step) if loop: RUN_LOOPED_STEP(step, loop, context) elif sub: emit_trail(\"composed\", sub); RUN_RECIPE(sub, child(context)) else: dispatch_worker(step) # OBSERVE: panel updates with step status + subagent vitals # persist a bounded artifact digest of each done step (resume spine) barrier() response <- aggregate(plan)",
   "old": "# EXECUTE (loops + sub-recipe calls): sequencing for group in plan.parallelism_groups: # groups run sequentially dispatch_all(group) in parallel: # steps within a group fan out for step in group: loop <- parse_loop(step); sub <- parse_uses(step) if loop: RUN_LOOPED_STEP(step, loop, context) elif sub: emit_trail(\"composed\", sub); RUN_RECIPE(sub, child(context)) else: dispatch_worker(step) # OBSERVE: panel updates with step status + subagent vitals barrier() response <- aggregate(plan)",
   "new": "# EXECUTE (loops + sub-recipe calls): sequencing for group in plan.parallelism_groups: # groups run sequentially dispatch_all(group) in parallel: # steps within a group fan out for step in group: loop <- parse_loop(step); sub <- parse_uses(step) if loop: RUN_LOOPED_STEP(step, loop, context) elif sub: emit_trail(\"composed\", sub); RUN_RECIPE(sub, child(context)) else: dispatch_worker(step) # OBSERVE: panel updates with step status + subagent vitals # persist a bounded artifact digest of each done step (resume spine) barrier() response <- aggregate(plan)",
   "marked": "# EXECUTE (loops + sub-recipe calls): sequencing for group in plan.parallelism_groups: # groups run sequentially dispatch_all(group) in parallel: # steps within a group fan out for step in group: loop <- parse_loop(step); sub <- parse_uses(step) if loop: RUN_LOOPED_STEP(step, loop, context) elif sub: emit_trail(\"composed\", sub); RUN_RECIPE(sub, child(context)) else: dispatch_worker(step) # OBSERVE: panel updates with step status + subagent vitals {+# persist a bounded artifact digest of each done step (resume spine)+} barrier() response <- aggregate(plan)"
  }
 ]
}
