Summary #
The detached-kernel link continues as though durability succeeded after some SQLite writes fail. This can invalidate its host-call deduplication and outbound replay guarantees during disk-full/I/O failures.
Reviewed commit: 154c6911d6a491aeeecacf26a06b6ae8c4bc70e1.
Code paths #
src/albedo/harness/extensions/python/link.gleam:805–817:callattempts to insert the host-call identity intokernel_calls, but mapsError(_)toFresh, authorizing execution without a durable claim.src/albedo/harness/extensions/python/albedo_python.erl:1299–1312: afreshdecision spawns the host call. An external effect, such as an MCP tool invocation, need not fail merely because the local ledger write failed.src/albedo/harness/extensions/python/link.gleam:681–685: bound outboundpersistandreplycallbacks log failures and returnNilrather than propagating failure to the port owner.src/albedo/harness/extensions/python/albedo_python.erl:1362–1368:host_replyinvokeslink_reply, writes the envelope, removes the in-memory running-call entry, and advances the outgoing sequence number regardless of whether persistence succeeded.
Failure scenarios to test #
- Force the call-claim write to fail, allow a side-effecting host call to execute, and end the daemon before it acknowledges the incoming call frame. On replay, no durable claim establishes that the effect may already have happened; it can be admitted as fresh again.
- Fail outbound persistence, then lose the connection/daemon before delivery completes. The reply/frame has no durable replay copy. If the kernel received an outbound sequence number whose advancement never reached SQLite, restart can also reuse sequence numbers that kernel has already consumed.
These are source-traced failure scenarios, not fault-injection reproductions. They require a storage failure and the relevant connection/restart timing; this report does not claim ordinary successful operation duplicates calls.
Expected behavior #
A failed deduplication claim must not authorize fresh execution. Persistence failures should reach the link owner so it can report unavailability/uncertainty and avoid transmitting frames under a false durable-write assumption. Preserve the existing distinction between known-fresh work and work with an unknown outcome.
Please add storage-failure regression coverage for claim, reply/outbox persistence, reconnect, and restart, using a counted external effect so duplicate execution is observable.
we should have better durability in general but i agree with this