Finish WHITEHAT-WP-0001 and own live residuals in WP-0006

Close T05 and T06 on the same applicable-target rule as T03: E3 cadence
and in-process calibration, platform-pg not_applicable, P1/P2 evaluator
proven against known-good and known-bad samples. Persist offline capacity
calibration. Live E3, P1/P2, flex-auth E2, and a later audit-core run
move to WHITEHAT-WP-0006, which authorizes no packet.

Assistant: grok
Assistant-Session: 01a05e32-c776-72a3-86ec-c490e027aca9
This commit is contained in:
tegwick 2026-09-01 20:26:47 +02:00
parent 69e03efd7f
commit 43327183d8
13 changed files with 355 additions and 73 deletions

View file

@ -258,6 +258,19 @@ def test_deliver_queues_abort_without_calling_it_target_assurance(tmp_path, caps
assert "Severity" not in queued
def test_capacity_fixture_writes_calibration_and_exits_zero(tmp_path):
output = tmp_path / "offline-capacity-calibration.json"
with pytest.raises(SystemExit) as stopped:
main(["capacity-fixture", "--output", str(output)])
assert stopped.value.code == 0
report = json.loads(output.read_text(encoding="utf-8"))
assert report["outcome"] == "pass"
assert report["evidence_class"] == "fixture"
assert {item["case"] for item in report["known_bad"]} == {
"unbound_governor", "exceeded_ceiling", "missing_neighbour",
}
def test_deliver_refuses_fixture_calibration(tmp_path, capsys):
report = tmp_path / "fixture.json"
report.write_text(json.dumps({

View file

@ -1,4 +1,4 @@
from whitehat_security.capacity import CapacitySample, characterize
from whitehat_security.capacity import CapacitySample, capacity_calibration, characterize
from whitehat_security.e3 import PROBES, evaluate
from whitehat_security.model import RunReport
from whitehat_security.reporting import risk_nexus_message
@ -35,6 +35,21 @@ def test_capacity_unbound_governor_is_finding():
assert len(result.reasons) == 2
def test_capacity_calibration_detects_known_bad_without_generating_load():
report = capacity_calibration()
assert report["outcome"] == "pass"
assert report["evidence_class"] == "fixture"
good = {item["case"]: item for item in report["known_good"]}
bad = {item["case"]: item for item in report["known_bad"]}
assert good["governor_bound_within_ceiling"]["outcome"] == "pass"
assert good["governor_bound_within_ceiling"]["neighbour_degradation"]["neighbour"][
"latency_increase_percent"
] == 50.0
assert bad["unbound_governor"]["outcome"] == "finding"
assert bad["exceeded_ceiling"]["outcome"] == "aborted"
assert bad["missing_neighbour"]["outcome"] == "finding"
def test_risk_message_contains_pass_and_no_severity():
report = RunReport(
schema_version="whitehat-run/v1", run_id="run-1", evidence_class="target",