# BROCA: Giving Agent Recipes a Grammar — A Gradual Type System and Combinator Algebra for Self-Composing Workflows: history

4 versions, 2026-06-06 to 2026-11-25. Newest first. Clone: https://sprintpaper.com/git/j17.git

## v1.3 · 2026-11-25

11,383 words, +309 / −4 words. Text: https://sprintpaper.com/papers/j17/v/1.3.md

**Every recipe parse and run now leaves a record**

One new section and a few wording fixes. Every time the system reads a recipe, it now writes a record: accepted, or refused for one of five named reasons. Every run records its steps and which ones failed. One query can then separate recipes refused before they ran from recipes that broke partway, and each points to a different fix. The improvement notes of 25 September asked for this section. The paper says plainly that these counts come from one deployment and prove nothing about typed versus prose recipes.

- New section 4.4 on parse and run records.
- Wording only elsewhere: "load-bearing" replaced with plain phrases, star symbols written as "stars".

## v1.2 · 2026-07-29

11,078 words, +1,034 / −637 words. Text: https://sprintpaper.com/papers/j17/v/1.2.md

**New mechanisms described; claims narrowed to an engineering design**

This version adds mechanisms built since June and pulls back on what the paper claims. The abstract is cut almost in half and now calls the work an implemented systems design, not a formal language: there is no formal semantics, no soundness proof and no public benchmark. The new mechanisms come from the improvement notes of 7 June, which this version marks as incorporated. The notes give the reason for the narrower claims: tests show behaviour, not that typed recipes beat prose ones.

- New section: recipes take typed parameters, checked before dispatch, filled from stored values, context or memory, or by pausing to ask.
- Spawned workers now have token and tool-call limits that are enforced during the run, not just planned.
- Parallel runs return one result per input, so one failure no longer sinks the batch.
- The supervisor that checks completion is itself a recipe with a computed loop limit.
- Recipe edits made by the agent live in a separate overlay that survives software updates.
- Two limitations added: no formal semantics, and no comparative benchmark. The conclusion is rewritten to match.

## v1.1 · 2026-06-14

10,681 words, +2,500 / −4 words. Text: https://sprintpaper.com/papers/j17/v/1.1.md

**Related work added; typed edges set against context compression**

This version places BROCA among open-source projects and admits a gap. It adds a related-work section and compares BROCA with headroom, a tool that compresses prose instead of removing it, and says the two fit together. It also concedes that the claim "typed edges save tokens" has no measurement behind it yet, and describes the benchmark that would settle it. The paper grows by about 2,500 words. The folder's improvement notes of 13 June asked for both the headroom positioning and the interop point.

- New: two ways to fix lossy prose, remove it at typed edges or compress it and fetch it back.
- New: the recipe format is the same `kit/1.0` schema the Journey registry uses; four outside kits were imported.
- New: authoring habits taken from two public skill collections ("when not to use", trigger phrases, test sets).
- The skill search is now described as surface similarity only, citing a negative result from a sibling experiment.
- A runtime gate on tool calls is noted as a second safety layer next to the closed condition language.
- Limitations gain two items: the efficiency claim is unmeasured, and the search does not judge meaning.

## v1.0 · 2026-06-06

8,185 words, first version. Text: https://sprintpaper.com/papers/j17/v/1.0.md

**A typed grammar for agent recipes**

An agent recipe is a list of steps written in English, and each step hands its result to the next as prose. Nothing checks, before the run, that a later step uses a field an earlier step really produces. The paper proposes a small language that fixes this while letting plain prose steps stay as they are, and says it is already built and tested.

- Steps can declare typed outputs and named inputs; undeclared steps stay plain prose.
- Before any step runs, every input and every condition is checked against an earlier step that declares that field.
- A small, safe condition language (`when:`) and an early exit replace free code.
- Map, filter and compose turn recipes into building blocks, and a searchable skill library supplies the parts.
- Failures are sorted into kinds and routed to retry, a fallback recipe, or continue with what survived.
- Every limit (retries, fan-out, nesting depth) is computed from the situation, not fixed. Self-editing of recipes exists but only proposes changes by default.
