Skip to content

fix(xtask): refuse duplicate changelog bullets before folding (#15606) - #15656

Merged
EffortlessSteven merged 2 commits into
mainfrom
codex/15606-fold-duplicate-bullets
Nov 21, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
codex/15606-fold-duplicate-bullets

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Before either write route touches disk, fold-changelog uses the checker's whitespace-normalized bullet comparison across Unreleased and the selected fragments. The error names the fragment and duplicate entry. Fold placement and output rendering use the existing path.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Proposal: none
Spec: Changelog policy
ADR: none
Plan item: #3921
Governing issue or accepted claim: #15606
Acceptance delta (one sentence): Both write routes reject a mixed old-and-new fragment before any file changes while clean fragments fold with their original text and section placement.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): codex/15606-fold-duplicate-bullets
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): none

Scope Classification

  • One production behavior

Production delta: Share the checker's bullet parser and duplicate comparison with the fold planner.
Evidence/support delta: A two-route regression checks the bytes of the changelog and both selected fragments, including a clean fragment that precedes the mixed one.
Non-goals: README preflight and CLI help wording. #15575 owns the roll-up and #15578 tracks the separate help text.
Changelog: changelog.d/15606-fold-duplicate-bullets.md uses the Internal / CI section for the contributor-facing fix.

Proof

Rust 1.95.0 isolated harness linked the exact fold and checker modules and used a small reporting stub. The new regression failed on b1dd0b51a8bf9b4aed894b605df514886e6a1161 because the mixed fragment was accepted. The touched module files were identical on candidate parent 6ba8360a77a6b6bece70c605fb1465ca6b29a03d. All 40 module tests and the changed Rust files' rustfmt --check passed on the candidate. The four changed Git blob hashes match the local proof inputs.

The harness also invoked the real fold command function against disposable files:

Case Baseline --limit 150 Baseline --release-cut Candidate, both routes
Rewrapped duplicate plus new bullet Exited 0 after writing and deleting Exited 1 after writing and deleting Exited 1 with changelog and fragment byte-identical
Duplicate only Exited 1 before changes Exited 1 before changes Exited 1 with both files byte-identical
Fresh bullets, including one matching a historical release Exited 0 Exited 0 Exited 0 with exact expected text and section order

Review and continuation

Source review: SOURCE_REVIEW_READY ddbcdd1

Owner review of 98015023784dda3572a8936f4e4fa30f9f3a8c39 checked that the fold receives only the selected batch, snapshots Unreleased before inserting any entries, and returns duplicate diagnostics before reaching the shared write and delete path. The regression covers normalization across wrapping and spacing, a different target section, and all-or-nothing handling of an earlier clean fragment.

Rollback

Revert the eventual squash as a single change.

Use the changelog checker’s normalized per-bullet comparison across Unreleased and the selected batch before either write route can change files.

Refs #15606
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 31 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 147 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 419b8504-6fc3-4f17-b300-46a817e52f5a
Commits

Reviewing files that changed from the base of the PR and between 6ba8360 and ddbcdd1.

Files selected for processing: 4

  • changelog.d/15606-fold-duplicate-bullets.md
  • xtask/src/policy/changelog_fragments.rs
  • xtask/src/policy/fold_changelog.rs
  • xtask/src/policy/fold_changelog/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

gemini-code-assist[bot]

This comment was marked as resolved.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent exact-head source review passed. The fold now uses the existing normalized per-bullet comparator before filesystem writes. The mixed-fragment fixture checks refusal on both write routes, unchanged changelog bytes, and retention of both the earlier valid fragment and the rejected one. No hosted result is implied by the isolated module proof.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 20, 2026 11:39

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent exact-head source rereview passed. The only successor change moves fixture cleanup after comparing the already-read bytes; write refusal, both route fixtures and the production duplicate comparator are unchanged. This is source review, not hosted qualification.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SOURCE_REVIEW_READY for head ddbcdd1

Source review of the duplicate-bullet refusal. No blocking finding.

The check moved from a substring to the normalized bullet comparison. fold_text no longer tests block.contains(&entry_text). It collects entry_sources — the Unreleased block's bullet_entries once, before any fold, plus each fragment's bullet_entries — and calls duplicate_entry_violations after the loop. That is the checker's own whitespace-normalized comparison, so - Old fix (#2). and - Old fix (#2). are the same entry, which the substring test missed.

The refusal still precedes every write. fold_in calls fold_text(&changelog, &fragments)? and only then writes the changelog and deletes fragments, so an Err from the duplicate check leaves both untouched. The in-memory lines are mutated before the check, but the function returns Err and the caller never writes, so the observable state is unchanged.

The test covers both write routes and the no-write claim. mixed_already_folded_and_new_entries_are_refused_before_writing runs --write --limit 150 and --write --release-cut over a fragment that holds one already-folded bullet and one new bullet, asserts the error names changelog.d/b-mixed.md, the normalized entry and duplicates an entry in CHANGELOG.md Unreleased, and asserts CHANGELOG.md and both fragments are byte-identical afterwards. The existing already_folded_entry_is_refused_not_duplicated is updated to the new message.

The clean fold is unchanged. The heading lookup, insertion point and splice are untouched, so a fragment with no duplicate folds with its original text and section placement; only the duplicate predicate changed. The fragment changelog.d/15606-fold-duplicate-bullets.md states the same behavior.

Not established here. I did not run cargo test on this head, so the pass is the Coder's; I read the committed source and the test. The hosted shards are the arbiter.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 434ea08 Nov 21, 2026
20 checks passed
@EffortlessSteven
EffortlessSteven deleted the codex/15606-fold-duplicate-bullets branch November 21, 2026 10:23
EffortlessSteven pushed a commit that referenced this pull request Nov 21, 2026
…discrepancy in the pending rows

Review on #15906: #15576 and #15578 are fixed by #15684, #15606 is partly
landed (#15656) with #15920 open, and #15860 with its repair #15905 is a
schema prerequisite under #3920 without the release-check label.

Refs #2766

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmmvYqCdwBcBFx9a2bC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant