File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
22"""Complete settings-catalog.json coverage for the Phase 2 settings refactor.
33
4- This is intentionally a one-shot, deterministic migration. It refuses to run if the
5- set of currently uncataloged persistent keys differs from the baseline discovered
6- in Phase 1, so it cannot silently paper over future catalog regressions.
4+ The migration is deterministic and only accepts either the exact Phase 1 gap or an
5+ already-completed catalog. Any different gap is treated as a regression.
76"""
87from __future__ import annotations
98
@@ -92,6 +91,13 @@ def main() -> int:
9291
9392 existing = {entry ["key" ] for entry in catalog .get ("settings" , [])}
9493 missing = set (unique ) - existing
94+ if not missing :
95+ catalog_count = len (existing )
96+ if catalog_count != len (unique ) or catalog .get ("settingCount" ) != catalog_count :
97+ raise SystemExit (f"Catalog claims full coverage but counts disagree: { catalog_count } /{ len (unique )} " )
98+ print (f"Catalog already complete at { catalog_count } /{ len (unique )} persistent keys" )
99+ return 0
100+
95101 if missing != EXPECTED_MISSING :
96102 raise SystemExit (
97103 "Refusing Phase 2 migration because the uncataloged baseline changed.\n "
You can’t perform that action at this time.
0 commit comments