Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
test(release): include notes proof in frozen workflow check [O3]
Corey Olson019c61da31fb
diff --git a/test/release-notes.test.js b/test/release-notes.test.jsdeleted file mode 100644index 84b05687..00000000--- a/test/release-notes.test.js+++ /dev/null@@ -1,49 +0,0 @@-/** @pullboard-test-input source-tree */-/** GitHub release notes use exactly the tagged changelog section, never generated notes [O3]. */-import assert from 'node:assert/strict';-import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';-import { tmpdir } from 'node:os';-import { join } from 'node:path';-import { test } from 'node:test';-import { runFixtureChild } from './fixture-child.js';--const workflow = readFileSync(new URL('../.github/workflows/release.yml', import.meta.url), 'utf8');--/** Execute the actual workflow extraction against private input; no GitHub or npm command runs. */-function extract(t, script, changelog, tag = 'v1.2.3') {- const root = mkdtempSync(join(tmpdir(), 'pullboard-release-notes-'));- t.after(() => rmSync(root, { recursive: true, force: true }));- writeFileSync(join(root, 'CHANGELOG.md'), changelog);- const notes = join(root, 'release-notes.md');- const result = runFixtureChild(process.execPath, ['--input-type=module', '-e', script], {- cwd: root, encoding: 'utf8',- env: { ...process.env, GITHUB_REF_NAME: tag, RUNNER_TEMP: root },- });- return { ...result, notes: existsSync(notes) ? readFileSync(notes, 'utf8') : null };-}--test('the release workflow publishes exactly the tagged changelog section [O3]', t => {- const match = workflow.match(/node --input-type=module <<'NOTES'\n([\s\S]*?)\n {10}NOTES/u);- assert.ok(match, 'the workflow extracts its notes from CHANGELOG before publishing');- const script = match[1].replace(/^ {10}/gmu, '');- const body = '\n### Added\n\n- Preserve **Markdown**, Unicode café, and trailing spaces. \n\n';- const changelog = '# Changelog\n\n## [Unreleased]\n\nNot this future version.\n\n## [1.2.3] - 2026-10-26\n' + body- + '## [1.2.2] - 2026-10-25\n\nNot this older version.\n';- const selected = extract(t, script, changelog);- assert.equal(selected.status, 0, selected.stderr);- assert.equal(selected.notes, body, 'only the selected section body is copied byte for byte');- const last = extract(t, script, '# Changelog\n\n## [1.2.3]\n' + body);- assert.equal(last.status, 0, last.stderr);- assert.equal(last.notes, body, 'the final section does not need a following release heading');- for (const invalid of [changelog.replace('[1.2.3]', '[1.2.30]'), changelog + '\n## [1.2.3]\nDuplicate\n',- '# Changelog\n\n## [1.2.3]\n\n## [1.2.2]\nOlder\n']) {- const refused = extract(t, script, invalid);- assert.notEqual(refused.status, 0, 'missing, duplicate, or empty notes refuse before publication');- assert.equal(refused.notes, null, 'a refusal never writes a notes file');- }- assert.match(workflow, /gh release create "\$GITHUB_REF_NAME"[^\n]*--verify-tag[^\n]*--notes-file "\$RUNNER_TEMP\/release-notes\.md"/u);- assert.doesNotMatch(workflow, /--generate-notes|--notes-from-tag/u, 'generated or tag-message notes never replace the changelog');- assert.ok(workflow.indexOf("<<'NOTES'") < workflow.indexOf('run: npm publish'), 'missing notes stop before npm publishing');- assert.ok(workflow.indexOf('run: npm publish') < workflow.indexOf('gh release create'), 'the GitHub release follows successful package publication');- assert.match(workflow, /publish:\n\s+permissions:\n\s+contents: write/u, 'only the publishing job gains release-write authority');-});diff --git a/test/workflows.test.js b/test/workflows.test.jsindex 6b0c01b0..976677ab 100644--- a/test/workflows.test.js+++ b/test/workflows.test.js@@ -1,8 +1,11 @@+/** @pullboard-test-input source-tree *//** Check that main CI shards work without hiding failures or cancelling unrelated runs [C7]. */import assert from 'node:assert/strict';-import { readFileSync } from 'node:fs';-import { resolve } from 'node:path';+import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join, resolve } from 'node:path';import { test } from 'node:test';+import { runFixtureChild } from './fixture-child.js';const ROOT = resolve(import.meta.dirname, '..');const WORKFLOW = readFileSync(resolve(ROOT, '.github/workflows/gate.yml'), 'utf8');@@ -51,3 +54,44 @@ function workflowShardsAndCancellation() {}test('the gate workflow shards and cancels superseded main runs [C7]', workflowShardsAndCancellation);++const workflow = readFileSync(new URL('../.github/workflows/release.yml', import.meta.url), 'utf8');++/** Execute the actual workflow extraction against private input; no GitHub or npm command runs. */+function extract(t, script, changelog, tag = 'v1.2.3') {+ const root = mkdtempSync(join(tmpdir(), 'pullboard-release-notes-'));+ t.after(() => rmSync(root, { recursive: true, force: true }));+ writeFileSync(join(root, 'CHANGELOG.md'), changelog);+ const notes = join(root, 'release-notes.md');+ const result = runFixtureChild(process.execPath, ['--input-type=module', '-e', script], {+ cwd: root, encoding: 'utf8',+ env: { ...process.env, GITHUB_REF_NAME: tag, RUNNER_TEMP: root },+ });+ return { ...result, notes: existsSync(notes) ? readFileSync(notes, 'utf8') : null };+}++test('the release workflow publishes exactly the tagged changelog section [O3]', t => {+ const match = workflow.match(/node --input-type=module <<'NOTES'\n([\s\S]*?)\n {10}NOTES/u);+ assert.ok(match, 'the workflow extracts its notes from CHANGELOG before publishing');+ const script = match[1].replace(/^ {10}/gmu, '');+ const body = '\n### Added\n\n- Preserve **Markdown**, Unicode café, and trailing spaces. \n\n';+ const changelog = '# Changelog\n\n## [Unreleased]\n\nNot this future version.\n\n## [1.2.3] - 2026-10-26\n' + body+ + '## [1.2.2] - 2026-10-25\n\nNot this older version.\n';+ const selected = extract(t, script, changelog);+ assert.equal(selected.status, 0, selected.stderr);+ assert.equal(selected.notes, body, 'only the selected section body is copied byte for byte');+ const last = extract(t, script, '# Changelog\n\n## [1.2.3]\n' + body);+ assert.equal(last.status, 0, last.stderr);+ assert.equal(last.notes, body, 'the final section does not need a following release heading');+ for (const invalid of [changelog.replace('[1.2.3]', '[1.2.30]'), changelog + '\n## [1.2.3]\nDuplicate\n',+ '# Changelog\n\n## [1.2.3]\n\n## [1.2.2]\nOlder\n']) {+ const refused = extract(t, script, invalid);+ assert.notEqual(refused.status, 0, 'missing, duplicate, or empty notes refuse before publication');+ assert.equal(refused.notes, null, 'a refusal never writes a notes file');+ }+ assert.match(workflow, /gh release create "\$GITHUB_REF_NAME"[^\n]*--verify-tag[^\n]*--notes-file "\$RUNNER_TEMP\/release-notes\.md"/u);+ assert.doesNotMatch(workflow, /--generate-notes|--notes-from-tag/u, 'generated or tag-message notes never replace the changelog');+ assert.ok(workflow.indexOf("<<'NOTES'") < workflow.indexOf('run: npm publish'), 'missing notes stop before npm publishing');+ assert.ok(workflow.indexOf('run: npm publish') < workflow.indexOf('gh release create'), 'the GitHub release follows successful package publication');+ assert.match(workflow, /publish:\n\s+permissions:\n\s+contents: write/u, 'only the publishing job gains release-write authority');+});