Skip to content

Commit dd10c9a

Browse files
committed
docs(routing): clarify RI-04 dry-run scope and sync stack ledger (RI-04)
1 parent ea19ab1 commit dd10c9a

2 files changed

Lines changed: 32 additions & 17 deletions

File tree

‎devlog/_plan/260804_router_intelligence/001_pr_stack_status.md‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ other; closing one is a maintainer decision and neither is stale.
132132
(2) SQL column names are snake_case - analytics SELECT now aliases to
133133
camelCase; (3) cost field is `estimate.cost.total` (CostBreakdown), not
134134
`costUsd`; plus the row-cap is injectable for truncation tests.
135-
- Final commit: `5f464c730` (CodeRabbit: cooldown parse gate, API `limit` default 5k, devlog + tests)
136-
- PR: #1005 (OPEN) https://github.com/lidge-jun/opencodex/pull/1005
135+
- Final commit: `5f464c730` (CodeRabbit: cooldown parse gate, API `limit` default 5k, devlog + tests);
136+
merged head on `dev`: `a594938c5`
137+
- PR: #1005 (MERGED) https://github.com/lidge-jun/opencodex/pull/1005
137138
- Verification:
138139
- `bun x tsc --noEmit`: PASSED (0 errors)
139140
- `bun run test tests/routing-analytics.test.ts`: 10/10 pass:
@@ -147,25 +148,34 @@ other; closing one is a maintainer decision and neither is stale.
147148

148149
### RI-04 - feat/ri-04-policy-profile-core
149150

150-
- Base SHA: `2069e724ec27e176644a11ff55bef307f5ebe3bf` (RI-03 head)
151-
- Reviewed commit: same as final (author self-review before push)
151+
- Base SHA: `a594938c5` (`dev` after #1005 merge; rebased from the RI-03 head
152+
when #1003/#1004/#1005 landed)
153+
- Reviewed commits: `63924495e` (RI-04 core) + review round `d478b393`
154+
(request-evidence wiring), `8e1f1c3d` (provider-namespace alias check, dead
155+
export removal), `aa9212fa` (CLI cleanup), `27511bf7` (absent-flag
156+
semantics, cost-limit enforcement, deterministic id ordering, CodeRabbit
157+
round)
152158
- Findings (self-review): 4 fixed pre-push - (1) `serviceTier` evidence type
153159
was `Unknownable` (number|boolean) but service tiers are strings - trace
154160
type narrowed to `string | "unknown"`; (2) alias validation missed the
155161
reserved `combo/` namespace prefix; (3) trace candidates did not carry
156162
`score` - added `score` to `TraceCandidateInput`/`buildCandidate`;
157163
(4) test expectation for weight normalization used wrong math (unspecified
158164
weights keep defaults; sum 4.35 not 4).
159-
- Final commit: pending (recorded after commit)
160-
- PR: pending
165+
- Final commit: `27511bf7` (see Reviewed commits)
166+
- PR: #1011 (OPEN, ready) https://github.com/lidge-jun/opencodex/pull/1011
161167
- Verification:
162168
- `bun x tsc --noEmit`: PASSED (0 errors)
163-
- `bun run test tests/routing-profile.test.ts`: 12/12 pass (validation,
164-
normalization, revision digest, collisions, config load, id/alias
165-
resolution, dry-run eligibility/unknown/tie-break, API list+dry-run,
169+
- `bun run test tests/routing-profile.test.ts`: 14/14 pass (validation,
170+
normalization, revision digest, collisions incl. provider namespace,
171+
config load, id/alias resolution, dry-run eligibility incl. request
172+
evidence and cost limit, unknown/tie-break, API list+dry-run,
166173
API error codes)
167-
- Focused regression suites: 176/176 pass across 8 files
174+
- Focused regression suites: pass across route-decision-trace,
175+
routing-analytics, request-history-index, combos, codex-routing,
176+
internal-cli-dispatch
168177
- `bun run privacy:scan`: passed
169178
- `tests/config.test.ts`: 109/115 pass; the 6 symlink failures reproduce
170179
identically on the pristine base (Windows symlink EPERM, environmental)
171-
- Remaining Low findings: none
180+
- Remaining Low findings: none (B3/B5 residual: no-eligible trace names
181+
candidate 0 as `selected`; API evidence fields are permissively dropped)

‎docs-site/src/content/docs/reference/configuration/routing.md‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,11 @@ commands, see [Combos](/guides/combos/).
8686
## Routing policy profiles (`config.routingProfiles`)
8787

8888
Routing policy profiles are the Router Intelligence selection layer: an explicitly requested
89-
`policy/<id>` (or configured alias) chooses among a fixed candidate allowlist using hard capability
90-
requirements and deterministic, explainable scoring. Existing model ids are **never** routed through
91-
a profile implicitly - policy routing only activates when the client requests a policy model id.
89+
`policy/<id>` (or configured alias) selects among a fixed candidate allowlist using hard capability
90+
requirements and deterministic, explainable scoring. In this release profiles are configuration and
91+
dry-run evaluation only: production requests are not yet routed through them (execution wiring
92+
arrives with RI-05), and existing model ids are **never** routed through a profile implicitly.
93+
Policy ids do not participate in the model resolution order above until execution lands.
9294

9395
Each key is an id matching `[A-Za-z0-9][A-Za-z0-9._-]{0,63}`, always addressable as `policy/<id>`,
9496
with one optional `alias`. Aliases must be unique and cannot collide with configured providers,
@@ -101,7 +103,7 @@ namespace, or reserved bare native families (`gpt-*`, `o1-*`, `o3-*`, `o4-*`, `c
101103
| `alias?` | `string` | — | Optional public model id in place of `policy/<id>`. |
102104
| `require?` | object | `{}` | Hard capability requirements evaluated before scoring (see below). |
103105
| `optimize?` | object | latency 0.55, health 0.25, cost 0.10, quota 0.10 | Scoring weights; normalized deterministically. |
104-
| `limits?` | object | — | Hard limits, e.g. `maxEstimatedCostUsd`. |
106+
| `limits?` | object | — | Hard limits, e.g. `maxEstimatedCostUsd` (enforced by the dry-run evaluator when candidate cost evidence is known). |
105107
| `unknownEvidence?` | object | capability `exclude`, health/quota/cost `penalize` | How unknown evidence is treated per dimension: `allow`, `penalize`, or `exclude`. Unknown never becomes zero. |
106108

107109
`require` supports: `minContextWindow` (positive integer), and the booleans `tools`, `imageInput`,
@@ -112,6 +114,9 @@ Request evidence supplied to a dry-run (context window, tools, image input, stru
112114
reasoning effort, service tier, encrypted Codex tasks) is evaluated against candidate capabilities
113115
together with the profile `require` block; a candidate must satisfy both to be eligible.
114116

117+
The CLI dry-run accepts request-evidence flags but cannot supply candidate capability evidence yet;
118+
candidate evidence is provided through the API (`POST /api/routing-profiles/dry-run`).
119+
115120
```json
116121
{
117122
"routingProfiles": {
@@ -147,8 +152,8 @@ without sending any upstream request.
147152
requirements filter first, then deterministic scoring ranks the survivors.
148153

149154
Both are virtual namespaces with aliases and collision validation; they differ in *how* a candidate
150-
is chosen. Profile scoring expands in capability (RI-05), health (RI-06), quota (RI-07), and cost
151-
(RI-08) dimensions, each recorded in the per-request route-decision trace.
155+
is chosen. Profile scoring will expand with capability (RI-05), health (RI-06), quota (RI-07), and
156+
cost (RI-08) dimensions; per-request trace recording arrives with execution (RI-05).
152157

153158
### Catalog eligibility
154159

0 commit comments

Comments
 (0)