diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..a99f9b616 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,13 @@ +# Agent instructions + +## CHANGELOG.md is written only at release time + +Don't add, edit or delete entries in `CHANGELOG.md` in a feature, fix, +refactor, CI or docs PR, even if a doc, template or reviewer asks for one. +The `[Unreleased]` section is written when a release is cut, by the release +agent, from the PRs merged since the last tag and the code itself. Put the +details of a change in its commit messages and PR description instead. + +If a PR you work on already changes `CHANGELOG.md`, restore that file to its +merge-base version. The only exceptions are release PRs: a `release/v*` +branch, or the release train's `release-sync` PR. diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c16305ab..15568d990 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,9 +9,11 @@ Pre-v3.0 entries are concise summaries derived from each tag's commit history. For full per-release detail, see the [GitHub releases page](https://github.com/SocketDev/socket-patch/releases). -Add entries under `[Unreleased]`; its `###` headings set the next version's -bump (Breaking/Removed → major, Added/Changed/Deprecated → minor, anything -else → patch). Releases are cut by the release train +PRs never edit this file. Only the release agent writes `[Unreleased]`, at +release time, from the PRs merged since the last tag and the code they +changed. Its `###` headings set the next version's bump (Breaking/Removed → +major, Added/Changed/Deprecated → minor, anything else → patch). Releases +are cut by the release train ([docs/release-train/DESIGN.md](docs/release-train/DESIGN.md)) with `scripts/release.py`: a release candidate's `[Unreleased]` entries become a `## [X.Y.Z-rc.N]` section, the rolling `release-sync` PR brings each cut diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 000000000..43c994c2d --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/docs/releasing.md b/docs/releasing.md index 6b590481b..cd4ac970d 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -21,9 +21,14 @@ See the [migration instructions](migrating-to-v5.md#installation-channels). ## 1. Write the release notes -Make sure `CHANGELOG.md`'s `[Unreleased]` section describes this release — -`release.py changelog cut` refuses to run if it is empty, and `release-lint.sh` -blocks a release whose CHANGELOG section is missing or empty. +Release notes are written only at release time: PRs never touch +`CHANGELOG.md`. The release agent (the release-train routine's `release-sync` +PR, or whoever cuts the release by hand) writes the `[Unreleased]` section from +the PRs merged since the last tag (`git log --first-parent ..origin/main`) +and from reading the code they changed. Describe user-visible behavior, not +implementation details. `release.py changelog cut` refuses to run if the +section is empty, and `release-lint.sh` blocks a release whose CHANGELOG +section is missing or empty. ## 2. Open the version-bump PR