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
feat(test): catalog, refusal steps and API guide for pullboard test [C7]
Corey Olsonf9bd51e6dc2b
diff --git a/docs/api.md b/docs/api.mdindex fe580171..cf9b22db 100644--- a/docs/api.md+++ b/docs/api.md@@ -40,6 +40,8 @@ The board setting `submit.requireInfraNote` in the coordinator's accepted `pullb`stats.caught` lists what the board caught in the window, read from moves it already records and never pushed: `counts` per kind (`sentBack`, `conflict`, `redHead`, `flake`, `stuck`), `total`, and `entries` of `{kind, item, at, text}`. A `sentBack` entry carries the gap the reviewer named; `conflict` is a reopen naming a trunk conflict; `redHead` is a reopen after the full suite failed at landing; `flake` is a flake proven by a paired rerun; `stuck` is a sentinel health finding. Text `stats` prints a `caught:` count line and one line per entry, and `pullboard digest` carries the same list for the last 30 days under `What the board caught`. It appears only when someone runs one of those commands.+`pullboard test <files>` runs the named test files with the board's focused test runner (`affectedTests` in `pullboard.json`) under one gate slot, so a machine with `gate.runnersFirst` on deals them to its registered runners first; the focused runner's per-file timeout applies there as here. A dirty worktree runs too: its tracked and untracked files, ignored ones left out, become a snapshot commit made with a private index, checked out cleanly for the run, and the worktree's own index and branches stay as they are. `--json` returns the runner's unchanged TAP as `output`, `runner` (the runner host, or `this machine`), `seconds` and `files`. When a file fails, each failed file is compared with main's own run of it, cached per main commit and file beside the board: `known` lists `{file, result}` with `result` `red` when main fails it too (a known main failure), `green` when main passes it, or `absent` when main does not have the file, and `main` names that commit. A runner whose transport dropped rejoins the pool after five minutes.+`gateWaits`, beside `stats`, lists, for each kind of gated run in the last day (`check`, `review`, `doctrine`, `gate`, `landing`), its `runs`, `medianWaitMs`, `slowestWaitMs` and `medianRunMs`, read from the board's gate receipts; text `stats` prints them under `gate waits, last day:`. A gate receipt is written for every run that takes a gate slot. Its fields are `waitMs` (queued for a slot), `admissionMs` (deciding and queueing, then handing over), `setupMs`, `runMs` and `evidenceMs` (reading the result and writing its record), and `slot: {kind, reason}`, where `kind` is `ordinary`, `browser`, `short`, `runner` or `inherited`. A timing profile carries it as `receipt`, `check --json` returns it as `receipt`, and the timing lines print it as `phases: ...; slot: <kind> (<reason>)`. A doctrine hold at submit prints its own `doctrine hold phases:` line.`stats.bars` counts bar corrections, keyed by agent: `{corrections, barRejects, buildRejects}`. A correction is an `edit --criterion` or `--check` on an item that was ever claimed. It must carry `--reason "what the old bar got wrong"` (HTTP `args.reason`); without one it is refused with `BAR_REASON`. A correction that follows the item's newest, unexplained reject marks that reject as caused by the bar, counted to the correcting agent; every other reject counts to the build, under the agent who added the item. Text `stats` prints one `bars:` line per agent, and text `show` prints each correction with its reason.@@ -130,6 +132,7 @@ For example: `flow: review wait average 61 min (1 measured; > 60 min); bottlenec| `badge` | `version:number`, `items:number`, `checked:number`, `percent:number\|null`, `changed:array` || `check` | `version:number`, `id:number`, `green:boolean`, `seconds:number`, `check:string`, `receipt:object`, `report:string` || `check accept` | `version:number`, `id:number`, `digest:string`, `check:string` |+| `test` | `version:number`, `green:boolean`, `output:string`, `runner:string`, `seconds:number`, `files:array`, `known:array`, `main:string\|null` || `claim` | `version:number`, `id:number`, `renewed:boolean`, `leaseUntil:string`, `digest:string` || `hold` | `version:number`, `lane:string`, `held:boolean` || `release` | `version:number`, `id:number` |diff --git a/src/main-red.js b/src/main-red.jsindex d644ebdf..153ea8ea 100644--- a/src/main-red.js+++ b/src/main-red.js@@ -186,11 +186,17 @@ export async function compareMainFailures(root, profile, onWait, output = '') {for (const path of missing) {try {// The slot is taken on the clean main checkout, so a runner can take it even when this worktree is dirty.- const measured = await withMainCheckout(root, main.commit, checkout => withGateSlot(checkout, async lease => {- const command = `${policy.config.affectedTests.trimEnd()} ${shellWord('./' + path)}`;- const run = await runProfiledShellAsync(checkout, command, { gateLease: lease, waitMs: lease.waitMs });- return { result: run.isGreen ? 'green' : 'red' };- }, { diagnostic: true, browser: true, agent: process.env.PULLBOARD_AGENT, kind: 'main-red', onWait }));+ const measured = await withMainCheckout(root, main.commit, async checkout => {+ /** Run main's copy of the file under one gate slot, on a runner unless remote is false. */+ const measure = remote => withGateSlot(checkout, async lease => {+ const command = `${policy.config.affectedTests.trimEnd()} ${shellWord('./' + path)}`;+ const run = await runProfiledShellAsync(checkout, command, { gateLease: lease, waitMs: lease.waitMs });+ return { result: run.isGreen ? 'green' : 'red' };+ }, { diagnostic: true, browser: true, remote, agent: process.env.PULLBOARD_AGENT, kind: 'main-red', onWait });+ // History a runner may not receive keeps the comparison on this machine, as it ran before runners.+ try { return await measure(true); }+ catch (error) { if (error?.code !== 'RUNNER_SECRET') throw error; return measure(false); }+ });if (measured.unavailable) throw new Error(measured.unavailable);// The cache lease excludes other comparisons; persist each result before yielding again.cache = readCache(file);diff --git a/src/next-step-defaults.js b/src/next-step-defaults.jsindex b03ed29b..16c07f72 100644--- a/src/next-step-defaults.js+++ b/src/next-step-defaults.js@@ -200,6 +200,9 @@ export const DEFAULT_NEXT_STEPS = Object.freeze({"BAR_COVERAGE": "record whole-file duration evidence, the named-check duration and any install duration in a coverage JSON file, then run pullboard bar sign <id> --coverage-file <path> --note \"...\"","NOTHING_FREE": "wait for work: pullboard next --wait 9 (minutes)","NOT_COMMITTED": "commit the files the message names, then run the command again",+ "NO_TEST_FILE": "name each test file by its path from the checkout root, then run pullboard test again",+ "NO_TEST_RUNNER": "set affectedTests in pullboard.json to the command that runs named test files, then run pullboard test again",+ "TEST_SNAPSHOT": "commit the work, then run pullboard test again","NOT_HOLDING": "name an item: pullboard check <id>, or run the project gate: pullboard gate","NOT_MAIN": "run this coordinator-owned operation from the main checkout, or ask the coordinator to do it","NOT_APPROVER": "ask one of the approvers pullboard.json names to do it, signed in as themselves; to change the list, an approver commits it and runs pullboard relay on",diff --git a/test/api-catalog.test.js b/test/api-catalog.test.jsindex b8e338bd..a87fa95b 100644--- a/test/api-catalog.test.js+++ b/test/api-catalog.test.js@@ -807,6 +807,21 @@ catalogCase('[A1] intake records a real outside pull request through the CLI', aassert.equal(document.item.item_commit, box.commit);});+catalogCase('[A1,C7] test runs named test files and reports where they ran', async () => {+ const box = await project();+ const configFile = join(box.repo, 'pullboard.json');+ writeFileSync(configFile, JSON.stringify({ ...JSON.parse(readFileSync(configFile, 'utf8')), affectedTests: 'node --test' }, null, 2));+ mkdirSync(join(box.repo, 'test'));+ writeFileSync(join(box.repo, 'test', 'catalog.test.js'), "import { test } from 'node:test';\ntest('catalog passes', () => {});\n");+ await box.git(box.repo, 'add', '-A');+ await box.git(box.repo, 'commit', '-q', '-m', 'test: a focused runner and one test file');+ const result = await json(box, box.repo, 'test', ['test/catalog.test.js']);+ assert.equal(result.green, true);+ assert.deepEqual(result.files, ['test/catalog.test.js']);+ assert.equal(result.runner, 'this machine', 'with no runner registered the files run here');+ assert.match(result.output, /^ok 1 - catalog passes/mu);+});+catalogCase('[A1,H11] sync shares a board through a real Git remote without an account', async () => {const source = await project();const remote = join(source.dir, 'shared-board.git');