Persist review evidence and deliver audit records transactionally

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
tegwick 2026-09-10 23:27:19 +02:00
parent 0e48355b9f
commit 2cc32168ac
14 changed files with 1474 additions and 22 deletions

View file

@ -114,9 +114,10 @@ def record(
Guards, in the order a defect is most likely to be caught:
- ``G_NOAGENT`` humans bind, agents draft. No upstream backstop exists.
- ``G_NOAGENT`` humans bind, agents draft; declared controls also guard upstream.
- ``G_STEP`` the verb must be legal for this step kind.
- ``G_PRES`` the presentation must be of this memo AND this version.
- ``G_ACTOR`` the acting person must be the presentation's recipient.
- ``G_ACK`` required highlights acked before any binding verb.
- ``G_REASONS`` a return carries at least one coded reason.
- ``G_SEALED`` binding verbs on a sealed version are illegal.
@ -125,7 +126,7 @@ def record(
raise DispositionRefused(
"G_NOAGENT",
f"{actor.kind.value} principals may draft but never bind "
"(INTENT principle 10; approval-engine provides no upstream backstop)",
"(INTENT principle 10)",
)
if verb not in legal_verbs(memo.step_kind):
@ -145,6 +146,9 @@ def record(
f"{memo.version} — no silent upgrade",
)
if actor.sub != presentation.principal_sub:
raise DispositionRefused("G_ACTOR", "actor did not receive this presentation")
if verb in BINDING_VERBS:
if memo.sealed:
raise DispositionRefused("G_SEALED", "binding verbs on a sealed version are illegal")