Skip to content

fix(source-control): changelog fragment writer duplicates headings and edits other plugins' fragments #7218

Closed

Description

@kyle-sexton

The source-control commit skill's scripts/write-changelog-fragments.sh has two defects. Both were seen repeatedly on 2026-10-11 (#7204, #7208, and the #7150 branch).

  1. A duplicate heading on every releasing commit. A second releasing commit on a branch appends another ### Fixed (or ### Added/### Changed) heading to the branch's fragment instead of adding its entry under the existing heading. markdownlint MD024 then fails lint-repo, and someone has to merge the headings by hand.
  2. It writes into other plugins' fragments during a merge. When run during a merge of main, it appended the commit's entry to fragments that the merge had just brought in from other plugins (.changes/harness-ops/fix-7203-..., .changes/source-control/feat-check-affected-push-hook-... on fix(work-items): filter list reads in the provider and order work by created_at #7208). The entries had to be removed by hand.

Fix

  • Add each entry under the matching existing heading, creating the heading only when it is absent, and raise the bump level only upward.
  • Only touch fragments this branch created: ones not present on the merge base. Write nothing during an in-progress merge.
  • Add a test for each case.

Activity

  1. github-actions commented on Oct 11, 2026

    @github-actions
    Contributor

    Thanks for the detailed report. As I understand it, scripts/write-changelog-fragments.sh in the source-control commit skill has two bugs on repeated-commit/merge scenarios:

    1. A second releasing commit on the same branch adds a duplicate ### Fixed/### Added/### Changed heading instead of appending under the existing one, which trips markdownlint MD024 in lint-repo.
    2. When run during a main merge, it also appends entries to fragments the merge brought in from other plugins, rather than only the fragments this branch itself created.

    You've cited concrete evidence (#7204, #7208, and the #7150 branch) and proposed a fix: append under the existing heading (creating it only if absent, and only raising the bump level upward), and scope writes to fragments not present on the merge base, skipping writes during an in-progress merge, with a test for each case. Nothing else looks missing from the report.

    I didn't find an existing open issue describing the same defects.

    Automated triage. A maintainer reviews it.

  2. kyle-sexton commented on Oct 13, 2026

    @kyle-sexton
    MemberAuthor

    Owner batch-ratified this admission in an attended session on 2026-10-12: work-class: scoped. Rule: class C1-C3, no trust surface, the independent check confirmed the recorded decision, and no owner step remains.

  3. added
    agent-ready
    and removed
    agent-ready
    on Oct 13, 2026
  4. added theissue type on Oct 15, 2026
  5. kyle-sexton commented on Oct 18, 2026

    @kyle-sexton
    MemberAuthor

    Agent Brief

    Type: Bug
    Summary: Make the changelog fragment writer reuse existing headings and touch only this branch's fragments.

    Current behavior:
    A second releasing commit on a branch appends another ### Fixed (or Added/Changed) heading to the branch's fragment, which fails markdownlint MD024. Run during a merge of main, the writer appends entries to fragments the merge brought in from other branches and plugins.

    Desired behavior:
    Each entry goes under the matching existing heading in the branch's fragment, and the heading is created only when absent. The bump level only rises. The writer touches only fragments absent from the merge base, and writes nothing while a merge is in progress.

    Key interfaces:

    • The fragment writer's heading merge and its fragment selection.

    Acceptance criteria:

    • A test with two releasing commits of the same type finds one heading holding both entries.
    • A test finds the bump level unchanged when a lower-level commit follows a higher one.
    • A test with a fragment present on the merge base finds that fragment unchanged.
    • A test with a merge in progress finds no fragment written.
    • scripts/run-test-file.sh passes on the writer's test file.
    • scripts/check-changelog-fragments.sh passes.

    Out of scope:

    • The fragment format and the release tooling that consumes fragments.
    • The commit skill's text, unless it states the old behavior.

    This was generated by AI during backlog shaping. The owner approved this in an attended backlog-shaping session on 2026-10-17.

  6. added
    agent-ready
    on Oct 18, 2026
  7. melodic-automation-lanes commented on Oct 18, 2026

    @melodic-automation-lanes
    Contributor

    The work-resolve-issue run that agent-ready started failed before it reported, or the token broker refused it because its workflow files differ from main's. work-unblock removed and added agent-ready back to start a fresh run on main's workflow files. It does this once per version of those files, so if this run fails the same way, a person looks at it.

  8. added
    agent-ready
    and removed
    agent-ready
    on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions