Skip to content

Retire cost-speed routing with a backward-compatible cost-only reader - #11767

Merged
lpcox merged 5 commits into
mainfrom
copilot/retire-cost-speed-routing
Nov 18, 2026
Merged

lpcox merged 5 commits into
mainfrom
copilot/retire-cost-speed-routing

Conversation

@lpcox

@lpcox lpcox commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Retire cost-speed without breaking cost routing when speed tables stop shipping. Explicit speed requests must fail rather than silently route by cost.

  • Reader contract: Prepare router 0.4.0 to accept three-cost-table and legacy six-table bundles, advertise only cost profiles, and reject retired goals explicitly. Require all three cost tables in directory bundles.
  • Behavior and integration: Preserve fixed cost rankings and cost/auto selection. Update configuration types, schemas, discovery, companion validation, and fixtures; keep published table schemas frozen.
  • Staged rollout: Retain the six-table producer bundle. Document released-reader compatibility and gate producer cutover on reader availability and completion of the compiler migration window; preserve old pinned artifacts.
  • Compatibility coverage: Exercise both bundle shapes, unchanged cost choices, retired-goal errors, and missing or malformed required cost tables.

@lpcox lpcox changed the title [WIP] Retire cost-speed routing goal and accept cost-only table bundles Retire cost-speed routing with a backward-compatible cost-only reader Nov 18, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 05:32
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 05:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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",
@lpcox

lpcox commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Updated the explicit-cost-robust response to match the router’s cost-ranked response in 338f75d. The API proxy Jest suite could not be run because dependency installation failed (registry DNS/404 errors).

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Documentation has been built for this PR.

Download preview artifact

To view locally:

  1. Download the docs-preview-pr-11767 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit e934a3c

@lpcox

lpcox commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot merge main and resolve conflicts

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and resolve conflicts

Merged main cleanly with no conflicts. The two-parent merge commit is ba40033.

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot fix these failing ci checks https://github.com/github/gh-aw-firewall/actions/runs/44369487762/job/135032527911?pr=11767 and https://github.com/github/gh-aw-firewall/actions/runs/44369488177/...

Fixed in 46b8b0c. Router race tests and go vet pass; Jest and govulncheck were blocked by sandbox DNS, and CodeQL skipped analysis because the database exceeded its size limit.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 94.33% 94.33% ➡️ +0.00%
Statements 92.94% 92.94% ➡️ +0.00%
Functions 93.53% 93.53% ➡️ +0.00%
Branches 87.20% 87.21% ➡️ +0.01%
📁 Per-file Coverage Changes (2 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/host-executor-socket.ts 95.9% → 95.9% (+0.00%) 91.5% → 90.2% (-1.22%)
src/nvx/one-shot-process.ts 81.5% → 84.0% (+2.47%) 74.7% → 76.8% (+2.11%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@lpcox
lpcox merged commit c1d3c5c into main Nov 18, 2026
54 of 55 checks passed
@lpcox
lpcox deleted the copilot/retire-cost-speed-routing branch November 18, 2026 19:30
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.

Retire the cost-speed routing goal and accept cost-only table bundles

3 participants