Files
alkstore/tasks/mem-doc-growth-outbox-notes.md
T

67 lines
2.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
id: mem-doc-growth-outbox-notes
name: Pin mem's growth postures and outbox semantics in the spec (review 004 items 10+11)
status: pending
depends_on: []
scope: narrow
risk: trivial
impact: isolated
level: implementation
tags: [review-004-fixes, mem-engine, docs]
---
## Description
Two recorded mem postures get their doc pins, per
`docs/reviews/004-pre-release-general-review.md` §"Findings recorded,
not fixed" items 10 and 11 (the review's "carry into the mem spec's
growth section when next touched" — this is that touch).
**(a) Growth postures (item 10)** — two honest sentences in
`engine-mem.md`'s growth section:
- The subscribe path drains the full backlog into the receiver's
pending deque before the first yield, and pending grows at publish
rate for a stalled consumer (`stream.rs:314-331` — the documented
"drains to the tail then parks" shape, unbounded on the consumer
side).
- The claim path is an O(total-live-rows) scan with full-row clones
per claim (`queue.rs:122-181`) — blessed economics for the ephemeral
tier.
**(b) Outbox outcome swallow (item 11)** — `outbox run_once` drops the
ack/retry row-refs' booleans and returns `Ok(true)` even when delivery
outlived the visibility window and nothing landed (`outbox.rs:104-122`).
Inherent to the no-heartbeat outbox design (at-least-once reclaim is
the recovery). Pin the "processed means delivered-or-reclaimable"
semantic with a doc sentence in `engine-mem.md`'s outbox section; add
the `debug_assert!` too if it adds value without noise — the review
offered either, implementer's call (record which and why).
Doc-only plus at most one `debug_assert!` — no behavioral change.
## Acceptance Criteria
- [ ] `engine-mem.md` carries the two growth-posture sentences,
anchored to the code sites
- [ ] The outbox "processed means delivered-or-reclaimable" semantic
is pinned (doc sentence; `debug_assert!` per the recorded call)
- [ ] Doc gate green (`RUSTDOCFLAGS="-D warnings" cargo doc
--no-deps`); mem tests green (the `debug_assert!` arm, if added,
exercised by an existing outbox test)
## References
- docs/reviews/004-pre-release-general-review.md §"Findings recorded,
not fixed" items 10–11 (the findings, the blessed-economics framing)
- docs/architecture/engine-mem.md (the growth section, the outbox
section)
- alkstore-mem/src/stream.rs:314-331, queue.rs:122-181,
outbox.rs:104-122 (the anchored sites)
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion