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.
| Location | Role 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.ts | Already accepts --main-repo <path> to override the --git-common-dir-resolved main checkout — the precedent to mirror. |
Proposed
Section titled “Proposed”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.
Approach
Section titled “Approach”Receiver to flesh out before promoting from
planning/draft.
- Add a
--main-repoflag toensure_ready_mutate.ts’s arg parser and thread it into the--commit-onbranch whereresolveMainCheckoutis called. - When the override is present, use it as the main checkout root instead of the
--git-common-dirresolution; keep the branch ==--commit-onguard. - Add a test mirroring
start_task.ts’s--main-repocoverage.
Files to touch
Section titled “Files to touch”Receiver to flesh out before promoting from
planning/draft.
| Location | Kind | Change |
|---|---|---|
plugin/skills/task-ensure-ready/ensure_ready_mutate.ts | modify | Add --main-repo override; use it for the --commit-on main-checkout resolution. |
Acceptance criteria
Section titled “Acceptance criteria”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 branchmain) rather than the--git-common-dir-resolved primary checkout. - AC-2: A test exercises the override path, mirroring
start_task.ts’s--main-repocoverage.
Out of scope
Section titled “Out of scope”- Changing
start_task.ts(it already has the override). - The broader question of whether task-work should formally support a non-
mainprimary checkout end-to-end — this task only adds the one missing override symmetric withstart_task.ts.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”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.