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(core): activate sign-offs from trusted base #1188 [C1,C7]
Corey Olsonf4cec4f75007
diff --git a/bin/check-signoffs.js b/bin/check-signoffs.jsindex a8b9bb5d..71142cea 100644--- a/bin/check-signoffs.js+++ b/bin/check-signoffs.js@@ -16,6 +16,8 @@ function main() {if (result.problem) {process.stderr.write(result.problem + '\n');process.exitCode = 1;+ } else if (result.policyInactive) {+ process.stdout.write('sign-off policy not active at base ' + (range.base ?? '(none)') + '\n');} else process.stdout.write('Contributor sign-offs checked: ' + result.checked + ' non-merge commits.\n');}diff --git a/src/commit-signoff.js b/src/commit-signoff.jsindex 35ff6b91..d15cbe4a 100644--- a/src/commit-signoff.js+++ b/src/commit-signoff.js@@ -26,7 +26,7 @@ function gitText(root, args) {}/** Local hooks use HEAD; CI supplies its trusted base object, never the contribution's policy. */-function maintainersAt(root, commit, required) {+function maintainersAt(root, commit) {let config;try { config = JSON.parse(gitText(root, ['show', commit + ':pullboard.json'])); }catch (error) {@@ -36,7 +36,7 @@ function maintainersAt(root, commit, required) {if (!config || typeof config !== 'object' || Array.isArray(config)) {throw new Refused('BAD_CONFIG', 'Restore an object in the trusted pullboard.json before checking sign-offs.');}- if (config.maintainers === undefined && !required) return null;+ if (config.maintainers === undefined) return null;if (!Array.isArray(config.maintainers) || config.maintainers.some(email =>typeof email !== 'string' || !email || email.trim() !== email || /[<>\u0000-\u001f\u007f]/u.test(email))) {throw new Refused('BAD_CONFIG', 'The trusted pullboard.json must contain maintainers as a list of exact author emails; ask the maintainer to correct the base branch.');@@ -79,7 +79,7 @@ export function pendingCommitSignoffProblem(root, message) {const commit = head.stdout.trim();const policyPath = gitText(root, ['ls-tree', '-z', commit, '--', 'pullboard.json']);if (!policyPath) return null;- const maintainers = maintainersAt(root, commit, false);+ const maintainers = maintainersAt(root, commit);if (maintainers === null) return null; // Other repositories have no contribution policy enabled.const mergePath = resolve(root, gitText(root, ['rev-parse', '--git-path', 'MERGE_HEAD']).trim());if (existsSync(mergePath)) {@@ -101,5 +101,7 @@ export function contributionSignoffProblem(root, { base, head }) {|| (base !== null && (!/^[0-9a-f]{40,64}$/u.test(base ?? '') || /^0+$/u.test(base)))) {throw new Refused('BAD_CONFIG', 'The sign-off check needs exact base and head commit ids from the CI event.');}- return rangeProblem(root, [head], base, maintainersAt(root, base ?? head, true));+ const maintainers = base === null ? null : maintainersAt(root, base);+ if (maintainers === null) return { checked: 0, problem: null, policyInactive: true };+ return rangeProblem(root, [head], base, maintainers);}diff --git a/test/commit-msg.test.js b/test/commit-msg.test.jsindex 267a13fd..49532ea9 100644--- a/test/commit-msg.test.js+++ b/test/commit-msg.test.js@@ -51,6 +51,9 @@ test('a push whose base has no maintainers list passes with the policy not activconst opaqueHead = checkPush(inactiveBase);assert.equal(opaqueHead.status, 0, opaqueHead.failure || opaqueHead.stderr);assert.equal(opaqueHead.stdout, bootstrap.stdout);+ const initialPush = checkPush('0'.repeat(40));+ assert.equal(initialPush.status, 0, initialPush.failure || initialPush.stderr);+ assert.equal(initialPush.stdout, 'sign-off policy not active at base (none)\n');box.env.GIT_AUTHOR_NAME = 'Test Agent';box.env.GIT_AUTHOR_EMAIL = '[email protected]';