Files
alkstore/tasks/mem-engine-integration.md
T
glm-5.3-flash 5abd351c86 Wave-6 decomposition (mem engine): eleven tasks per the pg-wave rhythm — foundations (crate scaffold, MemStore::new isolation, guarded state core, wake routing, wasm32 gate from birth), seam-tx (the load-bearing tx overlay: eleven staged _tx methods, commit-merge + wake-at-commit — pg-fix-tx-wake's discipline structural from the start, drop = discard trivial, with_tx panic posture), mechanisms mutually parallel (notify-listen close-at-engine-drop/no-replay/never-coalesced; queues = ADR-010 machine driver-free with the equal-jitter curve and opts resolution as ADR-012 §2's third owner; streams log+offsets+trim; locks TTL registry, no busy-path analog), scheduler-outbox (tick/catch-up-64/leadership through the __alkstore_scheduler lock, engine-uniform per ADR-009 §4; outbox over queues with the 60/5/5 seam stamp), integration (suite third StoreFactory column green on host under a current-thread flavor, wasm32 acceptance items, engine-mem.md to implementation-complete), and the review-wave-6 gate (born-pinned audit: conformance read, discharge-map wiring, wasm items, three-way equivalence green, class-1 window discipline). Window riders: suite-harness-current-thread — the wave's one suite-side pre-task, past_stamp_sleep's blocking sleep goes async per review 003's properties.rs:1683 posture note, enabling the current-thread flavor; pg-fix-scheduler-tick-seam — review 003 Finding 1, the cfg(test) transient-fault seam driving the real tick_with_retries through retry-then-success and exhaustion arms (the last uncovered wave-4 hardening arm, sqlite-commit-error-arm pattern). Task hygiene: pg-fix-open-path frontmatter fixed (unquoted 'max_size: 0' colon-space inside the name scalar broke YAML parsing — taskgraph validate had been red one-error since the wave-4 fix-batch decomposition; also restores review-wave-4-fixes' dependency resolution). implementation.md: wave-6 table row → decomposed, task-set listing with the parallelism note (rider + pre-task independent of the mem chain; rider closes before the gate), wave-6 decomposition bullet in the review-rounds record. Docs-only change; verified taskgraph validate (60 tasks, no cycles), cargo fmt --check, cross-reference read
2026-10-10 09:57:01 +00:00

95 lines
4.2 KiB
Markdown

---
id: mem-engine-integration
name: Mem engine — integration (full-surface wiring, suite third column, wasm32 acceptance)
status: pending
depends_on: [mem-engine-notify-listen, mem-engine-streams, mem-engine-queues, mem-engine-locks, mem-engine-scheduler-outbox, mem-engine-seam-tx, suite-harness-current-thread]
scope: moderate
risk: medium
impact: phase
level: implementation
tags: [wave-6, mem-engine, integration]
---
## Description
The integration task: wire the finished mechanisms into a complete
`Store`, adopt the contract suite as the third column, and carry the
wasm acceptance items through ([ADR-024](../architecture/decisions/024-mem-engine.md)
§5; the born-pinned posture — engine-mem.md §Isolation and the suite
factory):
- **Full-surface wiring**: every handle constructible off one
`MemStore`; trait-object plumbing; crate docs (module docs + a
crate-level doc carrying the honest-ephemeral posture statement —
no durability, single-process, ephemeral by design, never
fleet-valid, per [ADR-024](../architecture/decisions/024-mem-engine.md)
§2 — and the wasm identity line per engine-mem.md §Identity).
- **Suite third column**: a `tests/contract_suite.rs` target
implementing `StoreFactory` (fresh `MemStore::new()` per run,
teardown = drop — the factory's isolation contract verbatim) and
running the shared rows wired per engine: mem's column carries the
mechanism rows that express on it and omits the engine-shaped rows
that cannot (reconnect-wake, watcher-death close, watcher-cadence —
the per-engine wiring the suite's rows already use;
`PayloadTooLarge`'s non-occurrence arm *wires* — the arm is the
pin). The column runs under a **current-thread runtime flavor**
(the pre-task's async-sleep harness makes this clean).
- **wasm32 acceptance**: `cargo check --target wasm32-unknown-unknown
-p alkstore-mem` (and the workspace's other crates untouched)
clean; the manifest's tokio features verified as the sync+time
subset. On-target suite execution stays scoped out (the named
collapse condition — a wasm-bindgen-test adapter crate — recorded in
the task Notes at completion, not an OQ).
- **No `spawn_blocking` anywhere**: grep-verified; internals
current-thread-clean by construction, now proven by the flavor the
column runs under.
- Suite column green is the wave's center-of-mass: 25 rows' worth of
contract v1 assertions against a third, independent implementation —
any red row is either a mem defect or (if the row pins
implementation detail a correct engine could fail) a found suite
defect to raise with the reviewer *before* editing the row (rows pin
ADR text; a wobble is amend-in-place material under the class-1
window).
## Acceptance Criteria
- [ ] `StoreFactory` implemented for the mem engine; the third suite
column wired and **green on the host** (same row set per the
wiring table above)
- [ ] The column runs under the current-thread flavor; no blocking
calls in mem internals (grep-verified)
- [ ] `cargo check --target wasm32-unknown-unknown -p alkstore-mem`
clean
- [ ] `engine-mem.md` updated from `draft`-initial to
implementation-complete (the spec grows with the wave per its
frontmatter note); crate docs carry the posture + wasm identity
- [ ] Workspace gates green; clippy `-D warnings`; fmt clean
- [ ] The class-1 window discipline respected: any suite-row change
or contract wobble surfaced to the reviewer, not silently
patched
## Dependencies note
`mem-engine-seam-tx` is listed because the overlay's commit-merge and
`*_tx` read shapes are what the suite's tx rows exercise on mem; the
mechanism tasks consume it, but a late seam fix may be needed if the
suite surfaces one — the task owns absorbing it.
## References
- docs/architecture/decisions/024-mem-engine.md §5 (acceptance items);
022-contract-suite-layout.md (the factory both engines already
implement — the shape to mirror)
- docs/architecture/engine-mem.md (spec of record)
- tasks/sqlite-engine-integration.md / tasks/pg-engine-integration.md
(the structural twins' integration tasks of record)
- tasks/review-wave-5.md appendix (the discharge map the third column
rides)
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion