Skip to content

feat: activate canonical pricing fallback sources - #11117

Merged
lpcox merged 2 commits into
mainfrom
lpcox-canonical-pricing-sources
Nov 5, 2026
Merged

lpcox merged 2 commits into
mainfrom
lpcox-canonical-pricing-sources

Conversation

@lpcox

@lpcox lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to merged #11113. Activate the remaining canonical fallback inputs without a shadow/parity waiting stage. Relates to #10295 and #10290; neither tracking issue is closed by this PR.

  • Keep shared/model-information/pricing-resolution.js::resolvePricing authoritative for source priority, tier selection, accounting and priceability. Replace the active guard's legacy curated/bare-slug imports with the existing catalogue-pricing.js adapter.
  • Read maintained rates from model-information.pricing.generated.json, generated from active shared/model-information/sources/copilot-*.json records. All 42 Copilot rate records and both long-context tiers are unchanged; no target.json tariff, promotion or successor is activated.
  • Generate and distribute model-information.fallback-pricing.generated.json from the governed import and explicit native compatibility associations. Include it in Docker, npm packaging and updater proposal validation. No independently authored price table or new runtime loader.
  • Scope the pinned OpenRouter import to pricing-provider identity openrouter plus full publisher-qualified wire IDs. Publisher namespaces are not native billing backends. Preserve exact-ID precedence and source-local separator/date normalization; namespaces match exactly, ambiguous matches fail explicitly, and remote refresh cannot rename requests, change backends or establish availability.
  • Preserve 16 native OpenAI/Anthropic associations as legacy_native_compatibility policy, not verified/current native billing evidence: the existing 12-model reference plus four explicit historical native guard fixtures. Keep original provenance; test dates do not refresh tariffs. No runtime provider adapter is needed to recognize a supported custom pricing-provider identity.
  • Preserve operator/configured/runtime/central precedence, partial-provider merging, strict context thresholds, BYOK/channel/deployment boundaries, revision/request/connection pinning, configured defaults, selector ceilings, unknown sentinel, recovery, opt-outs, budget guards and sanitized accounting-error dispatch blocking. Historical adapters remain for unrelated consumers.

Explicit charge and coverage changes

The raw pinned import contains 455 rows: 429 accepted and 26 rejected by the governed importer. For 429 exact qualified OpenRouter IDs, 426 default four-component rate vectors are unchanged. The other three changes and two tier corrections are intentional and documented, not hidden migration details:

OpenRouter wire ID Before After
openai/gpt-4o-2024-05-13 Bare/date-folded collision: input $2.50, cached input $1.25, output $10 per million Exact dated ID: $5, $0.50, $15. One million fresh input plus one million output: 1,250 → 2,000 credits.
google/gemini-2.5-pro Curated cache write null; no cache-write charge Imported $0.375/M cache write: 0 → 37.5 credits/M cache-write tokens.
google/gemini-3.5-flash Curated cache write null; no cache-write charge Imported $0.0833333333333333/M: 0 → 8.333333 credits/M after existing rounding.
anthropic/claude-haiku-5.5 above 100,000 prompt tokens Inherited Copilot long tier Applicable imported flat rates. At 100,001 fresh input tokens: 5.00005 → 1.00001 credits. Copilot/native compatibility tiers remain unchanged.
openai/gpt-6.1-sol above 272,000 prompt tokens Inherited Copilot long tier Applicable imported flat rates. At 272,001 fresh input tokens: 108.8004 → 54.4002 credits. Copilot/native compatibility tiers remain unchanged.

Unreviewed canonical_slug aliases are not promoted to pricing identities: 39 distinct aliases associated with accepted rows no longer resolve after retained normalization. In particular, openai/gpt-4-turbo:batch remains priced but cannot assign its batch rate to the base openai/gpt-4-turbo ID. Same-slug prices are no longer borrowed by Copilot, native APIs, arbitrary custom/compatible backends or omitted providers. Additional native coverage requires explicit source association/evidence, not manufacturer inference.

Unpriced behavior is unchanged: concrete unpriced requests warn and can proceed; their usage is excluded from AI-credit totals, so enforcement can undercount spending. This is not execution admission. Explicit operator/configured tariffs or configured default pricing remain available. Missing cache-read prices retain the explicit legacy 10%-of-input policy; missing cache write remains null; genuine zero is distinct from missing/null required components. Nonrepresentable imported prices error rather than becoming free.

Validation

  • npm run models:generate and npm run models:check — passed; canonical revision b50272501bad3e9a6d687bfdf3940b0d0e72996084240a82bab525f0627f023c.
  • npm run build, npm run type-check and pre-commit npm run lint — passed. Lint reports existing warnings, zero errors.
  • Canonical/shared/compiler/import/publication/maintenance selection: 132 tests passed. Final host/shared/compiler selection: 53 tests passed (overlapping suites, not additive).
  • Full API-proxy suite: 141 suites passed; 3,273 tests passed, 2 skipped.
  • Four provider-free packaged smoke executions: off-tree Docker application layout and extracted npm package, each with shipped sources and compiler-generated fixture sources. Zero network calls in every run. Fixture source edits demonstrably change actual HTTP/WebSocket charges without editing the historical table. Coverage includes real budgets, overrides, complete/partial components, native/custom/Copilot scope, same-slug namespaces, exact/date precedence, ambiguity, both strict tier boundaries, missing/zero/null and numeric underflow, explicit shipped charge deltas, and refresh-pinned charges/revisions.
  • Related Markdown lint and git diff --check — passed.

No live provider inference, workflow dispatch, extra container/guest/VM runs or merge was performed. Automatic PR CI is expected.

Remaining limitations

Exact-decimal accounting remains next. Generalized compatible assembled tariffs, all promotions/successors/non-token charges, broader reasoning/export migrations, feed harness constraints and runtime/VM/compiler-overlay redesign are out of scope. Imported rates are pinned fallback evidence, not current native tariffs or availability assertions. This does not complete Phase 5 or the parent migration.

See docs/model-catalogue-publication.md and ADR 0004 for the source-authority path, detailed deltas and limitations.

Implementation head: 84819819bec3abb6825f0548e766bb8eba32c45a.

Use generated maintained rates and governed backend-scoped OpenRouter imports.

Preserve native legacy compatibility policy and verify packaged accounting paths.

Co-authored-by: Copilot App <[email protected]>
Copilot AI adaptive review requested due to automatic review settings November 4, 2026 22:01
@github-actions

github-actions Bot commented Nov 4, 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-11117 artifact from the workflow run
  2. Unzip and open index.html in your browser

Built from commit bc5f9e0

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 new projection is missing from both workflow safe-output allowlists, causing the projection-coverage test to fail and preventing maintenance proposals from including the required generated output.

1 open issue
What changed in this PR

This PR activates canonical fallback pricing for AWF’s shared AI-credit resolver, replacing legacy guard lookups while keeping pricing separate from execution eligibility.

Changes:

  • Uses generated maintained rates, scoped OpenRouter imports, and explicit native compatibility associations.
  • Extends compiler validation, packaged assets, and provider-free HTTP/WebSocket accounting coverage.
  • Documents intentional charge changes, narrowed coverage, and unchanged unpriced-request behavior.
File Description
shared/​model-information/​target.generated.json Updates the staged target revision.
shared/​model-information/​sources/​pricing-reference.json Declares native compatibility policy and associations.
shared/​model-information/​manifest.generated.json Updates compiler version and catalogue revision.
shared/​model-information/​catalog.generated.json Updates the catalogue revision.
shared/​model-information/​baseline-to-target.generated.json Updates the staged comparison revision.
scripts/​model-information/​publication.test.ts Includes the fallback projection in publication fixtures.
scripts/​model-information/​maintain.cjs Adds the fallback projection to maintenance validation.
scripts/​model-information/​compile.test.ts Tests active projections and unsupported tariff rejection.
scripts/​model-information/​compile.cjs Generates scoped imports and native compatibility pricing.
scripts/​ci/​smoke-pricing-resolution.cjs Expands charge, scope, tier, and budget smoke checks.
docs/​model-catalogue-publication.md Explains activation, charge deltas, and limitations.
docs/​adr/​0004-model-information-management.md Records the canonical fallback migration.
containers/​api-proxy/​token-tracker.copilot-sdk-model.test.js Makes Copilot accounting fixtures provider-explicit.
containers/​api-proxy/​server.websocket.test.js Uses explicitly associated native pricing for budget checks.
containers/​api-proxy/​models-dev-catalog.js Labels the adapter as historical in comments.
containers/​api-proxy/​model-metadata-characterization.test.js Updates provider-scoped fallback expectations.
containers/​api-proxy/​guards/​pricing-resolution.test.js Tests scoped matching, tiers, and revision metadata.
containers/​api-proxy/​guards/​ai-credits-guard.test.js Updates provider scope and accounting expectations.
containers/​api-proxy/​guards/​ai-credits-guard.js Switches active fallback lookups to canonical adapters.
containers/​api-proxy/​Dockerfile Ships the generated fallback pricing asset.
containers/​api-proxy/​catalogue-proxy.test.js Exercises packaged accounting with compiler-generated fixtures.
containers/​api-proxy/​catalogue-pricing.js Adds maintained and provider-scoped imported pricing adapters.
containers/​api-proxy/​body-handler.test.js Makes credit-warning fixtures provider-explicit.
containers/​api-proxy/​ai-credits-pricing.js Updates comments to direct active rate authoring to canonical sources.

Review effort: Max (auto)

'shared/model-information/baseline-to-target.generated.json',
'src/model-information.compat.generated.json',
'containers/api-proxy/model-information.pricing.generated.json',
'containers/api-proxy/model-information.fallback-pricing.generated.json',

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.

Added the fallback-pricing projection to both safe-output allowlists and regenerated the workflow lock. Commit: fb39172.

@lpcox

lpcox commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator Author

@copilot address review feedback

Copilot AI commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

@copilot address review feedback

Addressed the review feedback and published the fix in fb39172.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

⏳ Copilot review left inline comments.

@lpcox To proceed:

  1. Ask @copilot to address the review feedback (reply to this comment or the review thread)
  2. Once the fix is pushed, add the ready-for-aw label to trigger agentic CI smoke tests

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.74% 93.77% 📈 +0.03%
Statements 92.29% 92.32% 📈 +0.03%
Functions 93.06% 93.07% ➡️ +0.01%
Branches 86.50% 86.56% 📈 +0.06%
📁 Per-file Coverage Changes (8 files)
File Lines (Before → After) Statements (Before → After)
src/enclave/docker-host-executor.ts 95.5% → 95.2% (-0.24%) 89.7% → 89.7% (+0.00%)
src/services/enclave-mcp-service.ts 97.2% → 97.2% (+0.02%) 97.3% → 97.3% (+0.02%)
src/cloud-hypervisor/enclave-artifact-manifest.ts 99.2% → 99.2% (+0.03%) 99.2% → 99.2% (+0.03%)
src/enclave/preflight.ts 92.2% → 92.4% (+0.19%) 92.6% → 92.8% (+0.18%)
src/cloud-hypervisor/enclave-invocation-staging.ts 94.7% → 95.4% (+0.65%) 93.1% → 93.9% (+0.83%)
src/cloud-hypervisor/artifact-manifest.ts 90.9% → 91.6% (+0.66%) 90.9% → 91.6% (+0.66%)
src/nvx/artifact-manifest.ts 88.4% → 90.0% (+1.60%) 88.4% → 90.0% (+1.60%)
src/cloud-hypervisor/enclave-session-diagnostics.ts 95.7% → 98.4% (+2.71%) 94.1% → 97.3% (+3.20%)

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

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing is starting OTel tracing validation...

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🪪 Smoke Copilot BYOK AOAI (Entra) is testing Azure OpenAI BYOK (Entra / GitHub OIDC) mode on this pull request...

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #11117

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #11117

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot BYOK AOAI (api-key) is testing Azure OpenAI BYOK (api-key) mode on this pull request...

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

💎 Smoke Gemini is crystallizing results on this pull request...

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services is testing service connectivity for this pull request...

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode)

✅ 1. GitHub MCP — PR list matches pre-fetched data
✅ 2. GitHub.com HTTP — 200 OK
✅ 3. File I/O — smoke test marker exists and readable
✅ 4. BYOK Inference — Direct BYOK mode via api-proxy → api.githubcopilot.com

Status: PASS — Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY)

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)

Overall: PASS

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia ✅ 1/1 passed ✅ PASS
Bun hono ✅ 1/1 passed ✅ PASS
C++ fmt ✅ N/A ✅ PASS
C++ json ✅ N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world ✅ N/A ✅ PASS
.NET json-parse ✅ N/A ✅ PASS
Go color ✅ ok ✅ PASS
Go env ✅ ok ✅ PASS
Go uuid ✅ ok ✅ PASS
Java gson ❌ 0/0 (not run) ❌ FAIL
Java caffeine ❌ 0/0 (not run) ❌ FAIL
Node.js clsx ✅ passed ✅ PASS
Node.js execa ✅ passed ✅ PASS
Node.js p-limit ✅ passed ✅ PASS
Rust fd ✅ 1/1 passed ✅ PASS
Rust zoxide ✅ 1/1 passed ✅ PASS

Overall: 7/8 ecosystems passed — FAIL

Failure details

Java (gson, caffeine): mvn compile failed resolving maven-resources-plugin:3.4.0 from Maven Central: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty. The JVM truststore is empty in this environment. The first attempt also hit LocalRepositoryNotAccessibleException for ~/.m2, so I retried with an alternate local repo.

.NET note: the first run failed on NuGet's mutex because /run/user/1001 was missing. It passed after setting XDG_RUNTIME_DIR.

The build-test label was not added because of the Java failures.

Generated by Build Test Suite for #11117 · copilot · auto · ~26 AIC · ⊞ 5.7K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #11117 · claude · haiku45 · ~35 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot: PASS

  • ✅ GitHub MCP (latest PR: "Increase Test Coverage Reporter agent timeout to 30 minutes")
  • ✅ GitHub.com connectivity (200)
  • ✅ File write/read

Author: @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed domain (api.github.com → 200)
  • ✅ Blocked domain (example.com blocked)

Overall: PASS — cc @lpcox

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor
  • fix: prepare Claude smoke images before agent execution ✅
  • feat: cut over to authoritative shared pricing resolution ✅
  • GitHub PR details ✅
  • Playwright title check ❌
  • File write/read ✅
  • Build AWF ✅
  • Overall status: FAIL

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.15 Python 3.12.15 ✅ YES
Node.js v24.22.1 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Result: Not all tests passed (Node.js mismatch), so the smoke-chroot label was not added. The chroot Node version (v2.98.0) looks unusual and may come from a different node binary on the chroot PATH.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@lpcox
lpcox enabled auto-merge (squash) November 5, 2026 00:52
@lpcox
lpcox merged commit bab29c7 into main Nov 5, 2026
135 of 147 checks passed
@lpcox
lpcox deleted the lpcox-canonical-pricing-sources branch November 5, 2026 00:54

This branch had an error being deployed

1 failed deployment
aoai-model — fb39172c Deployed Nov 5, 2026 by lpcox via conclusion #2258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants