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.

ci: run the gate on every push and pull request [C7]

Corey Olson6c34c3f28bfa
diff --git a/.github/workflows/gate.yml b/.github/workflows/gate.yml
new file mode 100644
index 00000000..c31eb039
--- /dev/null
+++ b/.github/workflows/gate.yml
@@ -0,0 +1,44 @@
+# The gate on every push to main and every pull request, with the oldest Node pullboard supports and
+# the newest (C7). macOS runs once the repository is public: GitHub bills macOS minutes tenfold on
+# private repositories, and runs public ones free. Full history, since spec check reads it.
+name: gate
+
+on:
+ push:
+ branches: [main]
+ pull_request:
+
+permissions:
+ contents: read
+
+jobs:
+ linux:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node: ['22.13', '24']
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node }}
+ - run: npm run gate
+
+ macos:
+ if: ${{ !github.event.repository.private }}
+ runs-on: macos-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ node: ['22.13', '24']
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node }}
+ - run: npm run gate
diff --git a/README.md b/README.md
index fcb30a74..0a694a6e 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
# Pullboard
+[![gate](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml/badge.svg)](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml)
+
**Vibe code a real product.** Your agents build from a spec you approved, in lanes that keep them out of each other's way, and nothing they build counts until a second agent verifies it.
Pullboard is a work board that lives in your git repo. Every requirement is a one-line row in `SPEC.md`. Agents claim work, build it in their own worktrees, and submit it at a commit with your tests passing. A different agent, from a different model family if you like, checks it against the bar that was frozen when the work started. You decide what to build, answer the questions, and watch it all on one page.
diff --git a/docs/proof/harness.mjs b/docs/proof/harness.mjs
index 1a7ea303..3cbbe584 100644
--- a/docs/proof/harness.mjs
+++ b/docs/proof/harness.mjs
@@ -10,7 +10,7 @@ import { tmpdir } from 'node:os';
import { join, resolve } from 'node:path';
const ROOT = resolve(import.meta.dirname, '..', '..');
-const COPIED = ['src', 'bin', 'test', 'skills', 'docs', 'package.json', 'PRACTICE.md', 'README.md'];
+const COPIED = ['src', 'bin', 'test', 'skills', 'docs', '.github', 'package.json', 'PRACTICE.md', 'README.md'];
/**
* Run an audit and print one line per change. Sets the exit code to 1 if any change comes out other
diff --git a/docs/proof/lanes-and-commits-mutants.mjs b/docs/proof/lanes-and-commits-mutants.mjs
index e4eb30a2..3a2bd567 100644
--- a/docs/proof/lanes-and-commits-mutants.mjs
+++ b/docs/proof/lanes-and-commits-mutants.mjs
@@ -1,6 +1,7 @@
/**
- * The proof audit of the lane and commit rows, L1 to L4 and C1 to C5 (item #55): for each row, one or
- * more changes to src/ that break the row's rule, and the tagged test that must go red under each.
+ * The proof audit of the lane and commit rows, L1 to L4 and C1 to C5 (item #55), and C7, CI (item
+ * #74): for each row, one or more changes that break the row's rule, and the tagged test that must go
+ * red under each.
* The harness works on a temporary copy, never a real checkout.
*
* Run it from the repo root: node docs/proof/lanes-and-commits-mutants.mjs
@@ -16,6 +17,9 @@ const CITES = ['test/hooks.test.js', 'feat and fix cite ids; cited ids exist'];
const PRE_PUSH = ['test/e2e.test.js', 'pre-push runs the gate once per tree'];
const MERGE_HINT = ['test/hooks.test.js', 'a refused merge message points to the message git writes'];
const FIXERS = ['test/e2e.test.js', 'pre-commit runs the fixers on fully staged files'];
+const CI = ['test/ci.test.js', 'CI runs the gate on every push and pull request'];
+const BADGE = ['test/ci.test.js', "the README shows the workflow's status badge"];
+const BADGE_LINE = '[![gate](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml/badge.svg)](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml)\n\n';
const PRE_PUSH_RUN = " const gate = runGate(info.root, ctx.config);\n if (gate.isCached)";
/** Row, the change, its edits as [file, from, to], the test that judges it, and the outcome expected. */
@@ -45,6 +49,11 @@ const MUTANTS = [
['C5', 'no fixer ever runs', [['src/hooks.js', ' if (!fixers.length) return [];', ' return [];']], FIXERS, 'red'],
['C5', 'a partly staged file is fixed anyway', [['src/hooks.js', 'covers(fixer, path) && !unstaged.has(path) && existsSync(join(root, path))', 'covers(fixer, path) && existsSync(join(root, path))']], FIXERS, 'red'],
['C5', 'what a fixer fixed is not staged again', [['src/hooks.js', "if (result.status === 0) git(root, ['add', '--', ...files]);", "if (false) git(root, ['add', '--', ...files]);"]], FIXERS, 'red'],
+ ['C7', 'macOS runs while the repository is private', [['.github/workflows/gate.yml', " if: ${{ !github.event.repository.private }}\n", '']], CI, 'red'],
+ ['C7', 'CI drops the oldest Node it supports', [['.github/workflows/gate.yml', " node: ['22.13', '24']\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: ${{ matrix.node }}\n - run: npm run gate\n\n macos:", " node: ['24']\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: ${{ matrix.node }}\n - run: npm run gate\n\n macos:"]], CI, 'red'],
+ ['C7', 'CI checks out one commit, not the history spec check reads', [['.github/workflows/gate.yml', ' - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: actions/setup-node@v4\n with:\n node-version: ${{ matrix.node }}\n - run: npm run gate\n\n macos:', ' - uses: actions/checkout@v4\n - uses: actions/setup-node@v4\n with:\n node-version: ${{ matrix.node }}\n - run: npm run gate\n\n macos:']], CI, 'red'],
+ ['C7', 'a pull request runs no gate', [['.github/workflows/gate.yml', ' pull_request:\n', '']], CI, 'red'],
+ ['C7', 'the README shows no badge', [['README.md', BADGE_LINE, '']], BADGE, 'red'],
];
audit(MUTANTS);
diff --git a/test/ci.test.js b/test/ci.test.js
new file mode 100644
index 00000000..c39662cf
--- /dev/null
+++ b/test/ci.test.js
@@ -0,0 +1,46 @@
+/**
+ * CI runs the gate (C7): on every push to main and every pull request, with Node 22.13 and 24, on
+ * Linux always and on macOS once the repository is public, since GitHub bills macOS minutes tenfold
+ * on private repositories. The workflow is read as text: the suite has no YAML parser and needs none.
+ */
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+import { resolve } from 'node:path';
+import { test } from 'node:test';
+
+const ROOT = resolve(import.meta.dirname, '..');
+const WORKFLOW = readFileSync(resolve(ROOT, '.github/workflows/gate.yml'), 'utf8');
+
+/**
+ * One job's text, from its name to the next job or the end.
+ *
+ * @param {string} name
+ * @returns {string}
+ */
+function job(name) {
+ const start = WORKFLOW.indexOf(`\n ${name}:\n`);
+ assert.ok(start >= 0, `the workflow has a ${name} job`);
+ const rest = WORKFLOW.slice(start + 1);
+ const next = rest.slice(1).search(/\n {2}[a-z][\w-]*:\n/);
+ return next < 0 ? rest : rest.slice(0, next + 1);
+}
+
+test('CI runs the gate on every push and pull request, Node 22.13 and 24, on Linux and, once public, macOS [C7]', () => {
+ assert.match(WORKFLOW, /\non:\n {2}push:\n {4}branches: \[main\]\n {2}pull_request:\n/, 'pushes to main and pull requests');
+ for (const [name, system] of [['linux', 'ubuntu-latest'], ['macos', 'macos-latest']]) {
+ const text = job(name);
+ assert.ok(text.includes(`\n runs-on: ${system}\n`), `${name} runs on ${system}`);
+ assert.match(text, /\n {8}node: \['22\.13', '24'\]\n/, `${name} runs Node 22.13 and 24`);
+ assert.match(text, /\n {10}node-version: \$\{\{ matrix\.node \}\}\n/, `${name} sets up the matrix's Node`);
+ assert.match(text, /\n {10}fetch-depth: 0\n/, `${name} checks out full history, which spec check reads`);
+ assert.match(text, /\n {6}- run: npm run gate\n/, `${name} runs the gate`);
+ }
+ assert.match(job('macos'), /\n {4}if: \$\{\{ !github\.event\.repository\.private \}\}\n/, 'macOS runs once the repository is public');
+ assert.doesNotMatch(job('linux'), /\n {4}if:/, 'Linux runs every time');
+});
+
+test("the README shows the workflow's status badge [C7]", () => {
+ const readme = readFileSync(resolve(ROOT, 'README.md'), 'utf8');
+ const badge = '[![gate](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml/badge.svg)](https://github.com/pullboard-dev/pullboard/actions/workflows/gate.yml)';
+ assert.ok(readme.split('\n').slice(0, 4).includes(badge), 'the badge sits under the title');
+});