Skip to content

fix(skills): origin/main is hard-coded in exec/qa/spec commands, and quality-checks.sh turns the git failure into zeros on master-default repos #1461

Open

Description

@admarble

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.md has 6 lines in code blocks that name origin/main (affected tests --changed origin/main, the changed-test-file list, formatter scoping, the rebase hint). qa/SKILL.md has 9 (diff hash, committed-changes check, affected tests, changed-file checks), spec/SKILL.md has 1, and qa/scripts/quality-checks.sh has 11. More appear in qa/references/*.md (18) and assess/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-only prints fatal: ambiguous argument 'origin/main...HEAD' and exits 128. But quality-checks.sh runs every check as a command substitution through a pipe, e.g. files_changed=$(git diff origin/main...HEAD --name-only | wc -l | xargs) and deleted_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 /exec and /fullsolve because of this: "A stock origin/main reference 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

  1. 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 in quality-checks.sh.
  2. Replace every executable origin/main with origin/$BASE.
  3. quality-checks.sh verifies git 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, loop or testgen SKILL.md, and no line of qa/scripts/quality-checks.sh, names origin/main literally. Evidence: a gate test that extracts fenced code blocks from those files plus the script and asserts zero origin/main matches, mutation-verified by restoring one literal in quality-checks.sh
  • AC-2: The base resolution uses SEQUANT_BASE_BRANCH, then origin/HEAD, then main, 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.sh exits non-zero with a message naming the missing ref when origin/$BASE doesn't resolve. Evidence: a test that runs the script in a temp repo whose only remote branch is master, with SEQUANT_BASE_BRANCH=main forced, and asserts a non-zero exit and the message
  • AC-4: In a temp repo whose default branch is master, with SEQUANT_BASE_BRANCH unset, quality-checks.sh reports the real changed-file count. Evidence: the same test harness with one changed file, asserting files_changed is 1, not 0
  • AC-5: qa/references/*.md and assess/references/predicted-collision-detection.md use origin/$BASE in their command examples. Evidence: grep -rn 'origin/main' .claude/skills/*/references returns 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/skills exits 0

Prior fixes / producers

Blocked

Activity

  1. added
    bug
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions