Skip to content

T-YQY2-task-next-lease-exclusion

Status: closed/superseded · Impact: high · Complexity: medium

Stage 3 of D-S30G-task-state-plane-split. Once in-progress stops being written to frontmatter, task next would re-offer in-flight work every tick. Exclude candidates with an active lease ref in the local mirror — the double-dispatch guard, with cas_create failing at claim as the hard backstop.

LocationRole today
apps/sdlc/lib/model/entities/task/ops/next.tsFrontmatter-only selector: status filter, autonomy exclusion, priority/impact sort, depends_on dispatchability. No lease read, no network.
apps/sdlc/skills/orchestrate/SKILL.mdTick sync step fetches main; no refs/sdlc/* refspec, so the local lease mirror only freshens when the dashboard happens to run.

next skips any candidate whose basename has an active ref at refs/sdlc/tasks/<basename> in the local mirror (archived refs don’t exclude), reports the skips (skipped_leased), and stays network-free. The orchestrate tick’s sync step gains the refs/sdlc/* refspec so the mirror is tick-fresh. Pre-cutover a leased task is also in-progress, so exclusion is a zero-behavior change; stale-mirror failure modes degrade safely (under-dispatch self-heals on next fetch; stale-missing is caught at claim).

  1. Add a local-ref existence check per candidate in next.ts; thread a skipped_leased list into --explain / output.
  2. Add the refs/sdlc/* refspec to orchestrate’s tick sync.
  3. Tests: leased candidate skipped; archived lease not skipped; absent mirror behaves as today.
LocationKindChange
apps/sdlc/lib/model/entities/task/ops/next.tsmodifyActive-lease exclusion + skipped_leased.
apps/sdlc/skills/orchestrate/SKILL.mdmodifyTick sync fetches refs/sdlc/*.
  • AC-1: A task with an active ref at refs/sdlc/tasks/<b> in the local mirror is never emitted by task next.
  • AC-2: A task whose lease lives only under refs/sdlc/archive/ is still offered.
  • AC-3: next makes no network calls; with no local mirror it behaves exactly as today.
  • Lease-phase-aware ordering or reporting beyond exclusion.

T-5G81-lease-payload-gates


← Back to Tasks