test: define the-nexus genome acceptance for #672

This commit is contained in:
Alexander Whitestone
2026-04-16 00:20:16 -04:00
parent c4a04ecb6d
commit 5d7b26858e

View File

@@ -0,0 +1,56 @@
from pathlib import Path
GENOME = Path("GENOME.md")
def read_genome() -> str:
assert GENOME.exists(), "GENOME.md must exist at repo root"
return GENOME.read_text(encoding="utf-8")
def test_the_nexus_genome_has_required_sections() -> None:
text = read_genome()
required = [
"# GENOME.md — the-nexus",
"## Project Overview",
"## Architecture Diagram",
"```mermaid",
"## Entry Points and Data Flow",
"## Key Abstractions",
"## API Surface",
"## Test Coverage Gaps",
"## Security Considerations",
"## Runtime Truth and Docs Drift",
]
missing = [item for item in required if item not in text]
assert not missing, missing
def test_the_nexus_genome_captures_current_runtime_contract() -> None:
text = read_genome()
required = [
"server.py",
"app.js",
"index.html",
"portals.json",
"vision.json",
"BROWSER_CONTRACT.md",
"tests/test_browser_smoke.py",
"tests/test_repo_truth.py",
"nexus/morrowind_harness.py",
"nexus/bannerlord_harness.py",
"mempalace/tunnel_sync.py",
"mcp_servers/desktop_control_server.py",
"public/nexus/",
]
missing = [item for item in required if item not in text]
assert not missing, missing
def test_the_nexus_genome_explains_docs_runtime_drift() -> None:
text = read_genome()
assert "README.md says current `main` does not ship a browser 3D world" in text
assert "CLAUDE.md declares root `app.js` and `index.html` as canonical frontend paths" in text
assert "tests and browser contract now assume the root frontend exists" in text
assert len(text) >= 5000