Repository navigation
feat: cut over to authoritative shared pricing resolution - #11113
Merged
Merged
Conversation
Capture reached pricing facts once and compare shared tariff selection. Preserve legacy charges, guards, source matching and request pins. Refs #11111 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit bbde513 |
Contributor
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
7 tasks done
Cut over real accounting and priceability to the shared resolver. Reuse lazy source facts, preserve override policy and request pins, and surface resolver failures without legacy fallback or free prices. Validate distributed proxy files with provider-free accounting smokes. Refs #11111 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The shadow comparison misses component-source, tier, and provenance disagreements and cannot independently validate central-pricing exclusions for BYOK or custom-target requests.
No open issues 🎉
What changed in this PR
Adds the first bounded Phase 5 pricing-shadow comparison to AWF’s shared model-information subsystem. The existing resolver remains authoritative for prices, accounting, warnings, and budgets.
Changes:
- Adds a pure shared pricing candidate and generated host/proxy contracts.
- Captures reached source facts and emits bounded, sanitized comparison diagnostics.
- Adds parity and WebSocket pricing-pin coverage, and documents remaining migration gates.
| File | Description |
|---|---|
src/model-information-pricing-resolution.test.ts |
Tests shared selection semantics and generated asset equality. |
src/model-information-contract/pricing-resolution.js |
Generated host pricing candidate. |
src/model-information-contract/pricing-resolution.d.ts |
Generated host pricing declarations. |
shared/model-information/pricing-resolution.js |
Implements candidate resolution and sanitized result comparison. |
shared/model-information/pricing-resolution.d.ts |
Defines captures, source facts, results, and provenance contracts. |
scripts/model-information/compile.cjs |
Distributes pricing contracts through canonical generation. |
docs/adr/0004-model-information-management.md |
Documents shadow-only scope and remaining Phase 5 gates. |
containers/api-proxy/runtime-model-catalog.js |
Observes provider tariffs and tier provenance. |
containers/api-proxy/provider-pricing-overlays.js |
Observes normalized operator pricing. |
containers/api-proxy/model-pricing-catalog.js |
Observes configured tariffs and catalogue metadata. |
containers/api-proxy/guards/pricing-shadow.test.js |
Covers parity, accounting preservation, and diagnostic bounds. |
containers/api-proxy/guards/pricing-shadow.js |
Runs shadow comparisons and deduplicates diagnostics. |
containers/api-proxy/guards/ai-credits-guard.js |
Integrates source capture while retaining legacy pricing authority. |
containers/api-proxy/catalogue-proxy.test.js |
Adds WebSocket pinning and packaged-context diagnostic checks. |
containers/api-proxy/catalogue-pricing.js |
Exposes reached central records for comparison. |
containers/api-proxy/catalogue-contract/pricing-resolution.js |
Generated proxy pricing candidate. |
containers/api-proxy/catalogue-contract/pricing-resolution.d.ts |
Generated proxy pricing declarations. |
Review effort: Max (auto)
This was referenced Nov 4, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User-directed cutover
This revision supersedes the initial shadow-only proposal. The user explicitly approved authoritative cutover in this same PR, preserving operator overrides and honest unpriced-model behavior, validated with deterministic regressions and provider-free smoke tests.
Authoritative path
AI-credit accounting / priceability -> source fact adapters -> shared resolvePricing -> selected tariff -> real charges / budget guards.shared/model-information/pricing-resolution.js::resolvePricing, generated into host/proxy contract assets, now drives real prices, charges and priceability. The legacy selection path and shadow comparison code are removed; there is no silent legacy fallback.Intentional changes and failure behavior
pricing_resolution_errorand surface explicitly; no invented price, free usage or fallback to the removed resolver.pricing_error, and subsequent dispatch is blocked until proxy restart/repair. Already-running responses cannot be recalled; recorded charges are not fabricated or retroactively adjusted.The existing stale-complete-provider fallback quirk, runtime-selected fallback tier and legacy import slug/case/prefix policy are preserved, not silently corrected. Cross-provider import collisions remain explicit fixtures.
Validation and provider-free smoke results
scripts/ci/smoke-pricing-resolution.cjsruns actual distributed proxy/accounting modules from both the off-tree Docker application context and an extracted npm package. Both passed with zero network calls enforced by network tripwires.models:generate/models:check, build, type-check, single-file bundle, ADR Markdown lint and whitespace checks passed. Canonical pricing data/catalogue revision remains unchanged.No live provider inference, label, workflow dispatch, container/VM execution or harness activation was performed.
Remaining concrete limitations
This cutover does not wait for or claim completion of exact-decimal accounting; general compatible assembled tariffs across units/currency/token ranges/effective dates; promotion/successor/non-token handling; provider-qualified governed-import activation; broader consumer migration; or release/live-environment evidence. Source adapters retain their legacy matching policy. Staged target-price corrections, production harness constraints and runtime invocation remain unchanged.
Closes #11111.
Parent tracking only: #10295 and #10290 remain open.