Repository navigation
Description
Epic: graph-2026-10-freeze-b Tier: judgment Execution: sequant_run
Problem
Sequant's overlap checks only see work it knows about. src/lib/merge-check/overlap-detection.ts compares the feature branches passed to sequant merge. src/lib/assess-collision-detect.ts compares file paths named in issue bodies. Neither looks at open PRs on origin that came from another session, another machine, Dependabot or a human. A peer PR that touches the same files merges in the middle of the run, and the issue's PR goes CONFLICTING. Sometimes the conflict is a semantic one that a textual rebase replays wrongly.
Field evidence:
- sequant feat: resume a partially-completed chain from its last good link #760 → feat: lightweight content pre-flight for --chain (AC presence, dependency-order sanity) #762 (PR feat(#762): lightweight content pre-flight for --chain #764) merged mid-session and touched
run-orchestrator.tsandtypes.ts. PR feat(#760): resume a partially-completed chain from its last good link #765 wentCONFLICTINGand CI silently stopped dispatching (gh pr checks: "no checks reported"). - ai-devtools-weekly cloudgate wave 1 (2026-10-14): two peer PRs outside the graph merged mid-wave, and one rewrote the sentence Add QA skill check for three-directory skill sync #499 was editing. The rebase became a semantic reconciliation, not a replay. The user-level
/graph-runskill now lists "every open PR, graph member or not, whose changed files intersect the wave's file scopes" as a merge-order member. Sequant's own checks should do the same.
Proposal
Add open PRs on origin as a source in the existing overlap machinery. Don't build a new checker. Changed files come from the platform layer (GitHubProvider owns gh). The intersection logic is reused.
sequant merge --checkreports open PRs that are not in the batch but whose changed files intersect the batch's changed files, as a separate finding class ("external PR overlap"). It is a warning and does not block.assess-collision-detect.tsgains a function that turns open-PR file lists into the existing⚠ #N Modifies <path> (overlaps #M); land sequentiallyline format, with PRs written asPR #M.
Freeze scoping (graph doc D-8, 2026-10-16): /assess builds its collision inputs in skill prose (assess/SKILL.md Step 5 calls the pure functions in assess-collision-detect.ts). Feeding open-PR data in needs a skill edit, which the freeze blocks. So this issue ships the assess-collision-detect.ts function and its tests, and /assess starts calling it in the same post-freeze change that wires /exec and /merger. sequant merge --check is CLI code and is fully in scope.
Acceptance Criteria
- AC-1:
sequant merge --checkreports each open PR on origin whose changed files intersect the batch's changed files, excluding PRs whose head branch is in the batch, as one "external PR overlap" finding naming the PR number, head branch and shared paths, at warning severity; the exit code is unchanged by these findings alone. Evidence: a merge-check unit test with a stubbed provider asserting the finding text and the unchanged exit code, mutation-verified by removing the in-batch exclusion. - AC-2: Open-PR file lists come from one new
GitHubProvidermethod, and no newghspawn exists outsidesrc/lib/workflow/platforms/. Evidence: a provider-stubbed test covering no open PRs, a PR with disjoint files (no finding), a PR with one shared path (one finding) and an in-batch PR (excluded), mutation-verified by making the method return every PR's files as shared, plusgit diff origin/main -- src ':!src/lib/workflow/platforms' | grep -E '^\+.*"pr", *"(list|view)"'printing nothing. - AC-3:
assess-collision-detect.tsexports a function that, given an issue → paths map and open-PR file lists, returns one⚠ #N Modifies <path> (overlaps PR #M); land sequentiallyline per overlapping PR and none for a disjoint PR. Evidence: a test insrc/lib/__tests__/assess-collision-detect.test.tsasserting the exact line for one overlapping PR and no line for a disjoint one, mutation-verified by dropping the intersection. - AC-4: When
ghis unavailable or the PR list call fails,sequant merge --checkprints exactly one line saying the open-PR overlap check was skipped and why, and otherwise behaves as today. Evidence: a test with a failing provider asserting the single skip line and an unchanged exit code.
Prior fixes / producers
git log -- src/lib/merge-check/overlap-detection.ts: feat(run): Add batch-level integration QA —sequant merge --check#313 (PR feat(#313): Add batch-level integration QA — sequant merge --check #324, the originalmerge --check), never changed since.assess-collision-detect.ts: fix(assess): path extraction counts cited paths as modification targets, producing phantom collisions #769 (PR fix(#769): section-aware path extraction; drop background-only citations #775, section-aware extraction), fix: parseDependencies matches prose mentions and silently reorders runs #767 (PR fix(#767): harden parseDependencies; share body-marker parser #774, shared body-marker parser), feat(assess): predict file-collision between PROCEED issues from body content #556 (original design).- Producers of overlap findings: two (
overlap-detection.tsfor batch branches,assess-collision-detect.tsfor issue bodies). The ACs state the outcome for both through one provider method (AC-2), not a second fetcher per consumer. - Field incidents: feat: resume a partially-completed chain from its last good link #760/feat(#762): lightweight content pre-flight for --chain #764 (sequant), ai-devtools-weekly cloudgate wave 1 (2026-10-14).
May touch
src/lib/merge-check/ (overlap-detection.ts, types.ts, report.ts, index.ts), src/lib/assess-collision-detect.ts, src/lib/workflow/platforms/github.ts, src/lib/workflow/platforms/platform-provider.ts, their tests, docs/reference/merge-command.md, CHANGELOG.md.
Non-Goals
- Any edit to
.claude/skills/,templates/skills/orplugin/(plugin freeze). The/assess,/execand/mergerprose that calls these checks is a follow-up after the freeze lifts (D-8). - No line-level conflict classification for external PRs. A file-level intersection is enough to warn.
- No blocking. The owner decides merge order.
- GitLab and Azure DevOps providers (Platform abstraction: GitLab and Azure DevOps support #375). The new method is GitHub-only; other providers return "not supported", which counts as a skip (AC-4).
Origin
Lesson from the ai-devtools-weekly cloudgate graph, recorded in ~/.claude/skills/graph-run/SKILL.md Step 1 on 2026-10-14. Related memory: spec conflict prediction is unreliable (#760). Companion #1455 edits skills and stays out of this graph.
Activity
docs(graph): add #1454 to graph-2026-10-freeze-b as a wave-2 node; D-…
docs(graph): graph-2026-10-freeze-b — freeze-safe fixes, second batch…
admarble commentedon Oct 16, 2026
Runner context (graph-2026-10-freeze-b, wave 2)
Wave 1 merged on 2026-10-16.
mainis at 9f1fb3f and includes #1440, #1396, #1305, #1325, #1405 and #1409. These notes are for both the exec phase and the qa phase:npm test(the full suite) in exec or qa. Each phase stops after 30 minutes with no progress, and these phases run the published sequant 2.19.0, which has no affected-tests mode. Run the test files you change or name withnpx vitest run <file>. CI runs the full suite on the PR.mainbut not released). Keep braces out of themutationandfailedTesttext.plugin/,.claude/skills/ortemplates/skills/.src/lib/merge-check/orassess-collision-detect.ts.admarble commentedon Oct 16, 2026
Complexity: Standard (4 ACs, 3 directories)
AC Quality Check
The linter flags nothing (4/4 pass). It misses three things that matter:
manual. TheirEvidence:clauses name tests ("a merge-check unit test…", "a test with a failing provider…"), but the parser files them as manual, so/qa§6h/§6i checks them less strictly. Exec should still ship them as unit tests with mutation markers.main, and prettier puts"pr",and"list"on separate lines, so a new spawn outsideplatforms/would get past it too. The stubbed-provider test does the real gating. QA should back the grep withgit diff origin/main -- src ':!src/lib/workflow/platforms' | grep -E '^\+.*(spawnSync|execSync|execFile)\(\s*"gh"'.Scope Assessment
Non-Goals: present (no skill, template or plugin edits; no line-level classification; no blocking; GitHub only).
merge-check/,workflow/platforms/,src/lib)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: External PR overlap finding, warning only, exit code unchanged
Verification: Unit Test
Scenario: Given batch branches A and B and a stub that returns PR #900 (head
other, sharessrc/x.ts) and PR #901 (head = A's branch) → When the external check runs and the report is built → Then there is exactly one warning namingPR #900,otherandsrc/x.ts, nothing for #901, andgetExitCode(batchVerdict)matches the run without the check.Assumptions: "Unchanged" works if the new
CheckResulthaspassed: trueand nobranchResults.computeBatchVerdictonly escalates on!passedor a branch WARN/FAIL (report.ts:57).AC-2: One provider method, no stray
ghspawnVerification: Unit Test (+ grep guard)
Scenario: The stub returns
[], a disjoint PR, a PR with one shared path, and an in-batch PR → the results are no finding, no finding, one finding, excluded.Assumptions:
gh pr list --state open --json number,headRefName,files --limit 100works (checked on this repo).ghcapsfilesat 100 per PR, so a larger PR could be under-reported. Note that in the doc; it is not a fix target.AC-3:
assess-collision-detect.tsformats open-PR overlapsVerification: Unit Test
Scenario: Given
{1454 → {src/a.ts}}and PRs#77: [src/a.ts]and#78: [src/b.ts]→ Then the output is exactly⚠ #1454 Modifies src/a.ts (overlaps PR #77); land sequentially, with nothing for #78.AC-4: Skip line when
ghis unavailable or failsVerification: Unit Test
Scenario: The stub throws (
ghmissing, auth error or non-zero exit) → Then the check yields exactly oneinfofinding,Open-PR overlap check skipped: <reason>, and the exit code is unchanged.Assumptions: The "line" is a report finding, not a separate
console.*call. That way--jsonstays valid JSON and markdown output still shows one bullet.Implementation Plan
Phase 1: Source and intersection
src/lib/workflow/platforms/github.ts, addlistOpenPRFilesSync(limit = 100): OpenPRFiles[]({ number, headRefName, files: string[] }). It goes throughrunGhOrThrowso failures throw. The existinggetStatusCheckRollupSyncswallows errors to[], which would make AC-4 impossible. Export the type fromplatforms/index.ts. Leave thePlatformProviderinterface alone: only GitHub exists, and the "not supported" case from the Non-Goals is the same throw → skip path.src/lib/open-pr-overlap.ts:findOpenPrOverlaps(workPaths: Map<number, Iterable<string>>, prs, excludeHeads: Set<string>)→{ key, prNumber, headRefName, sharedPaths[] }[]. Both consumers use it, so the intersection exists once.Phase 2: Merge consumer
merge-check/overlap-detection.ts, addrunExternalPrOverlap(branches, source: { listOpenPRFilesSync(): OpenPRFiles[] })→CheckResultwith name"external-pr-overlap", alwayspassed: true, and emptybranchResults. It aggregates per PR across the batch, so each PR gets one finding:PR #M (<head>) shares <paths> with this batch. With no overlap it adds oneinfoline (same convention asoverlap-detection). If the call throws, it adds the single skipinfoline. Exclusion is byheadRefName ∈ branches.map(b => b.branch).merge-check/index.ts, add"external-pr-overlap"to the phase-1 list ingetChecksToRunand pass the existingghProvider. Update the expectations inmerge-check-extended.test.ts.Phase 3: Assess consumer, tests, docs
assess-collision-detect.ts, addformatOpenPrCollisionWarnings(issuePaths, prs), which calls the helper and returns lines in the AC-3 format./assesswiring waits until after the freeze (D-8).merge-check-extended.test.ts(AC-1/2/4) andsrc/lib/__tests__/assess-collision-detect.test.ts(AC-3). Add a parse test forlistOpenPRFilesSyncinplatforms/github.test.ts. Run only these files withnpx vitest run <file>, nevernpm test(runner note).docs/reference/merge-command.md(new finding class, warning only, skip line, 100-file cap), add aCHANGELOG.mdUnreleased entry, and add ADR-0016 (see Design Review Q2).Design Review
src/lib/open-pr-overlap.tsintersects.merge-checkandassess-collision-detecteach format.external-pr-overlapCheckResultwithpassed: true. Rejected: (a) folding external PRs intorunOverlapDetection, which would make them branch WARNs, move the batch verdict toNEEDS_ATTENTIONand break AC-1's exit-code clause; (b) a secondghfetcher per consumer, which AC-2 forbids; (c) putting the intersection insideassess-collision-detect.tsand importing it from merge-check, which couples the CLI to the assess module. The plan picks between designs, so the exec PR includes ADR-0016 (docs/adr/0016-…, shape perdocs/adr/README.md).runOverlapDetectionanddetectFileCollisions.overlap-detection.tshasn't changed since feat(run): Add batch-level integration QA —sequant merge --check#313.assess-collision-detect.tsfixes (fix: parseDependencies matches prose mentions and silently reorders runs #767, fix(assess): path extraction counts cited paths as modification targets, producing phantom collisions #769) were for body-path extraction, which this doesn't touch. No recurring class.origin/main?" Because the PR head may not be fetched locally, andghalready returns the file list. "Why throw instead of[]?" An empty list means "no peers", and a failure has to be distinguishable from that (AC-4).overlap-detection.ts(batch) andassess-collision-detect.ts(bodies). This adds one new source (listOpenPRFilesSync) and one shared intersection, and each consumer formats. There is one fetcher and one intersection, so no parity test is needed.Feature Quality Planning
--json filesis a GraphQL call. One call permerge --check,--limit 100, 15 s timeout throughrunGhOrThrow.owner:branch) won't match the batch, which is correct, since it is external.platforms/github.ts. This change only adds a method, so a textual conflict is unlikely. Wave-2 peers fix(worktree): a non-default bare --base is cut from local <base> but counted against origin/<base> (#1380 follow-up, #1234/#1386 class) #1406 and fix(run): uncommitted hook changes go unwarned — phases run the committed .claude/hooks/, but the #1354 check only covers skills #1456 don't overlap.Open Questions
info. A warning would read as an overlap. Either way the exit code is unaffected.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: The scope is narrow and every AC's
Evidence:already names the exact test and mutation, so testgen stubs would only duplicate them (overriding the default "feature with unit-test ACs → testgen"). Not UI work and not security-sensitive.Label Review
Current: enhancement, graph-2026-10-freeze-b
Recommended: + planned
Quality Loop: won't auto-enable (SCOPE_OK).
admarble commentedon Oct 16, 2026
QA Verdict: AC_NOT_MET
AC coverage: 3/4 met
Gaps:
fix(#1454): one-line skip reason; CHANGELOG and lockfiles are not ext…
admarble commentedon Oct 16, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 4/4 met
Gaps:
docs/adr/0016-external-pr-overlap-as-separate-check.md:45names the skill-wiring follow-up as feat(spec): AC quality questions — who deploys an edited committed copy, and what clock a count AC waits on #1455. feat(spec): AC quality questions — who deploys an edited committed copy, and what clock a count AC waits on #1455 is "feat(spec): AC quality questions…". The real follow-up is feat(exec,merger,assess): wire #1454's open-PR overlap check into the skills (post-freeze) #1459, "wire feat(merge,assess): open PRs on origin whose files overlap the work are merge-order members — add them to the existing overlap checks #1454's open-PR overlap check into the skills (post-freeze)". This is a one-character doc fix.Suggestions:
formatOpenPrCollisionWarningsdoes not filterEXCLUDED_PATHSitself. This is safe today, becauseextractPathsFromIssueBodyalready removes those paths (assess-collision-detect.ts:227). It's worth noting for whoever wires up feat(exec,merger,assess): wire #1454's open-PR overlap check into the skills (post-freeze) #1459.Needs human review:
docs(#1454): ADR-0016 names #1459 as the skill-wiring follow-up
admarble commentedon Oct 16, 2026
Runner verification (graph-run, wave 2): NEEDS_VERIFICATION discharged.
QA's re-run held back only for the
testcheck, which was still running. On heade39da4015every check passed:test,canary,typecheck,validate-skills,validate-plugin,node-floor-guard,tautology-advisoryand Gitleaks.What the runner ran in the worktree:
npx vitest run src/lib/merge-check/merge-check-extended.test.ts src/lib/__tests__/assess-collision-detect.test.ts src/lib/workflow/platforms/github.test.ts: 96/96 passed.tsc --noEmitis clean.CHANGELOG.mdand lockfiles aren't counted as shared paths (EXCLUDED_PATHS, as/assessuses).Follow-up ledger: the skill wiring is filed as #1459 (post-freeze, D-8). No other open items.
feat(#1454): open PRs on origin whose files overlap the work are merg…