mem engine locks — pure reconciliation: the TTL-registry mechanism landed implemented with the seam task's whole-engine scope, and every pin the task enumerates already exists in lock.rs's suite (contention/loser-None, duration guards on try_lock+renew, silent lapse + re-acquire + renew-past-expiry refused via the frozen clock, release shapes, entry validation, no-lock_tx) — zero code, zero tests changed; the task is the disposition of record (task file status + Notes/Summary)
This commit is contained in:
1 parent
61a1148165
commit
f37fb0d17d
1 file changed
+50
-7
@@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
id: mem-engine-locks
|
id: mem-engine-locks
|
||||||
name: Mem engine — named locks (in-memory TTL registry)
|
name: Mem engine — named locks (in-memory TTL registry)
|
||||||
status: pending
|
status: completed
|
||||||
depends_on: [mem-engine-seam-tx]
|
depends_on: [mem-engine-seam-tx]
|
||||||
scope: narrow
|
scope: narrow
|
||||||
risk: low
|
risk: low
|
||||||
@@ -37,14 +37,14 @@ The named-locks mechanism over an in-memory TTL registry
|
|||||||
|
|
||||||
## Acceptance Criteria
|
## 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
|
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
|
refused — pinned (clock-controlled tests via the state core's
|
||||||
clock accessor)
|
clock accessor)
|
||||||
- [ ] Concurrent-contention shape: loser is `None`, winner's lease
|
- [x] Concurrent-contention shape: loser is `None`, winner's lease
|
||||||
intact — pinned
|
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
|
clean; workspace gates green
|
||||||
|
|
||||||
## References
|
## References
|
||||||
@@ -58,8 +58,51 @@ The named-locks mechanism over an in-memory TTL registry
|
|||||||
|
|
||||||
## Notes
|
## 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
|
## Summary
|
||||||
|
|
||||||
> To be filled on completion
|
> 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.
|
||||||
Reference in new issue
Block a user