fix: refuse an export without its truth

dist/ is not committed and exports/ is. On a fresh clone, or with a
mistyped --truth-dir, the export copied each platform's file back
uncorrected, said OK and replaced the corrected export in exports/.
check_freshness then reported a stale export instead of the missing
model. The platform now fails, writes nothing, and names the
generate_truth command.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 14:54:16 +02:00
1 parent 63556b4873
commit 19b88ca055
2 files changed
+31 -2

No files matched your search

+6 -2
View File
@@ -457,8 +457,12 @@ def export_platform(
except StaleTruth as exc:
return False, [str(exc)]
if truth is None:
truth = {}
messages.append(f"no truth for {platform}, only the platform's own data")
# Without a truth the export is the platform's file copied back, and
# it replaced the corrected one in exports/ on a fresh clone.
return False, [
f"{truth_dir / f'{platform}.yml'} is absent: run "
f"python scripts/generate_truth.py --platform {platform}"
]
systems, report = build_native_model(truth, scraped)
if not systems: