Skip to content

feat(V2-03): one logical write coordinator (ADR-070) - #79

Merged
MikeRoss27 merged 1 commit into
devfrom
codex/v2-03-write-coordinator
Aug 14, 2026
Merged

feat(V2-03): one logical write coordinator (ADR-070)#79
MikeRoss27 merged 1 commit into
devfrom
codex/v2-03-write-coordinator

Conversation

@MikeRoss27

Copy link
Copy Markdown
Contributor

Summary

  • Implements ADR-070 (rev3, Accepted) — V2-03 in the normative sequence: a single WriteCoordinator now owns all product mutable state (Engine + memory/vector/graph/FTS indexes) behind a private ProductStateCell, replacing the old arbitrary with_inner_write closure authority.
  • Reads route through a closed ReadGateway; writes submit closed WriteIntents ordered by a canonical FIFO, with a phase-aware WAL outcome (Aborted/Durable/OutcomeUnknown/DurableReopenRequired/StructuralReopenRequired) and a product visibility barrier so a reader never observes a torn index state.
  • Finishes the migration of native_store/{mod.rs,porting.rs,trait_impl.rs} onto the coordinator (forget_many, purge_agent, graph upserts, import, container reads) and fixes a real pre-existing bug found in the process (put_memory/put_memory_batch expected the wrong WriteValue variant).
  • ADR-067 remains the sole authority for physical publication (catalog/generation/crypto); this ADR only closes the logical write side.

Test plan

  • cargo check -p basemyai --all-targets --features test-util — 0 errors
  • cargo xtask check (fmt + clippy -D warnings across every crate/binding, matches CI) — exit 0
  • cargo xtask test — full matrix passes
  • cargo test -p xtask and cargo xtask v2-layering — pass, no unauthorized public API surface change (baseline updated to reflect resolved with_inner* debt)

🤖 Generated with Claude Code

Replaces the implicit `NativeMemoryStore::with_inner_write` closure
authority with a single owner of the mutable product state: a
BaseMyAIRuntime with a private ProductStateCell, a read-only
ReadGateway, and one WriteCoordinator holding a non-clonable
ProductWriteToken. All live mutation paths (memory, graph, import,
purge, key/passphrase rotation) now submit closed WriteIntent values
and are ordered by a canonical FIFO, with a phase-aware WAL outcome
(Aborted/Durable/OutcomeUnknown) and a product visibility barrier
that prevents observing a torn index state.

ADR-067 remains the sole authority for physical publication; V2-03
only closes the logical write side per ADR-070 rev3.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@MikeRoss27 MikeRoss27 self-assigned this Aug 14, 2026
@MikeRoss27
MikeRoss27 merged commit 5ede84a into dev Aug 14, 2026
28 of 30 checks passed
@MikeRoss27
MikeRoss27 deleted the codex/v2-03-write-coordinator branch August 14, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant