Skip to content

Commit d06ceda

Browse files
wmitsudaclaude
andcommitted
Fix version conflict reporting in summarize-changes skill
- Add fallback for fetching toml from merged PRs (head branch -> merge commit -> main) - Add critical instruction to faithfully report script output, not fabricate results - Clarify version conflict definition: same type + same ext + same range required - Add Subdir column to conflict table for clarity Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 088c79a commit d06ceda

File tree

1 file changed

+22
-8
lines changed
  • .claude/skills/summarize-changes

1 file changed

+22
-8
lines changed

.claude/skills/summarize-changes/SKILL.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,18 @@ Run these commands using the Bash tool:
3838
```
3939
gh pr diff <number> --repo erigontech/erigon-snapshot > /tmp/pr_diff.txt
4040
```
41-
3. Fetch the full toml file from the PR's head branch:
41+
3. Fetch the full toml file from the PR's head branch (with fallback for merged PRs where the branch may be deleted):
4242
```
4343
HEAD_REF=$(gh pr view <number> --repo erigontech/erigon-snapshot --json headRefName -q .headRefName)
44+
MERGE_COMMIT=$(gh pr view <number> --repo erigontech/erigon-snapshot --json mergeCommit -q .mergeCommit.oid)
4445
TOML_FILE=$(gh pr diff <number> --repo erigontech/erigon-snapshot --name-only | head -1)
46+
# Try head branch first; if deleted (merged PR), fall back to merge commit, then main
4547
gh api "repos/erigontech/erigon-snapshot/contents/$TOML_FILE" \
46-
-H "Accept: application/vnd.github.raw" -F ref="$HEAD_REF" > /tmp/pr_toml.txt
48+
-H "Accept: application/vnd.github.raw" -F ref="$HEAD_REF" > /tmp/pr_toml.txt 2>/dev/null \
49+
|| gh api "repos/erigontech/erigon-snapshot/contents/$TOML_FILE" \
50+
-H "Accept: application/vnd.github.raw" -F ref="$MERGE_COMMIT" > /tmp/pr_toml.txt 2>/dev/null \
51+
|| gh api "repos/erigontech/erigon-snapshot/contents/$TOML_FILE" \
52+
-H "Accept: application/vnd.github.raw" -F ref="main" > /tmp/pr_toml.txt
4753
```
4854
4. Run the analysis script with both files:
4955
```
@@ -52,6 +58,8 @@ Run these commands using the Bash tool:
5258

5359
The script (`analyze_diff.py` in the skill directory) parses the diff, classifies all changes, and outputs structured sections. Use its output to build the final report.
5460

61+
**CRITICAL: You MUST faithfully report the script's output.** Do NOT fabricate, guess, or paraphrase results. For every critical section (hash changes, unexpected deletions, version conflicts, version downgrades), copy the exact counts, file types, and ranges from the script output. If the script says `count=0` for version conflicts, report zero — do not infer conflicts from other observations.
62+
5563
### What the script detects
5664

5765
- **Hash Changes**: same filename in both removed and added sets with different hash (CRITICAL)
@@ -127,19 +135,25 @@ If NO unexpected deletions, use ✅ emoji:
127135

128136
### VERSION CONFLICTS
129137

130-
If version conflicts exist, use 🚨 emoji:
138+
A version conflict means the SAME file type, SAME extension, AND SAME range (identical start-end) has multiple versions in the final toml. For example, both `accessor/v2.0-logaddrs.0-64.efi` and `accessor/v2.1-logaddrs.0-64.efi` existing simultaneously is a conflict. Different versions covering DIFFERENT ranges (e.g., v2.0 for 0-256 and v2.1 for 256-512) is NOT a conflict — that is a normal version transition boundary.
139+
140+
**CRITICAL: Only report conflicts that appear in the script output.** The script already applies the correct definition (same type + same range). Copy the exact types, ranges, and counts from the `=== VERSION CONFLICTS ===` section. Do NOT infer or fabricate conflicts.
141+
142+
If version conflicts exist (script reports count > 0), use 🚨 emoji:
131143

132144
### 🚨🚨🚨 VERSION CONFLICTS — DO NOT MERGE
133145

134146
> **Multiple versions of the same file for the same range must not coexist. This will cause download conflicts for nodes.**
135147
136-
Group by State Snapshots / CL Snapshots / EL Block Snapshots. Show a table:
148+
Group by State Snapshots / CL Snapshots / EL Block Snapshots. Show a table with one row per conflict from the script output:
149+
150+
| Subdir | Type | Ext | Range | Versions |
151+
|--------|------|-----|-------|----------|
152+
| accessor | accounts | .vi | 0-32 | v1.1, v1.2 |
137153

138-
| Type | Ext | Range | Versions |
139-
|------|-----|-------|----------|
140-
| accounts | .vi | 0-32 | v1.1, v1.2 |
154+
When many conflicts share the same pattern (same subdir, type, ext, versions) across consecutive ranges, they can be summarized as a single row with a range span, e.g., "0-64 through 1792-1856 (29 ranges)".
141155

142-
If NO version conflicts, use ✅ emoji:
156+
If NO version conflicts (script reports count=0), use ✅ emoji:
143157

144158
### ✅ Version Conflicts
145159

0 commit comments

Comments
 (0)