Repository navigation
fix(#890): resolve the remaining bare main...HEAD consumers via resolveDiffBase - #894
Merged
admarble merged 2 commits intoAug 4, 2026
Conversation
…veDiffBase qa-cache keys its diff hash and scopes invalidation via resolveDiffBase, runs all five git calls array-form (execFileSync), and gains an injectable QACacheOptions.cwd (default process.cwd()) so real-repo tests need no process.chdir. Existing caches invalidate once (ref inside the hash key changes). worktree-manager's per-worktree summaries and phase-executor's aider file-context (keeping its per-worktree cwd) use the resolved ref. All 13 bare main...HEAD in exec/docs/test/merger/ assess/loop skill prose audited per occurrence (all worktree-diff contexts, none intentionally local) and origin-qualified identically across the three mirrors, plus one same-root-cause main..HEAD commit list in merger. Regression-tested against real repositories with local main deliberately behind origin (qa-cache.integration.test.ts): cache hash, global + per-check invalidation scoping, and injected-cwd incremental diffs. Fixes #890
…ompleteness sweep QA's adversarial sweep found three same-root-cause consumer groups the issue's enumeration missed: the qa skill's quality-checks.sh gate script (11 bare main...HEAD per mirror — #878 covered the SKILL.md prose and the two TS gate scripts, not this one), eight two-dot main..HEAD in qa/SKILL.md's Phase 0 implementation-detection and s10a changelog-gate commands (#878 swapped three-dot only; a stale local main makes Phase 0 report phantom "implementation exists"), and the coverage-analysis hook in post-tool.sh (.claude/hooks + templates/hooks). All swapped identically across mirrors; hooks stay byte-identical. The __fixtures__/dependency-markers corpus keeps its bare refs on purpose — frozen historical issue bodies, not live commands.
admarble
deleted the
feature/890-fix-observability-remaining-bare-main-head-con
branch
August 4, 2026 06:16
4 tasks
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
Follow-up to #878: the remaining bare
main...HEADconsumers now resolve their diff base viaresolveDiffBase(nearest-candidate betweenorigin/<base>and the bare ref), so a stale localmaincan no longer leak merged-upstream content into them.qa-cache.ts— diff hash and changed-file invalidation scoping resolve viaresolveDiffBase; all five git calls are array-formexecFileSyncand honor a new injectableQACacheOptions.cwd(defaultprocess.cwd()), which also makes the class testable against real repos withoutprocess.chdir. Note: existing QA caches invalidate once on upgrade (the ref inside the hash key changes) — a single fresh QA run, as pre-approved in the issue.worktree-manager.ts— per-worktree diff summaries (--name-only,--stat) use the resolved ref.phase-executor.ts— the file-context list handed to file-oriented drivers (aider--file) uses the resolved ref, keeping its per-worktreecwd;execSync→ array-formexecFileSync.main...HEADacrossexec/docs/test/merger/assess/loop(+predicted-collision-detection.md) audited per occurrence (all worktree-diff contexts, none intentionally local) and origin-qualified identically across all three mirrors, plus one same-root-causemain..HEADcommit list inmerger.quality-checks.sh(11 refs ×3 mirrors), qaSKILL.mdtwo-dotmain..HEADPhase-0/§10a commands (8 ×3 — 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 swapped three-dot only), andpost-tool.sh's coverage hook (.claude/hooks+templates/hooks). The frozen__fixtures__/dependency-markerscorpus deliberately keeps its bare refs.AC Verification
resolveDiffBase+ stale-local-main regression testqa-cache.integration.test.ts(7 tests, real repos). Mutation-verified: reverting the ref swap fails exactly the 3 targeted tests; dropping the injectedcwdfails exactly the incremental-path testworktree-manager.ts:406-437cwdphase-executor.ts:1114-1135check-skill-sync.ts44/44Test plan
lint:skill-calls: cleanworktree-manager.ts:575/1254are pre-existing onorigin/main, outside every hunk of this diffFixes #890
🤖 Generated with Claude Code