canon: distinguish sector domains from project identity
Some checks are pending
CI Smoke / host-smoke (push) Waiting to run
CI Smoke / container-smoke (push) Waiting to run
Python Tests / pytest (push) Successful in 21s

This commit is contained in:
codex 2026-08-23 01:47:39 +02:00
parent bd063eb6c3
commit 450b4b80b0
8 changed files with 46 additions and 9 deletions

View file

@ -163,10 +163,22 @@ def self_test(allowed: dict) -> bool:
"business_mechanics": ["teleportation"],
}
}
legacy_project_as_domain = {
"repo_classification": {
"category": "research",
"domain": "custodian",
}
}
ge, _ = validate(good, allowed)
be, _ = validate(bad, allowed)
ok = (ge == []) and (len(be) >= 5)
print(f"self-test: good_errors={len(ge)} bad_errors={len(be)} -> {'PASS' if ok else 'FAIL'}")
le, _ = validate(legacy_project_as_domain, allowed)
legacy_rejected = any("`domain` 'custodian' not in allowed domains" in error for error in le)
ok = (ge == []) and (len(be) >= 5) and legacy_rejected
print(
"self-test: "
f"good_errors={len(ge)} bad_errors={len(be)} "
f"legacy_project_domain_rejected={legacy_rejected} -> {'PASS' if ok else 'FAIL'}"
)
return ok