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
chore(core): scan all source files for import style
Corey Olson344eef9328f2
diff --git a/bin/static-style-checks.js b/bin/static-style-checks.jsindex 7617815d..37acd398 100644--- a/bin/static-style-checks.js+++ b/bin/static-style-checks.js@@ -1,6 +1,6 @@#!/usr/bin/env node/** The Pullboard repository's source-only preflight; no browser fixtures run [C7]. */-import { readFileSync } from 'node:fs';+import { readFileSync, readdirSync } from 'node:fs';import { join } from 'node:path';import { spawnSync } from 'node:child_process';import { importStyleViolations } from '../src/static-import-style.js';@@ -12,7 +12,12 @@ import { PULLBOARD_COMMANDS } from '../src/cockpit.js';const root = process.cwd();let failed = false;-const sources = ['src/cli.js', 'src/cockpit.js', 'src/serve.js'].map(file => ({ file, source: readFileSync(join(root, file), 'utf8') }));+const sources = readdirSync(join(root, 'src'), { recursive: true })+ .filter(file => file.endsWith('.js'))+ .map(file => {+ const path = join('src', file);+ return { file: path, source: readFileSync(join(root, path), 'utf8') };+ });for (const row of importStyleViolations(sources)) {console.error(`${row.file}:${row.line}: one import binding per line (${row.count} bindings)`);failed = true;diff --git a/test/static-style.test.js b/test/static-style.test.jsindex d48b4755..28ffa99b 100644--- a/test/static-style.test.js+++ b/test/static-style.test.js@@ -1,7 +1,10 @@/** @pullboard-test-input source-tree *//** The actual repository preflight keeps source oracles separate from browser behavior [C7]. */import assert from 'node:assert/strict';-import { resolve } from 'node:path';+import { spawnSync } from 'node:child_process';+import { cpSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';+import { tmpdir } from 'node:os';+import { join, resolve } from 'node:path';import { test } from 'node:test';import { runFixtureChild } from './fixture-child.js';@@ -13,3 +16,32 @@ test('the repository static style command enforces its source rules [C7]', () =>console.log(JSON.stringify({ staticProgramWallMs: performance.now() - before, status: child.status }));assert.equal(child.status, 0, child.failure ?? ((child.stdout ?? '') + (child.stderr ?? '')));});++test('the static checks read every source file for one import binding per line [C7]', t => {+ const root = mkdtempSync(join(tmpdir(), 'pullboard-static-style-recursive-'));+ t.after(() => rmSync(root, { recursive: true, force: true }));+ const repository = resolve(import.meta.dirname, '..');+ cpSync(join(repository, 'src'), join(root, 'src'), { recursive: true });+ for (const directory of ['bin', 'test']) mkdirSync(join(root, directory), { recursive: true });+ for (const file of ['static-style-checks.js']) cpSync(join(repository, 'bin', file), join(root, 'bin', file));+ cpSync(join(repository, 'test/wall-clock-budgets.js'), join(root, 'test/wall-clock-budgets.js'));+ for (const file of ['package.json', 'pullboard.json']) cpSync(join(repository, file), join(root, file));++ const nested = 'src/commands/nested/import-style-fixture.js';+ mkdirSync(join(root, 'src/commands/nested'), { recursive: true });+ writeFileSync(join(root, nested), "import { strict as assert, equal } from 'node:assert';\nvoid assert; void equal;\n");+ for (const args of [+ ['init', '-q', '-b', 'main'],+ ['add', 'src', 'bin', 'test', 'package.json', 'pullboard.json'],+ ['-c', 'user.name=Fixture', '-c', '[email protected]', 'commit', '-q', '-m', 'fixture'],+ ]) {+ const result = spawnSync('git', args, { cwd: root, encoding: 'utf8' });+ assert.equal(result.status, 0, result.stderr);+ }++ const child = runFixtureChild(process.execPath,+ ['--experimental-vm-modules', '--disable-warning=ExperimentalWarning', 'bin/static-style-checks.js'],+ { cwd: root, encoding: 'utf8' });+ assert.equal(child.status, 1, child.failure ?? ((child.stdout ?? '') + (child.stderr ?? '')));+ assert.ok(child.stderr.includes(`${nested}:1: one import binding per line`), child.stderr);+});