port: verify root pack ledger and repair runtime adapters

This commit is contained in:
shen
2026-09-24 00:18:33 -07:00
parent c84f913cfd
commit 330ec9745b
89 changed files with 17085 additions and 6808 deletions
@@ -340,9 +340,16 @@ def cmd_check(repo: Path, units: dict[str, Path], args) -> int:
if status == "RUN_AS_IS" and (layer(unit) != "python" or not unit.endswith(".py")):
print(f"ERROR {label}: {fn} is RUN_AS_IS outside a Python script unit")
problems += 1
if status == "RUN_AS_IS" and not info.get("evidence"):
print(f"ERROR {label}: {fn} is RUN_AS_IS without runtime evidence")
problems += 1
if status == "RUN_AS_IS":
expected_impl = f"pack://{Path(unit).name}:{fn}"
if info.get("impl") != [expected_impl]:
print(f"ERROR {label}: {fn} must name the 40250 root pack entry {expected_impl}")
problems += 1
evidence = info.get("evidence")
if not isinstance(evidence, list) or not evidence or not all(
isinstance(item, str) and item.strip() for item in evidence):
print(f"ERROR {label}: {fn} needs a non-empty runtime evidence list")
problems += 1
if status in {"ADAPTED", "N_A", "DIVERGENT", "NEEDS_LIVE"} and not info.get("note"):
print(f"ERROR {label}: {fn} is {status} without note")
problems += 1