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.

feat(doctrine): hold four checks with unique ids [D1,D3]

Corey Olson9d148ab2d529
diff --git a/DOCTRINE.md b/DOCTRINE.md
index 990a4355..3be2ff7f 100644
--- a/DOCTRINE.md
+++ b/DOCTRINE.md
@@ -17,12 +17,16 @@ Statuses: approved = in force · draft = proposed · wont = considered and decli
- C4 [approved, must] Refusals throw Refused(code, message); nothing else exits the process except the bin. | gate: review
- C5 [approved, must] Text from files or users is escaped before it reaches a page. | gate: test/view.test.js
- C6 [draft, aim] Functions under 60 lines and files under 1,000. | gate: review
+- C9 [approved, must] Source and test files stay under 1500 lines; existing excess can only fall. Why: bounded files keep changes and reviews manageable. | gate: check node bin/checks/file-size.js | count: 111
+- C8 [approved, must] No bare empty catch hides a failure; existing cases can only fall. Why: failures need handling or an explicit reason to ignore them. | gate: check node bin/checks/empty-catch.js | count: 13
## T · Tests
- T1 [approved, must] Tests use node:test against real git repos and a real SQLite file, not mocks. | gate: review
- T2 [approved, must] Every test name cites the spec rows it proves. | gate: review
- T3 [approved, must] The suite passes on Node 22, 24 and 26 before a release. | gate: release check
- T4 [draft, must] A check that guards a rule is shown failing on a broken copy before anyone trusts it. | gate: review
+- T5 [approved, must] Every test name cites the spec rows it proves; existing omissions can only fall. Why: a passing test must name the requirement it checks. | gate: check node bin/checks/test-names.js | count: 15
+- T6 [approved, must] Tests declare the source files they read; existing omissions can only fall. Why: affected-test selection must see those dependencies. | gate: check node bin/checks/test-inputs.js | count: 19
## G · Git and the gate
- G1 [approved, must] `npm run gate` (spec check and tests) passes before every push. | gate: pre-push hook
diff --git a/test/readme.test.js b/test/readme.test.js
index 9c258e3e..8f4d4370 100644
--- a/test/readme.test.js
+++ b/test/readme.test.js
@@ -4,15 +4,18 @@
* text, and the lifecycle is drawn from the declaration itself (M1), refusing what it cannot place.
*/
import assert from 'node:assert/strict';
-import { readdirSync, readFileSync } from 'node:fs';
+import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
import { join, resolve } from 'node:path';
-import { test } from 'node:test';
+import { after, test } from 'node:test';
import { FIGURES, drawLifecycle } from '../docs/img/draw.mjs';
import { HELP, commandPhrases } from '../src/help.js';
import { MACHINE } from '../src/machine.js';
import { agentsBlock } from '../src/templates.js';
+import { createE2eHelpers } from './e2e-helpers.js';
const ROOT = resolve(import.meta.dirname, '..');
+const e2e = createE2eHelpers();
+after(e2e.cleanup);
const README = readFileSync(join(ROOT, 'README.md'), 'utf8');
const drawn = Object.keys(FIGURES).map((name) => `docs/img/${name}.svg`).sort();
const SHOT_FIGURES = [
@@ -20,6 +23,30 @@ const SHOT_FIGURES = [
{ path: 'docs/shots/desktop.png', alt: "The desktop board shows open, claimed, submitted and accepted work, a Needs you row for a held lane, search in the top bar, the status bar, an accepted item's review history, and a stats line with merged work, sent-back share and the bottleneck recommendation." },
];
+test("Pullboard's doctrine carries its four checks [D1,D3]", () => {
+ const box = e2e.project();
+ const checkout = join(box.dir, 'doctrine-checkout');
+ box.git(box.dir, 'clone', '--shared', ROOT, checkout);
+ writeFileSync(join(checkout, 'DOCTRINE.md'), readFileSync(join(ROOT, 'DOCTRINE.md'), 'utf8'));
+ box.git(checkout, 'add', 'DOCTRINE.md');
+ const staged = box.tryGit(checkout, 'diff', '--cached', '--quiet');
+ assert.ok(staged.status === 0 || staged.status === 1, staged.stderr);
+ if (staged.status === 1) box.git(checkout, 'commit', '-q', '-m', 'docs: exercise doctrine checks [D1,D3]');
+
+ const spec = box.run(checkout, 'spec', 'check');
+ assert.equal(spec.code, 0, spec.out + spec.err);
+ const report = box.run(checkout, 'doctrine', 'check');
+ assert.equal(report.code, 0, report.err);
+ const lines = report.out.trim().split(/\r?\n/u);
+ assert.equal(lines.length, 4, 'doctrine check prints exactly four Rigor rules');
+ assert.deepEqual(lines.map((line) => line.slice(0, line.indexOf(' '))), ['C9', 'C8', 'T5', 'T6']);
+ for (const line of lines) {
+ const result = / · (\d+), was (\d+) · holding$/u.exec(line);
+ assert.ok(result, `${line} is holding at a committed count`);
+ assert.equal(result[1], result[2], `${line} matches the current main count`);
+ }
+});
+
/** Average glyph width, in ems, generous enough for the widest system font each figure may get. */
const EM = { sans: 0.56, mono: 0.62 };
const SIZE = { head: 14, t1: 14, t2: 12, label: 12, aside: 12, code: 11.5 };