fix(federation): sync rebuilds pages from committed manifest mirrors — kills the drift class#59
Merged
Merged
Conversation
…— kills the drift class Root cause of the recurring registry-drift reds (#54, #55, #58): the page builder live-fetched remote manifests, so the CI drift check was a function of whatever publishers were serving at check time — any upstream manifest edit redded every PR until someone hand-rebuilt the page. federation-sync only ever committed manifests.json, never pages. Fix: - mirrors/manifests/<id>.json: committed byte-exact mirror of every non-self-hosted manifest; _load_manifest prefers it over live fetch, making builds (and --check) hermetic. - build_registry_pages.py --refresh: refetch mirrors, rebuild pages only when content changed (stamps pinned otherwise, so no-change days are byte-identical and the workflow opens no PR). - federation-sync workflow: runs --refresh after the manifest sync and commits manifests.json + mirrors/ + registry/ atomically; diff gate switched to git status --porcelain so new files count. - Seeded mirrors + rebuilt pages in this commit (one-time stamp churn: 'Last fetched ... (mirror)' + fresh 'Pages generated'). Verified: --refresh idempotent on second run; --check green against the rebuilt tree; 36/36 tests pass. Claude-Session: https://claude.ai/code/session_01WQAhb3Xjq1mMwf1My4YeEP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Root fix for the recurring registry-drift reds (#54, #55, #58). Two structural problems:
build_registry_pages.pylive-fetched remote manifests, so the "registry pages match a fresh build" check depended on whatever publishers were serving at check time — any upstream manifest edit redded every PR in this repo until someone hand-rebuilt the page.federation-synconly ever committedmanifests.json, never the pages built from it.Fix
mirrors/manifests/<id>.json— committed, byte-exact mirror of every non-self-hosted manifest (.gitattributes: mirrors/** -text)._load_manifestprefers the mirror over live fetch, so builds and--checkare now hermetic: pages can only drift when this repo's own inputs change.--refreshmode — refetches mirrors, then rebuilds pages only if content actually changed (timestamps stay pinned otherwise, so a no-change day produces a byte-identical tree). A failed fetch keeps the existing mirror and warns; fatal only if no mirror exists yet.--refreshafter the manifest sync and commitsmanifests.json+mirrors/+registry/atomically in the auto-PR. Diff gate switched fromgit difftogit status --porcelainso newly created mirror/page files count.Last fetched … (mirror)+ freshPages generated).Semantics
--check(PR gate) never touches the network for mirrored entries./examples/) manifests keep resolving from the working tree, unchanged.Verification
--refreshis idempotent (second run: "ok: mirrors and registry pages already current").--checkgreen against the rebuilt tree; 36/36 tests pass.https://claude.ai/code/session_01WQAhb3Xjq1mMwf1My4YeEP