.changeset-released/README.md
This directory holds a per-branch record of which changesets have already been released. Each file is named after a release branch (with / replaced by -, e.g. main.txt, release-10.0.txt) and contains one consumed changeset id per line.
Fixes are cherry-picked between main and release/* branches, so the same changeset file can end up on both. The release branch's release consumes its copy and deletes it, but the cherry-picked copy on main would otherwise survive the merge back and be applied a second time on the next main release.
The ledger prevents that double-application. Each branch only writes to its own file, so cross-branch merges are conflict-free; the wrapper around changeset version reads the union of every file when deciding what to skip.
The directory lives at the repo root (sibling of .changeset/) rather than inside .changeset/ because @changesets/read treats every directory inside .changeset/ as a legacy v1 changeset and tries to read changes.md from it.
pnpm bump runs the wrapper at __utils__/scripts/src/bump.ts, which:
*.txt in this directory and unions the ids..changeset/<id>.md whose id is in that union (renames to <id>.md.released) so changeset version does not see it.changeset version, which consumes the remaining .md files.<current-branch>.txt.If changeset version fails, hidden files are renamed back to their original .md names so the working tree is left clean. The current branch is detected from git rev-parse --abbrev-ref HEAD; set RELEASE_BRANCH to override.
Release branches must be merged back into main between releases, so that main sees the release branch's ledger entries before its own next release runs.