Repository navigation
feat(release/auto-changelog): add clean-room changelog proofreader - #301
Merged
Merged
Conversation
HowardBraham
force-pushed
the
clean-room-proofreader
branch
from
October 25, 2026 23:01
40827ac to
d46e9c1
Compare
HowardBraham
force-pushed
the
clean-room-proofreader
branch
from
October 26, 2026 05:19
d46e9c1 to
b8974d5
Compare
mcmire
reviewed
Oct 27, 2026
mcmire
left a comment
Contributor
There was a problem hiding this comment.
I have not reviewed changes to scripts, but as far as the risk to other repos goes, this looks pretty safe to me. I don't believe other repos use the merge-previous-releases action (or at least, I don't recognize it).
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 27, 2026 21:14
b8974d5 to
d76f1b4
Compare
JadeCong
pushed a commit
to CloudEngineHub/metamask-extension
that referenced
this pull request
Oct 29, 2026
…MetaMask#47463) ## **Description** This is the very last step in a chain of PRs to turn on fully-autonomous CHANGELOG generation in Extension. ## **Changelog** CHANGELOG entry: null ## **Related issues** ### Previous PRs in the chain #### release-tools/auto-changelog MetaMask/release-tools#127 MetaMask/release-tools#130 #### github-tools MetaMask/github-tools#300 MetaMask/github-tools#301 MetaMask/github-tools#303 <!--## **Manual testing steps** ## **Screenshots/Recordings** ## **Pre-merge author checklist** ## **Pre-merge reviewer checklist**--> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Workflow-only change that adds a CI secret env var and removes an action input; no runtime extension code or user-facing behavior changes. > > **Overview** > Turns on the **AI changelog proofreader** for release changelog automation by passing **`AI_ANALYZER_LITELLM_KEY`** into the `update-release-changelog` GitHub Action (same LiteLLM secret pattern as other AI workflows). > > Also **drops the explicit `previous-version-ref: 'null'`** input so previous-version resolution is handled by the updated action rather than being hard-coded in this repo. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c801241. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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.