Port the explorer shell: tokens, header, hero, and a generic table.

CONTENT-WP-0002-T01 adapts the pinned OnCo visual system under ui/ without the corpus, mark, or kind routes.

Assistant: grok
Assistant-Session: 01a1346c-fdff-7741-b1af-b7283661554b
This commit is contained in:
tegwick 2026-10-13 22:51:00 +02:00
parent 695060e38d
commit a6e360aaa5
27 changed files with 4013 additions and 3 deletions

View file

@ -0,0 +1,43 @@
#!/usr/bin/env python3
"""Reject oncology vocabulary on UI import lines, and require the MIT notice."""
from __future__ import annotations
import re
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
UI = ROOT / "ui"
IMPORT_LINE = re.compile(r"""^\s*(import|export)\b.*\bfrom\b|^\s*import\s*\(""")
FORBIDDEN = re.compile(r"oncology|cancers?|drugs?|targets?", re.IGNORECASE)
SOURCE_SUFFIXES = {".ts", ".tsx", ".css", ".mjs"}
def import_lines(path: Path) -> list[str]:
hits: list[str] = []
for number, line in enumerate(path.read_text(encoding="utf-8").splitlines(), start=1):
if IMPORT_LINE.search(line) and FORBIDDEN.search(line):
hits.append(f"{path.relative_to(ROOT)}:{number}: {line.strip()}")
return hits
def main() -> int:
problems: list[str] = []
for path in sorted(UI.rglob("*")):
if not path.is_file() or "node_modules" in path.parts or ".next" in path.parts:
continue
if path.suffix in SOURCE_SUFFIXES:
problems.extend(import_lines(path))
notice = (UI / "NOTICE").read_text(encoding="utf-8")
if "Copyright (c) 2026 OnCo" not in notice or "MIT License" not in notice:
problems.append("ui/NOTICE is missing the OnCo MIT copyright and permission notice")
if problems:
print("\n".join(problems))
return 1
print("ui boundary: no oncology imports; NOTICE retains the OnCo MIT text")
return 0
if __name__ == "__main__":
sys.exit(main())