Summary
Advanced invariant hardening for control/session state beyond current lock-based guarantees.
Deferred Scope (grouped)
- Persist broker control snapshot (
control_state.json) on major transitions and reload at startup.
- Add generation-based CAS semantics for session/control state writes to prevent stale-writer updates.
Why deferred
- Requires migration/versioning decisions for persisted broker state.
- Requires careful API compatibility and broader refactor of state update paths.
Acceptance Criteria
- Restart-safe broker state restoration is deterministic and tested.
- CAS write conflicts are detected and surfaced with explicit errors.
- Transition tests cover stale update rejection and retry paths.