[P0] Implement the hard capture gate and lifecycle state machine #7

Closed
opened 2026-07-17 23:58:46 +00:00 by lost-rob0t · 0 comments
lost-rob0t commented 2026-07-17 23:58:46 +00:00 (Migrated from github.com)

Goal

Make the off switch authoritative across the entire process.

Requirements

  • States: off, starting, recording, paused, stopping, and faulted.
  • Turning off must stop new capture, cancel queued and in-flight processing, clear volatile buffers, and prevent persistence.
  • Process startup defaults to off unless an explicit opt-in setting says otherwise.
  • Unsupported session type, unavailable encryption, or policy failure transitions to faulted, never recording.
  • State changes emit sanitized audit events.
  • Concurrent state commands are serialized and idempotent.

Acceptance criteria

  • Tests prove no capture backend or persistence operation can run while off.
  • A stop request invalidates stale work using generation/session tokens or equivalent.
  • Restarting the daemon does not silently resume capture.
  • State transitions are deterministic and fully unit tested.

Depends on

## Goal Make the off switch authoritative across the entire process. ## Requirements - States: `off`, `starting`, `recording`, `paused`, `stopping`, and `faulted`. - Turning off must stop new capture, cancel queued and in-flight processing, clear volatile buffers, and prevent persistence. - Process startup defaults to `off` unless an explicit opt-in setting says otherwise. - Unsupported session type, unavailable encryption, or policy failure transitions to `faulted`, never recording. - State changes emit sanitized audit events. - Concurrent state commands are serialized and idempotent. ## Acceptance criteria - Tests prove no capture backend or persistence operation can run while `off`. - A stop request invalidates stale work using generation/session tokens or equivalent. - Restarting the daemon does not silently resume capture. - State transitions are deterministic and fully unit tested. ## Depends on - #5 - #6
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
nsaspy/local-recall#7
No description provided.