@davoodmehraban89 / LifeMate / commits / 5047168
Fork 0

LifeMate — Personal, Family & Learning Companion

test: define phase 5 release operations contract

davoodmehraban89 committed Oct 5, 2026 at 17:12 UTC 5047168f45effda4a40d3e2ffaeb8c5e0ccdb004
1 file changed +23
backend/tests/release_contract.test.js new
+23
@@ -0,0 +1,23 @@
1 +import test from 'node:test';
2 +import assert from 'node:assert/strict';
3 +import fs from 'node:fs';
4 +
5 +const read = (path) => fs.readFileSync(new URL(`../../${path}`, import.meta.url), 'utf8');
6 +
7 +test('release runbooks exist and preserve production approval gates', () => {
8 + for (const path of [
9 + 'docs/operations/DEPLOYMENT.md',
10 + 'docs/operations/ROLLBACK.md',
11 + 'docs/operations/BACKUP_RESTORE.md',
12 + 'docs/operations/INCIDENT_RESPONSE.md',
13 + 'docs/operations/PRODUCTION_CHECKLIST.md',
14 + 'CHANGELOG.md',
15 + ]) assert.ok(read(path).length > 100, `${path} must be substantive`);
16 + assert.match(read('docs/operations/DEPLOYMENT.md'), /staging/i);
17 + assert.match(read('docs/operations/DEPLOYMENT.md'), /explicit approval/i);
18 + assert.match(read('docs/operations/ROLLBACK.md'), /rollback/i);
19 + assert.match(read('docs/operations/BACKUP_RESTORE.md'), /pg_dump/);
20 + assert.match(read('docs/operations/BACKUP_RESTORE.md'), /pg_restore/);
21 + assert.match(read('docs/operations/INCIDENT_RESPONSE.md'), /minor-sensitive/i);
22 + assert.match(read('docs/operations/PRODUCTION_CHECKLIST.md'), /AI.*disabled|disabled.*AI/is);
23 +});