Skip to content

The Spec PR owns its rules, tested in-process behind a seam, and the Delivery writes "Built with" through its own - #410

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-409
Oct 5, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-409

Conversation

@JacobStephens2

Copy link
Copy Markdown
Owner

Summary

The Spec PR's rules reach GitHub and the progress lines only through a private seam, and the Delivery writes the "Built with" line as a step of its own route, through its existing Outside.

 Spec PR (src/spec_run/spec_pr.rs)
-  resume / landed / show / put_back ──► github::* , progress::step
+  resume / landed / show / put_back ──► Outside
+                                         ├── OnGitHub   (same github::* calls)
+                                         └── InMemory   (tests: holds the PR, its body, the Spec's title)
 Route::steps (src/delivery.rs)
   catch up? → opening session → push
+  write "Built with"   (outside.pull_request / pr_body / set_pr_body; a failure is a warning)
   before_ready         (a Run: nothing; a Spec run: the Spec PR puts its checklist back)
   mark the PR ready → Repair loop → after the merge

The before-ready closure in Delivery::deliver no longer calls GitHub itself. The same GitHub requests go out in the same order, with the same progress lines, warnings and pull request bodies.

Evidence

  • Before: only the end-to-end tests could reach the Spec PR's rules and the "Built with" write, through the fake gh.
    After: new in-process tests:
    • spec_run::spec_pr::tests has 11 tests: resume converts only a ready open PR, landing opens a draft or writes the checklist, show is a no-op or only warns, and put back fails when there is no PR or the set fails.
    • delivery::tests has 3 new tests: "Built with" is written after the push and before the before-ready step, nothing is set when the line is already there, and a failed read or write is a warning that still marks the PR ready. no_pr_fails now also checks that no body is read.
  • Two end-to-end tests that these now cover were deleted from tests/spec_run.rs: a_spec_review_that_keeps_the_markers_has_the_checklist_replaced_between_them and a_checklist_update_github_refuses_is_only_a_warning.
  • cargo test: all pass (461 unit, every integration suite). cargo clippy --all-targets: clean.

Merge Danger

Door: two-way

A refactor with the same requests and output, so a revert undoes it cleanly.

Blast Radius: small

It touches the Spec run's Spec PR and every Delivery's "Built with" write. A mistake there would show as a missing or misplaced line in a pull request's body. The kept end-to-end tests (the Spec PR opening, the checklist put back after the "Built with" line, and the "Built with" tests for the Harness choice and Codex) still pin it.

Unaddressed findings

Standards

  • Outside and OnGitHub are pub(super), not private. The issue decides that SpecPr is generic over its adapter, not boxed. That forces the bound and the default type to be visible to spec_run, and the module itself is private to spec_run. The doc comment says so.
  • Data Clumps: spec, branch and base are held in both SpecPr and OnGitHub. The issue has the real adapter hold the Spec and branch. The rules still need them for the opened body's text and the opening progress line.
  • Duplicated Code: the read / splice / set-if-changed shape appears in both the Spec PR and the Delivery. The issue decides the two splicers stay separate. Sharing only the wrapper would couple the two seams for two short functions.
  • Speculative Generality: unused Fails variants in InMemory. The issue asks for an adapter that "can fail any one call", so every call can be made to fail.
  • The pull request is read twice in Route::steps. The issue decides this explicitly: requests stay unchanged for the end-to-end fakes.

Spec

  • "fail any one call": InMemory fails every call of a kind, not the nth call. That covers every listed case. "The Spec PR just opened is not found" comes from a None read, not a failure, so a separate opened_is_lost flag models it.
  • "holds the pull request (number, URL, …)": the URL is derived from the number. The result is the same, with one fewer field to keep in sync.

Closes #409

🤖 Generated with Claude Code

JacobStephens2 and others added 2 commits October 5, 2026 03:25
…ilt with" through its own (#409)

The Spec PR's rules reach GitHub and the progress lines only through a
private `Outside` seam: the real adapter calls the same GitHub functions as
before; an in-memory one drives the rules in-process. The Delivery's route
writes the "Built with" line as a step after the push, through its existing
`Outside`, now with the pull request's body. Two end-to-end tests the
in-process ones now cover go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e Delivery's does, one behaviour per test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JacobStephens2
JacobStephens2 merged commit 7a307f3 into main Oct 5, 2026
13 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-409 branch October 5, 2026 07:37
@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.

The Spec PR owns its rules, tested in-process behind a seam, and the Delivery writes "Built with" through its own

1 participant