From f37fb0d17dbd5be7cce6556037f553a6f85d95cc Mon Sep 17 00:00:00 2001 From: "glm-5.3-flash" Date: Sat, 10 Oct 2026 12:16:44 +0000 Subject: [PATCH] =?UTF-8?q?mem=20engine=20locks=20=E2=80=94=20pure=20recon?= =?UTF-8?q?ciliation:=20the=20TTL-registry=20mechanism=20landed=20implemen?= =?UTF-8?q?ted=20with=20the=20seam=20task's=20whole-engine=20scope,=20and?= =?UTF-8?q?=20every=20pin=20the=20task=20enumerates=20already=20exists=20i?= =?UTF-8?q?n=20lock.rs's=20suite=20(contention/loser-None,=20duration=20gu?= =?UTF-8?q?ards=20on=20try=5Flock+renew,=20silent=20lapse=20+=20re-acquire?= =?UTF-8?q?=20+=20renew-past-expiry=20refused=20via=20the=20frozen=20clock?= =?UTF-8?q?,=20release=20shapes,=20entry=20validation,=20no-lock=5Ftx)=20?= =?UTF-8?q?=E2=80=94=20zero=20code,=20zero=20tests=20changed;=20the=20task?= =?UTF-8?q?=20is=20the=20disposition=20of=20record=20(task=20file=20status?= =?UTF-8?q?=20+=20Notes/Summary)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tasks/mem-engine-locks.md | 57 ++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/tasks/mem-engine-locks.md b/tasks/mem-engine-locks.md index c125234..bf889b5 100644 --- a/tasks/mem-engine-locks.md +++ b/tasks/mem-engine-locks.md @@ -1,7 +1,7 @@ --- id: mem-engine-locks name: Mem engine — named locks (in-memory TTL registry) -status: pending +status: completed depends_on: [mem-engine-seam-tx] scope: narrow risk: low @@ -37,14 +37,14 @@ The named-locks mechanism over an in-memory TTL registry ## Acceptance Criteria -- [ ] `try_lock`/`renew`/`release` over the TTL registry; entry +- [x] `try_lock`/`renew`/`release` over the TTL registry; entry validation (names + duration guard) — pinned -- [ ] TTL expiry: silent lapse, re-acquisition, renew-past-expiry +- [x] TTL expiry: silent lapse, re-acquisition, renew-past-expiry refused — pinned (clock-controlled tests via the state core's clock accessor) -- [ ] Concurrent-contention shape: loser is `None`, winner's lease +- [x] Concurrent-contention shape: loser is `None`, winner's lease intact — pinned -- [ ] `cargo check --target wasm32-unknown-unknown -p alkstore-mem` +- [x] `cargo check --target wasm32-unknown-unknown -p alkstore-mem` clean; workspace gates green ## References @@ -58,8 +58,51 @@ The named-locks mechanism over an in-memory TTL registry ## Notes -> To be filled by implementation agent +> Filled by implementation agent, 2026-10-10. + +1. **The implementation already landed in the seam task** — + `mem-engine-seam-tx` Note 1 (the all-or-nothing trait-impl + disposition, the same one the notify-listen and queues twins + recorded): the `MemLock` registry mechanism in + `alkstore-mem/src/lock.rs` was implemented with the seam's + whole-engine scope; this task found its mechanism *implemented*. +2. **Full coverage reconciliation — zero new tests needed**: every + shape the description and the three acceptance criteria enumerate + was already pinned by the seam suite in `lock.rs`: the contention + shape (first wins, loser `None` as a clean value, same-owner + re-grant without a second lease row — `contention_grants_once_and_ + the_loser_reads_none`), the duration guard (`ttl <= 0` → opaque + `Database` `Err` on both `try_lock` and `renew`, ADR-023 §2's + durations kind — `duration_guards_reject_non_positive_ttls`), the + TTL expiry row via the frozen clock (in-TTL refusal, silent lapse, + re-acquisition, old-holder renew refused — `expiry_lapses_silently_ + and_reacquires`), renew-past-expiry refused + the new holder's + clean life (`renew_past_expiry_is_refused`), the release shapes + (held-true, past-expiry-still-the-holder's, re-acquired-elsewhere + no-op — `release_shapes`), entry validation (empty/blank/reserved + name, empty owner — `entry_validation`), and the + locks-are-not-tx-scoped posture (the overlay neither sees nor + stages locks — `locks_are_not_tx_scoped`). Note also the seam + task's recorded semantis delta (seam Notes 7): mem pins + renew-past-expiry *refused*, where the SQLite substrate would + revive a not-yet-purged lapsed row — the stricter, contract-honest + arm. +3. **No production code changed and no test changed** — the task is a + disposition: the surface was verified correct as-found. ## Summary -> To be filled on completion \ No newline at end of file +> Filled on completion, 2026-10-10. + +Completed the mem engine's locks task as a pure reconciliation: the +TTL-registry mechanism landed with the seam task's whole-engine scope, +and the reconciliation against the description's pin list found all +three acceptance criteria's shapes already unit-pinned in +`alkstore-mem/src/lock.rs`'s seven tests (contention/loser-None, +duration guards on both entry kinds, clock-controlled silent lapse + +re-acquisition + renew-past-expiry refused, release shapes, entry +validation, no-`lock_tx`). No code and no tests changed; acceptance +criteria satisfied as-found. Verified: `cargo test -p alkstore-mem` +green, workspace `cargo test` green, `cargo clippy --all-targets -- +-D warnings` clean, `cargo fmt --check` clean, +`cargo check --target wasm32-unknown-unknown -p alkstore-mem` clean. \ No newline at end of file