fix(pages): unify docs and schema registry into one pages deploy#12
Conversation
The documentation workflow (pages.yml, on push to main) and the schema registry workflow (publish-registry.yml, on version tags) both deployed to the single GitHub Pages origin under the same `pages` concurrency group. GitHub Pages serves only one deployment per repository, so each run replaced the whole site: a docs push wiped the registry (every schema $id 404'd) and a tag push wiped the docs. They clobbered each other. Make pages.yml the sole owner of the Pages deployment. It now triggers on both branch pushes and version tags, builds the mkdocs site, then rebuilds every tagged release into site/registry/ so one artifact contains both. The registry is served as a stable sub-path (/registry/...). publish-registry.yml is removed since its only job was the now-conflicting Pages deploy. Schema $id values keep the canonical schemas.coding-autopilot.dev namespace as their stable identity; docs are updated to the reachable /registry/ URLs and the custom-domain DNS requirement is documented as a manual follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 004c3fc704
ℹ️ 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".
| # must not carry its own CNAME (that would remap the whole origin). | ||
| rm -f registry/CNAME | ||
| mkdir -p site/registry | ||
| cp -R registry/. site/registry/ |
There was a problem hiding this comment.
Because the deleted registry workflow uploaded path: registry, the published Pages root previously contained /index.json, /v0.1/..., and /releases/...; copying the rebuilt registry only under site/registry/ means the next unified deployment removes those already documented schema URLs and breaks existing consumers of the public registry. Keep the new /registry paths if desired, but also copy or redirect the legacy root-level registry paths in the same artifact so released schema URLs remain stable.
Useful? React with 👍 / 👎.
Root cause
The repo had two workflows deploying to the single GitHub Pages origin under the same
pagesconcurrency group:pages.yml— mkdocs docs, on push tomain.publish-registry.yml— schema registry (registry/), on version tags.GitHub Pages serves only one deployment per repository — each
deploy-pagesrun replaces the entire site. So a docs push wiped the registry (every schema$idat.../v0.1/...404'd) and a tag push wiped the docs. They clobbered each other; whichever ran last won.Fix
Make
pages.ymlthe sole owner of the Pages deployment and build one artifact containing both:pages.ymlnow triggers on branch pushes and version tags (v[0-9]+.[0-9]+.[0-9]+) plusworkflow_dispatch../site, then rebuilds every tagged release into./site/registry/(mkdocs cleans its output dir, so the registry is assembled after). Docs live at the site root; the registry is a stable sub-path at/registry/....npm ci && npm testandvalidate:registrybefore upload, so a broken registry blocks the deploy.publish-registry.ymlis removed — its only job was the now-conflicting Pages deploy.Reachable URLs (changed — registry moved to a sub-path)
https://coding-autopilot-system.github.io/cas-contracts/registry/index.jsonhttps://coding-autopilot-system.github.io/cas-contracts/registry/v0.1/prompt-envelope.schema.jsonhttps://coding-autopilot-system.github.io/cas-contracts/registry/releases/v0.1.0/prompt-envelope.schema.jsondocs/DISTRIBUTION.mdandREADME.mdare updated accordingly.Schema
$iddecisionSchema
$idvalues keep the canonicalhttps://schemas.coding-autopilot.dev/...namespace. That URL is the schema's stable identity (referenced by every schema file and by the test suite); it is not tied to hosting location. Rewriting it to the GitHub Pages sub-path would be a breaking identity change across every schema and test, so it was intentionally left unchanged.lib.mjsis untouched.Local validation
Also simulated the workflow's build+copy steps locally against the repo's actual tags: registry builds into
site/registry/withindex.json,releases/, andv0.1/present, andvalidate:registrypasses.Manual follow-up (infrastructure — cannot be done from code)
schemas.coding-autopilot.dev— to make the canonical$idURLs directly resolvable requires DNS setup at the registrar. Because the single Pages origin now serves docs at root and the registry under/registry/, a custom domain would remap the whole origin and cannot point at just the sub-path. Activating that domain needs a dedicated hosting origin for the registry (separate Pages project or CDN). This is documented indocs/DISTRIBUTION.md; until then, consumers resolve schemas from the GitHub Pages/registry/URL above.🤖 Generated with Claude Code