skip to content
Replays

Script Execution Flow

Scripted Pattern Control Flow

Pattern scripts, verdict branches, rule probes, and the documentation that makes them authorable

Gantry milestones

4 milestones 12 tasks 30 agents

9 plan 10 execute 18 review 1 fix

244k peak context

146k median execute

Pattern scripts, verdict branches, rule probes, and the documentation that makes them authorable

3h 10m total 13m 25s per task

7m 7s plan 1h 14m execute 37m 7s review

136 edits 1k commands

codex harness

This run finished a broad pattern-language change: verdict-producing steps learned to branch on their own results, script steps became engine-owned commands, rule blocks gained script probes and bare outcomes, and the public pattern docs were reconciled with the shipped behavior.

The work was cut as a stack. First the shared branch vocabulary landed, then scripts were added as a validated step and carried through interpreter, identity, production execution, journal, and replay. The final implementation milestone pushed the same script semantics into rules and rewrote the bundled patterns, after which a narrow cleanup fixed a documented goal-check condition name that review had found.

How this walkthrough is structured

Feature

What did the run build and ship?

The current tree still exposes verdict branches, engine-owned script steps, script rule probes, bare rule outcomes, replayable script journals, migrated bundled patterns, and matching public pattern documentation.

Build

How did Gantry structure the work?

The run moved from shared branch syntax to production script execution, then reused that contract in rule blocks and docs, with the recorded stress concentrated where new script syntax met the gate and where the last documentation correction had to be repaired.

Milestone 1

Verdict Branching

2 tasks 8 agents 49m 32s wall time 244k peak context

Verdict branch support is still present in the pattern language and interpreter. Gate and goal-check steps carry typed branch tests, shared targets resolve through the closed destination vocabulary, and conditional steps use the file-format spelling documented in the pattern spec. Bundled patterns and compatibility notes now describe verdict flow on the producing step instead of a trailing verdict conditional.

This milestone carried the non-script control-flow foundation. Its brief kept scripts out and focused the cut on verdict-producing steps, branch-target validation, and the conditional spelling change that later work would inherit. The child ledgers show the branch surface and compatibility sweep both finished cleanly, while the run facts show review-triggered re-planning after the first child task. That made the branch vocabulary a settled dependency before the script milestones began.

Validated Branch Keys

3 agents 35m 48s wall time 244k peak context 1 replan

The loader still models branch targets as typed values rather than late strings. Reserved terminal words, block targets, and contextual loop controls are resolved during validation, and branch-bearing steps expose their target lists through shared helpers. The retired conditional spelling is not part of the deserialized format, so authors get one accepted spelling instead of a compatibility alias.

This sprint was asked to define the load-time contract before any new executor behavior depended on it. A fresh worker could hold it because the boundary was pure pattern format: accept optional branch keys on verdict producers, reject malformed targets eagerly, and remove the old conditional spelling. Review then caused a replan for the remaining milestone work, which is exactly where a validation contract should force downstream clarity.

Verdict Branch Execution

2 agents 7m 3s wall time 146k peak context

The current bundled pattern files and docs still reflect that migration. Verdict-producing steps branch directly, pattern version notes explain the compatibility effect of changed bundled bytes, and conformance coverage guards against drifting back to retired conditionals. The contribution is partly folded into later pattern rewrites, but the branch execution contract remains observable in the interpreter.

This sprint closed the accounting around the branch migration that had already started landing. Its brief framed the work as compatibility and regression coverage: version the behavior-affecting bundled edits, keep script behavior out, and prove patterns no longer depend on trailing verdict conditionals. The run facts show the unit stayed green, so the later script work inherited a tested branch surface rather than an open migration.

Milestone 2

Script Steps

4 tasks 17 agents 1h 23m wall time 172k peak context

Script steps remain a first-class step kind. The pattern language accepts command and inline-source forms under the shipped spelling, the interpreter computes branch verdicts from exit status or trimmed stdout, and the production world runs commands from the worktree with durable script-result records for replay. Inline source materialization and run identity still live in the frozen pattern path.

This milestone added scripts as real pattern steps by layering the work from syntax to mock execution, frozen inline source, and production replay. That shape made each fresh agent responsible for one boundary: language, interpreter contract, identity, then process runtime. The first child task is where the gate went red and an investigation plus replan followed, which located the stress at the new script declaration surface rather than at the later production bridge.

Script Step Syntax

8 agents 24m 17s wall time 131k peak context 1 replan

`ScriptStep` is still part of the pattern data model with a command form, an inline interpreter-plus-source form, and script-specific branch keys. The validation layer rejects ambiguous command declarations, invalid branch grammar, unresolved destinations, and context-sensitive targets before a run starts. Fall-through grounding can now use a following script step as deterministic evidence.

This sprint gave later agents a typed script declaration without asking it to execute anything. The brief named the precise command forms, branch grammar, parameter substitution, and grounding rule for fall-through agents. Its gate failure and follow-up investigation show that the risk was in making the new syntax closed and validated enough for the rest of the stack. After replanning, the milestone could continue against a corrected language surface.

Mock Script Execution

2 agents 18m 58s wall time 156k peak context

The interpreter still owns script control flow. It asks the world to run a script, treats infrastructure failure as a halt, computes branch selection from exit status or stdout, preserves stderr outside branch tests, and records selected targets. Mockable script execution is also reused by script rules, so the contract from this unit became the shared runtime decision path.

This unit consumed the language contract and corrected it to the final command-key spelling before execution spread further. Its scope was interpreter-local: pass a script request through the mockable world boundary, compute the verdict, and steer control flow without involving production processes. The recorded run stayed green here, which left production execution with a small request and result contract instead of open interpreter semantics.

Freeze Script Source

3 agents 14m 52s wall time 172k peak context 1 replan

Inline script bodies are still materialized under the run's frozen pattern scripts directory. Production execution requires inline source paths to live under that frozen directory, and sub-pattern invocation materializes inline sources for child orchestration directories as well. Run identity continues to include the frozen pattern closure, so changed inline bodies do not silently collide with earlier runs.

This sprint isolated identity and closure concerns from process execution. It was sized around one invariant: inline script bytes must be frozen and materialized before production can run them, so a resumed run never reads mutable pattern text. The run facts show review led to replanning after this unit, which matches a boundary that changed how later work should consume frozen script material.

Production Script Replay

1 agents 14m 27s wall time 115k peak context

Production scripts now execute through `GenericProductionPatternWorld`. The runner launches shell commands or frozen inline sources from the worktree, records process roster identity, separates stdout and stderr, handles timeout and abort as infrastructure, and reuses prior script-result events during replay. The journal preserves the display label, verdict, selected target, and stream facts needed for post-mortem views.

This final script-step sprint joined the interpreter contract to the real process world. The brief was broad but contained: launch engine-owned commands, scope the active item environment, classify infrastructure failures, journal process facts, and replay durable results instead of rerunning commands. It landed without recorded repair, which indicates the earlier syntax, interpreter, and freeze cuts gave this agent stable inputs.

Milestone 3

Script Rules Docs

5 tasks 10 agents 54m 1s wall time 100k peak context

Rule blocks now share the script runtime rather than carrying a second dialect. The loader normalizes condition probes and script probes, bare outcomes resolve through the same destination vocabulary as branch targets, and cycle checks include bare block outcomes. The bundled pattern set and pattern docs teach the final spelling, while later cleanup corrected the one goal-check name that review found.

This milestone completed the plan-format surface after script steps already worked. Its sequence is visible in the briefs: validate the rule shape, execute script probes, resolve bare outcomes, rewrite bundled patterns, then reconcile public docs. The run facts show the implementation and documentation children stayed green, but the milestone review found a follow-up naming mismatch for the goal-check condition and forced the final cleanup milestone.

Rule Surface Validation

1 agents 12m 23s wall time 87k peak context

`RuleProbe` still separates condition probes, script probes, and invalid raw shapes for diagnostics. Raw rules reject mixed condition and run declarations, script-only tests without a command, and rules with no probe. Bare outcomes are converted through the branch-target vocabulary, and validation includes block references reached by the bare-name spelling.

This sprint was the rule-side equivalent of the earlier script syntax cut. It stopped before runtime and made load validation decide whether each rule has exactly one probe and a resolvable outcome. That made a fresh worker's task narrow: normalize the accepted shape and reject invalid combinations with useful diagnostics. The run record shows no repair, so script-rule execution could depend on a clear normalized rule contract.

Script Rule Execution

1 agents 12m 3s wall time 78k peak context

Script rules execute through the same world boundary and journal path as script steps. During rule evaluation, condition and script probes interleave in declaration order, a matching script selects the rule outcome, and a non-match falls through to later rules. Resume reads journaled script results, so a rule probe at the same position is not executed again.

This sprint extended the already-proven script execution behavior into rule evaluation. Because script steps existed, the worker did not need to invent another command model; it only had to evaluate ordered probes, preserve first-match behavior, and halt on infrastructure failure. The clean run here shows the value of sequencing script rules after the step runtime rather than alongside it.

Bare Outcome Runtime

2 agents 5m 36s wall time 94k peak context

Bare rule outcomes are now runtime behavior, not only parsed syntax. Reserved words become terminal or control dispositions, bare block names run that block and then resume rule evaluation, and contextual loop controls keep their validation rules. The interpreter's rule loop still expresses that structured return directly.

This unit closed the outcome half of rule execution separately from script probes. The brief focused on runtime behavior for reserved terminal words and block names, including structured entry and return. Keeping it separate meant tests could prove bare-name outcomes for both condition and script rules without mixing that concern into process execution. The run record shows a green boundary.

Bundled Pattern Rewrite

1 agents 10m 31s wall time 76k peak context

The current bundled patterns are written in the final plan-format spelling. Their control flow uses verdict branch keys and bare outcomes where the docs say they should, and behavior-affecting edits are represented in the pattern version notes. The older gated task-set file is gone from the current tree, but the surviving shipped patterns still carry the migrated style.

This sprint applied the completed language to Gantry's shipped patterns. The brief made it mechanical and constrained: move verdict flow onto the producing step, use bare outcomes where clearer, retain shared ending blocks where they carry reuse, and update version headers. It stayed green, which fits a propagation unit whose risk was conformance drift rather than new engine behavior.

Docs Reconciliation

2 agents 6m 47s wall time 100k peak context

The pattern specification and manual now describe script steps, script rules, bare outcomes, verdict branches, compatibility effects, and excluded script features as shipped behavior. They also state that retired spellings have no aliases and that scripts do not create a broader environment or failure-policy surface. The later cleanup refined the goal-check condition spelling in that same documentation set.

This closing sprint aligned public documentation with the engine and bundled patterns. Its brief explicitly forbade documenting excluded behavior, so the task was not to broaden the feature but to make the authored contract match the code. The sprint passed, but milestone review still found one goal-check condition name that needed a follow-up, turning documentation drift into the next narrow unit.

Milestone 4

Goal Check Docs

1 tasks 6 agents 21m 15s wall time 40k peak context

The public pattern spec now names the goal-check verdict condition with the implemented spelling. The docs keep the distinction between verdict-producing steps that branch directly and rule or conditional conditions that read recorded verdict state. No production code or compatibility alias was introduced by this cleanup.

This milestone was deliberately small because the preceding review had already identified the mismatch. It isolated the correction to documentation: use the implemented goal-check condition spelling and leave behavior, aliases, prompts, and pattern rewrites alone. The gate went red once and a fix ran, so even the small final patch still benefited from Gantry's checked repair loop.

Goal Condition Rename

3 agents 14m 52s wall time 40k peak context 1 fix

`manual/spec.md` now teaches the goal-check verdict condition under the implemented name and no longer presents the obsolete spelling as the author-facing contract. The surrounding docs still describe direct goal-check branching separately from conditions that inspect recorded verdicts. The change is intentionally documentation-only and leaves the engine surface unchanged.

This sprint carried only the follow-up documentation mismatch from the previous milestone. A fresh worker could hold it because the brief named the obsolete spelling, the replacement spelling, and the prohibition on behavior changes. Its first gate went red and a fix ran before review passed, which located the remaining risk in exact documentation consistency rather than implementation.