Skip to content

Let a route decide each item of a list - #231

Closed
wseaton wants to merge 1 commit into
openai-decisionfrom
route-each
Closed

wseaton wants to merge 1 commit into
openai-decisionfrom
route-each

Conversation

@wseaton

@wseaton wseaton commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

A route may now declare over and decide each item of a list on its own, so a playbook can put a decision model in front of per-item agent work. This implements the core of the per-element routes RFC draft (rfc-route-over): C-ROUTE-EACH and C-ROUTE-FILES with ADR-0062 and ADR-0064. The score-question clause stays on that branch.

  • Mapped route. One decision per item, each recorded as route[K]'s row; resume asks only for the missing ones.
  • Aligned edges. Tasks mapped over the same producer.field read each other per item: fix[K] gets judge[K]/analyze[K] instead of their folds, under any join, and a when on an aligned route is read against route[K]. An unlisted answer settles that item not taken without dispatch. Fan-outs count such items under not_taken instead of failing, and a fan-out whose every item is untaken is untaken to its leaves.
  • keyed. Any mapped task can narrow an object field of an unmapped dependency to its item's entry. An output-decided mapped route reads answers from an aligned source, or from an unmapped source's object keyed by item.
  • Route files. Schema-declared JSON files of dependencies go into the model's state under files, by dependency, so a route can judge an agent's RESULT.json.
  • Decision binding withheld. CRUCIBLE_INFERENCE and the decision key are stripped from every task process; only a route asks the decision model.

plan_admitted gains keyed, the fan-out summary gains not_taken; CONTRACT_VERSION 1.16.0. Tested: IR validation for alignment, keyed, files and keyed sources; executor tests for per-item gating, all-untaken fan-outs, a missing keyed entry, output-decided mapped routes, and resume from every cut; a harness test for route files; and a route_e2e run of the real binary asking an OpenAI-shaped server once per item with that item's keyed state while no task process sees the binding.

Stacked on #226. One gap against C-ROUTE-FILES: a staged file that does not parse reaches the model as null but its path is only logged, not recorded on the route's result.

Changelog: Added: a route can map over a list and gate each item of an aligned fan-out, with keyed narrowing and dependency files in the decision state

A route could not declare over, so a playbook that fans work out over a
list could only gate the whole fan-out on one decision. A route may now
map over a list (C-ROUTE-EACH, ADR-0062): each item is one decision,
recorded as its instance's row, so a resume asks only about items it
has no answer for.

Two tasks mapped over the same producer field are aligned. An edge
between them is read per item: instance K receives the dependency's
instance K in place of its fold, under any join, and a when on an
aligned route is read against that route's instance K. An item whose
answer is not listed settles not taken without dispatch; a fan-out
counts such items under not_taken instead of failing on them, and one
whose every item was untaken settles not taken.

keyed lets any mapped task narrow an object field of an unmapped
dependency to its item's entry. A route's files put dependencies'
schema-declared JSON files in the model's state under files
(C-ROUTE-FILES), so a route can judge an agent's RESULT.json. An
output-decided mapped route reads each item's answer from its aligned
source, or from an unmapped source's object keyed by item.

The decision binding and its key are withheld from every task process
(C-INFERENCE, ADR-0064): only a route asks the decision model.

plan_admitted carries keyed; the fan-out summary carries not_taken.
CONTRACT_VERSION 1.16.0.
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown

Docs preview for this PR is built and attached as the docs-preview artifact.

Download docs-preview, unzip, and open index.html in a browser.

Rebuilt for 0f2542b.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant