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

@ -64,6 +64,29 @@ class ChainReport:
}
def order_chain_rows(rows: Iterable[ChainRow]) -> list[ChainRow]:
"""Follow stored links, independently of historical acceptance timestamps.
Keep unreachable/forked rows in the result so verify_rows reports a break
rather than silently dropping evidence outside the genesis chain.
"""
remaining = list(rows)
successors: dict[str, list[ChainRow]] = {}
for row in remaining:
successors.setdefault(row.chain_prev, []).append(row)
ordered: list[ChainRow] = []
used: set[str] = set()
previous = GENESIS
while len(successors.get(previous, [])) == 1:
row = successors[previous][0]
if row.event_id in used:
break
ordered.append(row)
used.add(row.event_id)
previous = row.chain_hash
return ordered + [row for row in remaining if row.event_id not in used]
def verify_rows(
rows: Iterable[ChainRow],
*,