T-5LP4-retire-stamp-and-start-commits
Status: closed/done · Impact: high · Complexity: large
D-S30G migration step 3, first half: the two highest-traffic
execution-state commits on main — the ensure-ready pass stamp and the
task-work start commit — stop being written. The lease becomes the only
record of in-flight state: the pass memo lands on the lease payload
(home added by T-HTN8), lease acquisition IS the start, and resume
detection reads the lease phase instead of main-HEAD stamp heuristics.
The fail-downshift path (semantic: the spec needs work) is untouched.
| Location | Role today |
|---|---|
apps/sdlc/skills/task-ensure-ready/ensure_ready_mutate.ts#passEdits | Pass mutation: drops definition_gap, sets readiness_verified_at |
apps/sdlc/skills/task-ensure-ready/ensure_ready_mutate.ts#main | The --commit-on main branch commits the pass stamp to origin/main via commitToMainViaWorktree |
apps/sdlc/skills/task-ensure-ready/SKILL.md | Documents the stamp, the --commit/--commit-on pass shapes, and the two-line ENSURE-READY-OK: + readiness_verified_at: marker block |
apps/sdlc/skills/task-work/start_task.ts#startTask | Commits status: in-progress (+ last_reviewed, ## Post-mortem stub) to origin/main via commitToMainViaWorktree, then CAS-transitions the lease claimed→working via transitionLease and resets the task branch onto origin/main |
apps/sdlc/skills/task-work/SKILL.md | Steps 5a/5b document the stamp-then-start commit pair; Step 2’s resume detection keys on the main-HEAD verify-stamp subject |
apps/sdlc/lib/model/entities/task/ops/probe-state.ts | resume_candidate is a six-way AND including readiness_verified_at non-null and main_head_is_verify_stamp (literal subject from verifyStampSubject) |
apps/sdlc/lib/model/entities/task/ops/_probe_core.ts#mainHeadSubject | Reads main’s HEAD subject for the stamp comparison |
apps/sdlc/lib/model/entities/task/ops/close-commit.ts | Terminal close commit; already clears readiness_verified_at; no Post-mortem stub handling |
Proposed
Section titled “Proposed”Ensure-ready’s pass verdict is a marker plus a lease memo — no frontmatter
write, no commit (when a definition_gap is present from a prior fail, pass
still clears it; that is a semantic edit and keeps its commit). Task-work’s
start is the lease transition plus branch reset — no main commit; the
## Post-mortem stub appends at close time instead. Resume detection reads
the lease: worktree + branch exist, lease phase claimed or working, no
open PR.
Approach
Section titled “Approach”ensure_ready_mutate.ts: in pass mode, stop settingreadiness_verified_at(passEditsshrinks to thedefinition_gapremoval). When the frontmatter has nodefinition_gap, the pass path performs no file mutation and no commit at all — marker only. The--commit-on mainpass branch writes the memo instead: invokesdlc lease task transitionwith--readiness-verified-at(and--touchpoints-verified-atwhen the touchpoint slice resolved clean), preserving the current phase. Fail mode is untouched.task-ensure-ready/SKILL.md: pass flow re-documented — marker block becomesENSURE-READY-OK: <basename>plus the memo destination; drop the stamp line; Step 3b’s frontmatter-only precondition notes it now applies only to the residualdefinition_gap-clearing commit.start_task.ts: remove thecommitToMainViaWorktreestart-commit block and itsplanStartMutation/startCommitDuemachinery; keep the lease claimed→working transition, the branch verification + reset, and theSTARTED:marker. The status staysopen/readyin frontmatter for the task’s whole in-flight life.close-commit.ts: append the## Post-mortemstub during the close mutation when the body lacks that section (the stub start_task used to plant), so the close-out post-mortem flow keeps its anchor.probe-state.ts/_probe_core.ts: add a nullablelease_phasefield (read via the lease library against the configured authority; null when unavailable). Recomputeresume_candidateas:task_status === "open/ready"ANDworktree_existsANDbranch_existsANDlease_phasein {claimed, working} ANDopen_pr_number === null. Removemain_head_is_verify_stampand thereadiness_verified_atconjunct from the gate; keep both fields in the output for one transition period, marked legacy in their descriptions.task-work/SKILL.md: Step 5 collapses to a single 5 (gate + lease transition, no stamp/start commits); Step 2’s resume-detection prose replaces the stamp heuristics (including the pre-2026-05-28 legacy branch-stamp fallback) with the lease-phase rule.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
apps/sdlc/skills/task-ensure-ready/ensure_ready_mutate.ts | modify | Pass mode: no stamp, no-op without definition_gap; --commit-on main pass writes lease memo via transition op |
apps/sdlc/skills/task-ensure-ready/SKILL.md | modify | Pass-flow and marker-block re-documentation |
apps/sdlc/skills/task-work/start_task.ts | modify | Drop the start-commit block; keep lease transition, branch reset, STARTED: marker |
apps/sdlc/skills/task-work/SKILL.md | modify | Steps 2/5 rewritten: lease-phase resume rule, no stamp/start commits |
apps/sdlc/lib/model/entities/task/ops/probe-state.ts | modify | lease_phase field; resume_candidate recomputed from lease phase |
apps/sdlc/lib/model/entities/task/ops/_probe_core.ts | modify | Lease-phase reader helper; mainHeadSubject demoted to legacy output support |
apps/sdlc/lib/model/entities/task/ops/close-commit.ts | modify | Append ## Post-mortem stub when absent during close mutation |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: ensure-ready pass on a clean task (no
definition_gap) makes no commit and leaves the file byte-identical; the marker still emits. - AC-2: ensure-ready pass via the task-work path records
readiness_verified_aton the lease payload (observable via lease inspect) and writes nothing to the task file. - AC-3: after
start_task.tsruns, origin/main has no new commit for the task and its frontmatter status is stillopen/ready, while the lease phase isworking. - AC-4:
sdlc task probe-stateoutput carrieslease_phase, andresume_candidateis true for the stalled shape (worktree + branch + leaseclaimed/working+ no PR) without any verify-stamp commit on main. - AC-5: a close via
sdlc task close-commiton a body lacking## Post-mortemlands the stub in the terminal commit. - AC-6: the fail-downshift path still commits
planning/needs-definition+definition_gapexactly as before.
Out of scope
Section titled “Out of scope”- The
prs[]mid-flight append retirement (T-IVEJ). - Schema removal of
readiness_verified_at/touchpoints_verified_at/in-progressvalues (D-S30G step 5 — after this soaks). - Reader migration beyond probe-state (dashboard and orchestrate already read the lease authority).
Dependencies
Section titled “Dependencies”T-HTN8— the lease memo fields must exist first (frontmatterdepends_oncarries this).D-S30Gshould be flipped toopen/acceptedbefore this lands (its migration step 1); it merged asopen/proposed.
Depends on
Section titled “Depends on”T-HTN8