Skip to content

T-IVEJ-prs-once-at-close

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

D-S30G migration step 3, second half: prs[] becomes a historical record written once in the terminal close commit. The mid-flight record-PR commit to main (one per PR open) retires; the lease’s pr_number — already set by task-work’s transition to awaiting-review — is the live binding. Independent of the stamp/start retirement (T-5LP4).

LocationRole today
apps/sdlc/skills/task-work/append_pr_url.ts#appendPrUrlStep 10.4 script: appends the PR URL to prs: frontmatter and commits to main (assertRepoOnMain guard, record-pr lifecycle subject, docs regen + rebase-push)
apps/sdlc/skills/task-work/SKILL.mdStep 10.4 invokes the append before the Step 10.5 lease transition; carries a crash-recoverability rationale for that ordering
apps/sdlc/lib/model/entities/task/ops/close-commit.tsTerminal close commit; verifies/appends a single --prUrl into prs[] idempotently
apps/sdlc/skills/task-close-out/Close-out flow; per the task schema it verifies/appends prs[] at close

No mid-flight prs[] write exists. At PR open, the only record is the lease (pr_number via the Step 10.5 transition). At close, close-commit accepts every PR URL the task produced (repeatable flag) and lands the full ordered list in the one terminal commit. The crash window between gh pr create and the lease transition is accepted: an unbound PR is discoverable by branch name (the probe’s open-PR lookup already does this).

  1. close-commit.ts: make the PR flag repeatable (--pr-url, N occurrences, order preserved, idempotent against URLs already present). The CLOSE-COMMIT ... prs= marker reports the final count.
  2. task-work/SKILL.md: remove Step 10.4 (the append_pr_url.ts invocation) and its ordering rationale; the transition to awaiting-review with --pr-number becomes the sole post-create step. Note the accepted crash window and the by-branch discovery fallback.
  3. Delete append_pr_url.ts (its computeAppend/writePrsFrontmatter helpers live in the shared lib consumed by close-commit.ts — verify nothing else imports the script before deleting).
  4. task-close-out skill: confirm the close flow passes every PR URL for the task (from the lease pr_number and gh pr list by task branch) through the repeatable flag; update its prose where it references the mid-flight append.
LocationKindChange
apps/sdlc/lib/model/entities/task/ops/close-commit.tsmodifyRepeatable --pr-url; ordered, idempotent multi-append
apps/sdlc/skills/task-work/SKILL.mdmodifyStep 10.4 removed; post-create flow is the lease transition alone
apps/sdlc/skills/task-work/append_pr_url.tsdeleteMid-flight writer retired
apps/sdlc/skills/task-close-out/modifyClose flow gathers the full PR list and passes it to close-commit; prose updated
  • AC-1: sdlc task close-commit invoked with two --pr-url values lands both, in order, in the terminal commit’s prs[]; re-invoking with a URL already present adds nothing.
  • AC-2: apps/sdlc/skills/task-work/append_pr_url.ts no longer exists, and no file under apps/sdlc/ references it (checked with a repo-wide search for the script name).
  • AC-3: apps/sdlc/skills/task-work/SKILL.md contains no Step 10.4 append; the PR-open flow goes gh pr create → lease transition with --pr-number.
  • AC-4: a task closed through the updated flow ends with prs[] populated in its terminal commit and no record-pr commit anywhere in its history.
  • The stamp/start-commit retirement (T-5LP4).
  • Schema changes to prs[] (shape is unchanged — only the write moment moves).
  • Multi-PR consolidation flows (/sdlc:consolidate-task-prs) beyond prose references to the retired step.
  • D-S30G should be flipped to open/accepted before this lands (its migration step 1); it merged as open/proposed.

← Back to Tasks