Repository navigation
Define versioned model contracts and provider-qualified identity - #10310
Conversation
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Validation, alias matching, and pricing compatibility defects remain in the new contracts.
11 open issues
Preserve provider identity in legacy catalogue lookup · New Enforce overlay scope across records, rules, and providers · New Restrict central feeds to documented authority scope · New Return diagnostics for malformed records and identity failures · New Reject overlapping aliases under mixed normalization policies · New Align family exception logic between validator and matcher · New Preserve catalogue ID and version boundaries · New Map legacy null cache-write charges to zero · New Handle scientific notation and fractional thresholds in v1 · New Require conditions for conditional reasoning support · New Require conditions for conditional translations · New
What changed in this PR
Adds opt-in model-information contracts for ADR 0004 Gate 2 while leaving production consumers unchanged.
Changes:
- Introduces versioned schemas, fixtures, shared identity matching, and cross-record validation.
- Projects existing configured-catalogue pricing into canonical tariffs.
- Documents migration compatibility, additive
/reflectdata, and the unresolved workflow handoff.
| File | Description |
|---|---|
src/model-information-contract.test.ts |
Tests schemas, validation, and identity matching. |
shared/model-information/schema.v1.json |
Defines versioned model-information formats. |
shared/model-information/identity.js |
Implements provider-qualified identity and matching. |
shared/model-information/identity.d.ts |
Declares identity API types. |
shared/model-information/fixtures.v1.json |
Supplies representative contract fixtures. |
shared/model-information/contracts.js |
Implements validation and pricing projection. |
shared/model-information/contracts.d.ts |
Declares contract API types. |
docs/adr/0004-model-information-management.md |
Records compatibility and migration requirements. |
containers/api-proxy/model-information-contract.test.js |
Tests proxy interoperability and catalogue projection. |
Review effort: Max
| | Unversioned operator overlay | Exact dated cost wins before base prefix; a base can match specialized suffixes; queries do not match in Phase 1 fixtures. | Keep the open legacy reader; new strict overlays use deterministic exact/alias/family specificity with declared exclusions for specialized variants. | | ||
| | Configured shared catalogue | `AWF_MODEL_PRICING_CATALOG` v1 strips prefix/date, normalizes separators/case, uses configured provider aliases, selects long tier only when input tokens **exceed** threshold. Carries `shared_catalog`, ID and version; outranks complete runtime pricing. | Map to `configured_catalog` pricing authority, **not** fetched-feed authority. Preserve existing acceptance, provider aliases, component rates, threshold boundary and accounting. Never apply new strict-format rejection retroactively. | | ||
| | Fetched central feed | No corresponding Phase 1 loader exists. | Explicit source/revision, freshness, integrity and offline policy; price and harness only, below complete fresh runtime pricing and the existing configured catalogue. A failed custom source never triggers an unconfigured default. | | ||
| | Curated and `models.dev` | Curated precedes bundled import; `models.dev` retains case differences and provider identity, and rejects query suffixes. The same slug at another provider is not a match. | Use reviewed facts ahead of governed imports, with source revision and per-component provenance; no cross-provider slug match or imported availability. | |
| if (['overlay', 'importedSnapshot', 'centralFeed', 'resolvedExport'].includes(kind)) { | ||
| const errors = validateRecords(value.models, value.rules || []); |
| if (kind === 'centralFeed') { | ||
| for (const model of value.models) { | ||
| if (model.availability?.length || model.lifecycle.status !== 'active') { | ||
| errors.push(`Central feed cannot establish availability or lifecycle: ${model.identity.key}`); | ||
| } | ||
| } |
| const errors = []; | ||
| const keys = new Set(); | ||
| const lookups = new Set(); | ||
| const aliases = []; | ||
| for (const model of models) { | ||
| const validation = validate('model', model); | ||
| errors.push(...validation); | ||
| if (validation.length) continue; | ||
| const id = model.identity; | ||
| const expected = identity(id.provider, id.rawId); | ||
| if (id.key !== expected.key || id.lookupId !== expected.lookupId) { | ||
| errors.push(`Invalid identity projection: ${id.key}`); | ||
| } |
| const ambiguous = aliases.some(({ alias: prior, key }) => key !== id.key && | ||
| prior.scope.provider === alias.scope.provider && | ||
| prior.scope.channel === alias.scope.channel && | ||
| prior.scope.deployment === alias.scope.deployment && | ||
| [alias.match, prior.match].some(match => { | ||
| const options = { caseInsensitive: match === 'case-insensitive', separators: match === 'separators' }; | ||
| return normalizeId(alias.id, options) === normalizeId(prior.id, options); | ||
| })); |
| const provenance = { | ||
| authority: 'configured_catalog', | ||
| source: 'shared_catalog', | ||
| revision: `${resolution.pricingCatalogId}/${resolution.pricingCatalogVersion}`, |
| }; | ||
| const components = Object.fromEntries( | ||
| Object.entries(resolution.pricing).filter(([name]) => name !== 'threshold').map(([name, price]) => | ||
| [name, { price: price === null ? { unavailable: true } : String(price), provenance }]), |
| const components = Object.fromEntries( | ||
| Object.entries(resolution.pricing).filter(([name]) => name !== 'threshold').map(([name, price]) => | ||
| [name, { price: price === null ? { unavailable: true } : String(price), provenance }]), | ||
| ); | ||
| return { | ||
| scope: { provider: scope.provider, channel: scope.channel, ...(scope.deployment ? { deployment: scope.deployment } : {}) }, | ||
| currency: 'USD', unit: 'USD_PER_1M_TOKENS', tier: resolution.tier, | ||
| ...(resolution.tier === 'long_context' ? { promptTokensAbove: resolution.pricing.threshold } : {}), |
| "harnesses": { "type": "array", "items": { "$ref": "#/$defs/harness" } }, | ||
| "limits": { "type": "object", "properties": { "contextTokens": { "type": "integer", "minimum": 1 }, "outputTokens": { "type": "integer", "minimum": 1 }, "tokenizer": { "type": "string" }, "provenance": { "$ref": "#/$defs/provenance" } }, "required": ["provenance"], "additionalProperties": false }, | ||
| "modalities": { "type": "object", "properties": { "input": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "output": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "provenance": { "$ref": "#/$defs/provenance" } }, "required": ["provenance"], "additionalProperties": false }, | ||
| "reasoning": { "type": "object", "required": ["support", "rawEfforts", "selectableEfforts", "mode", "provenance"], "properties": { "support": { "$ref": "#/$defs/state" }, "condition": { "type": "string" }, "rawEfforts": { "type": "array", "items": { "type": "string" } }, "selectableEfforts": { "type": "array", "items": { "type": "string" } }, "default": { "type": "string" }, "mode": { "enum": ["optional", "required", "forbidden"] }, "requestFields": { "type": "object", "additionalProperties": { "type": "string" } }, "effortAliases": { "type": "object", "additionalProperties": { "type": "string" } }, "provenance": { "$ref": "#/$defs/provenance" } }, "additionalProperties": false }, |
| "modalities": { "type": "object", "properties": { "input": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "output": { "type": "array", "items": { "type": "string" }, "uniqueItems": true }, "provenance": { "$ref": "#/$defs/provenance" } }, "required": ["provenance"], "additionalProperties": false }, | ||
| "reasoning": { "type": "object", "required": ["support", "rawEfforts", "selectableEfforts", "mode", "provenance"], "properties": { "support": { "$ref": "#/$defs/state" }, "condition": { "type": "string" }, "rawEfforts": { "type": "array", "items": { "type": "string" } }, "selectableEfforts": { "type": "array", "items": { "type": "string" } }, "default": { "type": "string" }, "mode": { "enum": ["optional", "required", "forbidden"] }, "requestFields": { "type": "object", "additionalProperties": { "type": "string" } }, "effortAliases": { "type": "object", "additionalProperties": { "type": "string" } }, "provenance": { "$ref": "#/$defs/provenance" } }, "additionalProperties": false }, | ||
| "protocols": { "type": "array", "items": { "type": "object", "required": ["protocol", "support"], "properties": { "protocol": { "type": "string", "minLength": 1 }, "support": { "$ref": "#/$defs/fact" }, "features": { "type": "object", "additionalProperties": { "$ref": "#/$defs/fact" } } }, "additionalProperties": false } }, | ||
| "translations": { "type": "array", "items": { "type": "object", "required": ["from", "to", "revision", "support", "features"], "properties": { "from": { "type": "string", "minLength": 1 }, "to": { "type": "string", "minLength": 1 }, "revision": { "type": "string", "minLength": 1 }, "support": { "enum": ["supported", "lossy", "unsupported", "unknown", "conditional"] }, "features": { "type": "object", "additionalProperties": { "$ref": "#/$defs/fact" } } }, "additionalProperties": false } }, |
|
@copilot address review feedback |
|
@copilot for copilot models, the authoritative list of supported models is the URL https://docs.github.com/en/copilot/reference/ai-models/supported-models However, this document may lag changelog announcements of deprecation plans like blog posts https://github.blog/changelog/2026-09-18-upcoming-deprecation-of-selected-github-copilot-models-in-mid-october/ and https://github.blog/changelog/2026-10-15-upcoming-deprecation-of-selected-github-copilot-models-in-mid-november/ As part of maintaining model information, we should draw on these information sources. |
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Documented the supported-models reference as the current-support authority and changelog posts as supplemental evidence for reviewed, dated lifecycle changes. Added in 002ea7e. |
|
✅ Copilot review passed with no inline comments. @copilot Add the |
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit 263de17 |
✅ Coverage Check PassedOverall Coverage
Coverage comparison generated by |
|
✅ Smoke Gemini completed. All facets verified. 💎
|
Smoke Test: Copilot BYOK (Direct Mode) ✅
Status: PASS
|
|
EGRESS_RESULT allow=pass deny=pass
Overall: PASS — cc @lpcox
|
Smoke Test: Claude Engine Validation
Overall result: PASS
|
|
OTEL smoke results
|
|
Services smoke test: PASS
|
|
Smoke test (Copilot)
|
Smoke Test: Gemini Engine Validation
|
Chroot Version Comparison
Result: Not all tests passed (Node.js version mismatch), so the
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — PASS Notes: the Bun and Deno install scripts were blocked by the sandbox, so I installed both from npm instead. For .NET and Maven I used writable runtime and repository paths (
|
|
Smoke test:
|

ADR 0004 Gate 2 needs a canonical model contract without silently changing the host and proxy behaviors characterized in Phase 1. The existing configured pricing catalogue must also retain its authority above runtime pricing, distinct from a future fetched feed.
/reflectendpoint. Production consumers remain unchanged.Open dependency: The workflow-frontmatter-to-AWF-config payload still requires agreement with
github/gh-aw; the ADR records this as a blocker rather than declaring a one-sided format final.