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(submit): honor the board item size budget [V4,C7]
Corey Olson216005bbf011
diff --git a/docs/formats.md b/docs/formats.mdindex 30e0ae3f..a785e199 100644--- a/docs/formats.md+++ b/docs/formats.md@@ -489,6 +489,8 @@ Migration preserves event rows and adds only schema objects that are missing.## Submit test selection+`pullboard.json` may set `"itemSizeBudget"` to a positive whole number of changed lines; it defaults to 100. A successful submit whose diff against current main adds plus deletes more than twice that budget prints one note with the count and suggests splitting into a chain of smaller items. At or below twice the budget it prints no size note. This advice never blocks submission; the budget is read from accepted main.+`pullboard.json` may set `affectedTests` to a command prefix that runs selected test files. When it is absent, `submit` runs the configured `gate` in full. When present and the import graph can safely select a subset, Pullboard appends the selected file paths to this prefix; an uncertain selection still runs the full gate. For example, this repository opts in with `"affectedTests": "node bin/run-tests.js"`. Projects using another test framework can leave the setting out and keep their configured gate, such as `npm test`.`pullboard.json` may set `worktrees` to `"inside"` or `"beside"`. Fresh `pullboard init` writes `"inside"`, placing new agent worktrees under `.claude/worktrees/<lane>-N`; it also adds `.claude/worktrees/` to `.gitignore` and prints guidance for dot-scanner ignore rules. An omitted setting defaults to `"beside"` to preserve existing sibling paths (`../<repo>-<lane>-N`). `pullboard resume --diagnostics`, JSON v1 `pullboard resume --json`, and `pullboard help worktree` show the active location from the primary checkout's config.diff --git a/src/commands/submit.js b/src/commands/submit.jsindex 85a99449..e72d2cff 100644--- a/src/commands/submit.js+++ b/src/commands/submit.js@@ -216,7 +216,7 @@ export async function submitHere(ctx, id, infra) {...(gate.deferred ? { note: gate.deferredFiles ? deferredSelectionNote(gate.deferredFiles) : 'full suite deferred to the landing gate' } : {}) }]);});// A large submit still goes through; the note only suggests a chain of smaller items (#1162).- const sizeNote = oversizeNote(changedLines(root, acceptedMain.commit, commit));+ const sizeNote = oversizeNote(changedLines(root, currentTrunk.commit, commit), acceptedMain.config.itemSizeBudget);if (sizeNote) ctx.io.say(`note: ${sizeNote}`);const report = waived? `submission proof waived, not green: ${waived.length} failure(s), each covered by a live person waiver; the whole output is in ${gate.log}\n${waivedLines.join('\n')}`diff --git a/src/config.js b/src/config.jsindex 93a4afcb..76002641 100644--- a/src/config.js+++ b/src/config.js@@ -46,6 +46,7 @@ export function defaults() {practice: DOCTRINE_FILE,gate: '',submit: { requireInfraNote: false },+ itemSizeBudget: 100,submitInvariants: [],staticChecks: '',lease: '2h',@@ -198,6 +199,9 @@ export function configProblems(config) {if (config.approvers !== undefined && (!Array.isArray(config.approvers) || config.approvers.length > 50 || new Set(config.approvers).size !== config.approvers.length|| config.approvers.some((login) => typeof login !== 'string' || !/^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})$/u.test(login)))) problems.push('"approvers" lists the GitHub logins who act as the person on a linked board, at most fifty; leave it out for today\'s behaviour');if (!['inside', 'beside'].includes(config.worktrees)) problems.push('"worktrees" is "inside" or "beside"');+ if (!Number.isSafeInteger(config.itemSizeBudget) || config.itemSizeBudget < 1) {+ problems.push('"itemSizeBudget" is a positive whole number of changed lines; 100 by default');+ }if (config.submitGate !== undefined && config.submitGate !== 'landing') {problems.push('"submitGate" is "landing" when the full suite should be deferred until landing');}diff --git a/src/submit-size.js b/src/submit-size.jsindex c7966498..5968440b 100644--- a/src/submit-size.js+++ b/src/submit-size.js@@ -26,9 +26,10 @@ export function changedLines(root, base, head) {* because the submit goes through as usual.** @param {number | null} lines the changed-line count from changedLines+ * @param {number} [budget] the board item size budget from accepted main* @returns {string | null}*/-export function oversizeNote(lines) {- if (lines === null || lines <= 2 * ITEM_SIZE_BUDGET) return null;- return `this submit changes ${lines} lines against main, over twice the ${ITEM_SIZE_BUDGET}-line item budget; consider splitting it into a chain of smaller items. The submit went through as usual.`;+export function oversizeNote(lines, budget = ITEM_SIZE_BUDGET) {+ if (lines === null || lines <= 2 * budget) return null;+ return `this submit changes ${lines} lines against main, over twice the ${budget}-line item budget; consider splitting it into a chain of smaller items. The submit went through as usual.`;}diff --git a/test/submit-size.test.js b/test/submit-size.test.jsindex 6d8b0b39..87635be1 100644--- a/test/submit-size.test.js+++ b/test/submit-size.test.js@@ -6,6 +6,7 @@ import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';import { join } from 'node:path';import { test } from 'node:test';import { createE2eHelpers } from './e2e-helpers.js';+import { configFromSource } from '../src/config.js';/** Submit a real committed change under the board's configured budget and inspect its public result. */function submitSized(helpers, lines, budget) {@@ -51,3 +52,14 @@ test('a submit far over the size budget prints a split suggestion and still subm}}});++// AFTER-only validation controls; the original causal case and every assertion above are unchanged.+test('the item size budget defaults to 100 and rejects invalid board settings [V4,C7]', () => {+ assert.equal(configFromSource('{}').itemSizeBudget, 100);+ for (const budget of [1, 50, 200]) {+ assert.equal(configFromSource(JSON.stringify({ itemSizeBudget: budget })).itemSizeBudget, budget);+ }+ for (const budget of [0, -1, 1.5, '50', null, [], {}, Number.MAX_SAFE_INTEGER + 1]) {+ assert.throws(() => configFromSource(JSON.stringify({ itemSizeBudget: budget })), { code: 'BAD_CONFIG', message: /itemSizeBudget/u });+ }+});