mirror of
https://github.com/Strategic-Automation/violin.git
synced 2026-08-14 12:33:37 +02:00
- state.py: fcntl/msvcrt file locking, reservation+finalization, history verification, remove dead subprocess bridges (p1-lock) - hypotheses.py: enforce canonical status, phase/host/service/port match, reject unrelated hypotheses (p1-hyp) - tools.py/__init__.py: retain kwargs (task_id), lifecycle hooks wired (REGISTERED_TOOLS + no-op-then-active hooks) (p1-life) - Migrate tests from tests/*.py to tests/guard + tests/pentest_docs; align to actual API (handle_target returns ips[0], handle_exec_burst fail-closed, PTT self-certify uses real batch_id, post-exploitation requires hypothesis) - scoping.md: add checkpoint.json continuity-artifact drift note - pyproject.toml: v1.2.0, per-file-ignores for tests/scripts (E402/S101) - Add .pytest-tmp-plugin/ to .gitignore 64 passed; ruff clean.
51 lines
1.6 KiB
Python
51 lines
1.6 KiB
Python
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
|