Commit Graph
1341 Commits
Author SHA1 Message Date
Dark-Alex-17 aa1287b902 docs(graph): document llm max_iterations: 0 in the example graph 2026-09-11 10:56:27 -06:00
Dark-Alex-17 d7a16363b8 feat(graph): warn when an llm node's turn cap is disabled 2026-09-11 10:56:27 -06:00
Dark-Alex-17 36601d8668 feat(graph): treat llm max_iterations: 0 as no turn cap 2026-09-11 10:56:27 -06:00
Dark-Alex-17 8e9a1f1ee8 docs: removed unnecessary comment on GraphState.history field 2026-09-11 10:56:27 -06:00
Dark-Alex-17 8f9284cb92 refactor(graph): keep the ordered visit log test-only
GraphState.history was pushed to on every node visit and deep-cloned on
every super-step snapshot and map fork, but its only reader is the
cfg(test) current_node accessor. Gate the field, its initializer, and
the push behind cfg(test) so production builds no longer carry an
unbounded Vec<String> that nothing observes.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 69a3d928ee docs(graph): document max_loop_iterations: 0 in the example graph 2026-09-11 10:56:27 -06:00
Dark-Alex-17 4c5aa8d895 feat(graph): warn when the visit cap is disabled
validate_timeouts now also flags settings.max_loop_iterations: 0, ahead
of the settings.timeout: 0 warning so both opt-outs read top-to-bottom
as they appear in settings. (design §3.14 / C22)
2026-09-11 10:56:27 -06:00
Dark-Alex-17 3aa35e1259 feat(graph): treat max_loop_iterations: 0 as no visit cap
Both enforcement sites (frontier loop and map chain step) skip the
comparison when the cap is 0; visits are still counted and logged.
Adds an executor test that loops past the default cap with 0, a test
pinning the frontier cap message for a non-zero value, and a map-chain
twin at 0. (design §3.14 / C22)
2026-09-11 10:56:27 -06:00
Dark-Alex-17 4dee1a6849 docs: Removed unnecessary unicode arrow from example graph config 2026-09-11 10:56:27 -06:00
Dark-Alex-17 f342dd7dd7 docs(graph): document timeout: 0 in the example graph
Comment-only: each of the five timeout fields in graph.example.yaml now
says that 0 disables the bound. Parsed content is unchanged.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 cd0318f384 feat(graph): warn when a timeout is disabled
A timeout: 0 on settings.timeout or on an agent/script/llm/rag node is
the author's explicit opt-out of the wall-clock bound. It stays legal;
the validator now emits one warning per zero so the choice is visible in
--validate output. Non-zero and unset values do not warn (unset already
means no bound for settings.timeout and llm nodes, matching the
explicit-zero-only convention of the orchestration-limit warnings).

Design §3.13 / C21.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 d630c7e30b feat(graph): treat timeout: 0 as no wall-clock bound
A zero on any of the five timeout fields (settings.timeout, agent, script,
llm, rag) now disables the bound instead of firing an immediate
"timed out after 0s" or graph bail. Unset values keep their defaults
(agent 300, script 30, rag 120, llm/settings none); non-zero values are
unchanged. One resolution helper, wall_clock(secs) -> Option<Duration>,
feeds all five call sites; the C17 peer-retirement mark and every error
message stay where they were.

The one existing test that relied on timeout: 0 firing
(run_item_chain_marks_identity_finished_when_agent_step_times_out) moves
to timeout: 1 with its 5s hold unchanged.

Design §3.13 / C21.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 b666b7e494 docs(graph): illustrate the inputs map on the example agent node
Comment-only block on deep_dive; the example's parsed YAML is unchanged.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 e26543f21a test(graph): cover agent node inputs end to end and at the runtime guards
Two offline chain tests materialize an echo-inputs graph agent whose
script reports the width it sees: a parent with inputs.width gets the
parent's value back, a parent without inputs gets the child's YAML
default. Two agents.rs tests pin the exact runtime guard texts for a
config-only target and a reserved initial_prompt key.

Task T5 of plans/map-subgraph-branches-design.md §3.12.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 10b8fe5cae feat(graph): validate agent node inputs at load time
Inside validate_agents: an agent node with inputs whose target has a
config.yaml but no graph.yaml is an error, and an inputs key named
initial_prompt is rejected. primary_templated_fields now includes every
inputs value for agent nodes, so validate_parallel_reads treats them as
cross-branch reads with no new pass.

Design: plans/map-subgraph-branches-design.md §3.12 V10a–V10c, task T5.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 3393123baf feat(graph): seed a child graph agent's state from an agent node's inputs map
Agent nodes gain an optional `inputs:` map of templates resolved against
the parent state and overlaid on the child graph agent's initial_state
before its executor starts. A lone {{key}} keeps the state value's JSON
type; mixed text renders to a string; initial_prompt is still owned by the
dispatcher. run_child_agent and run_active_agent_graph keep their
signatures as wrappers over the new *_with_inputs variants, and
run_agent_for_graph rejects inputs aimed at a config-only agent or
containing initial_prompt.

Design: plans/map-subgraph-branches-design.md §3.12 (C18), task T5.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 0bef0f2c39 fix(graph): retire the teammate identity before structured extraction
PR #24 follow-up 10. The identity was only retired by the frontier and
chain-exit safety nets, so a peer stayed messageable during
structured::extract after its agent had already stopped. Mark it
finished the moment the agent future resolves, on success and on both
error paths.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 874ef7f6ec fix(graph): reject a literal max_concurrency of 0 instead of clamping it
Copilot review on PR #24. The validator already rejects 0 and the
template path errors on it, but a literal 0 loaded with
validate_before_run off was silently clamped to 1. Fail with the same
error shape as the template path; only the absent-cap default clamps.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 e746ca1f87 fix(graph): clear peer identity fields after every map chain step
Copilot review on PR #24. The fields were only ever cleared by
run_agent_for_graph taking them, so a failure between arming and that
take (e.g. prompt interpolation) left them set on the item's ctx.
Reset both unconditionally once the step returns.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 dc5e3201da refactor(graph): move the cfg(test) OUTPUT_KEY import into llm's test module
PR #24 follow-up 7.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 cdbff88b4f fix(graph): pick the map teammate identity name by BFS from the branch entry
PR #24 follow-up 6. The identity used to fall back to YAML declaration
order after the entry, so the name depended on how the author ordered
the nodes map. Walk next/fallback edges from the entry instead.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 62122fc698 refactor(graph): drop the duplicated locator prefix from map chain step errors
PR #24 follow-ups 3 and 4. run_chain_steps already wraps every step
error with the map/item/node/step locator, so the inner messages
repeated it. Make them prefix-free and turn the unreachable End arm
into an honest internal-invariant message.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 31c33b5a23 fix(graph): name the offending node type when a map branch reaches a disallowed node
PR #24 follow-up 2. With validate_before_run off, a user-authored
approval/input/end/map node inside a branch reached a message that
called itself an internal error. Name the node type and point at the
validator setting instead.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 2f839b332d fix(function): build bundled bash tools without writing back to the source tree
PR #24 follow-up 1. The bundled-tools test called the writing
generate_bash_declarations on the repo's assets/functions/tools/*.sh,
so cargo test could rewrite tracked files. Split the build+export step
into a pure build_bash_tool so the test never touches the source tree.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 b65aa76d2d docs: updated the formatting of a few comments 2026-09-11 10:56:27 -06:00
Dark-Alex-17 d8f1778bc7 docs: describe map branches as per-item subgraph chains in graph.example.yaml
Comment-only rewrite of the map/branch and teammates comments: a branch is
the entry of a per-item chain; chain nodes may use next, state_updates,
output_schema, fallback and script _next inside the chain; output_key is
removed from the fork and must be written by the chain; max_concurrency
accepts an integer or a template; a teammate identity spans the item's
whole chain.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 c10965cd71 test(graph): pin the per-item retry chain and bundled validator warning parity
Add the motivating map-chain integration test: draft -> check, where check
re-routes to draft via script `_next` until an item-local attempts counter
reaches 2, run with validate_before_run on. A sibling test drives the same
map node against a parent state to pin that only collect_into lands on the
parent and that no chain visit touches the parent's loop counts.

Extend bundled_graph_agents_parse_and_validate: the sorted (node, warning)
set of every bundled graph must equal the set the pre-subgraph validator
produced, and graph.example.yaml must load through GraphParser, validate
without errors, and declare a writer for its map's output_key.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 b4a73aae7f test(graph): pin teammate retirement on agent timeout and frontier completion 2026-09-11 10:56:27 -06:00
Dark-Alex-17 846bc39263 test(graph): run a validated two-step map chain end to end
Same two-script chain as `map_chain_two_script_steps_route_via_next`,
with `validate_before_run: true`, proving the validator admits the
chains the runtime executes.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 824edf587b feat(graph): validate map branch subgraphs instead of single branch nodes
`validate_map_branches` checked only the entry node and forbade `next`,
non-`output_key` `state_updates` and `output_schema` on it. The runtime
now executes the whole subgraph reachable from `branch`, so the validator
follows suit as `validate_map_subgraphs`, at the same position in
`validate()`:

- approval/input/end/map nodes are rejected anywhere in the subgraph,
  attributed to the map node; when the offending node is a `fallback`
  target the message says why a previously accepted `fallback` now fails
- a fan-out `next` inside the subgraph is rejected
- a subgraph that shares nodes with the main flow (reachable from
  `start` without entering any map branch, via the new
  `main_flow_reachable`) is rejected, naming the shared nodes
- a new warning fires when no subgraph node declares a write to
  `output_key` via `state_updates` or `output_schema`; any script in the
  subgraph suppresses it, since scripts may write any key
- the `next`, `state_updates` and `output_schema` restrictions are gone:
  intra-branch writes are fork-local scratch

Two maps may share a subgraph. `find_reachable_nodes` and
`compute_parallel_groups` are unchanged.

Tests: the three rules that inverted are renamed to say what they now
assert (`map_branch_with_in_subgraph_next_passes`,
`map_branch_state_updates_scratch_key_passes`,
`map_branch_with_output_schema_passes`); the four
`map_branch_cannot_be_*` tests pass unmodified. Thirteen new tests cover
each rule, the fallback hint, the missing-writer warning and its three
suppressions, a three-node chain, and `main_flow_reachable`.
2026-09-11 10:56:27 -06:00
Dark-Alex-17 0083cf0c42 test(graph): cover map subgraph chains, output contract and teammate lifetime 2026-09-11 10:56:26 -06:00
Dark-Alex-17 f1cf9a6ae7 feat(graph): run map branches as per-item subgraph chains
A map item no longer runs a single branch node; it walks the subgraph
reachable from `branch` over `next`/`fallback` edges (branch_subgraph),
one chain per item, holding one semaphore permit for the whole chain.
Chain steps go through the shared `step()` so llm retries, fallbacks,
script `_next` and agent timeouts keep their existing semantics. A node
without `next` ends the chain (StepContext.branch_mode), a route outside
the subgraph, a fan-out, an end node or a loop past
max_loop_iterations fails the item, and every item error carries
`map node 'X': sub-branch [i] failed at node 'Y' (step n)`.

`output_key` is removed from each item's fork before the chain runs, so
the collected value must be written by the chain rather than inherited
from the parent.

Teammate identities are now per item for the whole chain: provisioned
when any flagged agent is in the subgraph, armed only before
`teammates: true` agent steps, and retired at chain exit. mark_finished
moves out of run_agent_for_graph to the two provisioning sites (frontier
task and chain exit), so timed-out and early-failing agents are also
marked finished.
2026-09-11 10:56:26 -06:00
Dark-Alex-17 2049316364 feat(graph): accept a {{template}} for a map node's max_concurrency
`MapNode.max_concurrency` becomes `Option<ConcurrencyCap>`, where
`ConcurrencyCap` is `Fixed(usize) | Template(String)`. Integers parse
exactly as before (`4` -> `Fixed(4)`, `0` -> `Fixed(0)`, absent -> `None`);
a string parses as a template that the map executor resolves against the
parent state right before the fan-out via `StateManager::interpolate_raw`,
mirroring `over:`. A template must resolve to an integer >= 1 or a numeric
string (scripts often emit numbers as strings); anything else, including 0,
is an error naming the map node, the template, and the resolved value/type.
The fixed path keeps its `.max(1)` clamp for byte-compatibility.

`Deserialize` is hand-written so a malformed value (`-1`, `4.5`, `true`,
a list, a map) reports the offending value and the accepted forms rather
than serde's opaque untagged-enum "did not match any variant".

Validator: a string cap that contains no `{{ ... }}` pair is a load-time
error (catches `"4"` typed for `4`); a templated cap joins the map node's
read set so `validate_parallel_reads` flags a read of a sibling branch's
write. The existing `Fixed(0)` rule and every other rule keep their order.

Design: plans/map-subgraph-branches-design.md §3.5, §3.11 (C3, I3).
2026-09-11 10:56:26 -06:00
Dark-Alex-17 a7744e7f89 fix(agents): name the map-branch output key in deep-research and finding-verifier
An llm node never persists its completion under `output` (the binding
is transient), so a map branch without state_updates collected the
stale inherited value: deep-research produced `None` findings and
finding-verifier errored on its first item because `output` was absent.

Both maps now declare an explicit output_key and their branch nodes
write it via state_updates. graph.example.yaml's research_subject gets
the same named-key pattern and its branch comment describes it.

Design: plans/map-subgraph-branches-design.md §2.6, §3.7 (C9).
2026-09-11 10:56:26 -06:00
Dark-Alex-17 24088a48a1 fix(graph): honor an explicit output key in state_updates
Hoist the three copies of apply_state_updates (llm, agent, rag) into
graph::state_updates::apply(state, output, has_schema, updates). The
helper computes every state_updates value first, restores the transient
`output` binding, and only then writes the computed updates, so a
`state_updates: { output: "{{output}}" }` entry is no longer clobbered
by the restore step.

The per-file wrappers stay as one-line calls so their existing tests are
unchanged; new direct helper tests live in state_updates.rs, including
the regression test for the clobber.

Design: plans/map-subgraph-branches-design.md §2.6, §3.7 (C5, D3).
2026-09-11 10:56:26 -06:00
github-actions[bot] 1df82b50b6 chore: refresh generated model catalog [skip ci] 2026-09-11 12:33:25 +00:00
github-actions[bot] 452d9e1b60 chore: refresh generated model catalog [skip ci] 2026-09-11 00:49:42 +00:00
github-actions[bot] 0f0f5448ef chore: refresh generated model catalog [skip ci] 2026-09-10 12:33:02 +00:00
github-actions[bot] 6e1683393f chore: refresh generated model catalog [skip ci] 2026-09-10 00:49:13 +00:00
Dark-Alex-17 d71cf75209 fix: Fixed the bad formatting in the finding-verifier agent 2026-09-09 17:39:56 -06:00
Dark-Alex-17 ddce9e330e docs: Added whetstone to the architect and sisyphus READMEs 2026-09-09 17:39:42 -06:00
Dark-Alex-17 2928125b0e feat: created the finding-verifier and whetstone agents for continuous code quality improvements 2026-09-09 17:22:26 -06:00
Dark-Alex-17 71c3283b87 test: updated macro test 2026-09-09 16:44:23 -06:00
Dark-Alex-17 47edaa35ff feat: teammates flag enabling peer messaging between concurrent graph agent nodes
Agent nodes marked teammates: true whose sub-agents run concurrently (map fan-out branches or multiple flagged agent nodes in one super-step) now form a team: each member gets a pre-provisioned inbox in a messaging-only PeerRegistry before any branch starts, a teammate roster injected into its prompt, peer resolution in agent__send_message, and a peers section in agent__list_running. Registries are scoped to a single fan-out and carry no lifecycle semantics: outputs still flow exclusively through collect_into/state reducers, finished peers reject new messages, and nothing registers in a supervisor. Also hardens the agent-recursion depth guard to work without a supervisor and adds validator warnings for zero-valued orchestration limits.
2026-09-09 16:44:23 -06:00
Dark-Alex-17 7e84804ed1 feat: support explicit can_spawn_agents, max_concurrent_agents, and max_agent_depth keys in graph.yaml
Graph agents previously derived can_spawn_agents from the presence of an agent node, so a pure-LLM-node graph could never spawn dynamic sub-agents. The three optional graph-level keys now override the derivation/defaults in AgentConfig::from_graph, enabling orchestrator graphs (can_spawn_agents: true with only llm nodes). Explicit false on a graph with agent nodes still runs those nodes; only dynamic spawning from llm nodes is disabled.
2026-09-09 16:44:23 -06:00
Dark-Alex-17 7f5b75dbdf fix: properly anchored the role frontmatter regex so it doesn't catch in-instruction separators 2026-09-09 13:23:33 -06:00
Dark-Alex-17 3865750f5a Merge branch 'main' of github.com:Dark-Alex-17/coyote 2026-09-09 12:33:04 -06:00
Dark-Alex-17 dbec2f77d1 fix: support non-object tool result outputs for bedrock 2026-09-09 12:32:54 -06:00
github-actions[bot] 6a4352d8b4 chore: refresh generated model catalog [skip ci] 2026-09-09 12:32:09 +00:00
github-actions[bot] 3e8ecdbeab chore: refresh generated model catalog [skip ci] 2026-09-09 00:52:07 +00:00