Repository navigation
Pre-flight checks - #16
Merged
Merged
Conversation
A Run now stops with a clear message and a non-zero exit, before any worktree, temp directory or session exists, when: - the argument is missing or not a GitHub issue URL (a usage error) - the Issue URL fails the Origin match - the issue is closed - HEAD is detached - the Base branch doesn't exist on origin - the local Base branch is ahead of origin - git user.name or user.email is not set Uncommitted changes in the launch directory are allowed and left out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Worktree::create_fresh fetches the Base branch itself again, so it no longer relies on pre-flight having fetched it first. - Share one gh-JSON helper between the issue and pull request lookups. - Check the git identity before the Base branch checks, which fetch. - Test that a repo-local git identity is accepted. - In the test harness, share one fallible git helper, and let the origin-spelling test add its own insteadOf rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JacobStephens2
added a commit
that referenced
this pull request
Sep 25, 2026
Resolve src/main.rs and src/run.rs against the pre-flight checks (#15/#16) and the Base branch merge and conflict Repair (#17). Keep main's run structure and carry the progress lines into it: the session log line moves into run_session, the push line into Worktree::push, and the newly built steps (merging the Base branch, starting a Repair) print their lines as issue #10 asks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JacobStephens2
added a commit
that referenced
this pull request
Sep 25, 2026
Brings in pre-flight checks (#16), the README (#15) and merging the Base branch with conflict Repair (#17) on top of the Failed run path. - run.rs: preflight::check replaces the inline origin check; the Repair session and final push sit inside implement(), so a failed Repair goes down the Failed run path. The session log reported on failure is the most recent one (repair-1 if it ran). - main.rs: parse the Issue URL up front (exit 2) as main does, then install the interrupt handler and report a FailedRun. - github.rs: main's gh_json/string_field helpers, plus isDraft, is_open, mark_ready and convert_to_draft. - failed_run.rs: reuses Worktree::merge_in_progress. - tests/mergeable.rs: a failed Repair is now a Failed run, so it prints the open PR's URL and sends the PR back to draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
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
Every pre-flight check now runs before a Run creates anything. Each one fails with a clear message and a non-zero exit.
The git identity check comes from the finding in the issue comment. Global config and repo config both count.
Tested seam: the
thirdshiftCLI only, with real git and fakegh/claude(tests/preflight.rs). Every rejection goes throughassert_rejected_before_any_work, which checks for no worktree, an empty$TMPDIR, and a fakeclaudethat was never invoked. The fakeghnow supportsissue view.Evidence
a_closed_issue_is_rejected→thirdshift: no PR found(the run went ahead). A detached HEAD gavegit symbolic-ref --short HEAD failed: …. A local Base branch ahead of origin went ahead. A missing identity went ahead.After:
cargo test→fresh_run8 passed,preflight11 passed.cargo clippy --all-targets -D warningsandcargo fmt --checkare clean.Merge Danger
Door: two-way
Only new checks and a small refactor. Reverting is a single revert.
Blast Radius: small
Runs that used to go ahead now stop early: local Base branch ahead of origin, closed issue, missing identity. A malformed argument now exits 2 instead of 1. Pre-flight adds one
gh issue viewand onegit ls-remoteper run.Unaddressed findings
Standards
"OPEN"strings,Stringfor the Base branch,issue_is(n, &str)in tests): a state enum or Base branch type isn't worth it with only two comparisons. It is better introduced with Issue branch selection (a later ticket), where the Base branch can be redefined.arginmain.rs): cosmetic. It is used on the next two lines only, and it isn't yet an Issue URL at that point.Spec
https://github.com/...is rejected): the spec lists "any casing" under the Origin match of the origin URL, not the Issue URL. The rejection is a fast usage error.#fragmentor?queryare rejected: not asked for. It fails fast as a usage error and could be a follow-up if it proves annoying.Closes #4
🤖 Generated with Claude Code