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(hooks): validate malformed row previews [C7]
Corey Olsondb8498ead4da
diff --git a/src/commit-metadata.js b/src/commit-metadata.jsindex d4474c70..01ffda0d 100644--- a/src/commit-metadata.js+++ b/src/commit-metadata.js@@ -25,7 +25,8 @@ export function prepareCommitMetadata(raw, { claim = null, landings = [], spec =if (metadata.some(entry => entry.key === 'Pullboard-Item') && parsed.item !== expected.item_id) problems.push(`Pullboard-Item must name this board item #${expected.item_id}`);if (parsed.rows !== null && parsed.rows.join(',') !== rows.join(',')) problems.push('Pullboard-Rows must match the frozen rows in spec order');if (!rows.length && parsed.rows !== null) problems.push('omit Pullboard-Rows for an item with no rows');- if (parsed.more && (parsed.shown.join(',') !== rows.slice(0, parsed.shown.length).join(',') || parsed.shown.length + parsed.more !== rows.length)) {+ const preview = /\[[^\]\n]*\+/u.test(parsed.header);+ if (preview && (!parsed.more || !parsed.shown.length || parsed.shown.join(',') !== rows.slice(0, parsed.shown.length).join(',') || parsed.shown.length + parsed.more !== rows.length)) {problems.push('the header preview must show the first frozen rows and +N for exactly the rest');}const keys = parsed.trailers.map(entry => entry.key);diff --git a/test/commit-metadata.test.js b/test/commit-metadata.test.jsindex 6daa16de..57ca4a11 100644--- a/test/commit-metadata.test.js+++ b/test/commit-metadata.test.js@@ -60,7 +60,7 @@ test('typed rows must be the complete frozen set in board order [C7]', () => {test('an abbreviated header preview must count the actual frozen remainder [C7]', () => {const box = claimed();- for (const preview of ['G1,+0', 'G1,+text', 'G1,+1,G2', 'G1,+2']) {+ for (const preview of ['G1,+0', 'G1,+text', 'G1,+1,G2', 'G1,+2', '+1']) {const result = hook(box, `test: wrong preview [${preview}]\n`);assert.notEqual(result.code, 0, preview);assert.match(result.err, /preview/u);