Repository navigation
Automate reviewed Copilot price maintenance and honor promotion expiry - #11227
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can undercharge reasoning tokens and misresolve dated tariffs, while compilation and CI blockers prevent the intended data-only pricing updates.
8 open issues
Use the active successor threshold for long-context pricing · New Apply provider-selected tiers when checking dated tariff eligibility · New Decouple maintained Copilot tariffs from legacy price projections · New Remove the fixed catalogue count from the pricing smoke test · New Reconcile reasoning rates when output prices increase · New Support short receipts and locate models by declared column · New Compare tariff-bearing records by model ID · New Validate tariff and Flash changes independently from other edits · New
What changed in this PR
Extends AWF’s reviewed model-information maintenance pipeline to capture Copilot billing evidence and handle dated fallback tariffs. The four missing model prices remain inactive pending a separate reviewed data-only PR.
Changes:
- Capture Copilot pricing tables and promotion footnotes, then generate evidence-backed tariff proposals.
- Add promotion-aware compilation and runtime selection while preserving higher-priority pricing.
- Extend approved maintenance commands, workflow validation, fixtures, and regression coverage.
| File | Description |
|---|---|
shared/model-information/target.generated.json |
Refreshes the staged catalogue revision. |
shared/model-information/manifest.generated.json |
Records compiler version 7 and the new revision. |
shared/model-information/catalog.generated.json |
Refreshes the maintained catalogue revision. |
shared/model-information/baseline-to-target.generated.json |
Refreshes the comparison revision. |
scripts/model-information/publication.test.ts |
Generalizes checks excluding staged-only models. |
scripts/model-information/maintenance-sources.json |
Adds the official Copilot billing source. |
scripts/model-information/maintenance-command.test.ts |
Tests approved pricing-refresh and validation commands. |
scripts/model-information/maintenance-command.cjs |
Exposes the fixed pricing-refresh command. |
scripts/model-information/maintain.test.ts |
Covers captures, proposals, no-op behavior, and verification. |
scripts/model-information/maintain.cjs |
Integrates pricing proposals, receipts, and independent validation. |
scripts/model-information/fixtures/copilot-promotion-contract.v1.json |
Separates successor-mechanics tests from published evidence. |
scripts/model-information/fixtures/copilot-pricing-negative.v1.json |
Defines retrieval and incomplete-evidence failures. |
scripts/model-information/fixtures/copilot-pricing-2026-11-06.html |
Preserves billing rows and attached promotion footnotes. |
scripts/model-information/fixtures/copilot-pricing-2026-11-06.capture.json |
Records source URLs, capture times, and hashes. |
scripts/model-information/fixtures/copilot-models-2026-11-06.html |
Preserves matching GA model documentation. |
scripts/model-information/copilot-pricing.cjs |
Extracts evidence and plans canonical tariff updates. |
scripts/model-information/compile.test.ts |
Tests dated projections, successors, and strict thresholds. |
scripts/model-information/compile.cjs |
Preserves dated tariffs in maintained pricing projections. |
scripts/ci/model-api-mapping-updater-workflow.test.ts |
Checks pricing commands and data-only boundaries. |
docs/adr/0004-model-information-management.md |
Documents promotion expiry and subsequent fallback behavior. |
containers/api-proxy/test-helpers/copilot-pricing-fixture.js |
Builds fixture-backed tariff projections for tests. |
containers/api-proxy/model-information.fallback-pricing.generated.json |
Refreshes the fallback catalogue revision. |
containers/api-proxy/guards/ai-credits-guard.test.js |
Covers charges, budgets, pricing priority, and expiry. |
containers/api-proxy/guards/ai-credits-guard.js |
Passes scope, token count, and time into maintained pricing. |
containers/api-proxy/catalogue-pricing.test.js |
Tests intervals, successors, and median-donor eligibility. |
containers/api-proxy/catalogue-pricing.js |
Adds dated maintained-tariff selection. |
.github/workflows/model-api-mapping-updater.md |
Adds pricing-maintenance guidance and validation coverage. |
.github/workflows/model-api-mapping-updater.lock.yml |
Regenerates output permissions and validation commands. |
Review effort: Max (auto)
| const effective = tariff => !tariff.effectiveFrom || Date.parse(tariff.effectiveFrom) <= time; | ||
| // Match the shared resolver: an expired long tier cannot become a base rate. | ||
| const requiresLong = scoped.some(tariff => tariff.tier === 'long_context' && | ||
| tokens > tariff.promptTokensAbove && effective(tariff)); | ||
| const active = scoped.filter(tariff => effective(tariff) && | ||
| (!tariff.effectiveUntil || Date.parse(tariff.effectiveUntil) > time)); | ||
| const base = active.filter(tariff => tariff.tier !== 'long_context'); | ||
| const long = active.filter(tariff => tariff.tier === 'long_context'); | ||
| const eligibleLong = long.filter(tariff => tokens > tariff.promptTokensAbove); | ||
| if ((requiresLong ? eligibleLong : base).length !== 1) return null; |
| const eligibleLong = long.filter(tariff => tokens > tariff.promptTokensAbove); | ||
| if ((requiresLong ? eligibleLong : base).length !== 1) return null; | ||
| const selected = base.length === 1 ? base[0] : eligibleLong[0]; |
| } | ||
| referenceNames.add(name); | ||
| const rate = pricing[name]; | ||
| if (rate.tariffs) throw new Error(`pricing-reference.json: dated Copilot tariff cannot author native compatibility: ${name}`); |
| 'GPT-6.1 Terra': ['gpt-6.1-terra', sourceFiles[0]], | ||
| 'Gemini 3.8 Flash': ['gemini-3.8-flash', sourceFiles[2]], | ||
| 'Gemini 4 Argon': ['gemini-4-argon', sourceFiles[2]], | ||
| 'MAI-Code-1.1-Flash': ['mai-code-1.1-flash', sourceFiles[3]], |
| if (old.length) { | ||
| candidate.components = { ...old[0].components, ...candidate.components }; | ||
| for (const component of components) { | ||
| if (JSON.stringify(semanticTariff(old[0]).components[component]) === | ||
| JSON.stringify(observedRow.prices[component])) candidate.components[component] = old[0].components[component]; | ||
| } | ||
| } |
| const gaQuote = supported.flatMap(table => table.rows).find(row => row.cells[0] === name)?.quote; | ||
| modelReceipts.push(receipt(modelsCapture, gaQuote, { model: id, fields: ['identity', 'lifecycle', 'modelType'] })); |
| const copilotTariffsChanged = copilotPricing.sourceFiles.includes(file) && | ||
| json(facts((before.models || []).map(model => ({ id: model.identity.rawId, tariffs: model.tariffs })))) !== | ||
| json(facts((after.models || []).map(model => ({ id: model.identity.rawId, tariffs: model.tariffs })))); |
| if (!expected || json(expected) !== afterBytes.toString('utf8') || | ||
| expectedEvidence.some(receipt => !claim.evidence.some(item => json(item) === json(receipt)))) { |
|
@copilot address review feedback and fix any 'npm test' failures |
Addressed all eight review findings with regression coverage and fixed the publication fixture. Validation passed: full root suite (564 suites, 12,331 passed, 74 skipped), full API-proxy suite (143 suites, 3,406 passed, 2 skipped), and targeted pricing/maintenance/publication checks. Commit: |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 135f14c |
…racter sanitization' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 93.75% | 93.74% | 📉 -0.01% |
| Statements | 92.28% | 92.27% | 📉 -0.01% |
| Functions | 93.02% | 93.02% | ➡️ +0.00% |
| Branches | 86.55% | 86.54% | ➡️ -0.01% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/nvx/one-shot-process.ts |
84.0% → 81.5% (-2.47%) | 76.8% → 74.7% (-2.11%) |
src/enclave/host-executor-server.ts |
91.2% → 91.2% (+0.00%) | 90.1% → 89.8% (-0.29%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
|
@copilot fix the failing ci check. make sure that 'npm test' runs without any failures https://github.com/github/gh-aw-firewall/actions/runs/42322250980/job/128249299969?pr=11227 |
Fixed in |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot merge main and resolve conflicts |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
@copilot merge main and resolve conflicts |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Merged |
| } | ||
| return null; | ||
| }; | ||
| captured.pricing = normalizePricingForAgent(safePricing); |
Close the final-event test and align artifact assertions with intentional progress metadata redaction. Co-authored-by: Copilot App <[email protected]>
| } | ||
| return null; | ||
| }; | ||
| captured.pricing = normalizePricingForAgent(safePricing); |
…aintenance' into copilot/automate-copilot-price-maintenance # Conflicts: # scripts/ci/collect-enclave-smoke-debug.test.ts
Merged
Fixed the diagnostic projection and pricing capture regressions; full root
Merged |


Maintenance omitted GitHub’s Copilot billing page, leaving four GA tariffs without maintained fallback coverage. Maintained-price compilation and consumption also lacked promotion-aware selection.
Evidence-backed proposals
Bounded promotion support
Reviewed data-only delivery
Rollout: This PR prepares proposals for GPT-6.1 Terra, Gemini 3.8 Flash, Gemini 4 Argon, and MAI-Code 1.1 Flash; it does not activate their canonical prices. After merge, dispatch maintenance on main, review its data-only PR, then verify downstream against an AWF artifact containing the merged tariffs.