Skip to content

Commit c5b238b

Browse files
V30: Trim generated proven appendix EOF
Normalize the canonical proven appendix renderer so promotion-generated markdown ends with exactly one trailing newline and no blank EOF line. Apply the same behavior to the demonstration renderer and cover it with the proven generator test. Proof: - node --test --test-force-exit protocol-demonstration/test/proven-generator.test.js - git diff --check - node scripts/generate-bitcode-proven.mjs --version V30 --commit 9d0adf7 --worktree-state clean --allow-dirty --stdout > /tmp/BITCODE_SPEC_V30_PROVEN.md && node -e "const fs=require('fs'); const s=fs.readFileSync('/tmp/BITCODE_SPEC_V30_PROVEN.md','utf8'); if(!s.endsWith('\n')||s.endsWith('\n\n')) process.exit(1);"
1 parent 9d0adf7 commit c5b238b

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

packages/protocol/src/canonical/proven-generator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7126,7 +7126,9 @@ export function renderCanonicalProvenMarkdown(data) {
71267126
])
71277127
));
71287128
}
7129-
lines.push('');
7129+
while (lines[lines.length - 1] === '') {
7130+
lines.pop();
7131+
}
71307132
return `${lines.join('\n')}\n`;
71317133
}
71327134

protocol-demonstration/src/canonical/proven-generator.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7124,7 +7124,9 @@ export function renderCanonicalProvenMarkdown(data) {
71247124
])
71257125
));
71267126
}
7127-
lines.push('');
7127+
while (lines[lines.length - 1] === '') {
7128+
lines.pop();
7129+
}
71287130
return `${lines.join('\n')}\n`;
71297131
}
71307132

protocol-demonstration/test/proven-generator.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ test('canonical proven generator renders a stable appendix from seeded proof run
4848
assert.ok(markdown.includes('## Run Details'));
4949
assert.ok(markdown.includes('`prompt-completeness`'));
5050
assert.ok(markdown.includes('_legacy/ENGI_SPEC_V15_PROVEN.md'));
51+
assert.match(markdown, /\n$/);
52+
assert.doesNotMatch(markdown, /\n\n$/);
5153
});
5254

5355
test('canonical proven generator fails closed on proof-family catalog drift across runs', () => {

0 commit comments

Comments
 (0)