Objective
Make every production work item pass through the deterministic execution-route decision before an LLM or effect executor is selected.
The repository already defines simplicio.execution-route/v1 and decide_route(), but current references are limited to its module/tests. The main runner does not consume the receipt as an authoritative routing gate.
Routing authority
- Worker: mapping, indexed search, dedupe, mechanical edit, schema validation, tests, diff and receipt publication when deterministic capability exists.
- Agent: ambiguous intent, plan synthesis, non-mechanical code/copy, new failure investigation, semantic review and recovery choice.
- Hybrid: deterministic gates first; invoke an agent only on inconclusive evidence or explicit semantic judgment.
- Runtime enforces physical/resource/policy constraints but does not make semantic decisions.
- Any compatible coordinator may be the agent; Simplicio Agent is not mandatory.
Implementation steps
- Add route decision as a required runner stage after intake/context and before planning/execution.
- Replace keyword-only production behavior with versioned capability-aware rules while retaining deterministic fixtures.
- Consume Mapper evidence/ContextGraph handles to classify scope and ambiguity without re-reading the tree.
- Query installed worker capabilities from Mapper, Dev CLI and optional Runtime.
- Persist the route receipt with task, evidence handles, confidence, backend candidates and causal IDs.
- Route worker tasks without an LLM call.
- Route agent tasks through the selected runtime driver, pinning coordinator/provider/model identity for the attempt.
- For hybrid tasks, record each deterministic gate and the precise escalation reason.
- Re-evaluate only when new evidence invalidates the route; prevent oscillation worker↔agent.
- Share token/resource budget across retries and fan-out.
- Replace fabricated zero token fields with measured values or UNAVAILABLE/null plus reason.
- Surface the route in status, progress, handoff and final receipts.
Tests
- Mechanical edit with available worker: zero LLM calls.
- Mechanical task with missing worker: hybrid and explicit repair/escalation.
- Ambiguous goal: agent route.
- Mixed task: deterministic preflight then one bounded agent escalation.
- Changed capability manifest invalidates cached route.
- Stale Mapper evidence is rejected.
- Retry does not silently change provider/model.
- Multi-item drain chooses routes independently.
- Route oscillation and budget exhaustion.
- Equivalent route receipt across two coordinator hosts.
Acceptance criteria
Relations
- Runtime ownership: wesleysimplicio/simplicio-runtime#3134
- Token economy: wesleysimplicio/simplicio-runtime#3086
Objective
Make every production work item pass through the deterministic execution-route decision before an LLM or effect executor is selected.
The repository already defines simplicio.execution-route/v1 and decide_route(), but current references are limited to its module/tests. The main runner does not consume the receipt as an authoritative routing gate.
Routing authority
Implementation steps
Tests
Acceptance criteria
Relations