docs(#277): add shared i18n parity artifact #282

Merged
integrator-bot merged 5 commits from feat/issue-277-i18n-parity-report into main 2026-03-13 11:59:51 +01:00
3 changed files with 38 additions and 0 deletions
Showing only changes of commit b968ea4430 - Show all commits

View File

@@ -76,4 +76,5 @@ Status: **Shared locale matrix is aligned (`en`, `da`) and backend→frontend er
```bash
python3 scripts/check_i18n_drift.py
python3 scripts/report_i18n_parity.py
python3 scripts/check_i18n_parity_artifact.py
```

View File

@@ -0,0 +1,36 @@
#!/usr/bin/env python3
"""Guard issue #277 parity artifact against non-deterministic regeneration."""
from __future__ import annotations
import hashlib
import subprocess
import sys
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
ARTIFACT_PATH = REPO_ROOT / "docs" / "ISSUE-277-SHARED-I18N-PARITY-ARTIFACT.md"
REPORT_SCRIPT = REPO_ROOT / "scripts" / "report_i18n_parity.py"
def sha256(path: Path) -> str:
return hashlib.sha256(path.read_bytes()).hexdigest()
def main() -> int:
before = sha256(ARTIFACT_PATH)
for run in range(1, 3):
subprocess.run([sys.executable, str(REPORT_SCRIPT)], cwd=REPO_ROOT, check=True)
after = sha256(ARTIFACT_PATH)
if after != before:
raise SystemExit(
f"issue #277 parity artifact is not deterministic after run {run}: {before} != {after}"
)
print(f"issue #277 parity artifact deterministic: {before}")
return 0
if __name__ == "__main__":
raise SystemExit(main())

View File

@@ -179,6 +179,7 @@ def render_report(catalog: dict) -> str:
lines.append("```bash")
lines.append("python3 scripts/check_i18n_drift.py")
lines.append("python3 scripts/report_i18n_parity.py")
lines.append("python3 scripts/check_i18n_parity_artifact.py")
lines.append("```")
lines.append("")
return "\n".join(lines)