feat: dedupe monorepo gems sharing identical changelog (#12)#15
Merged
Conversation
Two gems published from a unified-CHANGELOG monorepo (sentry-rails + sentry-ruby from getsentry/sentry-ruby is the canonical case) emitted byte-identical bullet content under separate `### gem` headers, wasting LLM context tokens. Add `_dedup_monorepo_deltas` — a pure awk pass that runs before the markdown reflow. When two delta blocks have identical (header_rest, bullets), it merges them under one comma-joined header. The reflow regex now accepts `name1, name2: ...` style headers. Dedup is byte-level conservative — different bullets or different version transitions stay separate. Update count is computed pre-dedup so the reported gem count is unchanged. Closes #12 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
_dedup_monorepo_deltas— pre-reflow awk pass that groups gems with byte-identical post-cutoff content under one comma-joined H3name1, name2: ...style headersupdate_countcomputed before dedup, so the reported gem count is unaffectedCloses #12.
Test plan
tests/test_save.shextended: 9 new cases covering grouping, divergence (different bullets), and count integrityBefore / after
For a project with
sentry-railsandsentry-ruby(both 5.23.0 → 6.5.0, identical bullets from monorepo):A typical Rails app saves ~3K tokens on the
sentry-*family alone.Notes
🤖 Generated with Claude Code