Resolve the default branch or fail, never guess master #232
No reviewers
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools!232
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/default-branch-resolve"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The workspace tools no longer guess
masterwhen they cannot tell a repo's default branch. Where a tool would change something (allod change submitpicking a PR base,pull-all --switch,flake-update-cascadepreflight, the secrets landing check), it now stops and prints the one repair:git -C <repo> remote set-head origin -a. Where a tool only reports (flake-status), it shows the branch as unknown instead of comparing against a guess. A repo in normal use has this ref, so day to day nothing changes; the difference shows only on a checkout built without a fetch or aftergit remote set-head origin -d.allod change beginandrecordbehave as before. Every suite passes, a cold reviewer from another model family found nothing, and rollback is a revert of four commits.Closes allod/tools#126
What changes
The helper existed three times, and all three guessed
masteron failure. Each now fails and every caller decides:cmd/allod/workspace.godefaultRemoteBranchbegin,submit, the unpushed-commit guard in front ofcleanup, the secrets landing checksubmitrefuses naming the repair or--base;beginand the secrets check refuse as they already did, now through the helper alone (their duplicate pre-checks are dropped, as the issue's Scope said); thecleanupguard keeps answering "unknown", never "clean"cmd/flake-update-cascadedefaultBranchlib/workspace.shworkspace_repo_default_branchpull-all,flake-statuspull-all --switchskips that repo with the repair named (a plainpull-allnever consulted it);flake-statusprints[default branch unknown — run: ...]The Bash helper's result no longer depends on the caller's
pipefail: it prints the name and exits 0, or prints nothing and exits non-zero. The cascade tool was not in the issue's callsite list; it carried its own copy of the same guess, so it is treated the same way here rather than left as the last silent one.Tests: Go unit tests for both Go helpers on a repo whose
origin/HEADis unset; shell assertions forsubmit's refusal,record's path,pull-all --switchskipping,flake-status's warning, and cascade preflight. Two fixture repos (nohead,unheaded) carry the unresolvable state on purpose instead of a fixture that fell into it by accident. Docs:workspace/README.md,flake/README.md,docs/allod-secret.md.Risk
R2. Localized behavior change across several consumers, each on its failure path only; the happy path is untouched. The worst credible failure after validation is a refusal on a checkout that used to be silently guessed at, with the repair printed. The destructive path (
cleanup) is unchanged in its "cannot tell" answer. One cross-family reviewer (codex, gpt-5.5) read the full diff cold against the issue and reported no findings after checking thepipefailinteractions, every(string, bool)call site, and the fixtures.Follow-up after merge: the active plan
allod/strategydev-plans/concurrent-agent-workspace.mddescribes the old helper's behavior and gets one line saying it now fails loudly.Validation
nix build .#checks.x86_64-linux.go-checks,flake-status-suite,cascade-suites,allod-parity: all passed, rerun by the integrator on the final commit.go test ./...including-tags site,secret: ok.gofmt -l,go vet ./...: clean.tests/allod-change.sh: 222 passed.tests/workspace/pull-all.sh: 33 passed (this suite is not wired into a flake check, so it was run directly).tests/flake/flake-status.sh: 36 passed.tests/flake/flake-update-cascade/preflight.sh: 13 passed.shellcheck -s bash -xover the touched shell files: clean. The one finding without-s bash, a missing shebang on the sourced library, predates this change.Owner request before merge: the added source and test comments are too verbose. Documentation moves to the READMEs and docs, not the source; remaining comments shrink to at most one line each, contract or trap only, no issue numbers or history.
4967dd24d9tocbd1fea458