Skip to content

fix(federation): sync rebuilds pages from committed manifest mirrors — kills the drift class#59

Merged
drknowhow merged 2 commits into
mainfrom
fix/federation-sync-rebuilds-pages
Jul 9, 2026
Merged

fix(federation): sync rebuilds pages from committed manifest mirrors — kills the drift class#59
drknowhow merged 2 commits into
mainfrom
fix/federation-sync-rebuilds-pages

Conversation

@drknowhow

Copy link
Copy Markdown
Owner

What

Root fix for the recurring registry-drift reds (#54, #55, #58). Two structural problems:

  1. build_registry_pages.py live-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.
  2. federation-sync only ever committed manifests.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_manifest prefers the mirror over live fetch, so builds and --check are now hermetic: pages can only drift when this repo's own inputs change.
  • --refresh mode — 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.
  • federation-sync workflow — runs --refresh after the manifest sync and commits manifests.json + mirrors/ + registry/ atomically in the auto-PR. Diff gate switched from git diff to git status --porcelain so newly created mirror/page files count.
  • Seeded the mirrors and rebuilt all pages in this PR (one-time stamp churn: Last fetched … (mirror) + fresh Pages generated).

Semantics

  • Publisher edits their manifest → nothing reds; next daily sync lands new mirror + rebuilt page in one auto-merged commit.
  • --check (PR gate) never touches the network for mirrored entries.
  • Self-hosted (/examples/) manifests keep resolving from the working tree, unchanged.

Verification

  • --refresh is idempotent (second run: "ok: mirrors and registry pages already current").
  • --check green against the rebuilt tree; 36/36 tests pass.
  • This PR's own drift check exercises the mirror-sourced build path on Linux.

https://claude.ai/code/session_01WQAhb3Xjq1mMwf1My4YeEP

drknowhow added 2 commits July 9, 2026 13:48
…— 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
@drknowhow drknowhow merged commit 2a8d845 into main Jul 9, 2026
7 checks passed
@drknowhow drknowhow deleted the fix/federation-sync-rebuilds-pages branch July 9, 2026 17:51
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.

1 participant