workflow-fix: pre-review deliverable-divergence probe (Step 5a/10d)
Highlight text on any card (body, plan, or an event) to anchor a comment, or leave a whole-task comment here. Mention @claude to summon a reply.
No comments yet.
Overview / Motivation
Auto-filed by the workflow-fix-on-bug protocol from a workflow-fix candidate raised on task #1771 (emitting agent: code-reviewer, round 1, 2026-08-08).
Goal
Add a cheap pre-review/pre-merge divergence probe that lists round-deliverable files also changed on origin/main since the merge-base and injects the list into the code-review brief (and blocks Step 10d auto-merge when the intersection is non-empty, routing to an implementer reconciliation round).
Workflow gap
- Bug observed: The #1771 branch reached round-1 code review with
origin/main having rewritten the same function + test file in the opposite
direction (#2164, landed 2026-08-07 via merge 5c91482fce); nothing in
Step 5a spec-freshness sync or the review dispatch flagged that
round-deliverable files had diverged on main since the merge-base.
(The "16/20 files diverged" figure is reviewer-measured — see the
epm:code-review v1marker on #1771, 2026-08-08T15:58:24Z, and /tmp/issue-1771-code-review-r1.md; re-measure at plan time.) - Why it is a workflow gap: Step 5a syncs never-branch-edited sibling files but is silent about deliverable files main has since modified, so a semantic collision (the open-sibling #1479/#1476 class, now at review/merge grain) surfaces only as a raw rebase conflict at Step 10d with no implementer in the loop.
- Confidence (emitter): medium
- verified-at-filing:
grep -n "DIVERGED\|diverged on main\|divergence probe" .claude/skills/issue/SKILL.md→ 3 hits (repo-root main copy, 2026-08-08), each read in context: lines 2080/13149 are the #1725 ROOT-divergence probe (localmainvsorigin/mainat the shared repo root — a different object than branch deliverables vs main) and line 10932 an unrelated sync-site list; Step 10d's merge-conflict handling (102 "conflict" mentions) is REACTIVE recovery at merge time, not a pre-review flag. Absence-of-guard claim: 0 hits for a pre-review deliverable-divergence probe.
Proposed change (candidate diff sketch — refine in planning)
+ Step 5a (after sync): MB=$(git merge-base origin/main HEAD);
+ comm -12 <(git diff --name-only $MB..HEAD | sort) <(git diff --name-only $MB origin/main | sort)
+ -> non-empty => append a "DIVERGED-ON-MAIN deliverables" list to the reviewer brief;
+ Step 10d: same probe; non-empty => do NOT auto-resolve — dispatch an implementer
+ reconciliation round naming the diverged files.
Planning notes: (a) exclude spec-freshness sync commits' paths from the branch side (subject-scoped exclusion, as Step 5a already does) or the probe false-positives on every synced file; (b) the Step 10d leg should compose with — not duplicate — the existing Known-failure-shape merge-conflict recovery (reactive); the new value is the PROACTIVE pre-review flag and the implementer-in-the-loop reconciliation routing; (c) unverified hypothesis — verify at plan time: whether a same-file-touched-on-both-sides list is low-noise enough on hot files (CLAUDE.md, SKILL.md are touched on main near-daily) or needs a hunk-overlap / same-symbol refinement to avoid flagging every round.
Scope / surfaces
- Primary target:
.claude/skills/issue/SKILL.md - Grep the workflow surface for the pattern before editing
(
grep -rln 'spec-freshness' .claude/ CLAUDE.md scripts/) and update every coupled surface the probe touches; list them in the plan.
Constraints / invariants
- Workflow-surface only — never experiment code,
configs/, ortasks/. scripts/workflow_lint.py --check-askspasses; ruff on touched files passes; ifworkflow.yamlorCLAUDE.mdchange, they stay consistent with the rule file.- This session runs under
EPM_WORKFLOW_FIX_SESSION=1and carries aworkflow_fix_target:Provenance line — it MUST NOT auto-route any of its own subagents' workflow-fix candidates (recursion guard, § Recursion guard).
Provenance
- workflow_fix_target: .claude/skills/issue/SKILL.md
- fingerprint: 55342a328f78
target_file: .claude/skills/issue/SKILL.md bug_observed: The #1771 branch reached round-1 code review with origin/main having rewritten the same function + test file in the opposite direction (#2164, landed 2026-08-07); nothing in Step 5a spec-freshness sync or the review dispatch flagged that 16/20 round-deliverable files had diverged on main since the merge-base. why_workflow_gap: Step 5a syncs never-branch-edited sibling files but is silent about deliverable files main has since modified, so a semantic collision (open-sibling #1479/#1476 class, now at review/merge grain) surfaces only as a raw rebase conflict at Step 10d with no implementer in the loop. proposed_change: Add a cheap pre-review/pre-merge divergence probe that lists round-deliverable files also changed on origin/main since the merge-base and injects the list into the code-review brief (and blocks Step 10d auto-merge when the intersection is non-empty, routing to an implementer reconciliation round). diff_sketch: |
- Step 5a (after sync): MB=$(git merge-base origin/main HEAD);
- comm -12 <(git diff --name-only MB origin/main | sort)
- -> non-empty => append a "DIVERGED-ON-MAIN deliverables" list to the reviewer brief;
- Step 10d: same probe; non-empty => do NOT auto-resolve — dispatch an implementer
- reconciliation round naming the diverged files. confidence: medium related_task: #1771
Goal refinement note (#2201, plan v4)
The implemented Step 10d leg blocks on the content-keyed UNREVIEWED delta —
paths absent from the final review round's [divergence-probe] disclosure,
plus disclosed paths origin/main changed again after the reviewed main=<sha>
— rather than the Goal parenthetical's any-non-empty intersection, which plan
§3 measured as a fleet wedge (3 of 5 healthy live branches carried non-empty
reviewed intersections on 2026-08-19). Reviewed-and-unchanged divergence is
annotated on the epm:merged note, never blocked; the Step 5a leg disclosing
the full refined set to both reviewers every round is unchanged.