Skip to content

Tell the changelog editing agent what it may not delete - #116221

Merged
alexey-milovidov merged 28 commits into
masterfrom
changelog-edit-retention-rule
Aug 28, 2026
Merged

alexey-milovidov merged 28 commits into
masterfrom
changelog-edit-retention-rule

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

The editing step of the NightlyChangelog job failed its own verification every night from 2026-08-12, always the same way:

WARNING: edit attempt 3/3 failed: Entries disappeared in the edit without a matching revert (['103182', '109946'])

verify_edit requires that every raw entry of a strict-retention category keeps its pull request link — an entry may be rewritten, merged into another bullet or moved to another category, but not dropped, because the Changelog-generated-up-to: point has already moved past it and no later run will offer it again. The prompt never said so, and the skill stated it only implicitly, so the agent pruned entries it judged insignificant: #103182 (Lightweight Updates v2, a Backward Incompatible Change) was deleted outright.

The other half of the same failure is revert handling. #109946 fixed the propagation of settings in accurateCastOrDefault, #114911 reverted it, and #114912 reverted that revert — all three inside one range. The skill covers this in section 2.5, but the agent reached the "landed and then reverted, so delete both" rule first and lost a fix that ships in the release.

Telling the agent the rules

  • The prompt lists the strict-retention categories (rendered from STRICT_RETENTION_CATEGORIES, so the prompt and the verifier cannot drift apart), says exactly which entries may be deleted and why deleting anything else is unrecoverable, and states the revert-of-revert rule.
  • The skill gets a retention rule ahead of the individual edits, and the walk over NO CL ENTRY now checks whether a revert is itself reverted before concluding that a change was reverted. The accurateCastOrDefault chain is the worked example.
  • The skill also learns the ClickHouse spelling, which the clickhouse_spelling check enforces: the 26.8 changelog pull request failed on CHANGELOG.md:366: Clickhouse, inherited verbatim from a pull request body.
  • A retry tells the agent why the previous attempt was rejected. Without that, all three attempts of a run rebuilt the same edit and hit the same rejection — which is what every run from 2026-08-12 on shows.

The revert bookkeeping is durable across runs

Telling the agent the rule is not enough, because the job is incremental: a cycle is edited in ~30 nightly runs and a revert chain routinely spans them. Run N integrates #109946; run N+1 sees #114911 and deletes it; run N+2 sees only #114912. On run N+2 nothing disappears in the edit and the intervening revert is gone from the raw blocks, so neither the agent nor the verifier could reconstruct the chain, and the shipped fix stayed out for good.

The branch now carries that memory in trailers on its own edit commits — the same mechanism as Changelog-generated-up-to:, so the state lives in the branch and the pull request diff stays clean:

Changelog-revert: <revert> <reverted> <title of the revert>
Changelog-deleted-entry: <pr> [<category>] [section|raw] <bullet as deleted>

analyze_reverts resolves each run's reverts against that ledger and reduces the cumulative revert graph, so a chain spread over several runs behaves exactly like one arriving in a single raw block, at any depth. Around it:

  • Reverts are classified from pull request metadata, not from the rendered bullet: tests/ci/changelog.py prints the author's own Changelog entry under the author's own Changelog category, so a revert can arrive under Improvement reading "Disable the setting again". One batched GraphQL query covers a run's whole raw block, and a failed lookup fails the run rather than silently reading as "not a revert".
  • Release-range membership comes from git (vX.Y.1.1-new..origin/master, first-parent), the only source that survives an entry being pruned in an earlier run.
  • Targets are bound from the Reverts owner/repo#N body marker, a Revert #NNNNN title, or a nested Revert "Revert "X"" title matched against titles the ledger remembers; an ambiguous or unresolvable revert grants nothing.

What the verifier now enforces

Each of these is an invariant the job used to accept the violation of, in both directions — allowed and required:

  • a strict-retention entry never disappears without a revert that licenses it, and an entry whose revert stands never stays;
  • a revert of something in this release leaves no trace of its own, and one of an earlier release keeps its entry (case 5), including when it reverts both;
  • an entry deleted for a revert that has since been reverted comes back — in the section, under the category it had (or that of the bullet it merges into), as one bullet carrying all of the pull requests that shared it, merged into the survivor rather than beside it;
  • every pull request that re-applied the change is recorded on that entry, and a re-applier with a change of its own keeps an entry too;
  • an entry is its attribution [#N](...) ([Author](...)), not a mention of #N inside someone else's bullet, and no pull request gains an attribution it did not have.

Where the rules leave a judgement to the editor — a prunable bullet that was never accepted, a revert of an earlier release the generator filed without a category — the prompt asks for it instead of the verifier imposing an answer.

A branch whose edit commits predate the trailers has an empty ledger and keeps the previous behaviour.

Testing

ci/tests/test_changelog_nightly_revert_ledger.py — 52 tests, run by the CI Tests job. Every one of the invariants above has a case that fails without the code that enforces it, most of them driving the real verify_edit; the timelines covered include the whole chain in one raw block, each stage of it arriving alone, chains five pull requests deep, merged bullets restored whole, split, or with a still-reverted sibling, category moves between runs, an empty ledger, and a failed pull request lookup.

The prompt side was verified by hand: the rendered prompt names every category the verifier is strict about, quotes the previous rejection on a retry and not on a first attempt, and is stable across renders. Independently, a hand edit that followed these rules passed verify_edit on the first try — that is how the 759-entry backlog of the 26.8 changelog was cleared in #111720.

Related: #111720
Related: #116138

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Version info

  • Merged into: 26.9.1.291 (included in 26.9 and later)

The editing step of the `NightlyChangelog` job has been failing its own
verification every night since 2026-08-12, always the same way:

    Entries disappeared in the edit without a matching revert (['103182', '109946'])

`verify_edit` requires that every raw entry of a strict-retention category
keeps its pull request link - an entry may be rewritten, merged or moved, but
not dropped, because the generation point has already moved past it and no
later run will offer it again. The prompt never said so, and the skill stated
the rule only implicitly, so the agent pruned entries it judged
insignificant: `#103182` (`Lightweight Updates v2`, a `Backward Incompatible
Change`) was deleted outright.

The second half of the same failure is the revert handling. `#109946` fixed
the propagation of settings in `accurateCastOrDefault`, `#114911` reverted
it, and `#114912` reverted that revert - all three in one range. The skill
covers this in section 2.5, but the agent reached the "landed and then
reverted, so delete both" rule first and lost a fix that ships.

So:

- The prompt now lists the strict-retention categories (from
  `STRICT_RETENTION_CATEGORIES`, so the two cannot drift apart), says which
  entries may be deleted and why deleting anything else is unrecoverable, and
  states the revert-of-revert rule.
- The skill gets a retention rule ahead of the individual edits, and the
  walk over `NO CL ENTRY` checks whether a revert is itself reverted before
  it concludes that a change was reverted. The `accurateCastOrDefault` chain
  is written out there as the worked example.
- A retry now tells the agent why the previous attempt was rejected. Without
  it, all three attempts of a run reproduced the same edit and the same
  rejection - visible in every run from 2026-08-12 on.

A hand edit that followed these rules passed `verify_edit` on the first try,
which is how the 26.8 backlog (759 raw entries) was cleared in
#111720.

Related: #111720
Related: #116138
@clickhouse-gh

clickhouse-gh Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a6aa16d]

Summary: ✅


AI Review

Summary

This PR hardens the NightlyChangelog edit step against irreversible entry loss by making the retention rule explicit, persisting revert/delete bookkeeping across nightly runs, and verifying restore/reapply behavior against that ledger. I reviewed the current diff, the existing thread history, and the new regression matrix in ci/tests/test_changelog_nightly_revert_ledger.py; I did not find any remaining correctness or metadata issues in the current head.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 25, 2026
Comment thread ci/jobs/changelog_nightly.py Resolved
alexey-milovidov and others added 4 commits August 25, 2026 00:30
The `clickhouse_spelling` check failed on the 26.8 changelog pull request
(`CHANGELOG.md:366: Clickhouse`) because an entry carried the misspelling
straight out of the pull request body it was generated from. The editing
skill lists the typos to fix, so list this one - it is now enforced by CI -
along with `loose`/`lose` from the same sentence.

Related: #111720
The skill spells out the misspellings (`Clickhouse`, `clickHouse`, `Click House`)
that the check rejects, in the same way the check, the ignore list and the style
guide do, so the line documenting them needs a line-scoped exception.

Fixes the `Style check` failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=116221&sha=9f07be43f844d60794ffcc6ab3a9c9ad136e44d6&name_0=PR&name_1=Style%20check
PR: #116221

Co-Authored-By: Claude Fable 5 <[email protected]>
Address review: `resolve_reverted_originals` granted deletion credit to every
raw-block revert with a `Reverts owner/repo#N` marker, even when that revert
was itself reverted later in the same range — so an edit dropping `#109946`
(reverted by `#114911`, which `#114912` reverted in turn) still passed
verification while the fix ships in the release.

Now the resolved reverts are walked in descending PR-number order (a revert
always has a higher number than its target): an uncancelled revert cancels
the reverts it targets and only uncancelled reverts contribute deletion
credit. Because a revert of a revert made through the web UI can lack the
body marker (`#114912` has none), the target is also resolved from the
nested title — `Revert "Revert "X""` binds to the earlier range revert
titled `Revert "X"`.

PR: #116221

Co-Authored-By: Claude Fable 5 <[email protected]>
Comment thread ci/jobs/changelog_nightly.py Resolved
`verify_edit` was only net-effect aware inside one raw block, while the job
edits a release cycle in ~30 nightly increments and a revert chain routinely
spans them:

1. run N integrates `#109946`;
2. run N+1 sees `#114911` and deletes `#109946`;
3. run N+2 sees only raw `#114912`.

On run N+2 nothing disappears in the edit — `#109946` went away the previous
day — so verification passed with a shipped fix missing from `CHANGELOG.md`,
and the editing agent had no way to know the entry ever existed: it is gone
from the file, and the intervening revert is gone from the raw blocks.

The branch now carries that memory itself, in trailers on its own edit
commits, the same way `Changelog-generated-up-to:` carries the generation
point:

    Changelog-revert: <revert> <reverted> <title of the revert>
    Changelog-deleted-entry: <pull request> <its bullet as it was deleted>

`analyze_reverts` resolves each run's reverts against that ledger and reduces
the *cumulative* graph, so a chain spread over several runs behaves exactly
like one arriving in a single raw block, at any depth:

- the reduction is what decides deletion credit, so a cancelled revert
  licenses nothing;
- an entry recorded as deleted whose revert is no longer uncancelled has to
  be back in `CHANGELOG.md` — `verify_edit` fails the run while it is not,
  and the prompt asks for it by name, quoting the bullet from the ledger;
- the recorded titles also let a web-UI `Revert "Revert "X""` (which carries
  no `Reverts owner/repo#N` marker) bind to an earlier revert the job saw
  days ago.

A branch whose edit commits predate the trailers has an empty ledger and
keeps the previous behaviour.

`ci/tests/test_changelog_nightly_revert_ledger.py` pins the timelines: the
whole chain in one block, the revert alone, the revert of the revert arriving
after the deletion, a revert of the re-apply, an empty ledger, and an
unresolvable revert.
Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
…ewest bullet

Two defects in the ledger, both found by the AI review of the previous
commit:

- The nested-title fallback bound a `Revert "Revert "X""` to *every* earlier
  revert titled `Revert "X"`. Revert titles are not unique — the same change
  can be reverted twice in a cycle, and both reverts carry that title — so an
  ambiguous match would cancel unrelated reverts and hand out deletion credit
  for, or demand the restoration of, entries nobody reverted. Only an
  unambiguous match binds now; anything else stays unresolved, which grants
  no credit at all.

- `read_revert_ledger` let the *oldest* `Changelog-deleted-entry:` record win,
  because `git log` walks newest first and the loop assigned unconditionally.
  An entry that is deleted, restored, and deleted again carries the link of
  the pull request that re-applied it the first time, and that text would have
  been dropped on the second restoration. `setdefault` keeps the newest
  record.

Both are pinned by tests that fail without the fix:
`test_ambiguous_nested_title_binds_to_nothing` and
`test_restoring_uses_the_newest_recorded_bullet`.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Both fixed in cd0489b, each with a test that fails without the fix.

Ambiguous nested titles. Agreed — revert titles are not unique, and two reverts of the same change both carry Revert "X", so a Revert "Revert "X"" that matches several of them identifies none. Only an unambiguous match binds now; anything else goes to unresolved, which grants no credit at all. test_ambiguous_nested_title_binds_to_nothing puts two earlier reverts titled Revert "<FIX_TITLE>" in the ledger and asserts that today's Revert "Revert "<FIX_TITLE>"" resolves to nothing, records nothing, cancels neither — so both earlier deletions stay licensed and no restoration is demanded. Without the fix it cancelled both and demanded #109946 back.

Oldest-wins replay. Also right: git log walks newest first and the loop assigned unconditionally, so the oldest Changelog-deleted-entry: won. Changed to setdefault, which keeps the newest record — the reviewer's first-seen suggestion, since first-seen is newest. titles got the same treatment for consistency. test_restoring_uses_the_newest_recorded_bullet walks the full delete → restore → delete → restore cycle and asserts the restored bullet is the one that already carries #114912's re-apply link; without the fix it was the pre-restoration text and that link was dropped.

ci/tests/test_changelog_nightly_revert_ledger.py is now 9 tests. CI Tests was green on the previous commit, so the file runs in CI.

Comment thread ci/jobs/changelog_nightly.py Resolved
…cord

`Changelog-deleted-entry:` stored a flat pull request -> whole bullet
snapshot, but a merge (skill section 7) puts several pull requests on one
bullet — 74 of them in the current `CHANGELOG.md`. Two things went wrong with
that:

- When only one of a merged bullet's pull requests was reverted, the bullet
  stayed in the file carrying the others, and the recorded line was the whole
  merged one. The prompt asked for that line back, which duplicates the
  siblings, and `verify_edit` accepted it: `not_restored` only asks whether
  `/pull/109000)` appears somewhere.
- When the whole merged bullet was deleted, every one of its pull requests was
  recorded against the same line, so the prompt listed the same bullet once
  per pull request.

`group_restorations` now groups the entries to restore by the line they were
recorded from — one bullet is restored once, however many pull requests it
covers — and reports the `siblings` of that line which are still in the file.
The prompt names them and asks for the missing link to be put back into the
existing bullet instead of a copy of the recorded line.

`duplicate_attributions` closes the verification gap: an edit that newly
attributes a pull request twice in the in-progress section is rejected.
Duplicates that predate the edit are left alone — the file has 20 of them
across released sections, where the same pull request legitimately appears in
a release and in a backport.

`test_verify_edit_accepts_only_the_exact_merged_bullet_restoration` runs the
whole path: leaving the reverted pull request out is rejected, pasting the
recorded bullet next to the surviving one is rejected, merging the link back
in passes. Without the duplicate check the paste is accepted, which is the
reported defect.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Fixed in c74a94a. The finding is right, and it is not hypothetical — the current CHANGELOG.md has 74 bullets carrying more than one attribution, so a merged bullet is the normal case, not an edge one.

Two distinct failures came out of the flat pull request -> whole bullet record, and both are now closed:

  • Only one pull request of the bullet was reverted. entry_line recorded the whole merged line, so the prompt asked for a line that still contains #109006 while #109006 is still in the file. group_restorations now reports, per restoration, the siblings of the recorded line that are still present, and the prompt says so explicitly: "That bullet also carries #109006, which is still in CHANGELOG.md: the bullet is therefore still there, so put the missing link back into it — do not paste the line above as a second bullet, and do not repeat #109006."
  • The whole merged bullet was deleted. Every one of its pull requests was recorded against the same line, so the prompt listed the same bullet once per pull request and invited exactly the duplication you describe. Restorations are now grouped by the recorded line: one bullet, restored once, with all of its pull requests named together (#109000, #109006, deleted when #115000 reverted them).

On the verification gap — you are right that not_restored cannot see this, since the link it looks for is present either way. duplicate_attributions closes it: an edit that newly attributes a pull request twice in the in-progress section is rejected. Pre-existing duplicates are deliberately left alone; the file has 20 across released sections, where the same pull request legitimately appears in a release and in a backport, so the check is a diff against the pre-edit section rather than an absolute rule.

On the test request — test_verify_edit_accepts_only_the_exact_merged_bullet_restoration is the focused regression you asked for, and it runs the whole path rather than a helper: #109000 and #109006 share a bullet, #109000 is reverted and dropped from it, the revert is then reverted, and

  • leaving #109000 out → ... still missing (['109000']),
  • pasting the recorded bullet next to the surviving one → ... attributes pull requests twice ... ['109006'],
  • merging the link back into the existing bullet → accepted.

I confirmed it fails for the right reason: with the duplicate check removed, the paste case returns None, i.e. exactly the silent acceptance you reported. Two more tests cover the prompt side (test_restoring_into_a_merged_bullet_names_the_surviving_siblings, test_a_merged_bullet_is_restored_once_for_all_its_pull_requests), and the skill's §2 step 6 now states the rule for a human running it by hand. The file is at 13 tests.

Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
… section

Two more carriers were missing on the restore path.

`resolve_revert_targets` handled the `Reverts owner/repo#N` body marker and
the nested `Revert "Revert "X""` title, but not `Revert #NNNNN` — the other
form the skill names, and the one that needs no matching at all because it
states the target. A re-apply titled that way stayed unresolved, the stale
`109946 → 114911` credit survived from the ledger, and the shipped fix stayed
dropped. It is now parsed before the nested-title form, anchored on the whole
title so that `Revert "Fix #12345"` — a quoted original title that mentions an
issue — is not read as naming `#12345`.

While there: every resolution form now requires the target to have the lower
pull request number. A revert is always merged after what it reverts, and that
is the invariant `revert_net_effect` settles whole chains with in one
descending pass, so a relation that breaks it is not a revert relation and is
dropped rather than trusted.

`group_restorations` decided that a merged bullet was "still there" by looking
for its other pull requests anywhere in the file, so a sibling that survives
only in an already-released section — the same pull request in the previous
release or in a backport, of which the file has 20 — made the prompt ask for a
merge into a bullet that is not in the in-progress section. The sibling test is
now scoped to that section. Whether an entry is missing at all is still asked
of the whole file, on purpose: a link sitting in a released section was
published there and has no business in this release.

Four tests added, including the two the review asked for: the cross-run
restore driven by a `Revert #NNNNN` title, and a recorded merged bullet whose
sibling survives only below. Both fail without the corresponding fix.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Both fixed in e8b367d, each with a test that fails without its fix.

Revert #NNNNN titles. Correct, and it was the worst kind of miss: the skill names that form in §2 step 1, and it is the exact form — it states the target, no matching needed — yet it was the one form not parsed. It is now handled before the nested-title fallback. test_a_numeric_revert_title_resolves_across_runs runs your timeline with the re-apply titled Revert #114911 and asserts #114911 is cancelled, #109946 is out of credits, and restore == {"109946": <bullet>}; without the fix the revert is unresolved, the ledger credit survives, and restore is empty.

Two details worth flagging, since neither was in the finding:

  • The pattern is anchored on the whole title, so Revert "Fix #12345" is not read as naming #12345 — it is a quoted original title that mentions an issue, and it belongs to the nested-title form. test_a_quoted_title_mentioning_an_issue_is_not_a_numeric_revert pins that.
  • Every resolution form now requires the target to have the lower number. A revert is merged after what it reverts, and that is the invariant revert_net_effect settles whole chains with in one descending pass — a relation breaking it is not a revert relation, so it is dropped rather than trusted. test_a_numeric_title_pointing_forward_is_not_a_relation covers it.

Sibling scope. Also right, and it is the mirror of a distinction I had already drawn elsewhere and then failed to apply here. siblings means "the bullet is still there, merge into it", which is only true of the in-progress section; the file legitimately carries the same pull request in the previous release or a backport (20 such cases today). Scoped to extract_in_progress_section now. test_a_sibling_surviving_only_in_a_released_section_is_not_a_bullet asserts both directions from the same ledger: sibling in the in-progress section → siblings == ["109006"] and the merge instruction appears; sibling only in the released section → siblings == [] and the prompt does not mention merging, so the entry is restored as its own bullet.

Whether an entry is missing is deliberately still asked of the whole file, matching disappeared_entries: a link sitting in an already-released section was published there and has no business in this release. The two questions are now answered at the right scopes, and the comment says which and why.

17 tests. CI Tests and Style check were green on c74a94a.

Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
Two restore-path gaps, both real.

**Scope.** Whether a recorded entry is back was asked of the whole file, so a
copy of the same pull request in an already-released section satisfied the
check and the in-progress section could stay without the entry. My previous
round defended that scope by pointing at `disappeared_entries`, which was the
wrong analogy: `removed` there is already section-scoped and consults no
released copy, so a `Changelog-deleted-entry:` record exists precisely for an
entry that *was* in the in-progress section. That is where it has to come
back, and all three restore questions - is it missing, is there a bullet to
merge into, is it in the right place - are now asked of that section. The
different question `disappeared_entries` asks of a raw entry that never made
it in keeps its whole-file scope, with the reason spelled out next to both.

**Category.** The ledger recorded the bullet but not the `#### <Category>` it
sat under, and the category is not derivable from the pull request: the
editing rules promote entries out of `NOT FOR CHANGELOG` (skill section 3) and
move them between real categories (section 6), so it is a decision of the edit
that first added the entry. The trailer is now
`Changelog-deleted-entry: <pr> [<category>] <bullet>`, the prompt names the
category instead of asking for it to be re-derived, and `verify_edit` rejects
a restoration that lands elsewhere. Only this run's restorations are checked -
the ledger keeps the record for the rest of the cycle, and a later edit may
legitimately move the entry again.

`entry_line` becomes `entry_placement`, returning the category with the
bullet.

Two tests added, the ones the review asked for:
`test_a_released_copy_does_not_stand_in_for_the_restoration` and
`test_a_promoted_entry_is_restored_under_the_category_it_was_moved_to`, both
driving the real `verify_edit`. Each fails without its fix.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Both fixed in 65e034f, each with a test that fails without its fix.

Scope. You are right, and my previous round defended the whole-file scope with the wrong analogy. I pointed at disappeared_entries — but removed there is already section-scoped and consults no released copy, which means a Changelog-deleted-entry: record exists precisely for an entry that was in the in-progress section. So that is where it has to come back, and a released copy can never stand in for it. All three restore questions — is it missing, is there a bullet to merge into, is it in the right place — are now asked of the in-progress section. The genuinely different question disappeared_entries asks of a raw entry that never made it in keeps its whole-file scope, and the reason is now written next to both so they do not get conflated again.

test_a_released_copy_does_not_stand_in_for_the_restoration builds the file with #109946 present only in the released section and drives the real verify_edit: the entry is still listed in missing, an edit that leaves the section without it is rejected with ... still missing from the in-progress section (['109946']), and putting it back is accepted. Without the fix the first case passes.

Category. Also right, and worse than a cosmetic slip: the category is a decision of the edit that first added the entry, not a property of the pull request, so re-deriving it undid §3 promotions and §6 moves. The trailer is now Changelog-deleted-entry: <pr> [<category>] <bullet>, entry_line became entry_placement (category with the bullet), the prompt names the category — "which sat under #### Improvement" — and explicitly says not to fall back to the pull request's own category, and verify_edit rejects a restoration that lands elsewhere.

One deliberate limit there: the category check applies only to this run's restorations, not to every entry in the ledger for the rest of the cycle. The ledger is append-only, so a permanent check would freeze that entry's category for the remaining ~30 runs and forbid a later legitimate §6 move.

test_a_promoted_entry_is_restored_under_the_category_it_was_moved_to uses an entry promoted out of NOT FOR CHANGELOG into Improvement: restoring it under Improvement is accepted, restoring it under the category of its own pull request is rejected with ... #110500 under Bug Fix ... instead of Improvement.

Both rules are in the skill's §2 step 6 as well, for a human running it by hand. 19 tests. Style check, CI Tests and PR were green on e8b367d.

Comment thread ci/jobs/changelog_nightly.py Resolved
The restore path asked whether `/pull/<pr>)` appears anywhere in the
in-progress section, which a bare link inside somebody else's bullet
satisfies: a `This closes` reference, or a follow-up named in prose. The
entry then never comes back as its own attribution and `verify_edit` accepts
the edit. `entry_placement` had the same hole from the other side - it fell
back to a merely mentioning bullet, so the category check read the category of
an unrelated entry.

This is not theoretical: the current `CHANGELOG.md` links 17 pull requests
that way without ever attributing them, while exactly one of its 4165 bullets
carries a link and no attribution at all. The attribution
`[#N](.../pull/N) ([Author](...))` is what the generator emits for every entry
and what a merge (skill section 7) appends per merged pull request, so
requiring it costs nothing and is what "the entry is there" means.

`is_attributed` is now the test for all three restore questions - is the entry
missing, is a sibling's bullet still there to merge into, and (through an
attribution-only `entry_placement`) which category it landed in.

`test_an_inline_mention_does_not_stand_in_for_the_restoration` drives
`verify_edit` with a section whose only occurrence of `#109946` is a mention
inside a bullet attributed to `#120000`: rejected, and accepted once the real
entry is there beside it.
`test_a_sibling_only_mentioned_inline_is_not_a_bullet_to_merge_into` covers
the sibling side. Both fail without the fix.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Fixed in d5c38de, with a test that fails without the fix.

The blocker is real, and it had the same shape on both sides: not_restored asked whether /pull/<pr>) appears anywhere in the section, which a bare link inside somebody else's bullet satisfies, and entry_placement fell back to that mentioning bullet, so the category check then read an unrelated entry's category.

I measured it against the real file rather than reasoning about it: CHANGELOG.md links 17 pull requests inline without ever attributing them (This closes references, follow-ups named in prose), while exactly one of its 4165 bullets carries a link and no attribution at all. So the attribution form is what "the entry is there" means, and requiring it costs nothing.

is_attributed is now the single test for all three restore questions:

  • is the entry missing — not_restored and missing;
  • is a sibling's bullet still there to merge into — siblings;
  • which category did it land in — entry_placement is attribution-only now, so it returns ("", "") rather than the category of a bullet that merely mentions the pull request.

test_an_inline_mention_does_not_stand_in_for_the_restoration is your case, driven through the real verify_edit: a section whose only occurrence of #109946 is a mention inside a bullet attributed to #120000 is rejected with ... still missing from the in-progress section (['109946']), and accepted once the actual entry sits beside it. It asserts the trap explicitly — "/pull/109946)" in mention_only is true while is_attributed(...) is false — so the regression cannot come back unnoticed. test_a_sibling_only_mentioned_inline_is_not_a_bullet_to_merge_into covers the sibling side, and the skill states the rule for a human running it by hand.

21 tests. Style check, CI Tests and Code Review were green on 65e034f.

Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
**The retention path judged entries by any link, the restore path by
attribution.** The previous commit fixed the restore side only, so a strict raw
entry still counted as preserved when another bullet merely mentioned its pull
request in prose — and `revert_licensed_deletions` then had no attributed
bullet to snapshot, making the entry unrecoverable as well as gone. Both halves
of `disappeared_entries` now use the attribution, which also removes a
spurious failure in the other direction: rewording a bullet and dropping an
inline reference to another pull request is not the loss of that pull
request's entry.

**A restoration did not have to record the pull request that re-applied the
change.** Skill section 2.5 appends its link to the entry, and that link is
the only trace of the re-apply left in the release, since its own revert
bullet is deleted. Restoring a bare `#109946` without `#114912` passed.
`verify_edit` now requires it, on the bullet the entry landed on rather than
somewhere in the section, and only for this run's restorations — a later edit
may reword the entry.

**The duplicate guard compared sets of duplicated pull requests.** An entry
already written twice could gain a third copy without changing the set.
`duplicate_attributions` becomes `attribution_counts`, and the check is
`count > max(1, count before the edit)`: no increase is allowed, while the
count an edit inherits is left alone (removing an entry is what the retention
rule forbids).

Four tests added; each fails without its fix.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 All three fixed in 21406b7, each with a test that fails without its fix.

Retention path judged by any link. Right, and it was my own inconsistency: the previous commit made the restore path attribution-based and left the retention path on substring matching. Both halves of disappeared_entries now use the attribution. Worth noting the consequence you point out is the worse half — the edit passes and revert_licensed_deletions finds no attributed bullet to snapshot, so the entry is unrecoverable as well as gone.

Fixing it also removed a spurious failure in the opposite direction, which the any-link check had: removed was extract_pr_links(old_section) - extract_pr_links(section), so rewording a bullet and dropping an inline reference to another pull request counted as losing that pull request's entry and demanded revert credit for it. test_dropping_an_inline_mention_is_not_losing_an_entry pins that.

Re-apply link not enforced. Correct, and this one loses information permanently for a reason worth spelling out: the re-applying pull request's own revert bullet is deleted, so the link appended to the entry is its only trace in the release. verify_edit now requires it on the bullet the entry landed on — test_a_restoration_records_the_pull_request_that_reapplied_it asserts that the same link on a different bullet in the same section is still a failure. Scoped to this run's restorations, like the category check: the ledger keeps the record for the rest of the cycle and a later edit may legitimately reword the entry.

Set-based duplicate guard. Correct. duplicate_attributions becomes attribution_counts and the test is count > max(1, count before the edit), so no increase is allowed while a count the edit inherits is left alone — removing an entry is what the retention rule forbids, so the guard must not force the agent to delete a pre-existing copy. test_an_already_duplicated_entry_cannot_gain_another_copy covers both: 2 → 3 rejected with #109946 3 times, 2 → 2 accepted.

25 tests. Style check, CI Tests, Code Review and PR were all green on d5c38de.

Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
…survivor

**`cancelling` was any-target, not every-target.** A revert that undoes
something of this release *and* something that shipped earlier was exempt from
strict retention on the strength of the first half alone, so its own entry
could disappear with the entry it cancels - taking the user-visible half of it
(skill section 2, case 5) out of the changelog. The exemption now needs every
target to belong to this cycle; one target from an earlier release keeps the
revert's entry protected.

**The shared-bullet rule ignored the pull requests that never left.** The split
check compared the bullets of the restored pull requests only, so with
`#109000` and `#109006` off one bullet and only `#109000` restored, re-adding
it as a second bullet with the same prose passed everything: no attribution
repeats, the category matches, the re-apply link is there. The check now spans
the group's `siblings` too, which is what "merge it back into the bullet that
survived" means.

The duplicate-attribution check moves ahead of the shared-bullet one: pasting
the recorded merged bullet beside the survivor trips both, and "you wrote this
entry twice" is the more specific diagnosis.

Two tests added. Each fails without its fix, and the shared-bullet one asserts
that no attribution repeats in its input, so it cannot pass as a restatement of
the duplicate check.
The skill states the rules the job enforces, so a human running it by hand
follows the same ones: a revert that spans two releases keeps its own entry,
and a restoration merges into the bullet that survived rather than being added
beside it.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Both fixed in cf845a6 (skill wording in d6189a6), each with a test that fails without its fix.

cancelling was any-target, not every-target. Right — targets[pr] & cycle_entries exempted a revert on the strength of one target, so a revert that undoes something of this release and something that shipped earlier could disappear with the entry it cancels, taking the user-visible half (case 5) out of the changelog. It now needs targets[pr] <= cycle_entries: one target from an earlier release keeps the revert's entry protected. test_a_revert_spanning_two_releases_keeps_its_entry asserts cancelling == [] for that shape, rejects dropping both, and accepts dropping only the cancelled entry.

The shared-bullet rule ignored the pull requests that never left. Also right, and it is the sharper of the two: with #109000 and #109006 off one bullet and only #109000 restored, re-adding it as a second bullet with the same prose passed everything — no attribution repeats, the category matches, the re-apply link is on it. The check now spans the group's siblings, which is what "merge it back into the bullet that survived" actually means. test_a_restoration_merges_into_the_surviving_bullet asserts max(attribution_counts(...).values()) == 1 for its input, so it cannot pass as a restatement of the duplicate check.

One consequential reordering: the duplicate-attribution check now runs before the shared-bullet one. Pasting the recorded merged bullet beside the survivor trips both, and "you wrote this entry twice" is the more specific diagnosis to hand back to the agent; the shared-bullet check is then left with exactly the case no other check sees, the trimmed copy.

41 tests. Style check, CI Tests, Code Review and PR were all green on 5aa2d9b.

Comment thread ci/jobs/changelog_nightly.py Resolved
`reapply_allowance` counted only the entries a re-applying pull request is
appended to, so a pull request that re-applies something of this release *and*
reverts something of an earlier one - one entry it brings back, plus its own
visible entry for the older revert (skill section 2, case 5) - was rejected as
`#116500 2 times`. That is the only correct changelog for that state, so the
job would have wedged on it.

The allowance now adds one for a re-applier that is not in `cancelling`. That
set is exactly the discriminator: a revert whose targets all belong to this
cycle leaves no trace of its own and is attributed once per entry it brings
back, while one with a target from an earlier release keeps an entry too. The
ordinary revert of a revert is in `cancelling`, so its allowance is unchanged.

`test_a_mixed_target_reapply_keeps_its_own_entry_too` accepts the two
attributions and still rejects a third.

It also pins a limit rather than papering over it: with the link appended to
the restored entry, dropping the pull request's own bullet leaves it attributed,
and since the rules do allow an entry to be merged into another bullet (section
7), link presence cannot tell a legitimate merge from an entry reduced to an
annotation. Enforcing an own bullet here would forbid a legitimate merge, so
the check stays out and the test records why.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Fixed in 4cbf1d6, with a test that fails without the fix.

The finding is right and it is a wedge, not a loss: #116500 re-applies #109946 and reverts #90000 from an earlier release, so the only correct changelog attributes it twice — on the restored entry and on its own visible bullet (case 5) — and the guard rejected exactly that.

cancelling turned out to be the discriminator already in hand: a revert whose targets all belong to this cycle leaves no trace of its own, so it is attributed once per entry it brings back; one with a target from an earlier release keeps an entry too, so it gets one more. The ordinary revert of a revert is in cancelling, so its allowance is unchanged — which is why the other 41 tests were unaffected.

One thing I did not add, and want to flag rather than leave implied. My first draft of the test also asserted that dropping #116500's own bullet is rejected. It is not, and it should not be: with the link appended to the restored entry the pull request is still attributed, and section 7 does allow an entry to be merged into another bullet, so link presence cannot distinguish a legitimate merge from an entry reduced to a re-apply annotation. A check there would forbid legitimate merges. The test now pins that as a known limit with the reasoning, instead of me quietly deleting the assertion.

On the environment note: pytest is not in the Code Review sandbox, but the file does run in CI — CI Tests executes pytest ci/tests/ and was green on d6189a6, as were Style check, Code Review and PR. 42 tests.

Comment thread ci/jobs/changelog_nightly.py Resolved
…is not an entry

**Same-cycle detection now has a durable source.** `cycle_entries` was built
from what the changelog still shows - the section, this run's raw entries, the
recorded deletions, the revert graph - and an entry pruned as insignificant on
an earlier run leaves none of those. A revert of it arriving weeks later
therefore looked like a revert of an earlier release: deleting it was rejected,
or keeping a visible bullet for a change with no net effect was accepted.

`release_range_prs` answers the question from git instead: the pull requests
merged into master since the cycle's `vX.Y.1.1-new` tag, from both subject
shapes the repository uses. Git remembers the range whatever the changelog did
with it. `--first-parent`, so the walk stays on master's own commits - a
contributor branch can carry merges of pull requests of the contributor's
*fork*, and there are five such numbers in the 26.8 range (`Merge pull request
#4 from someone/...`), which mean nothing here. 2277 pull requests for that
range, in 0.3s.

**And the limitation from the previous round is closed rather than documented.**
A re-applier that also reverted something of an earlier release has a change of
its own; the link it contributes to the entry it brought back is an annotation
on someone else's bullet and cannot stand in for that. It is checkable without
forbidding a legitimate merge, by asking for *some other* bullet rather than
for a bullet of its own: a section 7 merge into a third entry still passes,
while collapsing the entry into the annotation does not.

Two tests added. The pruned-entry one runs the same input with and without the
range, so it shows both the old verdict and the new one; the annotation one
also asserts that the legitimate merge is still accepted.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Both addressed in be76347 — including the one I had dismissed. You were right to re-raise it.

Same-cycle detection now has a durable source. cycle_entries was assembled from what the changelog still shows, and a pruned entry leaves none of it, so a revert of it looked like a revert of an earlier release. release_range_prs answers the question from git instead: the pull requests merged into master since the cycle's vX.Y.1.1-new tag. Git remembers the range whatever the changelog did with the entry, which is the property the other four sources lacked.

Two details from implementing it:

  • --first-parent, so the walk stays on master's own commits. A contributor branch can carry merges of pull requests of the contributor's fork, and the 26.8 range has five (Merge pull request #4 from someone/...) whose numbers mean nothing here. Without it those land in the set.
  • The upper bound is origin/master, not the generation point: a pull request merged after today's range is then recognised a run early, which is harmless since it belongs to the cycle either way. 2277 pull requests for the 26.8 range in 0.3s.

test_a_revert_of_a_pruned_entry_is_still_same_cycle runs your exact timeline twice on the same input, without and with the range, so it records both the old verdict and the new one.

And I was wrong to close the second one as a limitation. It is checkable, and the distinction I thought blocked it is the thing that makes it work: ask for some other bullet rather than for a bullet of its own. A section 7 merge of #116500's entry into a third bullet then still passes, while collapsing its entry into the annotation on #109946 does not. own_entry_required is the re-appliers that arrived under a strict-retention category and are not exempt — exactly the ones with a change of their own — and the test asserts the rejection and that the legitimate merge is accepted.

The reasoning I gave for dismissing it ("link presence cannot tell a legitimate merge from an annotation") was true of link presence and false of the check that was available; I should have looked for that instead of documenting the gap.

43 tests. Style check, CI Tests, Code Review and PR were all green on 4cbf1d6.

Comment thread ci/jobs/changelog_nightly.py Resolved
`cancelling` said a same-cycle revert's own bullet *may* go and left it at
that, so an edit could delete the entry the revert cancelled and still publish
the revert itself as an ordinary `Improvement`. The change and its undoing
cancel out; the skill's rule is that the user sees no trace of either side, and
half of it was unenforced. The same allowed-but-not-required asymmetry as
`credits` two commits ago, in the sibling set.

`verify_edit` now rejects an attribution of a `cancelling` pull request in the
in-progress section - with one exception that had to be carved out carefully:
the link of a revert of a revert on the entry it brought back. That pull request
is in `cancelling` too (its target is a revert of this cycle), and skill section
2.5 *requires* its link there, so the check asks only for attributions on
bullets other than the entries it re-applied. Without that carve-out the
verifier would demand the link and then reject it.

`test_a_revert_under_a_real_category_is_still_a_revert` gains the accepted-bad
shape the review named, and `test_a_reapply_link_is_not_a_lingering_revert_entry`
pins the carve-out from both sides.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Fixed in 8437a7d, with the accepted-bad shape you named as the regression.

You are right, and it is the same allowed-but-not-required asymmetry as credits two commits ago, in the sibling set: cancelling said a same-cycle revert's own bullet may go and left it there, so deleting the entry and publishing the revert as an ordinary Improvement passed. Half of "no trace of either" was unenforced.

verify_edit now rejects an attribution of a cancelling pull request in the in-progress section, with one carve-out that needed care: the link of a revert of a revert on the entry it brought back. That pull request is in cancelling too — its target is a revert of this cycle — and section 2.5 requires its link there, so a flat "reject any attribution of a cancelling pull request" would have demanded the link and then rejected it. The check therefore asks only for attributions on bullets other than the entries it re-applied, which is the mirror of the own_entry_required check from the previous commit: a non-exempt re-applier needs some other bullet, an exempt one may have no other bullet.

test_a_revert_under_a_real_category_is_still_a_revert gains your shape (changelog([disguised]) → Reverts of changes of this release still have entries of their own (['#115800'])), and test_a_reapply_link_is_not_a_lingering_revert_entry pins the carve-out: with #114911 and #114912 both in cancelling, the restored entry carrying #114912's link is accepted, and a bullet of its own on top of it is not.

One note on that second test: the "bullet of its own" case is caught by the duplicate guard rather than by this check, because #114912 is then attributed twice against an allowance of one. I left the assertion at "rejected" rather than pinning the message — which check catches it is not the point, and pinning it would make the test brittle to exactly the kind of reordering I did two rounds ago.

44 tests. Style check, CI Tests, Code Review and PR were all green on be76347.

Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
…ot cancelled

**A re-apply link on a recorded line is not a pull request that shared the
bullet.** `group_restorations` took every other attribution on the line as a
surviving sibling, and a line restored once already carries the link of the
revert that re-applied it. When the same re-applier annotates more than one
entry, the shared-bullet rule then demanded that link be on this entry's bullet,
and which bullet `entry_placement` finds first decides the verdict - a correct
changelog rejected on shape and order. Siblings are now the attributions that
are not reverts.

**A change that already shipped is not cancelled out by a revert.** A pull
request merged into the last release branch after the cycle start is in this
range but its entry sits in a released section, so reverting it reverses
behaviour users already have: a change of its own (skill section 2, case 5), not
a cancelling out. `cycle_entries` now subtracts what the released sections
attribute, which is the same distinction `disappeared_entries` already draws for
its own leniency.

**And the third case is put to the agent rather than decided by the verifier.**
The generator files a revert with no `Changelog entry` under `NO CL ENTRY`, so a
mixed-target revert of an earlier release carries no signal that it is
user-visible, and `own_entry_required` - which keys off the strict categories -
does not cover it. Whether such a reversal deserves an entry is exactly the
judgement case 5 asks for ("meant to be visible to users"), so the prompt gets a
"Reverts of earlier releases" list naming the pull request and what it reverts,
and says not to treat it as a revert that leaves no trace. Requiring an entry
would have the verifier make a call the rules leave to the editor.

Three tests added, one per case; each fails without its fix.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 All three addressed in dfd9f58, each with a test that fails without its fix.

Annotations are not siblings. Right, and your diagnosis of why it breaks — order dependence — is exactly it: a line restored once already carries the re-applier's link, and when that re-applier annotates more than one entry, whichever bullet entry_placement finds first decides the verdict. Siblings are now the attributions on the recorded line that are not reverts. Writing the test also showed the shape has to be complete to be legitimate at all: for #114912 to annotate two entries the graph needs both reverts, and then reapply_allowance is 2 — so the test asserts the allowance too, otherwise it would have been passing for the wrong reason.

A published change is not cancelled out. Also right. cycle_entries was pure range membership, and a pull request merged into the last release branch after the cycle start is in the range with its entry in a released section — users have the behaviour, so reverting it is case 5. It now subtracts what the released sections attribute, which is the same distinction disappeared_entries already draws for its own leniency; I had it in one place and not the other.

The third one I have handled differently, deliberately. You are right that case 5 does not depend on the raw category and that own_entry_required therefore misses a NO CL ENTRY mixed-target revert. But requiring an entry there would have the verifier decide something the rules leave to the editor: case 5 is conditional — "if the original PR shipped in an earlier release and the revert is meant to be visible to users". A revert of an old release that is not user-visible is legitimately pruned, and forcing an entry would wedge the job on a correct edit.

So the prompt gets a "Reverts of earlier releases" list naming each such pull request and what it reverts, saying the change is not cancelled out by anything in this release and that the case 5 judgement applies. The agent decides; the verifier does not. This is the same offered-not-required split I used for the prunable restorations, and for the same reason.

If you would rather the verifier require an entry for every revert with a target outside the cycle, that is a one-line change — but it makes the job fail on a legitimately pruned revert of an old release, so I have not made it.

47 tests. Style check, CI Tests, Code Review and PR were all green on 8437a7d.

Comment thread ci/jobs/changelog_nightly.py Resolved
The previous commit fixed "a re-apply annotation is not a sibling" by
subtracting every revert, which is too much. A revert of an earlier release is
rewritten into a normal entry (skill section 2, case 5), so it can have been
merged into a bullet like any other pull request - and dropping it from
`siblings` reopened the hole the shared-bullet rule exists to close: with the
surviving pull request on the recorded bullet being such a revert, restoring the
deleted one as a second bullet was accepted again.

What disqualifies an attribution is being an annotation on *this* entry, not
being a revert. `group_restorations` now returns the line's other attributions
as `others` and the caller, which has the revert chain, splits them: the group's
own `reapplied_by` are the annotations, everything else shared the bullet.

`test_a_visible_revert_can_be_a_merged_sibling` puts a case-5 revert on the
recorded bullet as the survivor: `siblings == ['115400']`, the second bullet is
rejected, merging into the survivor passes. It fails with the previous commit's
filter, and the two sibling tests now pin the classification from both sides.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Fixed in 6e468ab, with the regression you asked for.

You are right, and it is a fix of mine that overshot: I closed "a re-apply annotation is not a sibling" by subtracting every revert, which reopened the shared-bullet hole for exactly the case the previous rounds established — a revert of an earlier release is a normal entry (case 5) and can have been merged into a bullet like any other.

What disqualifies an attribution is being an annotation on this entry, not being a revert. group_restorations now returns the line's other attributions as others and the caller splits them, since it has the chain: the group's own reapplied_by are the annotations, everything else shared the bullet. That is the narrow filter you suggested, expressed per entry rather than per pull request.

test_a_visible_revert_can_be_a_merged_sibling puts a case-5 revert on the recorded bullet as the survivor: siblings == ['115400'], restoring #109946 as a second bullet is rejected with `#109946`, `#115400` on 2 bullets, and merging it into the survivor passes. It fails with the previous commit's filter in place, and together with test_a_reapply_annotation_is_not_a_merged_sibling the classification is now pinned from both sides — which is what it needed, since I had moved it too far in each direction in turn.

48 tests. Style check, CI Tests, Code Review and PR were all green on dfd9f58.

Comment thread ci/jobs/changelog_nightly.py Resolved
`required` was decided from the recorded category alone, so a
`Build/Testing/Packaging Improvement` entry an earlier edit had accepted into
the in-progress section became optional again once a revert of it was itself
reverted, and the run passed without restoring it. That category is both a
prunable raw category and a legitimate section header, so the category cannot
tell the two apart.

The ledger records which it was: `Changelog-deleted-entry:` gains a
`[section]` or `[raw]` marker next to the category. `raw` is a bullet still
sitting in a raw block when the revert cancelled it - the rules were free to
prune it, so its restoration stays offered. `section` is one an edit had kept,
which is that edit having made the section 3 and 4 judgement already, so it is
required like a strict-category entry.

Two tests, one per half: that the marker decides `required` and the verdict on
an edit that leaves the entry out, and that the recording side sets it from
whether the bullet was in the section.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Fixed in d3f082a, with a test for each half.

You are right, and you named the missing bit precisely: the category cannot answer the question, because Build/Testing/Packaging Improvement is both a prunable raw category and a legitimate section header. Changelog-deleted-entry: now carries a [section] or [raw] marker next to the category:

  • raw — the bullet was still in a raw block when the revert cancelled it. §3 and §4 were free to prune it, so its restoration stays offered.
  • section — an edit had already accepted it, which is that edit having made the §3/§4 judgement. Required, like a strict-category entry.

test_a_kept_build_entry_is_required_back runs the same ledger twice, once with each marker, and asserts required and the verdict on an edit that leaves the entry out. test_a_kept_entry_is_recorded_as_coming_from_the_section covers the recording side, since the distinction is worthless if the writer does not set it — that one is the half I would have been most likely to get wrong silently, because the reader would simply have seen raw for everything.

This also tightens the offered/required split I argued for two rounds ago: "offered" now means "prunable and never accepted", which is the narrow case I actually wanted, rather than "prunable category".

50 tests. Style check, CI Tests, Code Review and PR were all green on 6e468ab.

Comment thread ci/jobs/changelog_nightly.py Resolved
Comment thread ci/jobs/changelog_nightly.py Resolved
…ategory

**`release_range_prs` read every `(#N)` in a subject.** A squashed revert
quotes the original title, `Revert "Something (#90000)" (#115800)`, and the
quoted number would put a pull request of an earlier release into this range -
the very distinction the caller uses the range for, so a revert of it would
look like something this release cancels out rather than a user-visible
reversal. Both shapes are now anchored: the squash number ends the subject, the
`Merge pull request #N` one starts it.

That shape does not occur in the last 60000 commits of this repository, where
reverts land as merge commits, so this is hardening rather than a live bug. The
anchored form is the right parse either way, and the regression pins it along
with a fork's own `Merge pull request #4` appearing mid-line.

**A sibling moved between categories made the merge impossible.** The category
check demanded the recorded header while the shared-bullet rule demanded a
merge into the surviving bullet, so once an edit had moved that bullet the two
contradicted each other and no edit could pass. The expected category is now
the surviving bullet's current one when there is a sibling to merge into, and
the recorded one otherwise: the check follows the bullet rather than a
remembered header.

The two rules then compose instead of fighting - moving the whole merged bullet
elsewhere stays legal, while leaving the survivor and restoring the entry beside
it under the old header is rejected, which the test asserts.
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 Both fixed in a6aa16d, each with a test that fails without its fix.

The subject parse is anchored. Right in principle: the quoted number in Revert "Something (#90000)" (#115800) would put a pull request of an earlier release into the range, which is exactly the distinction the caller uses the range for. Both shapes are now anchored — the squash number ends the subject, Merge pull request #N starts it.

One honest qualification: I went looking for that subject shape and it does not occur in the last 60000 commits of this repository, where reverts land as merge commits (grep -cE '\(#[0-9]+\).+\(#[0-9]+\)$' → 0). So this is hardening, not a live bug. The anchored form is the right parse regardless, and the test also pins a fork's own Merge pull request #4 appearing mid-line, which is a shape I did find (five of them in the 26.8 range) and which --first-parent alone handles.

The category now follows the bullet. This one is a genuine contradiction between two of my own rules, and you are right that it made the correct edit impossible: the category check demanded the recorded header while the shared-bullet rule demanded a merge into the surviving bullet, so once an edit had moved that bullet nothing could pass. The expected category is the surviving bullet's current one when there is a sibling to merge into, and the recorded one otherwise.

The two rules now compose. Writing the test showed the boundary is not where I first assumed: moving the whole merged bullet to another category stays legal, because that is a legitimate §6 move of that bullet — my first draft asserted it should fail, which was wrong. What is rejected is leaving the survivor where it is and restoring the entry beside it under the old header, and the test asserts that, noting that the category check catches it first and the shared-bullet rule would too.

I also corrected the error message, which claimed a restoration "keeps the category the entry had when it was deleted" — now it says "or that of the bullet it merges back into".

52 tests. Style check, CI Tests, Code Review and PR were all green on d3f082a.

@alexey-milovidov alexey-milovidov self-assigned this Aug 28, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Aug 28, 2026
Merged via the queue into master with commit 021ae59 Aug 28, 2026
174 checks passed
@alexey-milovidov
alexey-milovidov deleted the changelog-edit-retention-rule branch August 28, 2026 21:42
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants