Repository navigation
Open
Labels
bugSomething isn't working
Description
Problem
The phase skills hard-code origin/main in executable commands, and the QA quality checks turn the resulting git failure into zeros.
- Executable uses:
exec/SKILL.mdhas 6 lines in code blocks that nameorigin/main(affected tests--changed origin/main, the changed-test-file list, formatter scoping, the rebase hint).qa/SKILL.mdhas 9 (diff hash, committed-changes check, affected tests, changed-file checks),spec/SKILL.mdhas 1, andqa/scripts/quality-checks.shhas 11. More appear inqa/references/*.md(18) andassess/references/predicted-collision-detection.md(1). - The error disappears. On a repo whose default branch is
master, git fails loudly. Measured in varius:git diff origin/main...HEAD --name-onlyprintsfatal: ambiguous argument 'origin/main...HEAD'and exits 128. Butquality-checks.shruns every check as a command substitution through a pipe, e.g.files_changed=$(git diff origin/main...HEAD --name-only | wc -l | xargs)anddeleted_tests=$(… | grep … | wc -l). The pipe drops the exit code, so the script reports 0 files changed, 0 deleted tests, 0 type issues, which is a clean-looking QA input for a diff it never read. varius wrote a local override for/execand/fullsolvebecause of this: "A stockorigin/mainreference does not fail loudly; it resolves to an empty/wrong range and silently under-reports the diff (e.g. '0 changed files' → false 'no tests needed')." - Only partly fixed: four skills already read
BASE="${SEQUANT_BASE_BRANCH:-main}", but in one place each, and the orchestrator never set the variable (fixed by fix(run): phase agents never get SEQUANT_BASE_BRANCH — skills fall back to main on master-default repos #1460).
Proposal
- One base resolution, used everywhere:
BASE="${SEQUANT_BASE_BRANCH:-$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##')}", then${BASE:-main}. Put it in_shared/references/and use it at the top of each skill's git block and inquality-checks.sh. - Replace every executable
origin/mainwithorigin/$BASE. quality-checks.shverifiesgit rev-parse --verify "origin/$BASE"once at the start and exits non-zero with a one-line message if it doesn't resolve, instead of reporting zeros.
Acceptance Criteria
- AC-1: No code block in
exec,qa,spec,looportestgenSKILL.md, and no line ofqa/scripts/quality-checks.sh, namesorigin/mainliterally. Evidence: a gate test that extracts fenced code blocks from those files plus the script and asserts zeroorigin/mainmatches, mutation-verified by restoring one literal inquality-checks.sh - AC-2: The base resolution uses
SEQUANT_BASE_BRANCH, thenorigin/HEAD, thenmain, in that order, and is defined once in_shared/references/. Evidence: a gate test scoped to that reference asserting the three-step order - AC-3:
quality-checks.shexits non-zero with a message naming the missing ref whenorigin/$BASEdoesn't resolve. Evidence: a test that runs the script in a temp repo whose only remote branch ismaster, withSEQUANT_BASE_BRANCH=mainforced, and asserts a non-zero exit and the message - AC-4: In a temp repo whose default branch is
master, withSEQUANT_BASE_BRANCHunset,quality-checks.shreports the real changed-file count. Evidence: the same test harness with one changed file, assertingfiles_changedis 1, not 0 - AC-5:
qa/references/*.mdandassess/references/predicted-collision-detection.mduseorigin/$BASEin their command examples. Evidence:grep -rn 'origin/main' .claude/skills/*/referencesreturns only prose lines that explain the old behaviour, if any - AC-6: Mirrored in all three skill directories. Evidence:
npm run sync:skills && git diff --exit-code -- .claude/skills templates/skills plugin/skillsexits 0
Prior fixes / producers
- Base-ref design cluster (re-patch retrospective tracker(graph): pre-release fixes before the next release after 2.18.0 (4 nodes) #1236): fix(chain): --chain successors branch from main, not predecessor's committed work (up-front worktree provisioning) #748, fix(observability): phase diff stats compare against the local base ref while worktrees branch from origin/<base> — phantom filesModified + base tip logged as the phase commit #878, fix(observability): remaining bare main...HEAD consumers after #878 — qa-cache diff hash, worktree-manager summaries, aider file-context, non-qa skill gates #890, bug(qa): the qa phase rebases an already-pushed branch onto main, forcing a force-push to land it #1069, bug(exec): sequant run worktrees never record sequantBase, so the zero-diff/uncommitted guard compares against origin/main and a --base ahead of main disables it #1234, bug(run): worktree creation and rebase hardcode 'origin/main' — fails on repos with non-main default branch #343, fix(run): --base creates the worktree from the branch but opens the PR against the repo default branch #1386. fix(observability): remaining bare main...HEAD consumers after #878 — qa-cache diff hash, worktree-manager summaries, aider file-context, non-qa skill gates #890 introduced the literal
origin/main...HEADlines inquality-checks.shwhen it fixed the older baremain...HEAD(staleness), so the default branch stayed hard-coded. Root cause: shell and skill consumers have no channel to the TypeScript resolver (resolveDiffBase/resolveBaseRef). fix(run): phase agents never get SEQUANT_BASE_BRANCH — skills fall back to main on master-default repos #1460 adds that channel, and this issue makes the skills use it, so skills must not grow their own detection beyond the documentedorigin/HEADfallback for interactive runs. - feat(exec/qa): explicit in-place checkout mode — run a phase on a branch in the current clone without creating or resolving a worktree #1136: introduced
SEQUANT_BASE_BRANCHas a user-set input for in-place mode. - varius
.claude/.local/skills/{exec,fullsolve}/overrides.md(2026-08-24): the local workaround, which this issue makes unnecessary.
Blocked
- Blocked by: fix(run): phase agents never get SEQUANT_BASE_BRANCH — skills fall back to main on master-default repos #1460
- Plugin freeze: this edits
.claude/skills/,templates/skills/andplugin/. Queue it after the freeze.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity