Repository navigation
fix(xtask): refuse duplicate changelog bullets before folding (#15606) - #15656
Conversation
Use the changelog checker’s normalized per-bullet comparison across Unreleased and the selected batch before either write route can change files. Refs #15606
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
…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
Summary
Before either write route touches disk,
fold-changeloguses 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
ripr-swarmSource-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-bulletsStack 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
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.mduses 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
b1dd0b51a8bf9b4aed894b605df514886e6a1161because the mixed fragment was accepted. The touched module files were identical on candidate parent6ba8360a77a6b6bece70c605fb1465ca6b29a03d. All 40 module tests and the changed Rust files'rustfmt --checkpassed 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:
--limit 150--release-cutReview and continuation
Source review: SOURCE_REVIEW_READY ddbcdd1
Owner review of
98015023784dda3572a8936f4e4fa30f9f3a8c39checked 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.ddbcdd1d815557d32b3220899af0417746892ed4has tree136c65959c180c0c135b5dd6c3868f33826d575e. GitHub merge subject9d8c49432db7b4c94ae3e31c469176c444f38128has the same tree and parents6ba8360a77a6b6bece70c605fb1465ca6b29a03d(observed main) andddbcdd1d815557d32b3220899af0417746892ed4. Main's required Rust result is green.98015023784dda3572a8936f4e4fa30f9f3a8c39. The successor moves only test cleanup after the diagnostic and byte assertions, so a failed test retains its fixture. Owner source review checked the one-line move and read back the resolved thread. All 40 isolated module tests and rustfmt passed on the successor. Published test blobb3505088783b3ab4202d2de021a51d7871de0131matches the tested bytes. Production command controls carry over from the identical production blobs.Rollback
Revert the eventual squash as a single change.