Add transactional conversations - #6
Conversation
5e0e3e9 to
50a12c9
Compare
|
Post-merge adversarial finding: Abort during visible-history persistence commits instead of rolling back ( I reproduced this deterministically at exact merge Surviving concerns: stream cancellation currently reaches Pi abort twice through nested cleanup/rollback, relying on Pi abort idempotency; and the registry has no idle eviction/shutdown policy, so successful conversation sessions remain cached for the registry lifetime. Neither displaced the concrete abort/save race above. The private file store's temp-create/rename/cleanup and permission boundary look proportionate to the explicitly single-process, non-crash-atomic scope. Disposition: corrective follow-up needed for the abort/save race, with a regression test at the production conversation boundary. Verification was not degraded. |
Summary
Conversationown visible-history continuity, one active turn, and the save-or-rollback decisionSessionAgentConsistency boundary
Visible-history save is the commit boundary. Model failure, active abort or stream cancellation, and save failure restore the prior persistent Pi branch and dispose the abandoned session. The registry keeps that conversation reserved until rollback finishes, preventing a retry from racing the same session file.
A real
SessionManagerreopen test proves the abandoned branch and plainstein.turn_rollbackmarker stay outside future model context. Registry tests exercise the realConversationandSessionAgentover one Pi boundary fake rather than reproducing the transaction state machine.This remains the next incremental slice from #4 after #5. It intentionally excludes HTTP/OpenAI transport, a runnable service, deployment, product policy, cross-process locking, and crash-atomic commit across independent stores. The #4 branch is unchanged.
Validation
mise run check(32 tests)git pre-commit--force-with-lease; PR had no reviews, requests, or comments