Repository navigation
Retire cost-speed routing with a backward-compatible cost-only reader - #11767
Conversation
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The updated cost/robust fixture still contains the old speed-ranked response, contradicting the router’s matching contract.
1 open issue
What changed in this PR
Prepares AWF’s router 0.4.0 to retire cost-speed while accepting both three-cost-table and legacy six-table bundles, preserving existing cost-routing behavior.
Changes:
- Restricts configuration, discovery, and requests to cost routing, with explicit retired-goal errors.
- Requires complete cost-table directory bundles while retaining the six-table package for staged rollout.
- Expands compatibility coverage and documents reader-release and compiler-migration gates.
| File | Description |
|---|---|
src/types/api-proxy-routing-options.ts |
Restricts the routing-goal type to cost. |
src/config-file-validation.test.ts |
Tests accepted cost modes and rejected speed goals. |
src/config-file-mapping.test.ts |
Uses cost routing in the mapping fixture. |
src/awf-config-schema.json |
Restricts configuration goals to cost. |
docs/awf-config.schema.json |
Aligns the documented schema with cost-only configuration. |
docs/awf-config-spec.md |
Documents cost-only behavior and rollout constraints. |
containers/router/testdata/routing-contract/route.json |
Records retired-goal rejection cases. |
containers/router/testdata/routing-contract/discovery.json |
Records cost-only discovery for router 0.4.0. |
containers/router/testdata/routing-contract/classify.json |
Uses a cost table for classifier independence. |
containers/router/table.go |
Preserves legacy table-profile parsing. |
containers/router/table_test.go |
Covers both bundle shapes and required-cost validation. |
containers/router/server_test.go |
Tests cost-only discovery and speed rejection. |
containers/router/schema_test.go |
Separates readable table profiles from served profiles. |
containers/router/route.go |
Filters legacy profiles and requires complete cost bundles. |
containers/router/route_test.go |
Limits serving tests to cost profiles. |
containers/router/README.md |
Documents compatibility and staged migration gates. |
containers/router/openapi.yaml |
Defines the cost-only 0.4.0 API contract. |
containers/router/main.go |
Updates the router version to 0.4.0. |
containers/router/Dockerfile |
Updates the version and notes retained legacy packaging. |
containers/router/decode.go |
Rejects unsupported routing goals explicitly. |
containers/router/decode_test.go |
Covers retired-goal rejection and valid cost decoding. |
containers/router/corpus_test.go |
Replays contract cases against both bundle shapes. |
containers/router/contract.go |
Separates served and legacy-readable profiles. |
containers/router/container_test.go |
Exercises both bundle shapes and cost-only capabilities. |
containers/router/cli_test.go |
Expects cost-only validation summaries. |
containers/api-proxy/routing-contract.test.js |
Tests cost-only capability validation. |
containers/api-proxy/routing-contract.js |
Rejects capabilities advertising retired goals. |
containers/api-proxy/routing-config.test.js |
Tests cost preservation and speed rejection. |
containers/api-proxy/routing-config.js |
Restricts supported configuration goals to cost. |
containers/api-proxy/fixtures/routing-contract/cases.json |
Updates recorded capabilities and route requests. |
Review effort: Max (adaptive)
| ], | ||
| "objective": { | ||
| "goal": "cost-speed", | ||
| "goal": "cost", |
|
@copilot address review feedback |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Updated the |
|
✅ Copilot review passed with no inline comments. @lpcox Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit e934a3c |
|
@copilot merge main and resolve conflicts |
…peed-routing Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed in |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (2 files)
Coverage comparison generated by |

Retire
cost-speedwithout breaking cost routing when speed tables stop shipping. Explicit speed requests must fail rather than silently route by cost.cost/autoselection. Update configuration types, schemas, discovery, companion validation, and fixtures; keep published table schemas frozen.