Repository navigation
feat: --dry-run for milestone new, task finish and milestone close — plan first, then act (#178) - #179
Conversation
19a5b6b to
be3dd26
Compare
There was a problem hiding this comment.
Verdict: request changes
PR #179 satisfies the core dry-run behavior in the required live probes, but the plan/execute refactor changes existing live milestone close output on a gated path.
Finding
internal/cli/milestone.go:299-327,355-358 defers the existing qa is unrouted note into the execute closure. On main, once QA verdicts pass with an unrouted QA role, the live verb prints that note before gathering records and checking the milestone document. On this branch, a live close that reaches DOC_MISSING returns from planClose before run exists/runs, so the note is omitted. Preserve the existing live output on DOC_MISSING while keeping dry-run write-free, and add a regression test covering an unrouted-QA, satisfied-verdict, missing-document close.
I also observed that sweep diagnostic notes are now buffered and printed before all branch result lines rather than interleaved at the point each task is visited (internal/cli/branches.go:83-88). The line texts and branch decisions remain the same, so this is recorded as compatibility evidence rather than a separate blocking finding.
Evidence
- Identity: configured App ID
4719924matchedGET /apps/radiusred-checky; PR author isradiusred-cody[bot], distinct from reviewerradiusred-checky[bot]. - Required reading order followed: complete PR diff first, then #178 (including Plan and resolved ask-the-human point), #133, M7-R5 on #163, then PR description.
go test ./...: pass.go vet ./...: pass.task finish 178 --dry-run: exit 1,NOT_OWNERat owner, all later gates not reached.- Same with
--bypass: exit 1,CREW_BYPASSat owner. milestone close 7 --dry-run: exit 1,OPEN_TASKS.milestone close 99 --dry-run: exit 1,NOT_FOUND.milestone new --dry-run --title "Probe" --requirement "a" --requirement "b": exit 0, M8, M8-R1/M8-R2 and ROADMAP row; worktree clean.- Title
M3: xand requirement**M8-R1** xpreviews both refused as expected. - After probes: #178 comment IDs unchanged; branch list unchanged; PR unmerged; no issue newer than #179; worktree clean.
- Docs checked: SPEC section 6 rows, introduction, coordinator contract, CLI usage, and CHANGELOG describe the preview behavior consistently.
No code was edited and the PR was not merged.
…stay interleaved (#178)
|
Fixed in 8109ce6: the |
There was a problem hiding this comment.
Second-round review complete at 8109ce6. The two prior live-equivalence regressions are fixed: an unrouted-QA note is again emitted before a live DOC_MISSING refusal/raw-material dump, and sweep lookup notes remain interleaved with branch outcomes. Compared taskFinish, milestoneClose, and sweepBranches against main: gate/refusal order and text, comment text/order, merge paths/output, head deletion, DOC_MISSING dump, sweep decisions/output, and write-after-gates behavior are preserved. go test ./... and go vet ./... pass. All required GitHub-backed dry runs produced the expected refusal codes/exit statuses or clean M8 preview, wrote no issues/comments/files, deleted no branches, and did not merge the PR. Docs and tests satisfy #178 / M7-R5 and the adopted #133 scope.
Closes #178, closes #133 — M7-R5.
What was done. The three writing verbs are split into a read-only plan — gates evaluated in the order the live verb checks them, actions decided — and an execute step. The live verb runs both;
--dry-runprints the plan and writes nothing. One code path builds the plan for both modes (internal/cli/dryrun.go;planFinish,planClose,planSweep/executeSweep), so a preview cannot disagree with the run.task finish <ref> --dry-run [--operator-confirm] [--bypass]— one line per gate (task open,no gate raised,gates resolved,owner,closing PR,CI checks,review,GitHub's required review,operator confirmation,bypass actor):ok,refused[CODE]: detail,not reached(after a refusal) ornot applicable(a path not taken); thenwould comment on PR #N: …for each comment it would post (owner bypass, operator confirmation, merge bypass),would merge PR #N (rebase)orvia the ruleset's administrator bypass,would delete head <branch>. The flags are previewed as given.milestone close <n> --dry-run—milestone open,tasks closed,requirements declared,QA verdicts,milestone document; then every branch the sweep woulddelete/keepand why, and the closing comment. The raw-material dump onDOC_MISSINGstays with the live verb.milestone new --dry-run …— validates exactly as the live verb (title/number disagreement, text carrying an ID), printswould create milestone M<n> …, the requirement IDs it would number, the ROADMAP row; creates nothing. The number is the point (End to end under an orchestrator: prove the flow driven by Paperclip (or another platform) #119 finding 45).dry run: nothing written.Tests (same PR,
dryrun_test.gowith a finish fake that records every write): a clean pass reports every gate ok / not applicable and the three actions, planning writes nothing,runwrites exactly merge + delete; a refusal (NOT_OWNER) is the plan's exit with every later gatenot reachedand no actions;--bypasspreviewed by an operator on another seat's task names the owner-bypass and merge-bypass comments and the admin merge, the same preview by a crew identity refusesCREW_BYPASS, the solo--operator-confirmpreview names the confirmation; the sweep plan deletes nothing andexecuteSweepdeletes exactly the planned branch; the printer's five states. The existing sweep tests pass unchanged through the wrapper.go test ./...green.Live, read-only, on this hub:
task finish 178 --dry-run→ owner ok, stops atrefused[NO_PR], six gates not reached, exit 1;milestone close 7 --dry-run→ stops atOPEN_TASKSnaming the three open tasks;milestone new --dry-run --title Probe --requirement … ×2→would create milestone M8,M8-R1, M8-R2, the row — andgit statusshows ROADMAP.md untouched.Not here: a dry run for
task start/checkpoint;statusalready previews task states.