Skip to content

T-2T20-task-work-backgrounds-quality-gate

Status: closed/done · Impact: medium · Complexity: small

AUTO-DEFINED: this spec was best-effort machine-authored by /sdlc:task-auto-define on 2026-07-19 because the task is autonomy: autonomous/pr. Review the Goal, Approach, Today, Files-to-touch, and Acceptance-criteria carefully before trusting it.

Close a /sdlc:task-work gap surfaced by T-JCML-augmented-convergence-audit in the sksizer/dev repo: task-work’s Step 7 quality gate and its Step 3a baseline capture each run the full quality-check suite, which exceeds the 2-minute foreground Bash timeout, and the gate additionally mis-resolves its default --baseline-dir against the empty worktree .sdlc/ instead of the main-repo capture dir. Both long-running steps must be backgrounded by default and the gate must receive an explicit main-repo baseline-dir so the quality gate completes reliably.

From T-JCML-augmented-convergence-audit:

task-work’s Step 7 quality gate and the Step 3a baseline capture each run the full 10-verb suite, which exceeds the 2-minute foreground Bash timeout, so both must be backgrounded to complete. Separately, the gate mis-resolves its default —baseline-dir against the (empty) worktree .sdlc/ instead of the main-repo capture dir, erroring ‘baseline not found’. Fix: have task-work background the gate (and baseline capture) by default and pass the main-repo —baseline-dir explicitly. Note: the explicit-baseline-dir half overlaps prior work in T-F1WJ-quality-run-resolves-superproject-baseline and the superseded T-5X6Y-task-work-step7-explicit-baseline-dir; the novel part is backgrounding the long-running gate/baseline steps.

LocationRole today
apps/sdlc/skills/task-work/SKILL.md:397Step 3a baseline-capture instruction. Shells sdlc quality baseline capture "$ORIGIN_MAIN_SHA" --config …/sdlc.yaml --baseline-dir …/.sdlc/quality-baselines in the foreground; a full-suite capture exceeds the 2-minute foreground Bash timeout, and the prose gives no backgrounding guidance.
apps/sdlc/skills/task-work/SKILL.md:827Step 7 quality-gate instruction. Shells sdlc quality run --config …/sdlc.yaml --diff-against-baseline "$ORIGIN_MAIN_SHA" --line in the foreground with no --baseline-dir; run inside the worktree its default resolves to the worktree’s empty .sdlc/quality-baselines/, so the gate errors “baseline not found”.
apps/sdlc/lib/services/quality/ops/run.ts:238quality run defaults baselineDir to join(projectRoot, ".sdlc", "quality-baselines"), and projectRoot defaults to the invoking cwd (the worktree) — the silent fallback the Step 7 prose must override with an explicit main-checkout dir.

Make /sdlc:task-work run both long-running quality shell-outs — Step 3a’s baseline capture and Step 7’s baseline-gated run — backgrounded by default, and make Step 7 pass an explicit --baseline-dir pointing at the main checkout’s .sdlc/quality-baselines directory (where Step 3a wrote the baseline while on main) instead of relying on the worktree-relative default. This is a apps/sdlc/skills/task-work/SKILL.md prose change only; the quality-service code is left untouched.

  1. In Step 3a of apps/sdlc/skills/task-work/SKILL.md, change the baseline-capture instruction so the sdlc quality baseline capture shell-out runs backgrounded by default (Bash run_in_background: true, then poll for completion), calling out that a full-suite capture exceeds the 2-minute foreground Bash timeout. Keep the existing --config and --baseline-dir flags on the capture.
  2. In Step 7, change the gate instruction so the sdlc quality run --diff-against-baseline shell-out runs backgrounded by default using the same poll-for-completion pattern.
  3. In that same Step 7 invocation, add an explicit --baseline-dir pointing at the main checkout’s .sdlc/quality-baselines — the directory Step 3a wrote to while on main — so the gate stops falling back to the worktree’s empty .sdlc/quality-baselines/. Document how to resolve the main-checkout root from inside the worktree (the parent of .sdlc/worktrees/<basename>, or git rev-parse --git-common-dir then its parent).
  4. Revise the “--baseline-dir is optional in spirit” note near line 402 so it no longer claims the gate-time default is correct from a worktree; state that Step 7 must pass the main-checkout dir explicitly because the worktree-relative default mis-resolves.
  5. Keep the edit confined to the SKILL.md prose — do not touch the quality-service runner/capture/diff code; the code-side auto-resolution is deferred to T-F1WJ-quality-run-resolves-superproject-baseline.
LocationKindChange
apps/sdlc/skills/task-work/SKILL.mdmodifyStep 3a: background the sdlc quality baseline capture shell-out. Step 7: background the sdlc quality run --diff-against-baseline shell-out and add an explicit --baseline-dir resolving to the main checkout’s .sdlc/quality-baselines; correct the “optional in spirit” note.
  • AC-1: Step 3a of apps/sdlc/skills/task-work/SKILL.md instructs running the sdlc quality baseline capture shell-out backgrounded by default (names run_in_background or an equivalent background-and-poll pattern) and cites the 2-minute foreground Bash timeout as the reason.
  • AC-2: Step 7 of apps/sdlc/skills/task-work/SKILL.md instructs running the sdlc quality run --diff-against-baseline shell-out backgrounded by default.
  • AC-3: The Step 7 sdlc quality run invocation in apps/sdlc/skills/task-work/SKILL.md includes an explicit --baseline-dir flag that resolves to the main checkout’s .sdlc/quality-baselines directory rather than the worktree-relative default.
  • AC-4: The “--baseline-dir is optional in spirit” note in Step 3a is revised so it no longer implies the worktree-relative default is correct at Step 7 gate-time.
  • AC-5: The change is confined to apps/sdlc/skills/task-work/SKILL.mdgit diff --name-only lists no file under apps/sdlc/lib/services/quality/.
  • The code-side change to make sdlc quality run auto-resolve the superproject baseline dir when invoked from a worktree — owned by T-F1WJ-quality-run-resolves-superproject-baseline.
  • Any change to apps/sdlc/lib/services/quality/ runner, capture, prune, or diff logic.
  • Refreshing the per-skill Mermaid doc docs/skills/task-work.md; a backgrounding-and-flag tweak does not change the flowchart’s step-level summaries.
  • Reworking the Step 6 heartbeat backgrounding, which is already backgrounded and unrelated to the quality gate.

Spawned by /sdlc:spawn-task-pr on 2026-07-19 UTC from T-JCML-augmented-convergence-audit in https://github.com/sksizer/dev.


← Back to Tasks