Admit source evidence snapshots and harden stream completeness
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a06e89-93a2-7aa2-82b3-ce5ccd2682e6
This commit is contained in:
parent
824fb1b966
commit
31e9963933
34 changed files with 1057 additions and 122 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from helpers import load_pilot, observation_from_fixture
|
||||
|
||||
from kings_guard.cadence import load_qonto_assistant_cadence
|
||||
from kings_guard.contracts import (
|
||||
ReconciliationView,
|
||||
|
|
@ -7,8 +9,6 @@ from kings_guard.contracts import (
|
|||
)
|
||||
from kings_guard.posture import PostureEvaluator, is_stream_finding
|
||||
|
||||
from helpers import load_pilot, observation_from_fixture
|
||||
|
||||
|
||||
def test_cadence_draft_covers_both_forms_against_qonto() -> None:
|
||||
cadence = load_qonto_assistant_cadence()
|
||||
|
|
@ -36,7 +36,9 @@ def test_unmet_declared_rate_is_a_stream_finding() -> None:
|
|||
counts={"audit.deny": 0},
|
||||
),
|
||||
),
|
||||
reconciliation=ReconciliationView(source_counts={"audit.deny": 0}, evidence_counts={"audit.deny": 0}),
|
||||
reconciliation=ReconciliationView(
|
||||
source_counts={"audit.deny": 0}, evidence_counts={"audit.deny": 0}
|
||||
),
|
||||
)
|
||||
|
||||
assert any(item.startswith("stream:cadence_unmet:audit.allow") for item in stream.findings)
|
||||
|
|
@ -54,7 +56,9 @@ def test_missing_heartbeat_is_a_stream_finding() -> None:
|
|||
now="2026-07-24T10:10:00Z",
|
||||
watching_since="2026-07-22T09:10:00Z",
|
||||
heartbeats=(),
|
||||
reconciliation=ReconciliationView(source_counts={"audit.deny": 1}, evidence_counts={"audit.deny": 1}),
|
||||
reconciliation=ReconciliationView(
|
||||
source_counts={"audit.deny": 1}, evidence_counts={"audit.deny": 1}
|
||||
),
|
||||
)
|
||||
|
||||
assert any(item.startswith("stream:heartbeat_missing:audit.deny") for item in stream.findings)
|
||||
|
|
@ -103,7 +107,9 @@ def test_stream_findings_are_distinguishable_from_content_findings() -> None:
|
|||
now="2026-07-24T10:10:00Z",
|
||||
watching_since="2026-07-22T09:10:00Z",
|
||||
heartbeats=(),
|
||||
reconciliation=ReconciliationView(source_counts={"audit.deny": 1}, evidence_counts={"audit.deny": 1}),
|
||||
reconciliation=ReconciliationView(
|
||||
source_counts={"audit.deny": 1}, evidence_counts={"audit.deny": 1}
|
||||
),
|
||||
)
|
||||
|
||||
content_findings = set(evaluation.assessment.findings)
|
||||
|
|
@ -127,7 +133,9 @@ def test_heartbeat_not_yet_due_does_not_false_alarm() -> None:
|
|||
now=observation.timestamp,
|
||||
watching_since=observation.timestamp,
|
||||
heartbeats=(),
|
||||
reconciliation=ReconciliationView(source_counts={"audit.deny": 1}, evidence_counts={"audit.deny": 1}),
|
||||
reconciliation=ReconciliationView(
|
||||
source_counts={"audit.deny": 1}, evidence_counts={"audit.deny": 1}
|
||||
),
|
||||
)
|
||||
|
||||
assert not any(item.startswith("stream:heartbeat_missing") for item in stream.findings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue