Repository navigation
feat(release/auto-changelog): add clean-room changelog proofreader - #301
Open
HowardBraham wants to merge 1 commit into
Open
HowardBraham wants to merge 1 commit into
HowardBraham wants to merge 1 commit into
Conversation
HowardBraham
added this pull request to stack #302
October 25, 2026 22:33
HowardBraham
force-pushed
the
clean-room-proofreader
branch
from
October 25, 2026 23:01
40827ac to
d46e9c1
Compare
Adds a script that proofreads the generated `## [version]` changelog section with a model, given only each PR's title and body as evidence, and writes the result back only if it passes validation. A model failure, a rejected key, or a response that fails validation leaves the changelog untouched and is recorded in a report. The section helpers shared with `merge-previous-release-changelog.mts` live in `release-section.mts`. The tsconfig allows `.ts`/`.mts` import extensions, which Node's native TypeScript support requires, and adds the DOM lib for `fetch` and `AbortController`. The DOM lib makes `Document` a global, so `segment-schema-draft-pr/apply-changes.ts` imports yaml's `Document` as `YamlDocument` to avoid shadowing it. `.github/scripts/**/*.mts` are CLI scripts, so they may read `process.env`.
HowardBraham
force-pushed
the
clean-room-proofreader
branch
from
October 26, 2026 05:19
d46e9c1 to
b8974d5
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
References
Explanation
Current state
The release changelog generator (
auto-changelog) produces a## [version]section with an### Uncategorizedbucket, terse or implementation-level wording, and commits that were only labeled. Someone has to clean it up by hand before release.Solution
A new
clean-release-changelog.mtsproofreads that section with an LLM, and writes it back only when the result passes validation. It does the following:git logevidence is used first, with GitHub as a fallback.### Uncategorized, and rewrites entries in concise, user-facing, past tense. The prompt is.github/prompts/auto-changelog-clean-room.md.auto-changelogparses them.Other changes
release-section.mts,shared/environment.mts,shared/report.mtsandshared/retry.mtshold the section extract/replace, PR parsing, environment, report and retry code.merge-previous-release-changelog.mtsnow imports the section helpers instead of repeating them. The oldest section now ends before the link references instead of swallowing them..ts/.mtsimport extensions, which Node's native TypeScript support requires, and adds the DOM lib forfetchandAbortController.apply-changes.ts: the DOM lib makesDocumenta global, sosegment-schema-draft-pr/apply-changes.tsimports yaml'sDocumentasYamlDocument..github/scripts/**/*.mtsare CLI scripts, so an override lets them readprocess.env.clean-release-changelog.test.mtscovers chunking, validation, evidence, retry and timeouts, and runs the script end to end in a subprocess with a throwaway git repo.release-section.test.mtsandretry.test.mtscover the helpers.Testing
tsc,lint:eslintandnode --testpass.src/segment-schema-draft-pr/apply-changes.test.ts, which also fail onmain.Note
Medium Risk
Touches release changelog content via external LLM and GitHub/git evidence, but writes only after validation and preserves the file on failure; credential scrubbing for child processes reduces leak risk.
Overview
Adds an LLM-based clean-room proofreader for generated
## [version]changelog sections:clean-release-changelog.mtschunks entries, gathers PR evidence (local mainline squash commits first, thengh api), calls LiteLLM with.github/prompts/auto-changelog-clean-room.md, and only replaces the section when output passes strict validation (Keep a Changelog categories, noUncategorized, exact PR reference set). Failures write a JSON report and leaveCHANGELOG.mdunchanged.Shared release tooling: new
release-section.mts(extract/replace sections, PR parsing) plusshared/environment.mts,report.mts, andretry.mts;merge-previous-release-changelog.mtsnow uses those helpers and stops oldest sections at link references.Build/lint:
tsconfigincludes.github/scripts/**/*.mts, enablesallowImportingTsExtensionsand DOM lib forfetch; ESLint allowsprocess.envon CLI scripts;apply-changes.tsaliases yamlDocumentasYamlDocumentafter DOM lib added.Tests: large coverage for chunking, validation, evidence, retries, and end-to-end subprocess runs; shared
git-test-environment.mtsfor git fixtures.Workflow integration is not in this PR (script is standalone).
Reviewed by Cursor Bugbot for commit b8974d5. Bugbot is set up for automated code reviews on this repo. Configure here.