Skip to content

Dry runs: milestone new, task finish and milestone close print what they would do and write nothing #178

Closed

Description

@radiusred-cody

Goal

The three verbs that write to the record or the repository — milestone new (an issue, a ROADMAP row), task finish (a merge, a deleted head, a recorded confirmation or bypass), milestone close (a sweep, a closed issue) — gain --dry-run: the verb evaluates exactly the gates it would evaluate, in order, prints each with its outcome and what it would then do, and writes nothing. A refused gate exits with the same code it would have; a clean run exits 0. milestone new --dry-run prints the number the milestone would get, so requirement prose can be written knowing it (the M4 lesson: a closed duplicate still counts). Adopted from #133 (M7-R5).

Requirements

M7-R5

Plan

  1. Plan, then act — each verb is split into a read-only plan that evaluates its gates in order and decides the actions, and an execute step that performs them; the live verb runs both, --dry-run runs the plan and prints it. Gate logic is not duplicated: the same functions produce the same refusals, so the dry run can never disagree with the real run. A gate the real verb would not reach (no PR → no checks) is printed as not reached.
    • task finish --dry-run [--operator-confirm] [--bypass]: prints CLOSED, GATED, GATE_UNRECORDED, NOT_OWNER, NO_PR, NO_CHECKS/CHECKS_PENDING/CHECKS_FAILING, NO_HOLDER_REVIEW/NO_NONDOER_APPROVAL, REVIEW_NOT_COUNTED, SELF_CONFIRM/CREW_BYPASS — each ok or refused[CODE]: detail — then the actions: the comment(s) it would post (owner bypass, operator confirmation, merge bypass), the merge (rebase or administrator bypass) of PR #N, the head it would delete. The flags are evaluated as given, so an operator can preview --bypass before using it.
    • milestone close <milestone number> --dry-run: NOT_FOUND, OPEN_TASKS, NO_REQUIREMENTS, VERDICT_MISSING/VERDICT_UNSATISFIED, DOC_MISSING; then every branch the sweep would consider with the action it would take and why (sweepBranches becomes a plan of {branch, delete, reason} that the live close executes), and the closing comment it would post. The raw-material dump on DOC_MISSING stays with the live verb; the dry run names the gate.
    • milestone new --dry-run --title T [--goal G] [--requirement R]…: validates the title and requirements exactly as the live verb does (M<k> prefix disagreement refused, text carrying its own ID refused), prints the number it would assign, the full title, the requirement IDs it would number, and the ROADMAP row — and creates nothing.
  2. Exit status: the first refusal's code, after the full report — so a script sees the same refused[CODE] it would from the live verb; 0 when every gate passes. No writes on either path.
  3. Sequencing (Backlog capture: --dry-run for task finish and milestone close #133's open question): the live milestone close keeps sweep-then-close; the sweep only ever deletes a merged or empty branch, so a close that fails after the sweep loses nothing — stated in the code, not changed.
  4. Tests, same PR: the sweep plan against the fake tracker (merged at tip → delete; pushed after merge → keep; open PR → keep; empty → delete; ahead → keep) and that a dry close deletes nothing; the finish plan's gate table on synthetic inputs (each refusal reached in order, not reached after a refusal, the actions on a clean pass, --bypass and --operator-confirm previews); milestone new --dry-run's number/title/row from a title list; the report's line format.
  5. Docs: SPEC §6 rows for the three verbs name --dry-run; docs/introduction.md's verbs paragraph says which verbs preview; the usage text; the coordinator contract's "run the verb, read the refusal" bullet gains "or preview it with --dry-run"; CHANGELOG.md [Unreleased]. No new refusal code.
  6. Not here: a dry run for task start or checkpoint (their writes are cheap and reversible); status already previews the inferred task states.
  7. go test ./... green; commits conventional, ≤ 100 characters and a lowercase first word after the type, both measured before committing; PR as the implementer with Closes #178 and Closes #133; the reviewer seat by dispatch under harness: codex; task finish 178 is the merge.

Ask-the-human points

Metadata

Metadata

Assignees

No one assigned

    Labels

    cc:task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions