chore(repo): retire duplicate nested source mirror

This commit is contained in:
Jens
2026-08-30 05:59:32 +02:00
parent d39816a4ca
commit b93d926b94
1157 changed files with 108 additions and 209568 deletions
+45
View File
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
"""Fail when a second GeoIntel source tree reappears below the repository root."""
from __future__ import annotations
import argparse
from pathlib import Path
CANONICAL_MARKERS = (
"backend/app/main.py",
"frontend/package.json",
"docs/API_CONTRACTS.md",
)
def nested_mirror_markers(repo_root: Path) -> list[str]:
nested = repo_root / "geointel"
return [marker for marker in CANONICAL_MARKERS if (nested / marker).is_file()]
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--repo-root",
type=Path,
default=Path(__file__).resolve().parents[1],
)
args = parser.parse_args()
repo_root = args.repo_root.resolve()
missing = [marker for marker in CANONICAL_MARKERS if not (repo_root / marker).is_file()]
if missing:
raise SystemExit(f"Canonical GeoIntel repository markers are missing: {missing}")
duplicates = nested_mirror_markers(repo_root)
if duplicates:
raise SystemExit(
"Nested GeoIntel repository mirror detected below geointel/: "
f"{duplicates}. The repository root is the only canonical source tree."
)
print("Repository layout verified: one canonical GeoIntel source tree")
return 0
if __name__ == "__main__":
raise SystemExit(main())