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.
45 lines
1.2 KiB
Python
45 lines
1.2 KiB
Python
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
SKILL = ROOT / "skills/pentest/SKILL.md"
|
|
REPORTING = ROOT / "skills/pentest/playbooks/reporting.md"
|
|
|
|
|
|
def test_skill_defines_output_budget_rules_for_batches():
|
|
text = SKILL.read_text(encoding="utf-8")
|
|
required = [
|
|
"Output budget",
|
|
"3-5 bullets",
|
|
"save raw output",
|
|
"$ENG_DIR/evidence/",
|
|
"do not paste full scanner output",
|
|
"quote only decisive lines",
|
|
]
|
|
for phrase in required:
|
|
assert phrase.lower() in text.lower()
|
|
|
|
|
|
def test_reporting_playbook_enforces_concise_evidence_excerpts():
|
|
text = REPORTING.read_text(encoding="utf-8")
|
|
required = [
|
|
"Output Budget",
|
|
"appendix",
|
|
"raw artifacts",
|
|
"decisive excerpt",
|
|
"avoid dumping raw command output",
|
|
]
|
|
for phrase in required:
|
|
assert phrase.lower() in text.lower()
|
|
|
|
|
|
def test_output_budget_preserves_evidence_integrity():
|
|
combined = "\n".join(
|
|
[
|
|
SKILL.read_text(encoding="utf-8"),
|
|
REPORTING.read_text(encoding="utf-8"),
|
|
]
|
|
).lower()
|
|
assert "never summarize away" in combined
|
|
assert "artifact path" in combined
|
|
assert "full output" in combined
|