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(projects): expose labels and forget repos [N33,N35,N36]

Corey Olson50668c6cc82b
diff --git a/src/cli.js b/src/cli.js
index d6c6ce5a..3ec196e6 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -42,7 +42,7 @@ import { runItems } from './run.js';
import { parseProblems, sweepItems } from './sweep.js';
import { renderSpecView } from './view.js';
import { tour } from './tour.js';
-import { registerProject } from './projects.js';
+import { forgetProject, registerProject } from './projects.js';
import { serveView } from './serve.js';
const PACKAGE = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8'));
@@ -111,6 +111,7 @@ Receipts
Spec
pullboard spec --json parsed SPEC.md and PRACTICE.md rows as JSON
+ pullboard forget <path> remove a repo from this machine's project list
pullboard spec check lint SPEC.md and PRACTICE.md
pullboard spec view [--out file] the spec, open questions, sign-offs and practice as one page
pullboard spec show <id> | unmet [--must] | signoff <ids> --by <initials>
@@ -631,7 +632,7 @@ function resumeHere(io) {
async function viewHere(io, values) {
try {
const info = repoInfo(io.cwd);
- if (info.isMain && existsSync(join(info.root, CONFIG_FILE))) registerProject(info.root);
+ if (info.isMain && existsSync(join(info.root, CONFIG_FILE))) registerProject(info.root, new Date(), loadConfig(info.root));
} catch (error) {
if (!(error instanceof Refused)) throw error;
}
@@ -670,7 +671,7 @@ function setupCommands(io, { first, values }) {
closeBoard: store.closeBoard,
});
notes.forEach((note) => io.say(note));
- if (registerProject(info.root)) io.say('registered this project on this machine, so pullboard view lists it');
+ if (registerProject(info.root, new Date(), loadConfig(info.root))) io.say('registered this project on this machine, so pullboard view lists it');
io.say('next: write SPEC.md rows, declare lanes in pullboard.json, then: pullboard add <lane> <title>');
io.say('with an agent: start a new Claude Code session here, which loads the pullboard skills, then tell it what to build; the pullboard-run skill runs the team');
return 0;
@@ -1486,6 +1487,13 @@ export async function main(argv, streams) {
return 0;
}
if (command === 'view') return await viewHere(io, values);
+ if (command === 'forget') {
+ if (!first || second) throw new Refused('USAGE', 'pullboard forget <path>');
+ const root = resolve(io.cwd, first);
+ if (!forgetProject(root)) throw new Refused('NO_REPO', `no registered repo at ${root}; see the projects in pullboard view`);
+ io.say(`forgot ${root}`);
+ return 0;
+ }
if (command === 'spec') return specCommand(io, args);
if (command === 'prompt') {
let root = io.cwd;
diff --git a/test/project-meta.test.js b/test/project-meta.test.js
new file mode 100644
index 00000000..64139298
--- /dev/null
+++ b/test/project-meta.test.js
@@ -0,0 +1,72 @@
+/** Project metadata and registry lifecycle (N33, N35, N36). */
+import assert from 'node:assert/strict';
+import { execFileSync, spawnSync } from 'node:child_process';
+import { existsSync, mkdirSync, mkdtempSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join, resolve } from 'node:path';
+import { test } from 'node:test';
+import { serveView } from '../src/serve.js';
+
+const BIN = resolve(import.meta.dirname, '../bin/pullboard.js');
+
+/** An isolated registry and real Git repos; every CLI child inherits the private home. */
+function fleet(t) {
+ const dir = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-cross-repo-')));
+ t.after(() => rmSync(dir, { recursive: true, force: true }));
+ const home = join(dir, 'home');
+ const env = { ...process.env, PULLBOARD_HOME: home, GIT_CONFIG_GLOBAL: '/dev/null', GIT_CONFIG_NOSYSTEM: '1', GIT_AUTHOR_NAME: 'Test Agent', GIT_AUTHOR_EMAIL: '[email protected]', GIT_COMMITTER_NAME: 'Test Agent', GIT_COMMITTER_EMAIL: '[email protected]' };
+ const prior = process.env.PULLBOARD_HOME;
+ process.env.PULLBOARD_HOME = home;
+ t.after(() => { if (prior === undefined) delete process.env.PULLBOARD_HOME; else process.env.PULLBOARD_HOME = prior; });
+ const git = (cwd, ...args) => execFileSync('git', args, { cwd, env, encoding: 'utf8', stdio: 'pipe' }).trim();
+ const run = (cwd, ...args) => spawnSync(process.execPath, [BIN, ...args], { cwd, env, encoding: 'utf8' });
+ const ok = (cwd, ...args) => { const out = run(cwd, ...args); assert.equal(out.status, 0, `${out.stdout}${out.stderr}`); return out.stdout; };
+ const repo = (folder, name, project = 'Demo group') => {
+ const root = join(dir, folder);
+ mkdirSync(root);
+ git(root, 'init', '-q', '-b', 'main');
+ writeFileSync(join(root, 'pullboard.json'), JSON.stringify({ name, project, gate: 'true', lanes: { app: { owns: ['src/'] }, review: { owns: [] } } }));
+ ok(root, 'init');
+ git(root, 'add', '-A');
+ git(root, 'commit', '-q', '-m', 'chore: private setup');
+ return root;
+ };
+ return { dir, home, env, git, run, ok, repo };
+}
+
+test('the view exposes configured repo/project names, refreshed labels, pruning and CLI forgetting [N33, N35, N36]', async (t) => {
+ const f = fleet(t);
+ const local = f.repo('local', 'Local label');
+ const gone = f.repo('gone', 'Gone label');
+ const view = await serveView({ port: 0 });
+ try {
+ const link = new URL(view.url);
+ const state = async () => (await fetch(`${link.origin}/api/state`, { headers: { 'x-pullboard-key': link.searchParams.get('k') } })).json();
+ let data = await state();
+ assert.deepEqual(data.projects.map(({ name, project }) => ({ name, project })), [{ name: 'Local label', project: 'Demo group' }, { name: 'Gone label', project: 'Demo group' }]);
+ const config = JSON.parse(readFileSync(join(local, 'pullboard.json'), 'utf8'));
+ writeFileSync(join(local, 'pullboard.json'), JSON.stringify({ ...config, name: 'New label', project: 'New group' }));
+ rmSync(gone, { recursive: true, force: true });
+ data = await state();
+ assert.deepEqual(data.projects.map(({ name, project }) => ({ name, project })), [{ name: 'New label', project: 'New group' }]);
+ f.ok(local, 'forget', '.');
+ assert.deepEqual((await state()).projects, []);
+ } finally { await view.close(); }
+});
+
+test('config refusals name bad project/display values and an unknown forget path [N33, N35, N36]', (t) => {
+ const f = fleet(t);
+ const root = f.repo('local', 'Local label');
+ const file = join(root, 'pullboard.json');
+ const valid = JSON.parse(readFileSync(file, 'utf8'));
+ for (const [field, value] of [['project', false], ['project', ''], ['project', ' padded '], ['name', 42], ['name', 'bad#label'], ['name', 'bad,label'], ['name', 'bad\nlabel']]) {
+ writeFileSync(file, JSON.stringify({ ...valid, [field]: value }));
+ const result = f.run(root, 'spec', 'check');
+ assert.equal(result.status, 1);
+ assert.match(result.stderr, /BAD_CONFIG/);
+ assert.ok(result.stderr.includes(`"${field}"`), result.stderr);
+ }
+ writeFileSync(file, JSON.stringify(valid));
+ assert.match(f.run(root, 'forget', join(f.dir, 'unknown')).stderr, /NO_REPO/);
+ assert.equal(f.run(root, 'forget').status, 1);
+});