Skip to content

T-31XR-ensure-ready-mutator-main-repo-override

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

/sdlc:task-work’s main-ref task-state commits (verify-stamp, start-commit) assume the project’s primary checkout is on branch main: ensure_ready_mutate.ts --commit-on main and start_task.ts both resolve the main repo via git rev-parse --git-common-dir (which always points at the shared .git, i.e. the primary checkout) and then refuse to commit unless that checkout’s current branch equals main. When an operator deliberately parks the primary checkout on another branch (e.g. a long-running backlog-capture branch), task-work cannot drive those steps directly — it has to improvise a throwaway main-ref worktree. start_task.ts already exposes a --main-repo override that sidesteps the --git-common-dir resolution; ensure_ready_mutate.ts does not, so the verify-stamp step has to be hand-applied via its --commit path against a manually-created worktree. Give the ensure-ready mutator the same --main-repo (or --commit-on <worktree-path>) override so task-work can land the verify-stamp on a dedicated main-ref worktree without improvising, when the primary checkout is intentionally on another branch.

Receiver to flesh out before promoting from planning/draft.

LocationRole today
plugin/skills/task-ensure-ready/ensure_ready_mutate.ts--commit-on main resolves the main checkout via --git-common-dir and hard-requires its current branch == the --commit-on value; no --main-repo override exists.
plugin/skills/task-work/start_task.tsAlready accepts --main-repo <path> to override the --git-common-dir-resolved main checkout — the precedent to mirror.

Receiver to flesh out before promoting from planning/draft.

The ensure-ready mutator accepts a --main-repo <path> override (mirroring start_task.ts) that, when supplied, targets that path as the main checkout for the --commit-on branch check and the task-file commit — so task-work can land the verify-stamp on a dedicated main-ref worktree when the primary checkout is parked on a non-main branch.

Receiver to flesh out before promoting from planning/draft.

  1. Add a --main-repo flag to ensure_ready_mutate.ts’s arg parser and thread it into the --commit-on branch where resolveMainCheckout is called.
  2. When the override is present, use it as the main checkout root instead of the --git-common-dir resolution; keep the branch == --commit-on guard.
  3. Add a test mirroring start_task.ts’s --main-repo coverage.

Receiver to flesh out before promoting from planning/draft.

LocationKindChange
plugin/skills/task-ensure-ready/ensure_ready_mutate.tsmodifyAdd --main-repo override; use it for the --commit-on main-checkout resolution.

Receiver to flesh out before promoting from planning/draft.

  • AC-1: ensure_ready_mutate.ts --commit-on main --main-repo <path> commits the verify-stamp/downshift against <path> (when <path> is on branch main) rather than the --git-common-dir-resolved primary checkout.
  • AC-2: A test exercises the override path, mirroring start_task.ts’s --main-repo coverage.
  • Changing start_task.ts (it already has the override).
  • The broader question of whether task-work should formally support a non-main primary checkout end-to-end — this task only adds the one missing override symmetric with start_task.ts.
  • none

Spawned by /sdlc:spawn-task-pr on 2026-06-05 UTC from T-TWZD-normalize-baseline-diff-nondeterministic-output in https://github.com/sksizer/dev.


← Back to Tasks