core: verify and pin the receiver's pre-yield offset() value (review 004 item 12, core-pin-offset-initial-value) — the three engines verified equal live, so the doc-pin branch applies: offset() reads 0 before any yield on every receiver — fresh consumer, stored positive checkpoint, stored negative seed (ADR-023 §2's totality arm, the one a checkpoint-seeded realization would surface on) — the no-yield sentinel, never the stored checkpoint: the checkpoint gates the feed's attach-read start while the receiver's offset tracks the last-yielded event only, composing with the pinned pre-yield save_offset() no-op; the attach read's prefetches sit unobserved and the first recv/try_recv observation is the first move (then the post-yield value, receiver_close_and_save_arms' pin). Verified by code read first (all three offset() bodies are self.position, all three constructors seed position: 0 unconditionally — mem stream.rs:353, sqlite :399, pg :620) then live: new suite row receiver_offset_pre_yield_is_zero (alkstore-contract-suite, stamped ADR-008 §8 + the core-contract.md pin, four arms incl. the first-observation composition leg) green on all three columns, pg against the harness server (parked pglo-poc :15432); pinned in three places: core-contract.md streams/subscribe row (dated 2026-10-11 annotation) + a verification-backlog bullet recording the verified pin, the core trait doc on offset() (core's doc comments are contract text), and the suite row itself — ADR-008 §8's shape comment deliberately left untouched (doc-only verification takes no ADR amendment, noted in the task); no engine code changed, no divergence to raise; gates green: workspace build/tests server-less, full pg column vs harness (135+26+9), clippy -D warnings, fmt --check, doc gate zero warnings, fuzz corpus replay 6/6, wasm32 mem check, taskgraph validate (96); task -> completed
This commit is contained in:
1 parent
321f579ac2
commit
9301bb926b
8 files changed
+196
-21
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
id: core-pin-offset-initial-value
|
||||
name: Verify and pin EventReceiver::offset()'s pre-yield value (review 004 item 12)
|
||||
status: pending
|
||||
status: completed
|
||||
depends_on: []
|
||||
scope: narrow
|
||||
risk: low
|
||||
@@ -38,14 +38,14 @@ conversation, not a doc edit.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] The three engines' pre-yield `offset()` values verified equal by
|
||||
- [x] The three engines' pre-yield `offset()` values verified equal by
|
||||
live runs (the probe/leg recorded; green on all three columns —
|
||||
pg against the harness server)
|
||||
- [ ] core-contract.md's `EventReceiver::offset()` text pins the
|
||||
- [x] core-contract.md's `EventReceiver::offset()` text pins the
|
||||
pre-yield return with a dated annotation
|
||||
- [ ] If divergent instead: the divergence recorded and raised with
|
||||
the user (this AC replaces the doc pin, not supplements it)
|
||||
- [ ] Doc gate green; any new suite leg green on all three columns
|
||||
- [x] Doc gate green; any new suite leg green on all three columns
|
||||
|
||||
## References
|
||||
|
||||
@@ -58,8 +58,59 @@ conversation, not a doc edit.
|
||||
|
||||
## Notes
|
||||
|
||||
> To be filled by implementation agent
|
||||
- **The engines were equal — the doc-pin branch applies, not the
|
||||
divergence branch.** Read first (all three `offset()` bodies are
|
||||
`self.position`, and all three constructors initialize
|
||||
`position: 0` unconditionally — mem
|
||||
`alkstore-mem/src/stream.rs:353`, sqlite
|
||||
`alkstore-sqlite/src/stream.rs:399`, pg
|
||||
`alkstore-postgres/src/stream.rs:620`), then verified live by the
|
||||
new suite leg on all three columns: 0 on every pre-yield arm
|
||||
(fresh, positive-checkpoint, negative-seed), no divergence to
|
||||
raise.
|
||||
- **Probe home: the contract suite** (the task's first choice) — a
|
||||
new row `receiver_offset_pre_yield_is_zero` in
|
||||
`alkstore-contract-suite/src/properties.rs`, wired into all three
|
||||
engines' `tests/contract_suite.rs` executors. Four arms: fresh
|
||||
consumer, consumer with a stored positive checkpoint, consumer
|
||||
with a stored negative checkpoint (the ADR-023 §2 totality seed —
|
||||
the arm a checkpoint-seeded realization would surface on), and a
|
||||
first-observation composition leg (the attach read prefetches
|
||||
unobserved; the first `recv` moves `offset()` to the last-yielded
|
||||
offset). Stamp per the `version_stamp` convention: ADR-008 §8's
|
||||
`EventReceiver` shape + the core-contract.md pin (no ADR owns this
|
||||
property's pre-yield arm — the review item is the pin's origin, so
|
||||
the backlog row is the cited pin).
|
||||
- **Doc pin location**: the task said "core-contract.md's
|
||||
`EventReceiver::offset()` paragraph" — no such standalone paragraph
|
||||
exists; the receiver's contract text lives in the streams/
|
||||
`subscribe(consumer)` bullet (ADR-008 §8 pins only the shape
|
||||
comment "the receiver's current offset"). The pin landed there
|
||||
(dated annotation), *and* on `offset()`'s own trait doc in
|
||||
`alkstore/src/event_receiver.rs` (core's doc comments are contract
|
||||
text per AGENTS.md; dated the same). ADR-008 §8's shape comment was
|
||||
deliberately left untouched — a doc-only verification task takes no
|
||||
ADR amendment.
|
||||
- **Verification-backlog bullet added** (core-contract.md), matching
|
||||
the section's evolved role: the new bullet records the verified pin
|
||||
with the row's name and the all-three-columns result, same posture
|
||||
as the review-004 suite legs before it.
|
||||
- Frontmatter `last_updated` extended with the pin (dated), keeping
|
||||
the freeze note intact.
|
||||
|
||||
## Summary
|
||||
|
||||
> To be filled on completion
|
||||
The pre-yield `offset()` question closed: all three engines return 0
|
||||
before any yield regardless of stored checkpoint (positive, negative,
|
||||
or absent) — the no-yield sentinel, composing with the pinned
|
||||
pre-yield `save_offset()` no-op; the first `recv`/`try_recv`
|
||||
observation is the first move. Pinned in three places: the contract
|
||||
text (core-contract.md streams row + verification-backlog bullet,
|
||||
dated 2026-10-11), the core trait doc (`event_receiver.rs::offset()`),
|
||||
and the suite (new stamped row `receiver_offset_pre_yield_is_zero` on
|
||||
`alkstore-contract-suite`). Verified: the new row green on all three
|
||||
columns (pg against the harness server `pglo-poc` :15432), full pg
|
||||
column green (135+26+9), workspace tests green server-less, clippy `-D
|
||||
warnings`, `cargo fmt --check`, doc gate zero warnings, fuzz corpus
|
||||
replay 6/6, wasm32 mem check green. Contract-observation only — no
|
||||
engine code changed, no ADR amendment.
|
||||
Reference in new issue
Block a user