T-S9SV-lease-heartbeat-verb-replaces-raw-ps-kill
Status: closed/superseded · Impact: medium · Complexity: medium
Agents currently shell out to raw ps and kill to discover and reap orphan
lease-heartbeat processes, but raw kill cannot be safely allowlisted — it
accepts arbitrary PIDs and $() substitution rides through wildcard permission
rules. This task replaces direct ps/kill usage with a scoped CLI verb,
sdlc lease heartbeat status|start|stop|reap --task <task-id>, so heartbeat
lifecycle management is allowlist-safe, idempotent, and emits deterministic
single-line output suitable for skill verdict contracts.
Agents currently shell out to raw
psandkillto discover and reap orphan lease-heartbeat processes (see T-IZLC-task-work-resume-reaps-orphan-heartbeat / PR #288, spawned 2026-06-04, which formalizes reap-on-resume). Raw kill cannot be safely allowlisted — it accepts arbitrary PIDs and$()substitution rides through wildcard permission rules (verified 2026-06-04). Replace direct ps/kill usage with a scoped CLI verb:sdlc lease heartbeat status|start|stop|reap --task <task-id>that (1) resolves PIDs exclusively from the task’s own pidfile under .sdlc/ — never from arguments; (2) verifies the PID’s command line matches the heartbeat script signature before signaling (stale pidfile / PID-reuse guard); (3) is idempotent with single-line deterministic output (REAPED / NOT-RUNNING / STARTED / ALIVE…) suitable for skill verdict contracts; (4) updates task-work SKILL.md (heartbeat start/stop steps and resume reap) and T-IZLC’s approach to route through the verb. Mention coordination: supersedes the raw ps/kill steps wherever skills reference them (grep for ps/kill in plugin/skills/). Related: T-IZLC-task-work-resume-reaps-orphan-heartbeat, T-AI8O-heartbeat-recipe-shell-agnostic.
TBD — receiver to fill before promoting from planning/draft.
Proposed
Section titled “Proposed”TBD — receiver to fill before promoting from planning/draft.
Approach
Section titled “Approach”TBD — receiver to fill before promoting from planning/draft.
Files to touch
Section titled “Files to touch”TBD — receiver to fill before promoting from planning/draft.
Acceptance criteria
Section titled “Acceptance criteria”TBD — receiver to fill before promoting from planning/draft.
Out of scope
Section titled “Out of scope”- none
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Spawned by /sdlc:spawn-task-pr on 2026-06-05 UTC from T-IZLC-task-work-resume-reaps-orphan-heartbeat in git@github.com:sksizer/dev.git.
Consolidated (2026-07-19 task-review)
Section titled “Consolidated (2026-07-19 task-review)”- Absorbs T-AI8O-heartbeat-recipe-shell-agnostic (superseded): the verb path must stay
shell-agnostic (fish/zsh, no bash
&/echo $!). - Absorbs T-XLSV-heartbeat-loop-help-documents-basename-positional (merged): document the
<basename>positional in thelease heartbeat-loop—help while adding stop/reap.