Skip to content

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.

fix(metadata): keep legacy aliases out of new commit hooks [C7]

Corey Olson3feff5bbccb2
diff --git a/src/hooks.js b/src/hooks.js
index d701a57a..6c6a73be 100644
--- a/src/hooks.js
+++ b/src/hooks.js
@@ -145,6 +145,9 @@ export function commitMsgProblems(raw, { rules, spec, doctrine = null, claimedIt
// A generated landing message keeps a rowless item's own type (RFC 0005), so it has no ids to cite. Only a
// landing checkout, merging a verified item the board says cites no rows, passes on its trailer.
const landing = parseCommitMessage(lines.join('\n'));
+ if (landing.trailers.some(entry => entry.key === 'Pullboard-Companion')) {
+ problems.push('Pullboard-Companion is retired; generated commits use Pullboard-Item');
+ }
const rowlessLanding = landing.scope === 'merge' && landing.rows === null && rowlessLandings.includes(landing.item);
if (type && rules.requireIds.includes(type) && !ids.length && !firstItem && !rowlessLanding) {
problems.push(
diff --git a/test/companion-metadata.test.js b/test/companion-metadata.test.js
index 7badea35..829b7fce 100644
--- a/test/companion-metadata.test.js
+++ b/test/companion-metadata.test.js
@@ -9,6 +9,9 @@ import {
parseCommitMessage,
} from '../src/commit-message.js';
import { landingMessage } from '../src/landing-message.js';
+import { commitMsgProblems } from '../src/hooks.js';
+import { defaults } from '../src/config.js';
+import { parseSpec } from '../src/spec.js';
import { itemsTouching } from '../src/why-file.js';
import { createE2eHelpers } from './e2e-helpers.js';
@@ -53,6 +56,9 @@ test('a new companion commit carries Pullboard-Item and an old one still parses
assert.doesNotMatch(rewritten.message, /Pullboard-Companion:/u);
assert.ok(commitMessageProblems(historical, { item: 17, rows: ['C7'] }).some(problem => /retired/u.test(problem)),
'historical readability never authorizes a new legacy trailer');
+ assert.ok(commitMsgProblems('feat(merge): old rowless\n\nPullboard-Companion: #17', {
+ rules: defaults().commits, spec: parseSpec(''), rowlessLandings: [17],
+ }).some(problem => /retired/u.test(problem)), 'legacy reading cannot borrow the hook exemption for a new rowless landing');
const mixed = historical.replace('Pullboard-Companion: #17', 'Pullboard-Item: #18\nPullboard-Companion: #17');
assert.equal(parseCommitMessage(mixed).item, 18, 'the canonical trailer takes precedence');
assert.equal(parseCommitMessage(mixed.replace('Pullboard-Item: #18', 'Pullboard-Item: invalid')).item, null,