From 6a8658cab939f9593548d8504925e3579dce374a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 29 Sep 2026 00:55:45 +0300 Subject: [PATCH] docs(release): the candidate checklist lowers the ratchets (#699 r1) CODE-REVIEW-699-r1 M1: `node scripts/ratchets.mjs tighten` was named only by the warning `release:prerelease` prints at publication, when the candidate commit is already made. The candidate checklist in docs/DEVELOPMENT.md now runs it after `npm run bundle:release`, so the caps come from the fresh dist/ and land in the candidate commit. - test/ratchets.test.mjs pins the step and its order. - Mutant release-runbook-forgets-tighten. Issue: #699 User-Visible: no Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_018qZfe7YS4rqEMKoVeS3GKd --- docs/DEVELOPMENT.md | 5 ++++- scripts/mutation-registry.mjs | 11 +++++++++++ test/ratchets.test.mjs | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 787ed880..18f38b65 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -528,7 +528,10 @@ above); the dev stand takes the head of `dev` from the `dev-build` branch Prepare the candidate as usual: synchronize every version field, add dated RU and EN changelog sections, update the production bundle snapshots with `npm run bundle:release` (since #657 the only commit that may change them; it -carries the `Release:` trailer) and write the +carries the `Release:` trailer), then lower the ratchets to the candidate's +facts with `node scripts/ratchets.mjs tighten` (#699: it rewrites the core line +caps, the gzip graph ceilings and `scripts/monolith-baseline.json` from the +fresh `dist/`; commit them with the candidate) and write the short bilingual body in `docs/RELEASE-NOTES.md`. That file is the one current instance of the canonical `## Основное` / `## Highlights` template; its two changelog links must be pinned to the new tag. diff --git a/scripts/mutation-registry.mjs b/scripts/mutation-registry.mjs index 016c90e6..fb552668 100644 --- a/scripts/mutation-registry.mjs +++ b/scripts/mutation-registry.mjs @@ -10448,6 +10448,17 @@ const MUTANT_DEFINITIONS = [ replace: '', }], }, + { + id: 'release-runbook-forgets-tighten', + guard: 'node --test --test-name-pattern="#699 r1 M1" test/ratchets.test.mjs', + because: '#699 r1 M1: the second side of the ratchet lives in the candidate checklist; a warning ' + + 'at publication time comes after the candidate commit and is ignored systematically', + patches: [{ + file: 'docs/DEVELOPMENT.md', + find: 'facts with `node scripts/ratchets.mjs tighten` (#699', + replace: 'facts with `node scripts/ratchets.mjs report` (#699', + }], + }, { id: 'monolith-delegates-return-only', guard: 'node --test --test-name-pattern="#624 делегаты" test/monolith-metrics.test.mjs', diff --git a/test/ratchets.test.mjs b/test/ratchets.test.mjs index 18f1efa5..9c246a00 100644 --- a/test/ratchets.test.mjs +++ b/test/ratchets.test.mjs @@ -65,3 +65,11 @@ test('#699 публикация беты напоминает о храпови assert.match(main, /'scripts\/ratchets\.mjs', 'report', '--warn'/); assert.match(main, /'scripts\/ratchets\.mjs', 'report', '--warn'\], \{ allowFailure: true, inherit: true \}\)/); }); + +test('#699 r1 M1: runbook беты опускает храповики при подготовке кандидата, до публикации', () => { + const runbook = read('docs/DEVELOPMENT.md'); + const prepare = runbook.slice(runbook.indexOf('Prepare the candidate as usual'), runbook.indexOf('npm run release:prerelease --')); + assert.ok(prepare.length > 0, 'раздел подготовки кандидата найден'); + assert.match(prepare, /`npm run bundle:release`[\s\S]*`node scripts\/ratchets\.mjs tighten`/, 'tighten — после свежего dist/'); + assert.match(prepare, /commit them with the candidate/); +});