T-2T0R-probe-state-inflight-lease-aware
Status: closed/done · Impact: high · Complexity: medium
Stage 2 of D-S30G-task-state-plane-split. The two lease-blind readers gain a lease arm so they keep working when execution state stops being mirrored into frontmatter. Dual-mode: the frontmatter fallback stays until stage 7 removes it.
| Location | Role today |
|---|---|
apps/sdlc/lib/model/entities/task/ops/probe-state.ts | Reads frontmatter status/stamp, worktree dir, branch, gh PR, and the main_head_is_verify_stamp commit-subject literal. No lease read. |
apps/sdlc/lib/model/entities/task/ops/_probe_core.ts | Shared probe helpers (frontmatter, git, gh). |
apps/sdlc/lib/model/entities/task/ops/inflight.ts | Classifies in-flight work from frontmatter status + open PR only. |
apps/sdlc/skills/task-work/SKILL.md | Step 2 branches on probe-state’s fields, incl. resume_candidate. |
Proposed
Section titled “Proposed”probe-state emits lease_present / lease_phase /
lease_pr_number from the local ref mirror (null when the mirror
is absent — no network in the op). resume_candidate becomes
lease-arm OR the legacy verify-stamp arm. inflight classification
prefers lease phase when present (working → implementing,
awaiting-review / responding → awaiting-review) with the
frontmatter rule as fallback. Pre-cutover, lease and frontmatter
agree, so behavior is unchanged.
Approach
Section titled “Approach”- Add a local-mirror lease reader to
_probe_core.ts(ref presence + parsed phase / pr_number / gates; null offline). - Extend probe-state’s output and its
resume_candidate/blocked_preflightderivations with the lease arm. - Rewrite
inflight.tsclassify to prefer lease phase. - Update task-work SKILL.md Step 2 prose to read the new fields.
- Tests: a lease-holding pre-split run resumes via the lease arm; a missing mirror degrades to today’s exact behavior.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
apps/sdlc/lib/model/entities/task/ops/_probe_core.ts | modify | Local-mirror lease reader. |
apps/sdlc/lib/model/entities/task/ops/probe-state.ts | modify | Lease fields + dual resume gate. |
apps/sdlc/lib/model/entities/task/ops/inflight.ts | modify | Lease-preferring classify. |
apps/sdlc/skills/task-work/SKILL.md | modify | Step 2 reads the new fields. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: A run holding a lease in phase
workingis a resume candidate even when main’s HEAD is not the verify-stamp commit. - AC-2: With no local lease mirror, probe-state and inflight reproduce today’s outputs.
- AC-3:
inflightclassifies a lease inawaiting-review/respondingas awaiting-review regardless of frontmatter.
Out of scope
Section titled “Out of scope”- Removing the legacy verify-stamp resume arm — stage 7 (T-11QZ-task-schema-v6-contract-sweep).
Dependencies
Section titled “Dependencies”- T-5G81-lease-payload-gates — the payload shape (gates) this reader parses.
Discovery context
Section titled “Discovery context”- Scaffolded from D-S30G-task-state-plane-split (migration stage 2 of 7).