from pathlib import Path ROOT = Path(__file__).resolve().parents[2] PENTEST = ROOT / "skills" / "pentest" REPORTING = PENTEST / "playbooks" / "reporting.md" TEMPLATE = PENTEST / "templates" / "report-template.md" def read(path: Path) -> str: return path.read_text(encoding="utf-8") def test_reporting_playbook_requires_terminal_finding_disposition_gate(): text = read(REPORTING) required = [ "## Finding Disposition Gate", "Before final report generation, every candidate must be classified", "`validated`", "`rejected`", "`escalated`", "`candidate`", "Manual Review Required", "no `candidate` entries remain in `$ENG_DIR/hypotheses.md`", "verification receipts directory", ] for phrase in required: assert phrase in text candidate_idx = text.index("`candidate`") block_idx = text.index("Block final report until disposition changes") assert candidate_idx < block_idx def test_report_template_has_manual_review_section_and_status_guidance(): text = read(TEMPLATE) required = [ "## Finding Disposition Gate", "Only `validated` findings belong in the confirmed findings list", "## Manual Review Required", "Use this section only for `escalated` items", "Do not list `candidate` items in the final report", "| `validated` | Confirmed finding |", "| `rejected` | Appendix or omit |", "| `escalated` | Manual Review Required |", "| `candidate` | Blocks final report |", ] for phrase in required: assert phrase in text