Skip to content

fix(cli): post-upgrade What's-new parses the modern changelog format#880

Merged
muqsitnawaz merged 3 commits into
mainfrom
whats-new-modern-format
Jul 11, 2026
Merged

fix(cli): post-upgrade What's-new parses the modern changelog format#880
muqsitnawaz merged 3 commits into
mainfrom
whats-new-modern-format

Conversation

@muqsitnawaz

Copy link
Copy Markdown
Contributor

Problem

The post-upgrade "What's new" summary (showWhatsNewrenderWhatsNew) only recognizes the old changelog format — standalone **Heading** lines with - sub-bullets. The changelog moved to single-line - **Title.** verbose prose… entries several releases ago (all of 1.20.48–1.20.50 + Unreleased), so line.startsWith('**') matches nothing and every recent upgrade prints a bare version header with zero bullets — releases look like they shipped nothing.

Fix

renderWhatsNew extracts the bold heading from both formats: ^- \*\*(.+?)\*\* for modern single-line entries (heading kept, prose dropped) and the existing standalone-line match for old sections. Range semantics (from, to] and the Unreleased exclusion are unchanged and now pinned by tests.

Verification

  • Unit tests cover both formats, prose-dropping, and Unreleased exclusion (6 tests green).
  • Against the real CHANGELOG.md, renderWhatsNew('1.20.49', '1.20.50') renders:
v1.20.50
  • Distributed agent teams: teammates can now run on different machines across your fleet, not just the box running `teams start`.
  • NEW: `agents doctor --devices` shows a cross-device agent-readiness matrix.
  • `agents run codex` / `agents teams` now honor your configured Codex model instead of silently defaulting to `gpt-5.3-codex`.
  • Fix: `agents add claude@<version>` now produces a runnable install — it no longer ships a half-built binary that dies with "claude native binary not installed."

Previously that range rendered v1.20.50 with no bullets.

The summary parser only matched standalone **Heading** lines (the pre-1.20.4x
changelog format). Every release since moved to single-line '- **Title.** prose'
entries, so the post-upgrade What's-new printed a bare version header with zero
bullets. Extract the bold heading from both formats; prose still dropped.

Verified against the real CHANGELOG.md: renderWhatsNew('1.20.49','1.20.50')
now emits all four 1.20.50 entry titles.
@prix-cloud

prix-cloud Bot commented Jul 11, 2026

Copy link
Copy Markdown

Code Reviewer

Verdict: Changes requested

Build:tsc clean (bun run build from apps/cli, exit 0, no diagnostics)
Tests:bun test src/lib/whats-new.test.ts — 6 pass, 0 fail, 17 expect() calls. Full local bun test hung indefinitely on an unrelated test (no output after 3+ min, unrelated to this diff's files); killed it and relied on gh pr checks 880 instead, which shows all shards (test-shard 1/2/3, typecheck, test-windows, bench, gitleaks) green.

Read before reviewing: root CLAUDE.md, apps/cli/AGENTS.md (no nested AGENTS.md/CLAUDE.md under apps/cli/src or apps/cli/src/lib). Build/test commands and CI scoping (apps/cli/AGENTS.md "Build, test, dev") matched what I ran.

Issues that need attention

The modern-format regex over-matches old-format sections, reintroducing the exact "noisy/wrong summary" failure mode for any upgrade range that crosses a pre-1.20.36 version. whats-new.ts:39const entryBullet = line.match(/^- \*\*(.+?)\*\*/); — matches any line starting with - **, not just top-level entries in the modern format. But older changelog sections use the format the PR says is "unchanged": a standalone **Heading** line followed by - sub-bullets, and several of those sub-bullets are themselves bold-led (- **Some claim.** detail…), e.g. CHANGELOG.md:268 under the 1.20.30**agents doctor --fix...** heading (CHANGELOG.md:261). I ran renderWhatsNew(changelog, '1.20.7', '1.20.30') against the real CHANGELOG.md (via the built dist/lib/whats-new.js) and got, among the v1.20.30 bullets:

  • `agents doctor --fix` + a daemon safety check: heal the gap between defined and installed
  • `agents doctor --fix`
  • Daemon safety check:
  • `agents doctor` overview now covers every installed version, not just defaults.
  • Says exactly WHAT is out of sync — plugins first.
  • Fixed a false "drift" that could never be reconciled:
  • Corrected a false promise in the sync-status readout.
  ...
  • Auto-cache is on by default.
  • Configurable, still flexible.
  • Explicit `always` now persists
  • Upgrade self-heal:
  • Disclosure fixed.
  • Back-compat:
  • Heal-on-upgrade:
  • Broker version-skew self-heal:
  • Opt-in by construction:
  • Security trade-off (documented in `docs/secrets.md`):
  • Release note:

The correct heading (`agents doctor --fix` + a daemon safety check: heal the gap between defined and installed) is now followed by three of its own sub-bullets rendered as if they were independent top-level entries — several as bare sentence fragments ("Daemon safety check:", "Upgrade self-heal:", "Back-compat:", "Release note:") that mean nothing out of context. This isn't a hypothetical: 1.20.30 is a real, reachable fromVersion for anyone upgrading from an old install, and the PR's own regression tests (whats-new.test.ts) never exercise a range that mixes the old standalone-heading format with a bold-led sub-bullet, so nothing caught it.

Before this PR, the old-format matcher (line.startsWith('**') && line.endsWith('**')) only matched a whole line wrapped in **…**, so a - **Bold.** prose sub-bullet never qualified — old-format ranges rendered cleanly (one bullet per heading). This PR fixes modern-format ranges but regresses old-format ranges that happen to contain bold-led sub-bullets, trading "recent upgrades show nothing" for "old upgrades show garbage" on a different set of inputs.

A fix likely needs the entry-bullet match to only fire when NOT already inside an old-style heading's sub-bullet list — e.g. track whether the current version section is using the standalone-heading format (seen a **Heading**-only line since the last ## version) and skip the - ** match in that mode, or only recognize - ** as a top-level entry when it appears immediately after the version header / a blank line, not mid-section.

Things to verify manually

None beyond the above — the described 1.20.49→1.20.50 verification in the PR body reproduces correctly locally against the real changelog.


Reviewed by Code Reviewer — actually ran the build and tests on this branch.

Review follow-up (prix-cloud): the modern-entry regex matched any '- **' line,
so old-format sections with bold-led sub-bullets ('- **Claim.** detail') rendered
those details as top-level entries — garbage for ranges crossing pre-1.20.36
versions. Track per version section whether a standalone **Heading** line was
seen; once seen, '- **' lines in that section are sub-bullets and are skipped.

Re-verified the reviewer's repro against the real CHANGELOG.md:
renderWhatsNew('1.20.7','1.20.30') now emits one bullet per heading, zero
sentence fragments.
@muqsitnawaz

Copy link
Copy Markdown
Contributor Author

Addressed in 13fe819: the - ** entry match is now suppressed once a standalone **Heading** line is seen in the current version section (flag resets per ## version), so old-format bold-led sub-bullets render as details again, not entries.

Re-ran your exact repro against the real CHANGELOG.md via the built dist/lib/whats-new.js: renderWhatsNew('1.20.7', '1.20.30') now emits one bullet per heading with zero sentence fragments (Daemon safety check:, Back-compat:, Release note: etc. all gone), and the modern 1.20.49→1.20.50 range still renders all four entry titles. New tests pin both the bold-led sub-bullet suppression and a mixed-format range.

@prix-cloud

prix-cloud Bot commented Jul 11, 2026

Copy link
Copy Markdown

Code Reviewer

Verdict: Ready to merge

Build: Green (tsc clean via bun run build)
Tests: src/lib/whats-new.test.ts — 8 passed, 0 failed (4 pre-existing + 4 new). src/lib/agent-spec/primitives.test.ts (the compareVersions this module depends on) — 7 passed, 0 failed. Full-repo bun test / bun test src/lib stalled with no CPU progress in this sandbox (looks tmux/network/device-dependent, unrelated to this diff) and was killed after ~60–90s — see "Things to verify manually."

Read AGENTS.md (root) and apps/cli/AGENTS.md before running anything — the latter documents the authoritative bun install && bun run build && bun test flow and confirms whats-new.test.ts sits correctly next to its source (1:1 convention).

Changes that work well

  • sectionUsesStandaloneHeadings is scoped and reset per version section (## 1.2.3 boundary), so a range spanning both changelog eras parses each section by its own format instead of a single global mode. I confirmed this against the real CHANGELOG.md: a 1.20.35 → 1.20.42 range correctly renders modern single-line entries for 1.20.42/1.20.41 (dropping their prose) and correctly renders old-format **Heading** entries for 1.20.36 while suppressing its bold-led sub-bullets (- **A bold-led sub-bullet.**-style lines) — matching the intent described in the new tests.
  • Ran renderWhatsNew('1.20.49', '1.20.50') against the actual CHANGELOG.md in the tree — output matches the PR description's claimed output exactly (4 bullets, prose dropped, headings intact).
  • Tests pin the exact failure mode being fixed (modern format previously matched nothing) plus the trickier regression risk (old-format bold-led sub-bullets must still be suppressed) and the Unreleased exclusion in both formats. Good coverage for a 19-line logic change.
  • No signature change to renderWhatsNew; both call sites (apps/cli/src/index.ts:317, :501, :710) are unaffected.

Things to verify manually

  • The full bun test run (and even the src/lib-scoped run) stalled in this sandbox with no CPU progress across a 5-minute wait, unrelated to any file touched here — likely a test elsewhere needing tmux/network/a registered device that isn't available in this environment. Worth confirming CI (tests.yml, the required check) is green on this branch, since I could not run the full suite to completion here.

Reviewed by Code Reviewer — actually ran the build and tests on this branch.

@muqsitnawaz muqsitnawaz merged commit 6baed0b into main Jul 11, 2026
8 checks passed
@muqsitnawaz muqsitnawaz deleted the whats-new-modern-format branch July 11, 2026 16:47
muqsitnawaz added a commit that referenced this pull request Jul 11, 2026
Resolves the CHANGELOG.md Unreleased-section conflict by keeping both
entries: the RUSH-1522 NEEDS-YOU precision fix and the post-upgrade
What's-new parser fix from main (#880).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant