Files
alkstore/tasks/suite-harness-current-thread.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

62 lines
2.2 KiB
Markdown

---
id: suite-harness-current-thread
name: Contract-suite harness — async sleep in `past_stamp_sleep`, current-thread flavor readiness
status: pending
depends_on: []
scope: narrow
risk: low
impact: component
level: implementation
tags: [wave-6, contract-suite]
---
## Description
The one suite-side change wave 6 carries
([ADR-024](../architecture/decisions/024-mem-engine.md) §5 item 4; the
review-003 posture note at `properties.rs:1683`): the suite's
`past_stamp_sleep` helper uses a blocking `std::thread::sleep` inside
async rows — safe under the multi-thread test flavors both existing
engines' targets use, but it would stall a current-thread runtime. The
mem engine's suite column **must** run under a current-thread flavor
(`#[tokio::test(flavor = "current_thread")]`) to keep the mem
engine's internals honestly current-thread-clean — which is what
wasm32 needs.
- Replace `past_stamp_sleep`'s blocking sleep with `tokio::time::sleep`
(async). The helper's semantics are unchanged (a bounded
pre-`run_at` settle before reads); the existing rows' determinism
posture is untouched — verify the two legs using it re-run green on
both engines with no timing drift (tolerances unchanged).
- Document (one line in the helper's doc comment or the factory
contract notes) the harness posture: **no blocking calls inside
suite rows** — the mem column enforces the flavor that catches
violations.
This task is engine-independent and can run any time before
`mem-engine-integration` wires the third column.
## Acceptance Criteria
- [ ] `past_stamp_sleep` is async (`tokio::time::sleep`)
- [ ] Both engines' existing suites re-run green with identical
assertions and tolerances (determinism posture intact)
- [ ] The no-blocking-calls posture noted where the harness's
determinism posture is documented
- [ ] Clippy `-D warnings`, fmt clean; workspace gates green
## References
- docs/architecture/decisions/024-mem-engine.md §5
- docs/reviews/003-wave-5-general-review.md §Finding 5 (the
`properties.rs:1683` posture note)
- docs/architecture/decisions/022-contract-suite-layout.md (the
factory contract the flavor rides)
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion