Skip to content

Store: add with_immediate_tx / with_deferred_read transaction combinators #213

Description

@George-RD

Parent

#208 (Spec: deepened Store interface)

Blocked by

None.

Deliverables

Add the private Store transaction combinators (expand step — no mass migration yet).

  • Store::with_immediate_tx<T>(&self, f: impl FnOnce(&rusqlite::Transaction) -> Result<T, StoreError>) -> Result<T, StoreError>: locks conn, opens TransactionBehavior::Immediate, runs f, commits on Ok, rolls back on Err.
  • Store::with_deferred_read<T>(...) for the sole Deferred read path (store/audit_support.rs::verify_and_replay_aggregate), kept explicitly separate from the write combinator.
  • Migrate ONE pilot write site to with_immediate_tx to prove the shape (leave the rest for the T6 sweep).
  • Tests: commit on Ok; rollback on Err; two racing writers serialize (D-050 write-serialization / TOCTOU closure, cf. D-167/D-169).

Rationale and the full seam are in spec #208 (decision D-001). Files: crates/openspine-kernel/src/store/mod.rs, store/audit_support.rs.

Verification

./scripts/check.sh green (builds openspine-shell bin first, per AGENTS.md). No public API removed yet; conn stays pub(crate) until T6.

🤖 Generated from spec #208 (wayfinder #189, map #182).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions