Skip to content

chore(wavebus): formalize CHANGELOG fragment aggregation pattern #524

@bakeb7j0

Description

@bakeb7j0

Summary

Formalize the CHANGELOG fragment aggregation pattern (currently applied via Prime-prompt overrides, starting P2W2 of cc-workflow#499) into first-class wave-pattern machinery:

  1. scripts/wavebus/changelog-aggregate <wave-root> — deterministic helper script that scans <wave-root>/flight-*/issue-*/CHANGELOG.fragment.md, merges fragments into categories under ## Unreleased, and writes the result to the target repo's CHANGELOG.md.
  2. /nextwave SKILL.md rewrite — fold the pattern into the default Prime(pre-wave) and Prime(post-wave) prompts so it's automatic, not prose-override.
  3. flight_partition enhancement (stretch) — honor a commutative_append_files: ["CHANGELOG.md"] input hint that actually overrides the hard-coded DEPENDENCY_MANIFEST whitelist. Callers can then declare append-only files inline and skip the fragment mechanism for simple one-liner cases.

Problem

flight_partition forces serial execution of any flights that both modify a file outside its DEPENDENCY_MANIFEST whitelist. CHANGELOG.md is append-only by convention but not whitelisted, so any wave with ≥2 stories that cite "add BREAKING-CHANGE entry in CHANGELOG" gets serialized.

Observed during P2W1 of cc-workflow#499: sdlc#362 + sdlc#363 serialized unnecessarily. At sdlc pace (~30s CI + merge-queue wait) this cost ~2 minutes that could have been parallel.

Design (already landed as memory)

See pattern_changelog_fragment_aggregation.md in project memory for the full pattern:

  • Flights write CHANGELOG.fragment.md in their <wave-root>/flight-<M>/issue-<X>/ directory
  • Prime(post-wave) scans fragments in deterministic order (flight#, issue#), merges by category (Breaking / Features / Fixes / etc.), commits to chore/<wave-id>-changelog branch, opens + merges single PR
  • Mechanical aggregation → no gate needed; content was already approved at each flight's gate
  • Fragment files deleted as part of wave cleanup

Changes

scripts/wavebus/changelog-aggregate (new)

#!/usr/bin/env bash
# Aggregate CHANGELOG fragments from wave-root into target-repo/CHANGELOG.md
# Usage: changelog-aggregate <wave-root> <target-repo-path> [<wave-id>]

Deterministic merge: sort fragments by flight-<M>/issue-<X> numeric order, preserve category headings (Breaking / Features / Fixes / Docs / Chore), deduplicate identical bullets, write under ## Unreleased (creating the heading if needed).

/nextwave SKILL.md

  • Flight stub prompt — add the "do NOT edit CHANGELOG.md directly; write CHANGELOG.fragment.md in your issue dir" directive verbatim.
  • Prime(post-wave) prompt — add aggregation step before wave_complete: scripts/wavebus/changelog-aggregate, commit on chore/<wave-id>-changelog, PR to main/kahuna, merge.
  • Step 5 Cleanup — add fragment-file deletion to the success path.

flight_partition (stretch — file as sub-issue if bigger than it looks)

Accept commutative_append_files: string[] input, extend the in-tool whitelist at call time. Docs update in mcp-server-sdlc Dev Spec §5.3 (partitioner contract).

Test Procedures

Unit Tests

Test Purpose Location
changelog-aggregate-basic.bats 3 fragments, 2 categories → merged in order under ## Unreleased tests/wavebus/changelog-aggregate-basic.bats
changelog-aggregate-empty.bats Zero fragments → no-op, exit 0 tests/wavebus/
changelog-aggregate-dedup.bats Two fragments with identical bullet → one line in output tests/wavebus/

Integration Coverage

  • P3W1 or later wave of cc-workflow#499 — observe fragment mechanism end-to-end in a wave with real parallelism benefit.

Acceptance Criteria

  • scripts/wavebus/changelog-aggregate exists, is executable, and passes its unit tests
  • /nextwave SKILL.md Flight stub prompt includes the fragment directive
  • /nextwave SKILL.md Prime(post-wave) prompt invokes changelog-aggregate before wave_complete
  • Cleanup step deletes fragment files on success path
  • pattern_changelog_fragment_aggregation.md memory file cross-references the SKILL.md section (swap "follow-up work" section for "where this lives")
  • At least one wave (P3W1 or later of cc-workflow#499) exercises the mechanism end-to-end

Stretch (optional, split as sub-issue if it grows)

  • flight_partition accepts commutative_append_files input and uses it to override whitelist
  • Unit test proves the hint un-serializes a CHANGELOG-only overlap

Dependencies

None — this is a new mechanism, no blocking changes. Could ship in parallel with any other wave work.

Metadata

  • Wave: (unassigned — backlog)
  • Phase: (unassigned)
  • Plan: n/a — standalone enhancement
  • Dev Spec: follow-up to cc-workflow#499 (Plan/Phase/Epic taxonomy); not in-scope for that Plan
  • Memory reference: pattern_changelog_fragment_aggregation.md
  • Origin: P2W1 of cc-workflow#499 (2026-04-27 session)

rules-lawyer 📜 (cc-workflow)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions