Pattern Language Redesign
Format Two Pattern Language
A complete migration from the retired pattern model to the current language, runtime, corpus, and surfaces.
5 milestones 32 tasks
6 plan 52 execute 57 review
21h 30m total 13m 21s per task
This run rebuilt Gantry's pattern language from the reader contract through production execution, then moved the bundled corpus and public surfaces onto that contract. The work was split by dependency: first the accepted language, then execution, then shipped patterns, then deletion of the retired runtime, then the surfaces and final proof. The stress in the record sits where the cut was hardest. The contract and runtime milestones stayed mostly green, while the legacy deletion milestone records repeated starts, a hand-completed deletion sprint, a diagram repair sprint with a red gate, and a later merge-resolution repair before the run landed.
How this walkthrough is structured
Feature
What did the run build and ship?
The current tree has a strict pattern reader, a typed execution path, shipped current-language patterns, regenerated reference data, and website surfaces that consume that data.
Build
How did Gantry structure the work?
The run was cut as a dependency stack, with the contract made reviewable before execution, execution before the corpus, the corpus before deletion, and deletion before public surfaces.
Milestone 1
Format-2 Contract
6 tasks 15 agents 1h 39m wall time
The current reference at `manual/spec.md` defines the accepted words, header marker, closed vocabularies, and record-compatibility distinction. The loader in `src/engine/pattern_language.rs` still resolves the source file into typed handles and rejects unknown or retired fields. The compatibility marker also remains part of the frozen run record path in `src/engine/run/pattern.rs`.
This milestone carried the language boundary before any runtime relied on it. Its sprints were small enough for fresh agents because each piece exposed a named contract: reference prose, authoring prose, loader dispatch, schema, resolution, and run compatibility. The run facts show this section stayed green at its own boundaries, which matches a documentation-and-loader foundation rather than an integration fight.
Reference Contract
2 agents 13m 20s wall time
`manual/spec.md` now describes the language as finite TOML data with producing steps, composition constructs, and declared outputs. It names the compatibility marker and states that retired files are refused rather than translated. Later edits have refined the prose, but the reference still carries this sprint's contract.
This sprint was asked to make the normative reference the authority before implementation agents hardened a partial model. The boundary was textual but still load-bearing: every later sprint could test its work against accepted words and closed vocabularies. It passed cleanly, so the cut gave the agent one document contract instead of the whole migration.
Authoring Docs
2 agents 10m 15s wall time
The pattern manual and prompt reference still explain current patterns through declared outputs, directory lists, command environment inputs, and prompt-only substitution. Agent prompt documentation remains separate from execution semantics. Where later runs rewrote prose, the live documentation still teaches the current language rather than a tolerant retired reader.
This sprint converted the reference contract into author-facing guidance and prompt-contract prose. The task was safe for a fresh agent because it consumed the reference rather than designing new runtime behavior. Its boundary stayed green, so the work functioned as propagation from the contract into nearby prose.
Versioned Loader Boundary
2 agents 10m 10s wall time
`src/engine/pattern_language.rs` still requires the header compatibility marker and reports the retired header key as incompatible. The source reader recognizes malformed declarations before interpreting the file body. Historical run support is kept outside this source-file reader.
This sprint inserted the versioned reader boundary while the retired path still existed. That made the cut narrow: choose the reader from the declared compatibility surface, keep old behavior stable, and route current files into the new path. The clean boundary meant later schema work did not have to defend against accidental fallback.
Strict Format-2 Schema
2 agents 14m 9s wall time
The typed model in `src/engine/pattern_language.rs` uses denied unknown fields on the pattern definition and closed step variants. Producing steps declare outputs directly, and constructs carry typed tables instead of retired surface keys. The reader still rejects obsolete step kinds as source errors.
This sprint made the new source shape strict before cross-reference resolution existed. The agent could hold the schema because it was a closed deserialization and rejection problem, not runtime execution. Its green boundary established that retired keys were errors rather than compatibility aliases.
Format-2 Resolution
2 agents 26m 19s wall time
The resolved structs in `src/engine/pattern_language.rs` still expose `ResolvedPatternDefinition`, `ResolvedPattern`, `ResolvedStep`, and typed ids for patterns, parameters, steps, and outputs. The loader composes includes, checks branches and references, and records recursion notices. Execution code consumes those resolved values rather than comparing authored names for behavior.
This sprint moved from parsed TOML to a resolved definition that execution could consume. Its boundary was author-owned names: resolve them once, validate them once, and leave downstream code with typed ids and enums. The green result gave the runtime milestone a stable data model.
Compatibility Boundary
2 agents 12m 41s wall time
Run pins still carry the pattern-language compatibility marker in `src/engine/run/pattern.rs`. Resume and merge-capability code answer from the frozen marker instead of attempting a current strict load of older closures. Old records remain a record-surface concern, not accepted source syntax.
This sprint completed the contract milestone by protecting run reuse and frozen reads. It was scoped around side-effect-free refusal, so a fresh agent could prove the boundary before any production interpreter work. The record shows no repair pressure here, leaving compatibility as a clean handoff to execution.
Milestone 2
Execution Model
7 tasks 17 agents 1h 43m wall time
The current execution path lives in `src/engine/run/generic_pattern.rs` and consumes the resolved pattern model from `src/engine/pattern_language.rs`. It executes agents, gates, commands, iteration, calls, stops, and resume through the current pattern-language compatibility path. The old execution model no longer owns current runs.
This milestone made the resolved language executable in layers. Each sprint added one runtime contract: entry and stops, state and branching, effects, iteration, calls, boundary replay, and production dispatch. The run facts show green gates throughout, so the decomposition kept runtime semantics isolated until the final production handoff.
Runtime Contract
2 agents 6m 58s wall time
The interpreter still treats the engine-provided `nothing` pattern as an identity and handles authored stops through the current runtime path. Runtime state is expressed through typed pattern and step handles. Display text may preserve authored names, but behavior starts from resolved declarations.
This sprint created the entry point for resolved patterns without translating them into the retired model. Its useful boundary was the fake-world surface: later semantics could be scripted without production side effects. It passed cleanly and gave the rest of the milestone a runtime host.
Output And Branching
2 agents 9m 15s wall time
The runtime still tracks output presence, malformed output values, step outcomes, and absence routing. Branches can read declared values or step outcomes, and missing required data reaches an engine stop when no route exists. Structural references remain whole values outside prompt prose.
This sprint made data flow executable before effects could produce real data. That cut let the agent focus on output presence, value routing, absence, and branchable outcomes. The green boundary meant later effect work could publish outputs into a known state contract.
Effect Step Semantics
2 agents 13m 21s wall time
`src/engine/run/generic_pattern.rs` still sends agent, gate, and command steps through production effect handling. Commands receive values through environment bindings, gates retain their task-gate authority, and agents carry prompt inputs, plan-change handling, and declared outputs. Effect results bind output state before later branches run.
This sprint attached the three producing step kinds to the state contract behind the world boundary. It was large but coherent because agent, gate, and command all publish through the same declared-output mechanism. Its successful boundary proved that external effects did not need a separate language.
Task Directory Iteration
2 agents 14m 31s wall time
Current patterns use `for` over declared directories for build briefs and map rosters. The interpreter supplies task file, task prose, task gate, and task basename as typed task references. Per-invocation state and run-scoped outputs keep repeated work isolated unless the pattern declares accumulation.
This sprint implemented bounded repetition as directory iteration. The unit was holdable because a task body invocation has one responsibility: receive a task file, run serially, and keep its state separate from its neighbors. Its green run boundary showed that repetition did not require retained milestone or sprint vocabulary.
Calls And Stop Handlers
2 agents 9m 26s wall time
`config/patterns/until.toml` still expresses its loop as recursive calls, and `config/patterns/build.toml` composes included patterns through calls and iteration. Stop handlers are header declarations that invoke ordinary patterns. Omitted call outputs are rebound absent instead of leaking stale state.
This sprint added sequential calls, legal recursion, and stop handlers after iteration was already defined. That ordering mattered because calls needed invocation frames and output rebinding rather than a second run model. The green boundary proved recursion and handler dispatch could remain pattern execution.
Boundaries And Resume
2 agents 16m 55s wall time
The runtime still resolves run base, previous step, iteration start, and named step boundaries against the active invocation stack. Resume reads durable records and reconstructs outputs, task context, step outcomes, and boundaries before proceeding. Boundary spans are used by effects without a separate git step kind.
This sprint made boundary references and replay real after calls and iteration existed. Its boundary was durable reconstruction: replay completed work, rebuild state, and execute only the frontier. The clean pass gave production dispatch a resume contract instead of an in-memory assumption.
Production Format-2 Dispatch
2 agents 23m 2s wall time
Production runs now select and freeze current-language pattern closures through `src/engine/run/pattern.rs`. Dispatch reaches the generic pattern runtime rather than materializing a retired definition. The shipped corpus depends on this path for normal execution.
This sprint was the milestone integration point. It had to prove that the fake-world contracts could run through production selection, frozen pins, agents, gates, commands, journals, and resume. Its clean boundary left the next milestone free to port the corpus rather than debug missing runtime semantics.
Milestone 3
Bundled Corpus
5 tasks 16 agents 5h 12m wall time
`config/patterns/` now contains current-language pattern files for build, milestone, sprint, map, until, and variants. The files declare the compatibility marker and express defaults, flag bindings, prompt bindings, iteration, recovery, and recursion as pattern data. Retired corpus files such as the old goal entry are absent.
This milestone installed the drafted corpus in dependency order: selection first, the build family, the roster and recursive loop entries, variants, then a real corpus run. A few sprints repeated after review, but the record has no red gate in this milestone. The cut kept the engine stable while the shipped pattern files moved.
Header Selection
2 agents 19m 57s wall time
Pattern headers in `config/patterns/*.toml` still declare default selection and fixed flag bindings. The registry loads duplicate claims as errors, and resumed runs resolve from the frozen pin. Operator selection is therefore data from the pattern header, not a separate hardcoded driver table.
This sprint established selection before replacing the files that would be selected. The boundary was the header binding contract: defaults, names, flags, required parameters, and frozen-pin resume. It stayed green and removed hidden driver knowledge before the corpus relied on it.
Build Family
3 agents 1h 36m wall time
`config/patterns/build.toml`, `config/patterns/milestone.toml`, and `config/patterns/sprint.toml` remain the shipped build family. The default build decomposes a plan, iterates milestone briefs, and delegates to sprint execution through current-language constructs. Recovery is authored in the pattern instead of encoded as a retired driver path.
This sprint installed the build, milestone, and sprint family together because they call through one another. The record shows the sprint restarted, which fits a corpus integration task where draft spelling had to meet the actual reader. It still finished through the normal gate, leaving later entries a working build family to call.
Map And Until
4 agents 1h 49m wall time
`config/patterns/map.toml` expresses a roster as a directory of task files and runs tasks with their carried prompt and gate command. `config/patterns/until.toml` expresses the acceptance loop as recursive calls into the build pattern. `steady` and `careful` are still map-shaped variants rather than separate runtime concepts.
This sprint installed the roster pattern and recursive acceptance-check pattern after the build family existed. It restarted and reviewed more than once, which locates the pressure in adapting the draft map and loop semantics to the implemented language. The boundary still held because these entries consumed the build family rather than modifying it.
Variants And Prompts
2 agents 27m 44s wall time
`config/patterns/redesign.toml` and related variants still declare their shape and parameter differences as current-language data. Prompt ids are passed as declared values rather than assembled from name fragments. CLI selection remains attached to headers rather than old pattern-name lists.
This sprint restored operator-facing variants after the core shapes loaded. Its task was surface binding rather than new execution semantics: flags, prompt ids, and variant declarations had to use the current rules. The green boundary shows the variants did not need special driver behavior.
Corpus Integration
2 agents 49m 11s wall time
The bundled registry still loads current-language patterns together, and the old corpus files do not remain as a fallback. The draft directory is now historical context rather than the source the engine reads. Real runs use the files under `config/patterns/`.
This sprint closed the corpus milestone by treating parse success as insufficient. It integrated the registry, removed replaced files, and ran a small real build through the installed corpus. The clean boundary gave the deletion milestone evidence that the new corpus could carry production work.
Milestone 4
Legacy Ontology Removal
8 tasks 49 agents 9h wall time
The current tree no longer has a live retired pattern runtime for new runs. `src/engine/pattern_language.rs`, `src/engine/run/generic_pattern.rs`, and `src/tui/pattern_diagram.rs` all operate on the current resolved model. Name-invariance and public-surface work remain visible in tests, reference export, and documentation.
This milestone is where the record shows the migration fighting back. Early strictness and production-effect sprints held, but deleting the retired runtime could not be made green by agents and was completed by hand, leaving diagram and test repair for the next sprint. The later diagram sprint hit a red gate, and the top-level milestone review needed troubleshooting before the run could continue.
Close Format 2 Contract
2 agents 11m 12s wall time
The reference still states that no retired primary words or aliases are accepted in current pattern files. Loader errors name incompatible headers and unknown fields. Remaining retired vocabulary is confined to historical prose, fixtures for refusal, or out-of-scope analysis.
This sprint reopened the contract at the deletion boundary. Its purpose was to close any loopholes before the old model disappeared, so the work was mostly rejection boundaries and vocabulary accounting. It passed cleanly, giving deletion a stricter target.
Enforce Strict Format 2 Loading
2 agents 11m 19s wall time
The source reader still denies unknown fields and obsolete keys. User-authored retired-format sources are rejected as incompatible current-language files. Strict loading sits before dispatch, so execution never receives a partially tolerated old shape.
This sprint turned the closed contract into reader behavior. The boundary was early refusal: reject old inputs and unknown fields before execution could begin. It stayed green, so stricter loading did not depend on the later runtime deletion.
Bind And Freeze Format 2 Runs
5 agents 43m 51s wall time
Current runs freeze selected patterns, bound inputs, and the compatibility marker in the run record. Resume and reuse check that marker before writing new state. Selection no longer follows mutable registry defaults once the run has a frozen pin.
This sprint had repeated starts, which fits the difficult boundary between selection, pins, and reuse. Its unit was still coherent: bind the selected declaration, freeze the closure, and refuse incompatible reuse. The review pressure landed before the runtime deletion, where mistakes were still contained.
Run Format 2 Through Production Effects
2 agents 11m 54s wall time
Production effect handling still reads resolved current-language steps and world requests. Agents, gates, commands, declared output checks, and plan-change handlers run through the generic pattern runtime. No current production path needs the retired interpreter to execute a pattern.
This sprint kept production effects current after pins and strict loading were in place. It did not need to delete the old model; it needed the current model to drive real agents, gates, commands, and records. Its clean boundary set up the one-pass deletion.
Delete The Format-1 Runtime In One Pass
25 agents 6h 10m wall time
The retired pattern type, interpreter, map-specific modules, goal and loop drivers, and generated map-spec path are absent from the current execution surface. Consumers that inspect records read domain records rather than interpreter re-exports. This deletion is foundational, but its individual contribution is folded into the later green tree by repair and surface work.
This sprint is the clearest stress point in the run. The brief records that several agent attempts failed because cutting the final consumers made denied unused code a build error, while keeping consumers alive meant the deletion was incomplete. The work was completed by hand and intentionally left diagram and test repair for the next sprint, so this unit's boundary was not an ordinary green sprint boundary.
Port The Pattern Diagram To Format 2
4 agents 33m 40s wall time
`src/tui/pattern_diagram.rs` now renders current-language patterns from `ResolvedPattern` data. It handles parameters, step order, branches, calls, iteration bodies, stop notes, recursion, and the engine-provided `nothing` target. The checked-in diagram snapshots include current-language outputs for shipped patterns.
This sprint repaired the visible hole left by the deletion. Its brief explicitly warned that the gate had been made green without a real diagram port, so the first boundary was a test that rendered shipped patterns rather than accepting a stub. The sprint hit a red gate and ran troubleshooting, which locates the difficulty in proving the diagram against real current-language declarations.
Prove Name Invariance
4 agents 35m 1s wall time
The test suite still contains name-invariance coverage around current-language loading and execution. Behavior-relevant routing uses typed handles for patterns, steps, outputs, parameters, tasks, and boundaries. Authored names remain available for display and records without becoming dispatch keys.
This sprint came after deletion and diagram repair because only then was the current runtime stable enough to compare. Its boundary was adversarial and narrow: scramble authored names while preserving typed structure. It repeated before passing, which fits a proof that must exclude display labels without hiding behavior.
Publish Format 2 Surfaces
2 agents 12m 39s wall time
The reference export and website data now represent the current bundled corpus and closed vocabulary. Pattern pages and prompt catalog surfaces avoid using retired grouping data as live structure. Fixtures for old behavior remain only where they prove refusal or historical record reading.
This sprint made the deletion visible outside the engine after the runtime proof existed. Its boundary was audit-like: exports, website data, prompt catalog references, fixtures, and deleted-vocabulary accounting had to agree with strict current-language behavior. It passed cleanly after the higher-risk deletion work was done.
Milestone 5
Surfaces and Verification
6 tasks 17 agents 1h 27m wall time
The current tree has regenerated reference data in both the Rust-side and website-side data sets, website pages that read the new shape, updated prompts and manuals, current fixtures, and final verification coverage. Record and replay surfaces inspect current-language runs through durable records rather than source-file compatibility shims.
This milestone moved from engine correctness to external agreement. It sequenced record surfaces, reference data, website rendering, prose, fixtures, and final verification so stale consumers were removed before the final acceptance pass. The record shows late stress in fixture and final verification work, plus a failed merge resolve after the milestone completed.
Run Record Surfaces
1 agents 2m 28s wall time
Run status, replay, merge-capability, and maintenance paths now read current pins and pattern-event streams. Old runs continue only where version-tolerant records supply enough data. Closure-derived views may degrade rather than loading retired pattern files.
This sprint handled completed and live run readers before public data exports. Its boundary was record discipline: status, replay, merge, and maintenance code had to consume durable records and pins, not resurrect a private source loader. The sprint reviewed at the milestone level before finishing, which matches a surface touching several readers.
Reference Data Contract
2 agents 12m 32s wall time
`docs/reference/data/reference.json` and `web/db/data/reference.json` are generated from the current implementation. The export describes the accepted words, step kinds, secondary vocabularies, command inputs, references, bundled patterns, and explanatory metadata. Consumers no longer probe both retired and current shapes.
This sprint created the data contract before the website consumed it. That cut let the agent focus on export shape, closed vocabularies, and stale-field rejection. It passed cleanly, giving the site one shape to read.
Website Pattern Surfaces
2 agents 17m 33s wall time
The website pattern pages read `web/db/data/reference.json` and render current-language corpus data. Pattern grouping and variant display no longer depend on deleted driver families. The docs pages describe directory-backed repetition, recursion, outputs, and closed references as the current language.
This sprint followed the export contract and kept the Rails work scoped to rendering that shape. The fresh agent did not need to decide language semantics; it had to remove assumptions about retired grouping and header names. The green boundary tied the website gate to regenerated data.
Prose And Prompts
4 agents 31m 1s wall time
Agent prompts under `config/agent-prompts/` and manuals under `docs/patterns/` now describe current-language syntax, routing, command inputs, prompt substitution, CLI binding, and frozen-pin resume. Remaining old-run prose is framed as record compatibility. The no-commit worker instruction remains in the relevant prompts.
This sprint aligned manuals, prompts, and reference prose after engine and website consumers had moved. Its repeated start indicates broad prose reach rather than a new code contract. The boundary was consistency: prompts still needed no-commit instructions while dropping live retired-language concepts.
Fixtures And Smoke Coverage
4 agents 13m 26s wall time
Retained pattern fixtures now use the current language unless they intentionally prove refusal or historical record behavior. Smoke coverage includes a real build-pattern run and adversarial name-invariance coverage. Tests that only preserved tolerant retired loading were removed or replaced with current behavior checks.
This sprint cleared stale tests before final acceptance. It had an execution failure and an unsuccessful troubleshoot attempt before passing, which locates the late risk in fixture conversion and smoke proof rather than in the core runtime. The scope was still right-sized because it touched tests and fixtures, not new language features.
Final Acceptance Check
1 agents 2m 29s wall time
The root and website gates now exercise the current corpus, reference export, website copy, fixtures, and record surfaces. The vocabulary absence rule is part of the verification surface, with historical and display exceptions separated from live pattern-language terms. The current tree stands as a single current-language implementation rather than a dual runtime.
This sprint was the proof pass rather than a feature slab. It checked the rewritten corpus, a real build run, name invariance, regenerated data, website integration, record surfaces, and deleted-vocabulary boundaries. The sprint itself was green, but the run later needed merge-resolution repair, showing that final local acceptance and integration were separate boundaries.