Skip to content

Compile reviewed model records into deterministic compatibility projections - #10317

Open
lpcox with Copilot wants to merge 9 commits into
mainfrom
copilot/adr-0004-phase-3-deterministic-projections
Open

lpcox with Copilot wants to merge 9 commits into
mainfrom
copilot/adr-0004-phase-3-deterministic-projections

Conversation

Copilot AI commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Model facts were maintained across host, proxy, and documentation files, while the endpoint updater could change a mapping copy independently. This PR introduces governed sources and offline compilation without activating the later resolver migrations.

  • Sources and imports

    • Add Copilot-qualified maintained records and a pinned, provider-qualified legacy catalogue snapshot. Record its repository capture and content hash without claiming an upstream retrieval date or license.
    • Stage the named pricing, availability, reasoning, and context corrections separately from the legacy baseline.
  • Projections and ownership

    • Generate the mapping copies, compatibility assets, static catalogues, revision manifest, and machine-readable baseline-to-target diff from reviewed sources.
    • Add CI stale-output detection. Contributors can update and verify projections with:
      npm run models:generate
      npm run models:check
  • Updater and activation boundary

    • Make the endpoint updater manual and read-only until a source-aware updater is available.
    • Keep live host validation, pricing, retirement, and import fallback behavior unchanged; the staged corrections remain for the later consumer migration gates.

Copilot AI changed the title [WIP] Implement ADR 0004 phase 3 for deterministic projections Compile reviewed model records into deterministic compatibility projections Oct 20, 2026
Copilot AI requested a review from lpcox October 20, 2026 00:48
@lpcox
lpcox marked this pull request as ready for review October 20, 2026 03:41
Copilot AI max review requested due to automatic review settings October 20, 2026 03:41

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 compiler correctness, pricing-provenance, workflow permissions, and ineffective test assertions block approval.

7 open issues
What changed in this PR

Introduces governed model sources and deterministic offline compilation for compatibility projections, while deferring live resolver migrations.

Changes:

  • Adds reviewed records, pinned legacy imports, and staged model corrections.
  • Generates compatibility assets, catalogues, manifests, and diffs with CI freshness checks.
  • Moves the endpoint updater to manual review and documents ownership boundaries.
File Description
src/​model-information.compat.generated.json Host support and retirement projection.
shared/​model-information/​sources/​target.json Staged model corrections.
shared/​model-information/​sources/​pricing-reference.json Pricing-reference coverage and provenance.
shared/​model-information/​sources/​mapping.json Maintained endpoint-mapping source.
shared/​model-information/​sources/​copilot-other.json Additional Copilot model records.
shared/​model-information/​sources/​copilot-gemini.json Copilot Gemini records.
shared/​model-information/​manifest.generated.json Revision, source, and import metadata.
shared/​model-information/​import-legacy-snapshot.js Pinned legacy catalogue importer.
shared/​model-information/​import-legacy-snapshot.d.ts Importer type declarations.
scripts/​model-information/​import.test.ts Import integrity and normalization tests.
scripts/​model-information/​compile.test.ts Compiler, projection, and packaging tests.
scripts/​model-information/​compile.cjs Offline compiler, validation, and stale-output detection.
scripts/​ci/​model-api-mapping-updater-workflow.test.ts Updater workflow contract tests.
package.json Generation and verification commands.
docs/​model-api-mapping.json Generated documentation mapping.
docs/​adr/​0004-model-information-management.md Ownership, provenance, and activation guidance.
containers/​api-proxy/​model-information.retired.generated.json Staged retirement projection.
containers/​api-proxy/​model-information.pricing.generated.json Staged curated-pricing projection.
containers/​api-proxy/​model-api-mapping.json Generated proxy mapping.
containers/​api-proxy/​Dockerfile Packages generated proxy assets.
.github/​workflows/​model-api-mapping-updater.md Manual review workflow source.
.github/​workflows/​model-api-mapping-updater.lock.yml Compiled review workflow.
.github/​workflows/​build.yml CI generated-output verification.

Review effort: Max

Comment on lines +75 to +76
report-failed-jobs: false
report-failure-as-issue: false
Comment on lines +101 to +106
for (const pattern of entry.patterns || []) {
if (patterns.has(pattern) && patterns.get(pattern) !== JSON.stringify(entry.endpoints)) {
errors.push(`mapping.json: ${provider}: conflicting equal-specificity pattern ${pattern}`);
}
patterns.set(pattern, JSON.stringify(entry.endpoints));
}
Comment thread scripts/model-information/compile.cjs Outdated
Comment on lines +121 to +131
const generatedAt = [{ at: imported.retrievedAt }, mapping.provenance, reference.provenance,
...records.map(([, data]) => data.provenance)]
.map(item => new Date(item.at).toISOString()).sort().at(-1);
const sortedModels = [...models, ...imported.models].sort((a, b) =>
a.identity.key < b.identity.key ? -1 : a.identity.key > b.identity.key ? 1 : 0);
const target = JSON.parse(fs.readFileSync(path.join(sources, 'target.json'), 'utf8'));
if (target.schemaVersion !== 1 || target.provenance?.authority !== 'maintained' ||
!target.provenance.at || !Array.isArray(target.availability) ||
!Array.isArray(target.routing)) {
throw new Error('target.json: invalid target metadata or corrections');
}
Comment on lines +144 to +147
if (!targetModels.has(id.key)) targetModels.set(id.key, {
schemaVersion: 1, identity: id, lifecycle: { status: 'active' },
modelType: 'completion', provenance: target.provenance,
});
Comment thread scripts/model-information/compile.cjs Outdated
Comment on lines +232 to +233
family: 'claude-mythos-preview', patterns: ['claude-mythos-preview*'],
endpoints: parent.endpoints, notes: 'Preview excludes xhigh; #10030.',
Comment thread scripts/model-information/compile.cjs Outdated
Comment on lines +269 to +275
const differences = resolvedTarget.filter(model =>
JSON.stringify(model) !== JSON.stringify(models.find(item => item.identity.key === model.identity.key)))
.map(model => ({
key: model.identity.key,
baseline: models.find(item => item.identity.key === model.identity.key) || null,
target: model,
}));
schemaVersion: 1, identity: modelIdentity,
lifecycle: { status: 'active' }, modelType: 'other',
tariffs: [{
scope: { provider: modelIdentity.provider, channel: 'native-api' },
@lpcox

lpcox commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed the review feedback in commit 7c0dbd9.

This branch has not been deployed

No deployments
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.

ADR 0004 phase 3: compile maintained model records into deterministic projections

3 participants