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.
| Location | Role today |
|---|---|
apps/sdlc/skills/task-work/SKILL.md:397 | Step 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:827 | Step 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:238 | quality 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. |
Proposed
Section titled “Proposed”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.
Approach
Section titled “Approach”- In Step 3a of
apps/sdlc/skills/task-work/SKILL.md, change the baseline-capture instruction so thesdlc quality baseline captureshell-out runs backgrounded by default (Bashrun_in_background: true, then poll for completion), calling out that a full-suite capture exceeds the 2-minute foreground Bash timeout. Keep the existing--configand--baseline-dirflags on the capture. - In Step 7, change the gate instruction so the
sdlc quality run --diff-against-baselineshell-out runs backgrounded by default using the same poll-for-completion pattern. - In that same Step 7 invocation, add an explicit
--baseline-dirpointing 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>, orgit rev-parse --git-common-dirthen its parent). - Revise the “
--baseline-diris 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. - 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.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
apps/sdlc/skills/task-work/SKILL.md | modify | Step 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. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1: Step 3a of
apps/sdlc/skills/task-work/SKILL.mdinstructs running thesdlc quality baseline captureshell-out backgrounded by default (namesrun_in_backgroundor 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.mdinstructs running thesdlc quality run --diff-against-baselineshell-out backgrounded by default. - AC-3: The Step 7
sdlc quality runinvocation inapps/sdlc/skills/task-work/SKILL.mdincludes an explicit--baseline-dirflag that resolves to the main checkout’s.sdlc/quality-baselinesdirectory rather than the worktree-relative default. - AC-4: The “
--baseline-diris 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.md—git diff --name-onlylists no file underapps/sdlc/lib/services/quality/.
Out of scope
Section titled “Out of scope”- The code-side change to make
sdlc quality runauto-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.
Dependencies
Section titled “Dependencies”- T-OLTA-task-work-step7-worktree-baseline-dir (open/ready) overlaps the
baseline-dir-from-worktree half of this task; coordinate so the two do not double-edit Step 7’s
--baseline-dirhandling. - T-F1WJ-quality-run-resolves-superproject-baseline (planning/draft) is the code-side
alternative; if it lands first, Step 7’s explicit
--baseline-dirbecomes belt-and-suspenders rather than the sole fix. Not a hard blocker. - T-5X6Y-task-work-step7-explicit-baseline-dir (closed/superseded) is the earlier explicit-baseline-dir attempt this task’s baseline-dir half revives.
- Builds on T-H69K-run-quality-checks-isolates-pre-existing-drift (closed/done), which introduced the baseline capture/diff mechanism the gate depends on.
Discovery context
Section titled “Discovery context”Spawned by /sdlc:spawn-task-pr on 2026-07-19 UTC from T-JCML-augmented-convergence-audit in https://github.com/sksizer/dev.