from pathlib import Path def test_poorly_structured_authoring_fixture_exercises_the_restructuring_boundary(): """Removing any rough source shape would weaken the hermetic acceptance probe.""" fixture = ( Path(__file__).parent / "fixtures" / "evidence_authoring" / "poorly_structured.md" ) text = fixture.read_text(encoding="utf-8") assert "La fascia pediatrica" in text # prose assert "- paziente" in text # rough list assert "D = dimesso" in text # enum assert "https://" in text # URL assert "non chiarisce" in text # ambiguity assert "CASE WHEN" in text # PostgreSQL expression candidate def test_acceptance_runner_includes_the_integrated_candidate_publication_gate(): runner = Path(__file__).parents[2] / "scripts" / "evidence-restructuring-acceptance.sh" assert "test_evidence_candidate_publication.py" in runner.read_text(encoding="utf-8") def test_owner_gate_manual_records_the_narrow_inventory_and_qdrant_baseline_protocol(): manual = Path(__file__).parents[2] / "docs" / "testing" / "evidence-restructuring-manual.md" text = manual.read_text(encoding="utf-8") normalized = " ".join(text.split()) assert "35 moveable source documents" in text assert "retained `psd-clinical/evidence/README.md`" in text inventory = text.split("README is not a source document and must remain", 1)[1] inventory = inventory.split("```text", 1)[1].split("```", 1)[0] assert sum(line.strip().endswith(".md") for line in inventory.splitlines()) == 35 assert "move exactly those 35 listed source documents" in normalized assert "with_payload:false" in text assert "with_payload:true" not in text assert "must be repeated through the successful `vector inspect` command" in normalized def test_owner_gate_current_summaries_supersede_stale_pre_inspection_history(): root = Path(__file__).parents[2] report = ( root / ".superpowers" / "sdd" / "2026-08-24-evidence-restructuring" / "task-12-report.md" ).read_text(encoding="utf-8") state = (root / "PROJECT_STATE.md").read_text(encoding="utf-8") current_report = report.split("## Historical record", 1)[0] current_state = state.split("## Modular workflow refactor candidate", 1)[0] assert "225 passed, 1 warning" in current_report assert "230 passed, 1 warning" in current_report assert "authorized read-only PSD" in current_report assert "35 moveable source documents" in current_report assert "**225 passed, 1 known pytest deprecation warning**" in current_state assert "**230 passed, 1 known pytest deprecation warning**" in current_state