Repository navigation
Test Issue branch selection in-process behind a seam for its reads - #377
Merged
Merged
Conversation
) Selection, the started check and the open pull request's base now read origin, GitHub and the Launch directory through a private read-only seam, with a production adapter making the same git and gh calls and an in-memory adapter for unit tests. End-to-end tests that only checked a selection rule or a refusal's wording are replaced by the unit tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Issue branch selection now reads origin, GitHub and the Launch directory through one private, read-only seam in
src/branch.rs. ADR-0002's rules run in-process against an in-memory adapter.The branch-number rule stays in the rules, so
issue-50not counting for#5is tested in-process. Thecfg(test)InMemoryadapter answers each listing by prefix, as git and GitHub do, and records every read.The Run, the Ready issue search and the Claim are unchanged, and so are the
gitandghcalls.Evidence
Before: every selection rule could only be checked by running the binary against a fake
gitandgh, end to end.After: 20 unit tests in
branch::testscover branch numbers, Fresh, Continuation, Refusals, Reads, Started and the PR's base. 8 end-to-end tests that checked only a rule or a refusal's wording were deleted:tests/numbered_branches.rs: 6tests/continuation.rs: 2Every required end-to-end keep is still there.
cargo test,cargo clippy --all-targets -- -D warningsandcargo fmt --checkpass.Merge Danger
Door: two-way
The change is internal to one module and the public interfaces are unchanged, so a revert is clean.
Blast Radius: selection
A mistake in the production adapter would change which Issue branch a Run picks. The kept end-to-end tests cover each production read.
Unaddressed findings
Standards
InMemoryowns itsRefCellof reads and the read enum isRead, wheresrc/ready.rsborrowsseenand calls itSeen. Skipped: the owned form is simpler here because no progress sink shares the record. The adapter name now matchesready.rs(GitHubAndOrigin).PrandPickedtypes repeatPullRequestandSelection. Skipped:PullRequestandSelectionderive neitherClonenorPartialEq, and adding derives to production types only for tests would widen them.Spec
an_open_pr_on_branch_2_after_a_merged_issue_branch_is_continueddrops a numbered-branch variant of the Continuation prompt check. Skipped:with_an_open_pr_the_continuation_prompt_asks_to_update_itstill covers that prompt. What the deleted test added was a selection rule, which is now unit-tested.Closes #376
🤖 Generated with Claude Code