Repository navigation
fix(orch): resolve stack branches by full ref when tags share names - #828
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
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.
orch frontier setresolves stack branches with abbreviated git names, which goes wrong when a tag shares a branch's name.git symbolic-ref --short HEADthen reports the current branch asheads/<branch>, so the forge lookup asks for PRs on a branch that does not exist and the frontier fails with "branch heads/ has no pull request". For other branches in the chain,git rev-parse <branch>prefersrefs/tags/<name>overrefs/heads/<name>. The frontier then records the tag's commit as the PR head without any error, andorch ledger checkgets compared against the wrong SHA.currentBranchnow reads the fullrefs/heads/...symbolic ref and strips the prefix, andbranchSharesolvesrefs/heads/<branch>^{commit}with--verify. Branches without a tag of the same name resolve exactly as before. The Claude Code harness copy is regenerated.Validation: added "resolves {gh,origin} branches when tags share their names" to
orch/orch.test.ts. It tagsstack/open(the current branch) andstack/closedatmainand checks every recorded SHA. On origin/main the new tests fail with theheads/stack/openforge lookup error. With only thecurrentBranchchange they fail becausestack/closedrecords main's SHA. With the full fix,bun test --timeout 900000 orchgives 23 pass and 0 fail (the long timeout is only needed because git was slow on a loaded machine). Also rannpm install --no-save ajv ajv-formats && node scripts/validate-plugins.mjs && node scripts/generate-pstack-harness-trees.mjs --check && node --test pstack/skills/*/scripts/test/*.test.mjs(57 pass, 0 fail, 93 skipped without TLC) andgit diff --check.Note
Low Risk
Narrow git ref-resolution change in orch frontier setup with regression tests; behavior unchanged when no name collision exists.
Overview
Fixes
orch frontier setwhen git tags share stack branch names. Abbreviated ref resolution could treat the current branch asheads/<name>(breaking forge PR lookup) or resolverev-parse <branch>to the tag commit instead of the branch tip (wrong frontier SHAs and ledger checks).currentBranchnow reads the fullrefs/heads/...symbolic ref and strips the prefix;branchSharesolvesrefs/heads/<branch>^{commit}with--verify. A new orch test tagsstack/openandstack/closedand asserts each frontier row keeps the correct branch SHA for bothghandorigin.Reviewed by Cursor Bugbot for commit 79e4132. Bugbot is set up for automated code reviews on this repo. Configure here.