v4.7 → v4.8
What changed from v4.7 to v4.8
From v4.7 (14 Jun) to v4.8 (19 Jun): 12,193 words to 12,346 words, 266 words in new or rewritten paragraphs and 113 taken out, 17 paragraphs changed.
References section added; figures redrawnAdds a references section, replaces the figures with redrawn versions, and cites an outside author's skills plugin as a reference instead of naming the repository. The open-gap section drops the method names from its title. Small wording edits.
v4.7 · 14 June 2026v4.8 · 19 June 2026
··· 3 unchanged paragraphs folded ···
v4.7 · AbstractThe 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 — are implemented and running, and which one — searched execution — remains specified but unbuilt. Throughout, we position the substrate against the fresh open-source ecosystem it shares a problem space with — chopratejas/headroom's reversible context-compression and addyosmani/agent-skills' anti-trigger and load-constraint discipline — and fold their stronger ideas into the substrate's own seams where they sharpen a claim.
v4.8 · AbstractThe 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 — are implemented and running, and which one — searched execution — remains specified but unbuilt. Throughout, we position the substrate against the fresh open-source ecosystem it shares a problem space with — the headroom project's reversible context-compression and the agent-skills plugin's anti-trigger and load-constraint discipline — and fold their stronger ideas into the substrate's own seams where they sharpen a claim.
··· 3 unchanged paragraphs folded ···
v4.7 · 1.1 The prefrontal analogy, taken seriouslyWhen a person sits down to debug a stubborn problem, very little of the work is the "debugging." Most of it is executive: deciding *that* this is a debugging task and not a redesign task, recalling the program ("reproduce, then isolate, then fix, then verify"), holding that program in working memory while the hands and eyes do the reading and editing, suppressing the urge to patch the first symptom, noticing when the current step has stopped producing new information, and spending more attention when the problem is hard and less when it is trivial. The prefrontal cortex is the organ of that executive layer: working memory, task-set selection, sequencing, response inhibition, and effort regulation.
v4.8 · 1.1 The prefrontal analogy, taken seriouslyWhen a person sits down to debug a stubborn problem, very little of the work is the "debugging." Most of it is executive: deciding *that* this is a debugging task and not a redesign task, recalling the program ("reproduce, then isolate, then fix, then verify"), holding that program in working memory while the hands and eyes do the reading and editing, suppressing the urge to patch the first symptom, noticing when the current step has stopped producing new information, and spending more attention when the problem is hard and less when it is trivial. The prefrontal cortex is the organ of that executive layer: working memory, task-set selection, sequencing, response inhibition, and effort regulation (Miller & Cohen, 2001).
··· 13 unchanged paragraphs folded ···
v4.7 · 2.1 The cycle```{=latex} \begin{figure}[H] \centering \includegraphics[width=\linewidth,height=0.85\textheight,keepaspectratio]{images/fig-cycle.pdf} \caption{The five-phase executive cycle, annotated with the executive function each phase implements. The dashed back-edge shows recipe improvement (the ADAPT phase) feeding the next turn.} \end{figure} ```
v4.8 · 2.1 The cycle
··· 20 unchanged paragraphs folded ···
v4.7 · 3.3 Negative evidence — anti-triggersA purely *additive* matcher has a real expressive gap: it can score a recipe upward on tag, title, and summary overlap, but it has no way for a recipe to declare *the prompts for which it must not be chosen*. The consequence is concrete: a recipe that fuzzily shares tokens with an out-of-scope prompt can win on lexical score alone, and the only correction available is the low-confidence advisory (§3.3 confidence tiers, below) — a soft signal, after the fact. The discipline that closes this gap is borrowed from addyosmani/agent-skills (Addy Osmani's agent-skills plugin), where every skill carries an explicit "When NOT to use" anti-trigger section that is as load-bearing as its triggers.
v4.8 · 3.3 Negative evidence — anti-triggersA purely *additive* matcher has a real expressive gap: it can score a recipe upward on tag, title, and summary overlap, but it has no way for a recipe to declare *the prompts for which it must not be chosen*. The consequence is concrete: a recipe that fuzzily shares tokens with an out-of-scope prompt can win on lexical score alone, and the only correction available is the low-confidence advisory (§3.3 confidence tiers, below) — a soft signal, after the fact. The discipline that closes this gap is borrowed from the agent-skills plugin (Osmani, 2026), where every skill carries an explicit "When NOT to use" anti-trigger section that is as load-bearing as its triggers.
··· 25 unchanged paragraphs folded ···
v4.7 · 4.3 Calling the library — `invoke skill:````{=latex} \begin{figure}[H] \centering \includegraphics[width=\linewidth,height=0.85\textheight,keepaspectratio]{images/fig-composition.pdf} \caption{Composition algebra: static step-merge flattens sub-recipe steps into one plan at build time (de-duplicated, depth- and cycle-guarded); a runtime call transfers control into a nested plan on a child session and folds its terminal note back as the step's outcome; an \texttt{invoke skill:} directive calls a typed stdlib primitive whose output is schema-validated. All are bounded by a depth cap and a cycle guard.} \end{figure} ```
v4.8 · 4.3 Calling the library — `invoke skill:`
··· 40 unchanged paragraphs folded ···
v4.7 · 7.5 Where a recipe may run — load constraintsA second discipline borrowed from addyosmani/agent-skills belongs here: each of Addy Osmani's skills declares *where* it may load — the main orchestrator versus a subagent — with a documented degraded fallback for the unmet case. The substrate dispatches the same recipe steps to the main worker and to fan-out subagents (the parallel and full-workflow modes above) with no notion that a given recipe or step might be invalid in a subagent context — a step that needs the orchestrator's privileges or its conversation-level view will simply misbehave when fanned out. A per-recipe (or per-step) **load-constraint** declaration, with a degraded fallback when the constraint is unmet, is the executive analogue of task-set *applicability*: the recognition that a program is valid in one execution context and not another. It belongs in the recipe schema (Appendix B) and is consulted on the dispatch path, so that fanning a step out is gated on that step actually being safe to run there — and falls back gracefully, rather than silently, when it is not.
v4.8 · 7.5 Where a recipe may run — load constraintsA second discipline borrowed from the same agent-skills plugin (Osmani, 2026) belongs here: each of its skills declares *where* it may load — the main orchestrator versus a subagent — with a documented degraded fallback for the unmet case. The substrate dispatches the same recipe steps to the main worker and to fan-out subagents (the parallel and full-workflow modes above) with no notion that a given recipe or step might be invalid in a subagent context — a step that needs the orchestrator's privileges or its conversation-level view will simply misbehave when fanned out. A per-recipe (or per-step) **load-constraint** declaration, with a degraded fallback when the constraint is unmet, is the executive analogue of task-set *applicability*: the recognition that a program is valid in one execution context and not another. It belongs in the recipe schema (Appendix B) and is consulted on the dispatch path, so that fanning a step out is gated on that step actually being safe to run there — and falls back gracefully, rather than silently, when it is not.
··· 10 unchanged paragraphs folded ···
v4.7 · 8.3 What the panel renders```{=latex} \begin{figure}[H] \centering \includegraphics[width=\linewidth,height=0.85\textheight,keepaspectratio]{images/fig-panel.pdf} \caption{The RECIPES panel sits beside the chat, divided by the split-of-concerns boundary: the chat carries the substantive answer, the panel carries orchestration mechanics. The panel stacks Discovery (catalog size, scored candidates with anti-trigger penalties, threshold, NO-MATCH), Composition (source badges, de-dup count), the Plan with per-step status and the parsed program, per-step Fan-out (one subagent-vitals row per dispatch, typed failures attributed), and the compact, expandable decision trail.} \end{figure} ```
v4.8 · 8.3 What the panel renders
··· 2 unchanged paragraphs folded ···
v4.7 · 8.4 The compact-expand decision trail```{=latex} \begin{figure}[H] \centering \includegraphics[width=\linewidth,height=0.85\textheight,keepaspectratio]{images/fig-statemachine.pdf} \caption{The life-cycle state machine the RECIPES panel renders: \texttt{searched} $\rightarrow$ \texttt{matched} $\rightarrow$ \texttt{merged/composed} $\rightarrow$ \texttt{seeded} $\rightarrow$ \texttt{running} $\rightarrow$ \texttt{looping/composing} $\rightarrow$ \texttt{done}, with the no-match $\rightarrow$ authoring $\rightarrow$ matchable-next-turn branch and the no-match $\rightarrow$ trivial $\rightarrow$ idle branch. Every transition emits a provenance-trail verb, so the figure doubles as a legend for the RECIPES trail.} \end{figure} ```
v4.8 · 8.4 The compact-expand decision trail
··· 16 unchanged paragraphs folded ···
v4.7 · 9.6 Doubt-driven verification — a completion critic that cannot inherit the worker's framingThe sharper discipline, drawn from the doubt-driven-development recipe in addyosmani/agent-skills, is to put a **fresh-context** boundary between the work and its review. Its loop is CLAIM → **EXTRACT** (reduce the work to its artifact and its contract, with the producing reasoning stripped out) → **DOUBT** (a fresh-context adversarial reviewer that never saw the reasoning re-examines the artifact cold) → **RECONCILE** (each finding is classified against the artifact text, trivial versus non-trivial) → **STOP** (explicit termination when only trivial findings remain, at a three-cycle cap, or on user override, with stated criteria for what counts as a non-trivial decision). The key mechanism a same-context critic lacks is exactly that EXTRACT/DOUBT boundary: stripping the reasoning and reviewing the artifact cold is structurally harder to fool than asking the producing context to grade itself. Its bounded STOP rule (trivial-only / three-cycle / override) is the same derived-ceiling discipline the substrate already uses for loops (§6.3), so it imports cleanly.
v4.8 · 9.6 Doubt-driven verification — a completion critic that cannot inherit the worker's framingThe sharper discipline, drawn from the doubt-driven-development recipe in the same agent-skills plugin (Osmani, 2026), is to put a **fresh-context** boundary between the work and its review. Its loop is CLAIM → **EXTRACT** (reduce the work to its artifact and its contract, with the producing reasoning stripped out) → **DOUBT** (a fresh-context adversarial reviewer that never saw the reasoning re-examines the artifact cold) → **RECONCILE** (each finding is classified against the artifact text, trivial versus non-trivial) → **STOP** (explicit termination when only trivial findings remain, at a three-cycle cap, or on user override, with stated criteria for what counts as a non-trivial decision). The key mechanism a same-context critic lacks is exactly that EXTRACT/DOUBT boundary: stripping the reasoning and reviewing the artifact cold is structurally harder to fool than asking the producing context to grade itself. Its bounded STOP rule (trivial-only / three-cycle / override) is the same derived-ceiling discipline the substrate already uses for loops (§6.3), so it imports cleanly.
··· 14 unchanged paragraphs folded ···
v4.7 · 10.5 Cost, latency, and the artifact-compression frontierA second axis becomes measurable once the carry-forward artifact (§11.1) is compressed rather than truncated: the **compression-versus-accuracy frontier**. The relevant external reference point is chopratejas/headroom (Tejas Chopra et al.), whose reproducible eval suite reports 60–95% token savings at roughly zero accuracy delta on standard benchmarks (GSM8K, TruthfulQA, SQuAD, BFCL) for its reversible Compress-Cache-Retrieve scheme. The substrate's artifact spine is the natural place to import that measurement: for each artifact content-type (a code done-note, a JSON tool result, a diff), report the tokens saved by the carry-forward compressor against the rate at which a later step had to *retrieve* the verbatim original — a concrete compression-vs-recovery curve, rather than the bare assertion that overhead is "small."
v4.8 · 10.5 Cost, latency, and the artifact-compression frontierA second axis becomes measurable once the carry-forward artifact (§11.1) is compressed rather than truncated: the **compression-versus-accuracy frontier**. The relevant external reference point is the headroom context-compression project (Chopra, 2026), whose reproducible eval suite reports 60–95% token savings at roughly zero accuracy delta on standard benchmarks (GSM8K, TruthfulQA, SQuAD, BFCL) for its reversible Compress-Cache-Retrieve scheme. The substrate's artifact spine is the natural place to import that measurement: for each artifact content-type (a code done-note, a JSON tool result, a diff), report the tokens saved by the carry-forward compressor against the rate at which a later step had to *retrieve* the verbatim original — a concrete compression-vs-recovery curve, rather than the bare assertion that overhead is "small."
··· 5 unchanged paragraphs folded ···
v4.7 · 11.1 Durable checkpointing — implemented, and now reversibleThe honest residual risk in earlier versions of this design was **lossiness**: a blind char-bounded truncation of the done-note can drop context a later step needs, and the only mitigation was keeping the full note in the plan body while the bounded field carried a one-way truncation. The principled fix is to make the carry-forward *reversible* and *content-type-aware*, and the external system that solves exactly this problem is chopratejas/headroom's **Compress-Cache-Retrieve** (CCR): the original artifact is cached verbatim, a compressed surrogate is what flows forward, and a later step that needs the dropped detail *retrieves the original on demand* rather than living with a lossy truncation. CCR also ships per-content-type compressors — AST-aware code compression (via tree-sitter), statistical JSON-array crushing, and log/diff/text handlers — which map directly onto the substrate's artifact payloads, where a blind char-truncation is worst *exactly* when the artifact is structured (a truncated code block or JSON array loses its tail wholesale). The §11.1 digest accordingly becomes content-type-aware (compress a code artifact by its AST, a JSON artifact by array-crushing, prose by summary) with the verbatim original cached behind a retrieve seam.
v4.8 · 11.1 Durable checkpointing — implemented, and now reversibleThe honest residual risk in earlier versions of this design was **lossiness**: a blind char-bounded truncation of the done-note can drop context a later step needs, and the only mitigation was keeping the full note in the plan body while the bounded field carried a one-way truncation. The principled fix is to make the carry-forward *reversible* and *content-type-aware*, and the external system that solves exactly this problem is headroom's **Compress-Cache-Retrieve** (CCR) scheme (Chopra, 2026): the original artifact is cached verbatim, a compressed surrogate is what flows forward, and a later step that needs the dropped detail *retrieves the original on demand* rather than living with a lossy truncation. CCR also ships per-content-type compressors — AST-aware code compression (via tree-sitter), statistical JSON-array crushing, and log/diff/text handlers — which map directly onto the substrate's artifact payloads, where a blind char-truncation is worst *exactly* when the artifact is structured (a truncated code block or JSON array loses its tail wholesale). The §11.1 digest accordingly becomes content-type-aware (compress a code artifact by its AST, a JSON artifact by array-crushing, prose by summary) with the verbatim original cached behind a retrieve seam.
··· 3 unchanged paragraphs folded ···
v4.7 · 11.2 The self-improving library — implemented, live end-to-endThe 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 (including any anti-trigger penalty, §3.3), 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. Beyond matcher weights, the library can now *grow and promote reusable primitives*, not only recipes: a deposited skill library accepts new typed primitives, and a candidate is promoted only when its measured success rate clears a bar set against the library's *current* success-rate distribution (a fitness bar measured against the live distribution rather than a hardcoded threshold; the no-frozen-bound policy is owned by separate work), with a never-delete archive making the deposit reversible. 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 (preferring compose-from-library, §5.1) once a bucket crosses a threshold — is the remaining active-authoring step that this machinery is built to support.
v4.8 · 11.2 The self-improving library — implemented, live end-to-endThe 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 (including any anti-trigger penalty, §3.3), 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. Beyond matcher weights, the library can now *grow and promote reusable primitives*, not only recipes — the same skill-library-as-code flywheel an embodied agent uses to accumulate reusable behaviours over a lifetime (Wang et al., 2023): a deposited skill library accepts new typed primitives, and a candidate is promoted only when its measured success rate clears a bar set against the library's *current* success-rate distribution (a fitness bar measured against the live distribution rather than a hardcoded threshold; the no-frozen-bound policy is owned by separate work), with a never-delete archive making the deposit reversible. 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 (preferring compose-from-library, §5.1) once a bucket crosses a threshold — is the remaining active-authoring step that this machinery is built to support.
··· 2 unchanged paragraphs folded ···
v4.7 · 11.3 External acquisition — implementedThe same external ecosystem that supplies importable content also supplies *discipline* the substrate has adopted natively rather than imported as data: addyosmani/agent-skills' anti-trigger and load-constraint conventions (now §3.3 and §7.5) are a case of treating a fresh open-source corpus as a source of mechanism, not merely of bridgeable artifacts. When such a corpus *is* bridged, three guards make importing untrusted content safe. Bridged recipes are stamped low-trust against the curated set, marking them distinguishable. 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.
v4.8 · 11.3 External acquisition — implementedThe same external ecosystem that supplies importable content also supplies *discipline* the substrate has adopted natively rather than imported as data: the agent-skills plugin's anti-trigger and load-constraint conventions (Osmani, 2026; now §3.3 and §7.5) are a case of treating a fresh open-source corpus as a source of mechanism, not merely of bridgeable artifacts. When such a corpus *is* bridged, three guards make importing untrusted content safe. Bridged recipes are stamped low-trust against the curated set, marking them distinguishable. 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.
··· 3 unchanged paragraphs folded ···
v4.7 · 11.5 Bounded search — the one open gap### 11.5 Bounded search (ToT/LATS) — the one open gap
v4.8 · 11.5 Bounded search — the one open gap### 11.5 Bounded search — the one open gap
not in v4.7
v4.8 · 11.5 Bounded search — the one open gapThe unbuilt extension is to make the plan *searched* rather than fixed — the agent analogue of deliberate, branch-and-evaluate problem solving (Tree of Thoughts; Yao et al., 2023) and of tree search that unifies reasoning, acting, and planning over a language agent's trajectories (Language Agent Tree Search; Zhou et al., 2023).
··· 13 unchanged paragraphs folded ···
not in v4.7
v4.8 · References## References
not in v4.7
v4.8 · References1. Osmani, A. (2026). *agent-skills: A discipline plugin for agent skills, with explicit anti-triggers and load-constraint declarations.* Open-source project (GitHub: addyosmani/agent-skills). 2. Chopra, T. (2026). *headroom: Reversible Compress-Cache-Retrieve context compression for language agents.* Open-source project, Apache-2.0 (GitHub: chopratejas/headroom). 3. Wang, G., Xie, Y., Jiang, Y., Mandlekar, A., Xiao, C., Zhu, Y., Fan, L., & Anandkumar, A. (2023). *Voyager: An Open-Ended Embodied Agent with Large Language Models.* arXiv:2305.16291. 4. Yao, S., Yu, D., Zhao, J., Shafran, I., Griffiths, T. L., Cao, Y., & Narasimhan, K. (2023). *Tree of Thoughts: Deliberate Problem Solving with Large Language Models.* arXiv:2305.10601. 5. Zhou, A., Yan, K., Shlapentokh-Rothman, M., Wang, H., & Wang, Y.-X. (2023). *Language Agent Tree Search Unifies Reasoning, Acting, and Planning in Language Models.* arXiv:2310.04406. 6. Miller, E. K., & Cohen, J. D. (2001). *An Integrative Theory of Prefrontal Cortex Function.* Annual Review of Neuroscience, 24, 167–202.
··· 12 unchanged paragraphs folded ···
Changed paragraphs in the same form, for scripts: JSON
· Markdown