feat: journal strict task consumption before native fixture effects
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 1s

Assistant: codex
Assistant-Model: gpt-6-astra
Assistant-Session: 01a140c4-354a-7823-8f0d-8f717397f786
This commit is contained in:
codex 2026-10-16 09:20:33 +02:00
parent d042d468df
commit e2b832b5d4
8 changed files with 717 additions and 2 deletions

View file

@ -231,6 +231,21 @@ class Journal:
return {"state": row[3], "evidence_digest": row[4], "dispatch_allowed": False,
"external_outcome_unknown": bool(pending)}
def next_call_ordinal(self, binding: Binding):
"""Continue the same admitted invocation after owner auth/consume calls.
This never grants dispatch or resumes a persisted admission. The actual
before_call transaction remains the final serialization/intent guard.
"""
if not self._held or self._admission != binding:
raise Refused("next call requires same live admission")
count,pending=self.db.execute("SELECT COUNT(*),COALESCE(SUM(outcome='pending'),0) FROM calls WHERE operation=?",(binding.operation_id,)).fetchone()
cleanup=self.db.execute("SELECT COUNT(*) FROM cleanup WHERE operation=? AND outcome!='owed'",(binding.operation_id,)).fetchone()[0]
state=self.db.execute("SELECT state FROM operations WHERE operation=?",(binding.operation_id,)).fetchone()[0]
if pending or cleanup or state in {'failed','unknown','cleanup-confirmed'} or count>63:
raise Refused("call sequence is uncertain, closed or exhausted")
return count
def before_call(self, binding: Binding, ordinal: int, call_digest: str):
"""Persist one exact plan-call intent before the mediator issues it.