From 3e884bf168076f43ae0e6a20fb9345569dee6862 Mon Sep 17 00:00:00 2001 From: SteveBot <1153461+unbraind@users.noreply.github.com> Date: Sun, 9 Aug 2026 22:02:52 +0200 Subject: [PATCH 1/2] chore(changelog): converge generation and verification on replace mode The changelog:check script and the release workflow generated CHANGELOG.md in prepend mode (--since-previous-tag --until-release-tag) while changelog:full renders the whole file in replace mode (--all-release-tags). A repo that generates with one mode and verifies with the other has an unsatisfiable gate: the check reports the file as out of date, and regenerating cannot fix it because the two modes legitimately produce different files (replace renders an ## Unreleased section for landed-but-unreleased items; prepend does not). - package.json: changelog:check now runs `npm run changelog:full -- --check`, so generation and verification always use the same replace-mode render. - .github/workflows/release.yml: the CHANGELOG.md generate and check lines now use --mode replace --all-release-tags (keeping --release-version-from-package, --item-url-base, --respect-item-release, --pm-bin, --github-step-summary). The release-notes --stdout line is intentionally left windowed (--since-previous-tag --until-release-tag) because release notes cover only the new release. - changelog:full already used replace mode; the prepend `changelog` script is left in place for release notes. build, typecheck, and the full test suite pass; changelog:check passes against the regenerated CHANGELOG.md. --- .agents/pm/history/pm-github-8f60.jsonl | 4 ++++ .agents/pm/issues/pm-github-8f60.toon | 19 +++++++++++++++++++ .github/workflows/release.yml | 4 ++-- CHANGELOG.md | 1 + package.json | 2 +- 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .agents/pm/history/pm-github-8f60.jsonl create mode 100644 .agents/pm/issues/pm-github-8f60.toon diff --git a/.agents/pm/history/pm-github-8f60.jsonl b/.agents/pm/history/pm-github-8f60.jsonl new file mode 100644 index 00000000..fc690891 --- /dev/null +++ b/.agents/pm/history/pm-github-8f60.jsonl @@ -0,0 +1,4 @@ +{"ts":"2026-08-09T20:00:14.217Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2","agent_model_source":"environment","agent_instance":"33e8b39f5af6e546a7fb41d6","agent_provenance":{"model":{"value":"glm-5.2","source":"environment"},"effort":null,"role":null,"topic":null},"op":"create","patch":[{"op":"add","path":"/metadata/id","value":"pm-github-8f60"},{"op":"add","path":"/metadata/title","value":"Converge changelog generation and verification on replace mode"},{"op":"add","path":"/metadata/description","value":""},{"op":"add","path":"/metadata/type","value":"Issue"},{"op":"add","path":"/metadata/status","value":"open"},{"op":"add","path":"/metadata/priority","value":2},{"op":"add","path":"/metadata/tags","value":[]},{"op":"add","path":"/metadata/created_at","value":"2026-08-09T20:00:14.217Z"},{"op":"add","path":"/metadata/updated_at","value":"2026-08-09T20:00:14.217Z"},{"op":"add","path":"/metadata/author","value":"pi-agent"}],"before_hash":"3cc22dff72be7b14824654a7a64ea62b04799939b2fee54c1b5f52ca60bf6df0","after_hash":"9dd9ef0cc2ee10adde3761b11ce9ec5886b96969c1fa94f57738cdd877f47124","message":""} +{"ts":"2026-08-09T20:00:33.236Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2","agent_model_source":"environment","agent_instance":"33e8b39f5af6e546a7fb41d6","agent_provenance":{"model":{"value":"glm-5.2","source":"environment"},"effort":null,"role":null,"topic":null},"op":"note_add","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-08-09T20:00:33.236Z"},{"op":"add","path":"/metadata/notes","value":[{"created_at":"2026-08-09T20:00:33.236Z","author":"pi-agent","text":"Converging changelog generation/verification on replace mode. package.json changelog:check now runs `npm run changelog:full -- --check`. release.yml CHANGELOG.md generate+check lines switched from --mode prepend --since-previous-tag --until-release-tag to --mode replace --all-release-tags; release notes --stdout line left windowed. changelog:full already used replace mode."}]}],"before_hash":"9dd9ef0cc2ee10adde3761b11ce9ec5886b96969c1fa94f57738cdd877f47124","after_hash":"cb8224c2170917a7986c67b09088881ed361d9c11b7f17faddc1004c51d437c5"} +{"ts":"2026-08-09T20:01:32.278Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2","agent_model_source":"environment","agent_instance":"33e8b39f5af6e546a7fb41d6","agent_provenance":{"model":{"value":"glm-5.2","source":"environment"},"effort":null,"role":null,"topic":null},"op":"close","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-08-09T20:01:32.278Z"},{"op":"replace","path":"/metadata/status","value":"closed"},{"op":"add","path":"/metadata/closed_at","value":"2026-08-09T20:01:32.267Z"},{"op":"add","path":"/metadata/completed_at","value":"2026-08-09T20:01:32.267Z"},{"op":"add","path":"/metadata/close_reason","value":"Converged changelog generation and verification on replace mode: changelog:check now runs full replace-mode render under --check; release.yml CHANGELOG.md generate/check lines use --mode replace --all-release-tags. build/check/249 tests pass; changelog:check passes."}],"before_hash":"cb8224c2170917a7986c67b09088881ed361d9c11b7f17faddc1004c51d437c5","after_hash":"ec19176f841d7b383810b6ae1a7dd31b2dfd9024c9cb99e31d6010a4d52de9a4"} +{"ts":"2026-08-09T20:01:55.750Z","author":"pi-agent","author_source":"asserted","agent_harness":"pi","agent_model":"glm-5.2","agent_model_source":"environment","agent_instance":"33e8b39f5af6e546a7fb41d6","agent_provenance":{"model":{"value":"glm-5.2","source":"environment"},"effort":null,"role":null,"topic":null},"op":"update","patch":[{"op":"replace","path":"/metadata/updated_at","value":"2026-08-09T20:01:55.750Z"},{"op":"add","path":"/metadata/resolution","value":"Switched changelog:check to npm run changelog:full -- --check and changed release.yml CHANGELOG.md generate+check lines to --mode replace --all-release-tags."},{"op":"add","path":"/metadata/expected_result","value":"npm run changelog:check passes against a replace-mode CHANGELOG.md; generation and verification use the same mode."},{"op":"add","path":"/metadata/actual_result","value":"build, check, 249 tests pass; changelog:full regenerates idempotently; changelog:check passes."}],"before_hash":"ec19176f841d7b383810b6ae1a7dd31b2dfd9024c9cb99e31d6010a4d52de9a4","after_hash":"ca1dcecb285a4332b1db82197a4fe2427d75a7e1f685721ac030991a08806f64"} diff --git a/.agents/pm/issues/pm-github-8f60.toon b/.agents/pm/issues/pm-github-8f60.toon new file mode 100644 index 00000000..b585ba47 --- /dev/null +++ b/.agents/pm/issues/pm-github-8f60.toon @@ -0,0 +1,19 @@ +id: pm-github-8f60 +title: Converge changelog generation and verification on replace mode +description: "" +type: Issue +status: closed +priority: 2 +tags: [] +created_at: "2026-08-09T20:00:14.217Z" +updated_at: "2026-08-09T20:01:55.750Z" +closed_at: "2026-08-09T20:01:32.267Z" +completed_at: "2026-08-09T20:01:32.267Z" +author: pi-agent +resolution: "Switched changelog:check to npm run changelog:full -- --check and changed release.yml CHANGELOG.md generate+check lines to --mode replace --all-release-tags." +expected_result: "npm run changelog:check passes against a replace-mode CHANGELOG.md; generation and verification use the same mode." +actual_result: "build, check, 249 tests pass; changelog:full regenerates idempotently; changelog:check passes." +notes[1]{created_at,author,text}: + "2026-08-09T20:00:33.236Z",pi-agent,"Converging changelog generation/verification on replace mode. package.json changelog:check now runs `npm run changelog:full -- --check`. release.yml CHANGELOG.md generate+check lines switched from --mode prepend --since-previous-tag --until-release-tag to --mode replace --all-release-tags; release notes --stdout line left windowed. changelog:full already used replace mode." +close_reason: "Converged changelog generation and verification on replace mode: changelog:check now runs full replace-mode render under --check; release.yml CHANGELOG.md generate/check lines use --mode replace --all-release-tags. build/check/249 tests pass; changelog:check passes." +body: "" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7fd91f3a..1dcde4a9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -102,8 +102,8 @@ jobs: shell: bash run: | set -euo pipefail - npx pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --since-previous-tag --until-release-tag --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --pm-bin ./node_modules/.bin/pm --github-step-summary - npx pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --since-previous-tag --until-release-tag --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --pm-bin ./node_modules/.bin/pm --check + npx pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --pm-bin ./node_modules/.bin/pm --github-step-summary + npx pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --pm-bin ./node_modules/.bin/pm --check npx pm-changelog --pm-root .agents/pm --stdout --since-previous-tag --until-release-tag --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --pm-bin ./node_modules/.bin/pm > RELEASE_NOTES.md - name: Run release checks diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b8832ba..68593dcd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixed +- Converge changelog generation and verification on replace mode ([pm-github-8f60](https://github.com/unbraind/pm-github/blob/main/.agents/pm/issues/pm-github-8f60.toon)) - The mandatory docstring gate could skip its own scan and still exit zero ([pm-github-wxob](https://github.com/unbraind/pm-github/blob/main/.agents/pm/issues/pm-github-wxob.toon)) ### Other diff --git a/package.json b/package.json index afa7ea51..48c74ce7 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "pack:dry-run": "npm pack --dry-run", "changelog": "pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --release-version-from-package --since-previous-tag --until-release-tag --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release", "changelog:full": "pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release", - "changelog:check": "pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --release-version-from-package --since-previous-tag --until-release-tag --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --check", + "changelog:check": "npm run changelog:full -- --check", "release:check": "npm run typecheck && npm run build && npm run docstring && npm run coverage && npm run audit:prod && npm run pack:dry-run && npm run changelog:check", "prepublishOnly": "npm run release:check", "release:notes": "pm-changelog --pm-root .agents/pm --stdout --since-previous-tag --until-release-tag --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release --pm-bin ./node_modules/.bin/pm --github-step-summary", From 7983b4d0947ecf3b396498019e528ffd0895f5e2 Mon Sep 17 00:00:00 2001 From: SteveBot <1153461+unbraind@users.noreply.github.com> Date: Sun, 9 Aug 2026 22:36:12 +0200 Subject: [PATCH 2/2] chore(scripts): drop the prepend changelog script that no gate accepts Nothing referenced it. It rendered `--mode prepend --since-previous-tag --until-release-tag`, which cannot produce the `## Unreleased` section `changelog:check` now requires, so running it produced an artifact the gate rejects. Removing it leaves one generator, `changelog:full`, which is exactly what the check verifies. --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 48c74ce7..f937525a 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "docstring": "node scripts/docstring-gate.ts", "audit:prod": "node --input-type=module -e \"import { spawnSync } from 'node:child_process'; import { devNull } from 'node:os'; const env = { ...process.env, npm_config_userconfig: devNull, NPM_CONFIG_USERCONFIG: devNull }; for (const key of Object.keys(env)) if (key.toLowerCase() === 'npm_config_allow_scripts') delete env[key]; const win = process.platform === 'win32'; const r = spawnSync(win ? 'npm.cmd' : 'npm', ['audit', '--omit=dev', '--ignore-scripts'], { stdio: 'inherit', env, shell: win }); process.exit(r.status ?? 1);\"", "pack:dry-run": "npm pack --dry-run", - "changelog": "pm-changelog --pm-root .agents/pm --mode prepend --output CHANGELOG.md --release-version-from-package --since-previous-tag --until-release-tag --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release", "changelog:full": "pm-changelog --pm-root .agents/pm --mode replace --output CHANGELOG.md --all-release-tags --release-version-from-package --item-url-base https://github.com/unbraind/pm-github/blob/main/.agents/pm --respect-item-release", "changelog:check": "npm run changelog:full -- --check", "release:check": "npm run typecheck && npm run build && npm run docstring && npm run coverage && npm run audit:prod && npm run pack:dry-run && npm run changelog:check",