Add a synthetic quality suite and upstream parity record.
Some checks failed
synthetic / suite (push) Has been cancelled
Some checks failed
synthetic / suite (push) Has been cancelled
Assistant: grok Assistant-Session: 01a1531b-6698-7732-8587-f28ea604bcdf
This commit is contained in:
parent
b5b6f6bc00
commit
f43edc1edc
14 changed files with 753 additions and 11 deletions
|
|
@ -55,6 +55,18 @@ def footer_problems(text: str, pin: str) -> list[str]:
|
|||
return [f"ui/components/SiteFooter.tsx missing {', '.join(missing)}"]
|
||||
|
||||
|
||||
def third_party_problems(root: Path = ROOT, pin: str | None = None) -> list[str]:
|
||||
pin = load_pin() if pin is None else pin
|
||||
path = root / "THIRD_PARTY.md"
|
||||
if not path.is_file():
|
||||
return ["THIRD_PARTY.md is missing"]
|
||||
text = path.read_text(encoding="utf-8")
|
||||
missing = [mark for mark in ("Copyright (c) 2026 OnCo", "MIT License", pin) if mark not in text]
|
||||
if not missing:
|
||||
return []
|
||||
return [f"THIRD_PARTY.md missing {', '.join(missing)}"]
|
||||
|
||||
|
||||
def tree_problems(root: Path = UI, pin: str | None = None) -> list[str]:
|
||||
pin = load_pin() if pin is None else pin
|
||||
problems: list[str] = []
|
||||
|
|
@ -74,6 +86,7 @@ def tree_problems(root: Path = UI, pin: str | None = None) -> list[str]:
|
|||
problems.append("ui/components/SiteFooter.tsx is missing")
|
||||
else:
|
||||
problems.extend(footer_problems(footer.read_text(encoding="utf-8"), pin))
|
||||
problems.extend(third_party_problems(root.parent if root == UI else root, pin))
|
||||
return problems
|
||||
|
||||
|
||||
|
|
|
|||
12
scripts/ci-synthetic.sh
Normal file
12
scripts/ci-synthetic.sh
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/sh
|
||||
# Synthetic suite. It does not fetch or require the OnCo corpus.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
python3 scripts/validate_fixtures.py
|
||||
python3 -m unittest discover -s tests -p 'test_*.py'
|
||||
python3 scripts/check_ui_boundary.py
|
||||
python3 scripts/check_ui_provenance.py
|
||||
python3 scripts/quality_report.py >/dev/null
|
||||
cd ui
|
||||
npm test
|
||||
npm run typecheck
|
||||
39
scripts/quality_report.py
Normal file
39
scripts/quality_report.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Print a quality report for every example dataspace."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import sys
|
||||
from datetime import date
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parent.parent
|
||||
sys.path.insert(0, str(ROOT))
|
||||
|
||||
from content_explorer.quality import report_dataspaces # noqa: E402
|
||||
|
||||
|
||||
def main() -> int:
|
||||
reports = report_dataspaces(ROOT / "examples" / "dataspaces", today=date.today().isoformat())
|
||||
if not reports:
|
||||
print("no dataspace fixtures found", file=sys.stderr)
|
||||
return 1
|
||||
problems = []
|
||||
for report in reports:
|
||||
if report["provenance"]["complete"] != report["provenance"]["records"]:
|
||||
problems.append(f"{report['dataspace']}: provenance incomplete")
|
||||
for name, count in report["failureClasses"].items():
|
||||
if count:
|
||||
problems.append(f"{report['dataspace']}: {name} {count}")
|
||||
json.dump(reports, sys.stdout, indent=2)
|
||||
sys.stdout.write("\n")
|
||||
if problems:
|
||||
print("\n".join(problems), file=sys.stderr)
|
||||
return 1
|
||||
print("Quality report OK", file=sys.stderr)
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue