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
fix(spec): validate revision statuses at the move boundary [P6]
Corey Olsone9aef7650034
diff --git a/src/spec-revisions.js b/src/spec-revisions.jsindex 8f007f7e..ca48ae8f 100644--- a/src/spec-revisions.js+++ b/src/spec-revisions.js@@ -67,7 +67,7 @@ export function validSpecRevision(row) {&& typeof row.replacement === 'string' && !/[\r\n]/u.test(row.replacement)&& typeof row.reason === 'string' && row.reason.trim() && !/[\r\n|]/u.test(row.reason)&& before.length === 1 && before[0].status === 'approved' && before[0].id === row.revises- && after.length === 1 && after[0].id === row.revises && after[0].text === row.text+ && after.length === 1 && STATUSES.includes(after[0].status) && after[0].id === row.revises && after[0].text === row.text&& after[0].gate === row.gate && after[0].status === row.status && row.source !== row.replacement&& [...new Set([...Object.keys(before[0]), ...Object.keys(after[0])])].filter(key => !['text', 'gate', 'status', 'line', 'section'].includes(key)).every(key => JSON.stringify(before[0][key]) === JSON.stringify(after[0][key]));diff --git a/test/spec-revise.test.js b/test/spec-revise.test.jsindex 6a0bc479..1b726433 100644--- a/test/spec-revise.test.js+++ b/test/spec-revise.test.js@@ -159,6 +159,9 @@ test('[P6,B23] revision plans preserve omitted fields and refuse formatting-onlyconst status = planSpecRevision(box.repo, config, { ...unchanged, status: 'retired' });assert.equal(status.replacement, status.source.replace('[approved]', '[retired]'));assert.ok(validSpecRevision(status));+ assert.equal(validSpecRevision({ ...text, status: 'not-a-status',+ replacement: text.replacement.replace('[approved]', '[not-a-status]') }), false,+ 'the ordered draft validator independently rejects unknown statuses');assert.equal(validSpecRevision({ ...text, replacement: `${text.replacement} | signers: someone-else` }), false,'a revision payload cannot silently introduce fields outside text, gate and status');assert.equal(readFileSync(file, 'utf8'), source, 'planning never writes the private row file');