Skip to content

Automate reviewed Copilot price maintenance and honor promotion expiry - #11227

Merged
lpcox merged 15 commits into
mainfrom
copilot/automate-copilot-price-maintenance
Nov 7, 2026
Merged

lpcox merged 15 commits into
mainfrom
copilot/automate-copilot-price-maintenance

Conversation

Copilot AI commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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

    • Capture Copilot price tables and attached footnotes with URL, hash, and timestamp.
    • Propose exact components and thresholds; preserve unavailable cache-write values, report incomplete evidence, and avoid unchanged-fact churn.
    • Reconcile only the fulfilled Gemini Flash staged pricing correction.
  • Bounded promotion support

    • Preserve and select dated tariffs and separately evidenced successors.
    • Expire promotional rates without inventing successors or retaining them as median donors.
    • Preserve higher-priority pricing, admission policy, and model eligibility.
  • Reviewed data-only delivery

    • Add the fixed maintenance command and regenerated workflow lock.
    • Retain sealed evidence, independent validation, single-PR deduplication, and data-only output restrictions.

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.

Copilot AI changed the title [WIP] Fix automate Copilot published-price maintenance and fill missing tariffs Automate reviewed Copilot price maintenance and honor promotion expiry Nov 6, 2026
Copilot AI requested a review from lpcox November 6, 2026 23:55
@lpcox
lpcox marked this pull request as ready for review November 6, 2026 23:55
Copilot AI adaptive review requested due to automatic review settings November 6, 2026 23:55

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

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
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)

Comment on lines +64 to +73
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;
Comment on lines +72 to +74
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];
Comment thread scripts/model-information/compile.cjs Outdated
}
referenceNames.add(name);
const rate = pricing[name];
if (rate.tariffs) throw new Error(`pricing-reference.json: dated Copilot tariff cannot author native compatibility: ${name}`);
Comment on lines +14 to +17
'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]],
Comment on lines +235 to +241
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];
}
}
Comment on lines +272 to +273
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'] }));
Comment thread scripts/model-information/maintain.cjs Outdated
Comment on lines +472 to +474
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 }))));
Comment thread scripts/model-information/maintain.cjs Outdated
Comment on lines +491 to +492
if (!expected || json(expected) !== afterBytes.toString('utf8') ||
expectedEvidence.some(receipt => !claim.evidence.some(item => json(item) === json(receipt)))) {
@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback and fix any 'npm test' failures

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@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: a853411. CodeQL returned no alerts but skipped analysis because the database was too large.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

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

@github-actions

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

Built from commit 135f14c

…racter sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

⚠️ Coverage Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

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

@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@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 b636511b by preserving attempt/runtime metadata on the final projected progress event after the event cap. The targeted suite passed (212 tests) and full npm test passed (564 suites, 12,333 tests).

Comment thread scripts/model-information/maintain.cjs Resolved
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

Comment thread scripts/model-information/maintain.cjs Resolved
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>
Comment thread scripts/model-information/maintain.cjs Resolved
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@lpcox

lpcox commented Nov 7, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

Comment thread scripts/model-information/maintain.cjs Resolved
lpcox and others added 2 commits November 6, 2026 18:11
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

Copilot AI commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main, resolved the diagnostics conflicts, and published merge commit 8bc4b4c. I also incorporated the latest remote branch fixes; the full root test suite passes (565 suites, 12,413 passed, 74 skipped).

}
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);
Copilot AI added 2 commits November 7, 2026 02:26
…aintenance' into copilot/automate-copilot-price-maintenance

# Conflicts:
#	scripts/ci/collect-enclave-smoke-debug.test.ts

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main and resolved the diagnostic conflicts, then incorporated the concurrent PR updates. Merge commit: 5c4adb9.

@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 the diagnostic projection and pricing capture regressions; full root npm test passes (565 suites, 12,413 passed, 74 skipped). Published in 5c4adb9.

@copilot merge main and resolve conflicts

Merged main and resolved the diagnostic conflicts, then incorporated the concurrent PR updates. Merge commit: 5c4adb9.

@lpcox
lpcox merged commit b0bcf21 into main Nov 7, 2026
37 of 39 checks passed
@lpcox
lpcox deleted the copilot/automate-copilot-price-maintenance branch November 7, 2026 06:16
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.

Automate Copilot published-price maintenance and fill four missing Copilot tariffs

4 participants