feat: working orhcestration engine

This commit is contained in:
2026-10-21 19:50:24 +01:00
commit ce5e2f20cd
161 changed files with 31794 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# Step F4: a sequence of agents
Built 2026-10-20, ahead of F3: the owner asked for the solution architecture agent's output to reach the operating model agent through the Orchestration engine.
## What was built
- **Sequences in configuration** (`agents.py`): `sequences: [{work, steps, description}]` beside `agents`. A step names a configured agent; a kind of work is an agent's or a sequence's, never both. `deploy/agents.local.yaml` has `solution_architecture`, `operating_model`, and `architecture_and_operating_model` of the two.
- **Routing** (`routing.py`): a decision is the agents in the order they work. A sequence is named like any work.
- **The relay** (`relay.py`): each task runs a plan, one agent or several. The first agent gets the request as it came. When an agent completes and another follows:
- if its last word is a status other than `completed` (`completed_with_warnings`), nothing after it starts, and the caller is told what was not started (`{"status": "stopped", ...}`). The implementation plan asks for the user to be asked here; that waits for F3's disposition;
- otherwise its files, by artifact name, go to the next agent as `sources`, with the Orchestration engine's own record, `execution.json`: `status`, `customer_case`, `execution_id` (the agent's task), `workflow_request`, `work`.
- **What each agent is sent:** the first, every field but `work`. The ones after it, `customer_case`, `pre_approved` and `request` only, so the first agent's spec never reaches the second. A field for one agent goes under its work's name, such as `operating_model: {scope: ...}` for the operating model's own fields.
- **Every agent's files reach the caller,** each artifact's metadata naming the work it is of.
- **The request is the text** every agent is sent, when the caller gives `request`: a KAB step otherwise sends all its fields again as one JSON document.
## Verified
- Six tests in `tests/orchestration/test_sequence.py` against scripted agents: the sequence read from configuration and routed; the first agent's files and record reaching the second as `sources` with the right fields; a first agent ending with warnings starting nothing after it; the second agent's question relayed and answered. One more in `test_relay.py` for the request as text.
- The operating model agent's real digest read the solution architecture agent's scripted files with this record (`../../../solution_architecture_agent/.agents/plans/iter-01-on-the-engine/steps/step-1.md`).
- 552 tests pass; `ruff` and `mypy` clean.
## Not done
- No run with real models through the sequence.
- A platform workflow step has no way to send a field nested under a work's name; the operating model's own fields reach it only from an A2A caller.