fix: repair chained imports and track blocked evidence dependencies
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

Assistant: codex
Assistant-Model: gpt-6.1-sol
Assistant-Session: 01a1046e-465c-7d43-8c4c-d10f0a1feadd
This commit is contained in:
tegwick 2026-10-04 11:36:06 +02:00
parent 28b567e588
commit 146f4e1dd3
21 changed files with 869 additions and 95 deletions

View file

@ -342,3 +342,17 @@ def test_postgres_policy_drops_the_claim_when_the_chain_cannot_be_walked(tmp_pat
backend.verify_chain = _unavailable
assert backend.retention_policy.tamper_evidence is False
assert backend.tamper_evidence_state().reason == "chain_unreadable"
def test_link_order_retains_forks_and_unreachable_rows_as_chain_breaks():
from audit_core.integrity import ChainRow, order_chain_rows, verify_rows
first = ChainRow('first', 'a', chain_link(GENESIS, 'a', 'first'), GENESIS)
second = ChainRow('second', 'b', chain_link(first.chain_hash, 'b', 'second'), first.chain_hash)
assert verify_rows(order_chain_rows([second, first])).intact
fork = ChainRow('fork', 'c', chain_link(first.chain_hash, 'c', 'fork'), first.chain_hash)
orphan = ChainRow('orphan', 'd', chain_link('absent', 'd', 'orphan'), 'absent')
for extra in (fork, orphan):
ordered = order_chain_rows([second, extra, first])
assert len(ordered) == 3
assert not verify_rows(ordered).intact