Skip to content

Commit a594938

Browse files
authored
feat(analytics): add route reliability and latency analytics (#1005)
* feat(analytics): add route reliability and latency analytics (RI-03) * fix(analytics): valid RI-01 decisionIds in tests; simplify helpers and query validation (RI-03) * fix(routing): address CodeRabbit RI-03 review (cooldown, limit, tests, devlog) * docs(devlog): sync RI-03 stack status after CodeRabbit round 2
1 parent 2a72aa4 commit a594938

6 files changed

Lines changed: 732 additions & 4 deletions

File tree

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

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ head SHA, PR number/URL, verification result, and review state.
1010
- Bun: `1.3.14`; package version: `2.10.0`
1111
- Worktree: `D:\codex-worktrees\ocx-router-intelligence`
1212
- Push remote: `origin` (Wibias/opencodex); PR target: `lidge-jun/opencodex:dev`
13-
- All PRs opened as DRAFT; nothing merged by this programme.
13+
- Programme stack: #1003 (RI-01) and #1004 (RI-02) merged to `dev`; #1005 (RI-03) open.
1414

1515
## Related in-flight PRs (not superseded by this stack)
1616

@@ -40,8 +40,8 @@ other; closing one is a maintainer decision and neither is stale.
4040
| RI | Branch | Base | Head SHA | PR | URL | Status |
4141
|---|---|---|---|---|---|---|
4242
| RI-01 | `feat/ri-01-route-decision-traces` | `e44d234f0` | `b5a8e7c4c` | #1003 | https://github.com/lidge-jun/opencodex/pull/1003 | MERGED |
43-
| RI-02 | `feat/ri-02-request-history-index` | `dev` (post-#1003 merge) | `03b0eafa7` | #1004 | https://github.com/lidge-jun/opencodex/pull/1004 | OPEN |
44-
| RI-03 | `feat/ri-03-routing-analytics` | `feat/ri-02` head | pending | pending | pending | queued |
43+
| RI-02 | `feat/ri-02-request-history-index` | `dev` (post-#1003 merge) | `2a72aa4a9` | #1004 | https://github.com/lidge-jun/opencodex/pull/1004 | MERGED |
44+
| RI-03 | `feat/ri-03-routing-analytics` | `dev` (post-#1004 merge) | pending | #1005 | https://github.com/lidge-jun/opencodex/pull/1005 | OPEN (resync) |
4545
| RI-04 | `feat/ri-04-policy-profile-core` | `feat/ri-03` head | pending | pending | pending | queued |
4646
| RI-05 | `feat/ri-05-capability-aware-routing` | `feat/ri-04` head | pending | pending | pending | queued |
4747
| RI-06 | `feat/ri-06-health-aware-routing` | `feat/ri-05` head | pending | pending | pending | queued |
@@ -107,7 +107,7 @@ other; closing one is a maintainer decision and neither is stale.
107107
4. duplicate-replay accounting counted ignored rows in `indexedRows` -
108108
now counts real `INSERT` changes.
109109
- Fixes: all four above; tests cover every one.
110-
- PR: #1004 (OPEN) https://github.com/lidge-jun/opencodex/pull/1004
110+
- PR: #1004 (MERGED) https://github.com/lidge-jun/opencodex/pull/1004
111111
- Final commit: recorded after review round (rebase + CodeRabbit/simplify
112112
fixes; new head pushes to #1004)
113113
- Verification:
@@ -121,3 +121,25 @@ other; closing one is a maintainer decision and neither is stale.
121121
codex-routing, codex-account-namespaces)
122122
- `bun run privacy:scan`: passed
123123
- Remaining Low findings: none
124+
125+
### RI-03 - feat/ri-03-routing-analytics
126+
127+
- Base SHA: `2a72aa4a9b0870c629adf842da659a5c521c6bfa` (`dev` after #1004 squash-merge)
128+
- Reviewed commit: `e732d02e` (pre–CodeRabbit review round)
129+
- Findings (self-review): 3 fixed pre-push - (1) `requestHistoryDb` accessor
130+
missing from the indexer (analytics needs the handle after open);
131+
(2) SQL column names are snake_case - analytics SELECT now aliases to
132+
camelCase; (3) cost field is `estimate.cost.total` (CostBreakdown), not
133+
`costUsd`; plus the row-cap is injectable for truncation tests.
134+
- Final commit: `5f464c730` (CodeRabbit: cooldown parse gate, API `limit` default 5k, devlog + tests)
135+
- PR: #1005 (OPEN) https://github.com/lidge-jun/opencodex/pull/1005
136+
- Verification:
137+
- `bun x tsc --noEmit`: PASSED (0 errors)
138+
- `bun run test tests/routing-analytics.test.ts`: 10/10 pass:
139+
classification (success/failure/cancel/incomplete), percentiles +
140+
coverage, fallback rate, provider/model/account + profile breakdown,
141+
unknown-price honesty, filters, truncation flag, API payload,
142+
cooldown on failure+attempts, API validation (`invalid_from`/`invalid_to`/`invalid_range`)
143+
- Focused regression suites: 144/144 pass across 6 files
144+
- `bun run privacy:scan`: passed
145+
- Remaining Low findings: none

0 commit comments

Comments
 (0)