fix(registry): rewrite schema $id to the resolvable Pages registry URL#18
Conversation
- Rewrite all 22 schema $id values from the unresolvable https://schemas.coding-autopilot.dev/ namespace to the live https://coding-autopilot-system.github.io/cas-contracts/registry/ URL - Update schemaId() in lib.mjs to build from pagesRegistryBase instead of canonicalSchemaBase (canonicalSchemaBase stays exported, unused by schemaId(), for the --domain CNAME option) - REQ-1.4.11
- Replace the anti-pattern test asserting $id must NOT match the Pages hosting URL with a regression test asserting $id DOES resolve under it - Update DISTRIBUTION.md to state $id equals the live fetch URL; document that activating schemas.coding-autopilot.dev in future would require an explicit $id migration, not a transparent zero-cost activation - Add BREAKING CHANGELOG entry under [Unreleased] documenting the reversal of v1.1.1's canonical-namespace decision - REQ-1.4.11
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f7f3deac9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| ### Changed | ||
|
|
||
| - **BREAKING:** Schema `$id` values now point at the live GitHub Pages registry (`https://coding-autopilot-system.github.io/cas-contracts/registry/...`) instead of the unresolvable `https://schemas.coding-autopilot.dev/` namespace introduced in v1.1.1. Consumers that hardcode the old `$id` string (e.g. offline schema validators) must update to the new value. See REQ-1.4.11. |
There was a problem hiding this comment.
Move breaking ID migration to a major line
This documents the $id rewrite as breaking, but the commit applies it in-place to the existing v0.1/v1.0/v1.1 schema lines while their record schemaVersion constants remain unchanged. Any patch or minor release from these directories will make consumers keyed to the already-published IDs fail to resolve schemas even though the contract version did not move to a new major, which violates the repository versioning rule for published schemas. Keep aliases/the old IDs for existing lines, or introduce this Pages-ID migration in a new major schema line.
Useful? React with 👍 / 👎.
| export function schemaId(version, name) { | ||
| return `${canonicalSchemaBase}/${version}/${name}.schema.json`; | ||
| return `${pagesRegistryBase}/${version}/${name}.schema.json`; | ||
| } |
There was a problem hiding this comment.
Keep schema evidence examples in sync
After changing the authoritative schema IDs to the Pages registry, the executable artifact-manifest fixtures still advertise https://schemas.coding-autopilot.dev/.../prompt-envelope.schema.json in examples/v0.1/artifact-manifest.json and examples/v1.0/artifact-manifest.json. Consumers copying those fixtures will keep emitting the old unresolvable namespace while schemaId() and the registry manifests now expect the github.io IDs, so the example lifecycle is no longer synchronized with the contract. Update the fixture URIs and add coverage for schema evidence URLs.
Useful? React with 👍 / 👎.
* docs(36-02): fix registry $id framing and append freshness footer - Clarify Pages registry is authoritative now; schemas.coding-autopilot.dev migration is in progress (PR #18), not settled fact - Append docs-verified freshness footer * docs(36-03): add docs/wiki tree (Home, Architecture, Operations, Decisions) - Architecture.md documents the schema-versioning + Pages registry publishing pipeline, and the in-progress $id migration (PR #18) - Operations.md verified test/validate/build-registry/CI commands - Decisions.md indexes phase history and open PRs --------- Co-authored-by: Kim Harjamäki <kim.harjamaki@prosimo.fi>
Summary
Fixes REQ-1.4.11: rewrites every schema
$idfrom the unresolvablehttps://schemas.coding-autopilot.dev/namespace to the live, already-working GitHub Pages registry URL (https://coding-autopilot-system.github.io/cas-contracts/registry/...).Diagnosis
gh api repos/Coding-Autopilot-System/cas-contracts/pagesconfirmscname: null— no custom domain is configured for this repository.curl https://schemas.coding-autopilot.dev/v0.1/common.schema.jsonfails to connect (curl exit code000).curl https://coding-autopilot-system.github.io/cas-contracts/registry/index.jsonreturns200today —pages.yml(the unified docs+registry publisher) already works correctly.The only remaining gap was that
$idnamed an address that doesn't resolve. This PR repoints$idto the address that actually works.What changed
$idvalues (schemas/{v0.1,v1.0,v1.1}/*.schema.json) rewritten fromhttps://schemas.coding-autopilot.dev/{version}/{name}.schema.jsontohttps://coding-autopilot-system.github.io/cas-contracts/registry/{version}/{name}.schema.json. Only the host+path prefix changed; each file's existing key/value whitespace style was preserved.scripts/lib.mjs:schemaId()now builds frompagesRegistryBaseinstead ofcanonicalSchemaBase.canonicalSchemaBaseremains exported (still used bybuild-registry.mjs's--domainCNAME option) but is no longer used for identity.tests/registry.test.mjs: replaced the"registry keeps canonical schema identity independent from the Pages hosting URL"test (which asserted$idmust NOT match the github.io URL) with"registry schema identity resolves under the live Pages registry URL", asserting the inverse — every manifest entry'sidmatches and equals the Pages registry URL for its path.docs/DISTRIBUTION.md: removed the "reserved canonical namespace" language and the claim that a future custom-domain activation would be transparent/zero-cost. Documents that$idis now identical to the live fetch URL, and that activatingschemas.coding-autopilot.devin the future would require an explicit$idmigration with its own consumer-compatibility plan.CHANGELOG.md: added a### Changedentry under[Unreleased]marked BREAKING, explaining the reversal and pointing consumers at REQ-1.4.11.Superseding prior art
v1.1.1 (commit
0b35b98, "fix(registry): restore canonical schema identity") deliberately set$idtoschemas.coding-autopilot.devand added a regression test specifically to prevent$idfrom ever matching the github.io URL. That decision assumed a custom domain would be activated later. It has not been, REQ-1.4.11 requires resolvability now, and the livepagesAPI check proves no DNS/custom-domain work is in flight. This PR supersedes that decision — the CHANGELOG and DISTRIBUTION.md updates say so explicitly so this isn't reverted a third time.Note on fix/pages-release-ordering
PR #16 (
fix/pages-release-ordering, "docs(release): define Pages publication ordering") is already merged tomain(docs-only change, a release-ordering runbook note inDISTRIBUTION.md). It needs no cherry-pick and is unrelated to this change.Breaking change for consumers
Consumers that hardcode the old
$idstring (e.g. offline schema validators) must update to the new value. This is addressed forcas-evalsin a companion PR (see plan 32-02).Test plan
npm ci && node --test tests/contracts.test.mjs tests/goal-contract.test.mjspassesnpm test(full suite, all 4 test files) passes — 36/36npm run build:registry -- --all && npm run validate:registry -- --registry registrypassesschemas.coding-autopilot.devreferences across all 22 schema files (grep -Lcount == 22)$idfield reads the new github.io valueNot merging this PR per environment constraint — PR-only, leaving open for review.