[Reliability] Add stream hygiene controls for test and replay runs #24

Closed
opened 2026-03-12 21:52:33 +00:00 by Mark · 3 comments
Owner

Observed during pico/nano mesh test runs.

Problem

Durable consumers may process retained intent.discovered messages from prior runs, causing unexpected cross-run execution in test harnesses.

Scope

  • Add per-run consumer group namespace defaults in launcher scripts
  • Add optional stream trim/reset controls for test runs
  • Add safety notes for production vs test retention behavior
  • Add test coverage for retained-stream isolation behavior

Acceptance

  • Fresh test run does not process previous test intents unless explicit replay mode is enabled
  • scripts/run_pico_nano_mesh_test.sh supports isolated run id/group
  • Docs updated in specs/v1-protocol-and-gates.md and USAGE.md
Observed during pico/nano mesh test runs. ## Problem Durable consumers may process retained `intent.discovered` messages from prior runs, causing unexpected cross-run execution in test harnesses. ## Scope - Add per-run consumer group namespace defaults in launcher scripts - Add optional stream trim/reset controls for test runs - Add safety notes for production vs test retention behavior - Add test coverage for retained-stream isolation behavior ## Acceptance - Fresh test run does not process previous test intents unless explicit replay mode is enabled - `scripts/run_pico_nano_mesh_test.sh` supports isolated run id/group - Docs updated in `specs/v1-protocol-and-gates.md` and `USAGE.md`
Author
Owner

Progress update:

Implemented in working tree:

  • Isolated consumer-group namespace per run in launcher scripts using RUN_ID
  • Durable workers now support --group-start-id and launchers default to $ (start at latest)
  • Backplane consume() supports group_start_id for Redis and memory backplanes
  • Added integration test tests/integration/test_stream_hygiene.py to validate latest-start isolation behavior

Remaining scope for #24:

  • Optional explicit stream trim/reset command path for test-only runs
  • Additional replay-safety controls in dead-letter tooling
Progress update: Implemented in working tree: - Isolated consumer-group namespace per run in launcher scripts using `RUN_ID` - Durable workers now support `--group-start-id` and launchers default to `$` (start at latest) - Backplane `consume()` supports `group_start_id` for Redis and memory backplanes - Added integration test `tests/integration/test_stream_hygiene.py` to validate latest-start isolation behavior Remaining scope for #24: - Optional explicit stream trim/reset command path for test-only runs - Additional replay-safety controls in dead-letter tooling
Author
Owner

Implemented remaining scope in working tree:

  • Dead-letter replay safety guard:
    • scripts/deadletter_cli.py replay now checks ledger state and blocks settled intents by default
    • explicit override available with --allow-settled
  • Dead-letter retention cleanup:
    • added deadletter_cli.py cleanup --maxlen N
  • Added tests for replay guard logic:
    • tests/unit/test_deadletter_cli.py
  • Updated docs:
    • USAGE.md
    • specs/v1-protocol-and-gates.md

This closes the outstanding replay-safety + retention pieces tracked by #24.

Implemented remaining scope in working tree: - Dead-letter replay safety guard: - `scripts/deadletter_cli.py replay` now checks ledger state and blocks settled intents by default - explicit override available with `--allow-settled` - Dead-letter retention cleanup: - added `deadletter_cli.py cleanup --maxlen N` - Added tests for replay guard logic: - `tests/unit/test_deadletter_cli.py` - Updated docs: - `USAGE.md` - `specs/v1-protocol-and-gates.md` This closes the outstanding replay-safety + retention pieces tracked by #24.
Mark closed this issue 2026-03-13 00:14:26 +00:00
Author
Owner

Phase Dependency Mapping

Linked to Phase Tracker: #31 (Phase 4: Optimization)

Prerequisites:

  • #8 (Integration test) - testing infrastructure
  • #17 (Automated test suite) ✅ - test framework

Type: Testing infrastructure
Priority: P2 (CI/CD quality)

Purpose: Isolate test runs from production

Acceptance Criteria:

  • Separate Redis databases per test run
  • Automatic cleanup after tests
  • Replay run isolation
  • No cross-contamination between runs

Related: #23 (dead-letter replay)

## Phase Dependency Mapping **Linked to Phase Tracker:** #31 (Phase 4: Optimization) **Prerequisites:** - #8 (Integration test) - testing infrastructure - #17 (Automated test suite) ✅ - test framework **Type:** Testing infrastructure **Priority:** P2 (CI/CD quality) **Purpose:** Isolate test runs from production **Acceptance Criteria:** - Separate Redis databases per test run - Automatic cleanup after tests - Replay run isolation - No cross-contamination between runs **Related:** #23 (dead-letter replay)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#24
No description provided.