- 1. Feature Context
- 2. Actor Flows (CDSL)
- 3. Processes / Business Logic (CDSL)
- 4. States (CDSL)
- 5. Definitions of Done
- 6. Acceptance Criteria
- 7. Additional Context (optional)
-
p1- ID:cpt-ex-ovwa-featstatus-cli-control -
-
cpt-ex-ovwa-feature-cli-control
This feature defines user-facing CLI controls and the local-only control channel contract between the CLI and the daemon. It covers status reporting, pause/resume, manual reset, and stop.
Key assumptions:
- Control communication is local-only.
- Reset is explicit and does not happen automatically.
Control channel contract (v1):
- Transport: Unix domain socket at control_socket_path (default: /tmp/overwork-alert.sock)
- Encoding: JSON request/response
- Commands: status, pause, resume, reset, stop
- CLI timeout: 2 seconds
Error handling expectations:
- If the daemon is not running or the socket is unreachable, the CLI MUST return a clear error and non-zero exit.
- If a request times out or the response is invalid JSON, the CLI MUST return a clear error and non-zero exit.
Acceptance criteria (timing):
- status MUST return within 2 seconds when the daemon is healthy.
- reset MUST complete within 2 seconds when the daemon is healthy.
Allow the user to inspect and control the tracker in a predictable, explicit manner using CLI commands.
cpt-ex-ovwa-actor-user
- Overall Design: DESIGN.md
- Related feature: tracker-core.md
- ID:
cpt-ex-ovwa-flow-cli-control-status
Actors:
cpt-ex-ovwa-actor-user
- -
p1- User runsoverwork-alert status-inst-run-status - -
p1- CLI sends local control request {cmd:"status"} -inst-send-status-request - -
p1- IF CLI cannot connect to daemon within timeout: RETURN error -inst-status-daemon-unreachable - -
p1- Daemon returns current TrackerState snapshot -inst-return-status - -
p1- IF response is invalid: RETURN error -inst-status-invalid-response - -
p1- CLI prints active time, limit, and paused/running state -inst-print-status
- ID:
cpt-ex-ovwa-flow-cli-control-reset
Actors:
cpt-ex-ovwa-actor-user
- -
p1- User runsoverwork-alert reset-inst-run-reset - -
p1- CLI sends local control request {cmd:"reset"} -inst-send-reset-request - -
p1- IF CLI cannot connect to daemon within timeout: RETURN error -inst-reset-daemon-unreachable - -
p1- Daemon clears active_time_seconds and over-limit reminder state -inst-clear-state - -
p1- CLI prints confirmation -inst-print-confirm
- ID:
cpt-ex-ovwa-flow-cli-control-pause
Actors:
cpt-ex-ovwa-actor-user
- -
p1- User runsoverwork-alert pause-inst-run-pause - -
p1- CLI sends local control request {cmd:"pause"} -inst-send-pause-request - -
p1- IF CLI cannot connect to daemon within timeout: RETURN error -inst-pause-daemon-unreachable - -
p1- Daemon sets TrackerState.status=PAUSED and RETURN ok -inst-daemon-pause - -
p1- CLI prints confirmation -inst-print-pause-confirm
- ID:
cpt-ex-ovwa-flow-cli-control-resume
Actors:
cpt-ex-ovwa-actor-user
- -
p1- User runsoverwork-alert resume-inst-run-resume - -
p1- CLI sends local control request {cmd:"resume"} -inst-send-resume-request - -
p1- IF CLI cannot connect to daemon within timeout: RETURN error -inst-resume-daemon-unreachable - -
p1- Daemon sets TrackerState.status=RUNNING and RETURN ok -inst-daemon-resume - -
p1- CLI prints confirmation -inst-print-resume-confirm
- ID:
cpt-ex-ovwa-flow-cli-control-stop
Actors:
cpt-ex-ovwa-actor-user
- -
p1- User runsoverwork-alert stop-inst-run-stop - -
p1- CLI sends local control request {cmd:"stop"} -inst-send-stop-request - -
p1- IF CLI cannot connect to daemon within timeout: RETURN error -inst-stop-daemon-unreachable - -
p1- Daemon begins graceful shutdown and RETURN ok -inst-daemon-stop - -
p1- CLI prints confirmation -inst-print-stop-confirm
- ID:
cpt-ex-ovwa-algo-cli-control-handle-command
- -
p1- Parse command from request payload -inst-parse-cmd - -
p1- IF cmd is missing or not recognized RETURN error -inst-handle-invalid-cmd - -
p1- IF cmd="status" RETURN current state snapshot -inst-handle-status - -
p1- IF cmd="pause" set status=PAUSED and RETURN ok -inst-handle-pause - -
p1- IF cmd="resume" set status=RUNNING and RETURN ok -inst-handle-resume - -
p1- IF cmd="reset" clear accumulation and RETURN ok -inst-handle-reset - -
p1- IF cmd="stop" request daemon shutdown and RETURN ok -inst-handle-stop
- ID:
cpt-ex-ovwa-state-cli-control-request-lifecycle
- -
p1- FROM RECEIVED TO VALIDATED WHEN request payload is parsed -inst-transition-validated - -
p1- FROM VALIDATED TO RESPONDED WHEN daemon sends response -inst-transition-responded
-
p1- ID:cpt-ex-ovwa-dod-cli-control-reset-and-controls
The CLI must provide status, pause, resume, reset, and stop commands. Reset clears the in-memory accumulated active time and over-limit reminder state, and there is no automatic reset.
Implementation details:
- Component:
cpt-ex-ovwa-component-cli - Component:
cpt-ex-ovwa-component-control-channel - Data:
cpt-ex-ovwa-dbtable-tracker-state
Implements:
-
p1-cpt-ex-ovwa-flow-cli-control-status -
p1-cpt-ex-ovwa-flow-cli-control-reset -
p1-cpt-ex-ovwa-flow-cli-control-pause -
p1-cpt-ex-ovwa-flow-cli-control-resume -
p1-cpt-ex-ovwa-flow-cli-control-stop -
p1-cpt-ex-ovwa-algo-cli-control-handle-command
Covers (PRD):
-
cpt-ex-ovwa-fr-cli-controls -
cpt-ex-ovwa-fr-manual-reset -
cpt-ex-ovwa-nfr-privacy-local-only
Covers (DESIGN):
-
cpt-ex-ovwa-principle-explicit-control -
cpt-ex-ovwa-constraint-macos-cli-only -
cpt-ex-ovwa-component-cli -
cpt-ex-ovwa-component-control-channel -
cpt-ex-ovwa-component-daemon -
cpt-ex-ovwa-seq-cli-reset -
cpt-ex-ovwa-dbtable-tracker-state
-
statusreturns within 2 seconds when the daemon is healthy. -
resetcompletes within 2 seconds when the daemon is healthy. - CLI returns clear non-zero exit codes when daemon is unreachable or response is invalid.
Pause/resume flows follow the same control channel pattern as reset/status and are handled by the same command handler algorithm.
Out of scope / not applicable (v1):
- No authentication/authorization beyond local-only transport and filesystem permissions on the Unix socket.
- No remote control interface; no TCP listener.
- No encryption in transit (local-only).