Skip to content

Mirror tracked-repo reconciliation from consensus snapshots#1653

Open
LandynDev wants to merge 1 commit into
feat/validator-repo-weight-consensusfrom
feat/weight-consensus-mirror-sync
Open

Mirror tracked-repo reconciliation from consensus snapshots#1653
LandynDev wants to merge 1 commit into
feat/validator-repo-weight-consensusfrom
feat/weight-consensus-mirror-sync

Conversation

@LandynDev

Copy link
Copy Markdown
Collaborator

Summary

Env-gated reconciler that keeps the GT mirror's tracked-repo set in sync with the consensus snapshot: voted repos get registered and deep-backfilled, repos absent for a full hysteresis window get deregistered. Runs inside the team validator after each snapshot store — no side deployment.

Motivation

With open-world voting the mirror needs a definitive tracked list without churn. The snapshot union changes at most 2x/day, so registrations/deregistrations follow a stable list; vote flicker between snapshots is invisible by construction.

Changes

  • weight_consensus/mirror_sync.py: diffs the eligible-voter basket union against GET /admin/repos, acts only on state transitions; registers with days=40 backfill (mirror's register default is 10); warns on voted repos pending GitHub App install; deregisters only when the consensus gate is active, a full MIRROR_DEREG_SNAPSHOTS=4 (~2 days) history window exists, and the repo appears in none of it; caps at MIRROR_MAX_TRACKED_REPOS=300 by aggregate share
  • Enabled solely by MIRROR_ADMIN_API_KEY env (team validator); requires STORE_DB_RESULTS since hysteresis reads basket history from postgres
  • Hooked into _store_weight_consensus after the DB write; failures isolated by the store-hook try/except, consensus never affected
  • 6 tests covering register/backfill, pending-install, hysteresis guards (short history, recent vote, inactive gate), and the cap

Stacked on #1651. Server side: entrius/das-github-mirror#226.

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