Skip to content

One Spec PR module owns the Spec PR in a Spec run - #369

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-367
Oct 4, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-367

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

The Spec PR's lifecycle in a Spec run moves into one module, a sibling of the Ticket board. The Spec run's loop tells it what happened, and stops carrying an Option<PullRequest> and the Base branch.

 src/spec_run.rs              # loop: tells the Spec PR "show" / "landed"
+src/spec_run/spec_pr.rs      # resume, show, landed, put_back, url; markers; opening body
 src/spec_run/ticket_board.rs # checklist is `## Tickets` + lines, no markers
 run_ready_tickets, after a Ticket ends
-  match spec_pr
-    Some(pr)        => write_checklist_or_warn(pr, list)
-    None if landed  => open_spec_pr(spec_branch, base, list)
-    None            => {}
+  if landed  spec_pr.landed(list)   # opens it if not open, else shows
+  else       spec_pr.show(list)     # warns on failure, no-op if not open
review_and_deliver
  spec_pr.landed(checklist) -> URL       # for the Spec review prompt
  delivery.deliver(.., before_ready: spec_pr.put_back(checklist))  # strict
  on failure: spec_pr.show(checklist)    # warn only

Per Decision 3, landed before the Spec review now also reads the body when the Spec PR is already open; it writes nothing because the checklist already matches.

Evidence

  • Before: on main, cargo test passes, including 75 Spec run end-to-end tests.
    After: cargo test passes on this branch, and the 75 Spec run tests are unchanged and still pass. These include: opening as a draft once the first Ticket lands, the checklist being put back after the Spec review, replacement between the markers, putting it back after a failed Spec review, a refused checklist update being only a warning, and a failed Ticket showing in an open Spec PR's checklist. cargo clippy --all-targets -- -D warnings is clean.
  • The with_checklist unit tests moved to spec_pr.rs. They now pass the bare checklist, and with_checklist wraps it in the markers itself. The Ticket board's checklist test expects no markers.

Merge Danger

Door: two-way

A refactor inside the Spec run with no user-visible change. Reverting this PR undoes it.

Blast Radius: Spec runs

If this is wrong, it shows up as a Spec PR that doesn't open, isn't drafted, or loses its Tickets checklist. The unchanged end-to-end tests cover each of these.

Unaddressed findings

Standards

  • Mysterious Name: show / put_back should be write_or_warn / write. Skipped: Decision 2 names the operations after what happened in the Spec run, not after how they fail.
  • landed both commands and queries (returns the URL). Skipped: Decision 2 specifies landed(checklist) → URL so the Spec review gets the URL from the call that guarantees the Spec PR is open.

Spec

  • None.

Closes #367

🤖 Generated with Claude Code

JacobStephens2 and others added 2 commits October 4, 2026 16:05
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 merged commit ad0547e into main Oct 4, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-367 branch October 4, 2026 20:28
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

One Spec PR module owns the Spec PR's draft, opening and Tickets checklist in a Spec run

1 participant