Skip to content

fix(router): imperativeVerbs was weighted zero — restore the dimension key - #53

Merged
VickyXAI merged 1 commit into
mainfrom
fix/imperative-verbs-weight
Aug 19, 2026
Merged

fix(router): imperativeVerbs was weighted zero — restore the dimension key#53
VickyXAI merged 1 commit into
mainfrom
fix/imperative-verbs-weight

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Found while pulling live values out of the shipped config to update the docs.

The bug

router_core/config.py was machine-transpiled from upstream config.ts, snake_casing config field names. imperativeVerbs is both a keyword-list field and one of the 15 dimension names, so the transpiler renamed it in both places. The weight ended up under imperative_verbs while rules.py emits imperativeVerbs, and the lookup is weights.get(dimension["name"], 0) — so the dimension scored zero on every request since 1.11.0.

The config docstring even says dimension-weight keys stay camelCase; the KEY_MAP applied globally and caught this one anyway.

Impact

Build/deploy-shaped requests were under-classified. Sampling 8 imperative prompts, 3 changed tier:

prompt with the bug correct
"Create and deploy the service" SIMPLE ambiguous → MEDIUM
"Set up the config and deploy it" SIMPLE ambiguous → MEDIUM
"Develop a CLI that generates reports" SIMPLE ambiguous → MEDIUM

The router is designed to fail upward under uncertainty; this made it fail downward for a whole class of prompt.

Why the parity check missed it

The 24-request cross-SDK comparison passes 24/24 both before and after — none of those prompts sat within 0.03 of a tier boundary. A sampled behavioural check cannot prove structural equivalence, which is why the new tests assert the structure directly.

Tests

  • every dimension the classifier emits has a weight, and every weight matches an emitted dimension (same set, both directions);
  • the weight table equals config.ts at 18bf4ab verbatim.

Cross-SDK parity re-verified after the fix: 24/24 identical.

Folded into the unreleased 1.12.0 — no published artifact carries this.

…n key

The transpile that produced router_core/config.py from config.ts snake_cased
config field names. `imperativeVerbs` is both a keyword-list field and one of
the 15 dimension names, so its weight landed under `imperative_verbs` while
rules.py emitted `imperativeVerbs`. `weights.get(name, 0)` then scored that
dimension at zero on every request.

Effect: build/deploy-shaped prompts were under-classified. 3 of 8 sampled
imperative prompts — "Create and deploy the service", "Set up the config and
deploy it", "Develop a CLI that generates reports" — classified SIMPLE where
the correct score leaves them ambiguous, which the strategy defaults up to
MEDIUM. The 24-shape cross-SDK check missed it because none of those prompts
sat within 0.03 of a tier boundary; it still reports 24/24 after the fix.

Guarded by two tests: the weight keys and the dimension names the classifier
emits must be the same set, and the weight table must match config.ts at
18bf4ab verbatim. Folded into the unreleased 1.12.0 — no published artifact
carries the bug.
@VickyXAI
VickyXAI merged commit 8aaa960 into main Aug 19, 2026
4 checks passed
@VickyXAI
VickyXAI deleted the fix/imperative-verbs-weight branch August 19, 2026 04:31
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