Skip to content

Router v1 - #6

Merged
datacas merged 2 commits into
mainfrom
feat/router-v1
Sep 21, 2026
Merged

datacas merged 2 commits into
mainfrom
feat/router-v1

Conversation

@datacas

@datacas datacas commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Routes a role to a concrete target, conservatively.

Two calibration campaigns produced exactly one usable finding about models: on five real work items an inexpensive implementer never passed review on the first attempt, at either effort level, and nothing separated the two efforts beyond that. This router does not pretend to a precision the evidence does not support.

Three ideas

Availability gates the choice, before any model is considered. An executor that is merely installed is not dispatchable: a binary on PATH proves no session, no repository access and no quota. The router is told each executor's state rather than discovering it — nothing documented reports remaining quota, and inferring it from a failed dispatch mistakes one exhausted window for evidence about a model.

Production may fall back; a calibration may not. Substituting an arm when quota runs out answers a different question with the same sample, so RoutingMode.CALIBRATION blocks and waits.

Cost is estimated over the cycle, not the first pass. Five of five implementations needed changes, so the estimate carries at least one resolution plus its review until a repository measures its own rate. A profile cheaper to run once is not automatically cheaper to finish with.

Escalation

Two rules, both from signals declared before routing — labelling afterwards would measure the routing rather than the models:

  • difficulty 3 implementation work goes to deep_coder;
  • a security-sensitive change is reviewed by senior_reviewer.

There is no evidence for finer rules yet.

Configuration

code_cycle.profiles in .code-cycle.yml is the single place a role resolves to an executor, provider, model and effort. A repository declares only what it changes; an unknown profile name is refused rather than ignored.

Verification

python3 scripts/validate-package.py   → VALID
python3 -m unittest discover -s tests → 157 tests, OK

Two calibration campaigns produced one usable finding about models: on five real
work items an inexpensive implementer never passed review on the first attempt,
at either effort level, and nothing separated the two efforts beyond that. This
router routes by role and a few declared signals, and refuses to invent a
ranking the data does not support.

Availability gates the choice before any model is considered. An executor that
is merely installed is not dispatchable — a binary on PATH proves no session, no
repository access and no quota — and the router is told each state rather than
discovering it, because nothing documented reports remaining quota and inferring
it from a failed dispatch mistakes one exhausted window for evidence about a
model. That distinction cost a campaign to learn.

Production may use a profile's fallback and must say it did; a calibration may
not, because substituting an arm answers a different question with the same
sample.

Cost is estimated over the cycle rather than the first pass. Five of five real
implementations needed changes, so the estimate carries at least one resolution
plus its review until a repository measures its own first-pass rate: a profile
cheaper to run once is not automatically cheaper to finish with.

Two escalation rules only, both from signals declared before routing rather than
from a model's opinion of its own work. Profiles resolve through
code_cycle.profiles, the single place a role maps to a model.

Also folds the two [Unreleased] changelog sections left by the previous merge
into one.

157 tests.
The fallback message reused the fallback's availability to describe the primary,
so a run that routed around an exhausted Codex reported 'primary executor codex
is ready'. The tests missed it because an earlier reason already carried the
right word somewhere in the explanation.

A routing decision is only auditable if its reasons are true, and this one
asserted the opposite of what happened. Two regression tests now check that each
reported state matches the executor it names, and that the fallback message
cannot claim a healthy primary.

Also states the decide-versus-dispatch boundary where it was being overclaimed.
Profile resolution exists: seven roles resolve to concrete targets and a skill
names a role rather than a model. Generic executor dispatch does not: nothing
converts a resolved target into a running worker on an arbitrary host, so
cc-orchestrator keeps its execution modes and a routing decision is advice it
honours deliberately. docs/instrumentation.md said 'no general profile system',
which stopped being true, and did not say the dispatch gap, which is the part
that matters.

159 tests.
@datacas
datacas merged commit d6c21c0 into main Sep 21, 2026
4 checks passed
@datacas
datacas deleted the feat/router-v1 branch September 21, 2026 08:43
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