All checks were successful
synthetic / suite (push) Successful in 56s
The single-operator pilot keeps static projection. Local OnCo use requires a CC BY-NC origin notice, and the slice stays out of public CI. Assistant: grok Assistant-Session: 01a15378-f601-7fe2-a143-8e1500a1d59c
50 lines
1.6 KiB
Python
50 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Fail if the public tree contains the OnCo corpus or a redistributed slice."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
FORBIDDEN_TRACKED = (
|
|
"tests/onco-reference/local/",
|
|
"tests/onco-reference/authorization.json",
|
|
"upstream-onco/",
|
|
)
|
|
|
|
|
|
def main() -> int:
|
|
problems: list[str] = []
|
|
tracked = subprocess.run(
|
|
["git", "ls-files"],
|
|
cwd=ROOT,
|
|
check=True,
|
|
capture_output=True,
|
|
text=True,
|
|
).stdout.splitlines()
|
|
for path in tracked:
|
|
for prefix in FORBIDDEN_TRACKED:
|
|
if path.startswith(prefix):
|
|
problems.append(f"tracked licensed path: {path}")
|
|
if path.startswith("examples/") and path.endswith(".json"):
|
|
text = (ROOT / path).read_text(encoding="utf-8")
|
|
if "CC-BY-NC-4.0" in text or "Data from OnCo" in text:
|
|
problems.append(f"public example carries OnCo rights: {path}")
|
|
examples = ROOT / "examples" / "dataspaces"
|
|
for snapshot_path in examples.glob("*/snapshot.json"):
|
|
snapshot = json.loads(snapshot_path.read_text(encoding="utf-8"))
|
|
for source in snapshot.get("sources") or []:
|
|
if source.get("license") == "CC-BY-NC-4.0":
|
|
problems.append(f"{snapshot_path}: CC-BY-NC source {source.get('id')}")
|
|
if problems:
|
|
print("\n".join(problems), file=sys.stderr)
|
|
return 1
|
|
print("Public tree has no OnCo slice")
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|