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(view): an open decision counts in the sidebar and title [B21,N26]

Corey Olson68432d06a813
diff --git a/src/cockpit.js b/src/cockpit.js
index 85ae9929..0f6038fc 100644
--- a/src/cockpit.js
+++ b/src/cockpit.js
@@ -394,8 +394,8 @@ const tone = (s) => s === 'approved' ? 'ok' : s === 'pending' ? 'no' : s === 'dr
const count = (n, one, many = one) => n + ' ' + (n === 1 ? one : many);
// What needs the person in a project, as its Needs-you list counts it: work sent back or waiting for a
// verdict, open questions, held lanes.
-const needCount = (x) => x.ok ? x.sentBack + x.awaiting + x.pending + x.holds : 0;
-const doing = (x) => [x.sentBack && count(x.sentBack, 'sent back'), x.awaiting && count(x.awaiting, 'to verify'), x.pending && count(x.pending, 'question', 'questions'), x.holds && count(x.holds, 'lane held', 'lanes held'), x.building && count(x.building, 'building')].filter(Boolean).join(' · ') || (x.open ? count(x.open, 'item open', 'items open') : 'nothing open');
+const needCount = (x) => x.ok ? x.decisions + x.sentBack + x.awaiting + x.pending + x.holds : 0;
+const doing = (x) => [x.decisions && count(x.decisions, 'decision', 'decisions'), x.sentBack && count(x.sentBack, 'sent back'), x.awaiting && count(x.awaiting, 'to verify'), x.pending && count(x.pending, 'question', 'questions'), x.holds && count(x.holds, 'lane held', 'lanes held'), x.building && count(x.building, 'building')].filter(Boolean).join(' · ') || (x.open ? count(x.open, 'item open', 'items open') : 'nothing open');
// The item lifecycle as pullboard declares it in src/machine.js, embedded when the page is served.
const FLOW = ${JSON.stringify(lifecycle()).replaceAll('<', '\\u003c')};
diff --git a/src/serve.js b/src/serve.js
index bc7d5bb1..66713d90 100644
--- a/src/serve.js
+++ b/src/serve.js
@@ -64,6 +64,8 @@ function summary(project) {
verified: count((item) => item.item_status === 'verified'),
pending,
holds: store.laneHolds(board).length,
+ // Asks still waiting for an answer need the person as much as a verdict does (B21).
+ decisions: store.openDecisions(board).length,
};
});
} catch (error) {
diff --git a/test/cockpit.test.js b/test/cockpit.test.js
index 2ded0f7f..a8046b73 100644
--- a/test/cockpit.test.js
+++ b/test/cockpit.test.js
@@ -662,6 +662,32 @@ test('the tab title says what needs you [N26]', async () => {
await nobody.stop();
}
});
+test('an open decision counts in the sidebar and the tab title [B21, N26]', async () => {
+ const box = machine();
+ const alpha = project(box, 'alpha');
+ const beta = project(box, 'beta');
+ box.run(beta.web, 'shout', 'coordinator', 'Ship beta today?', '--decision');
+ const view = await startView(box);
+ try {
+ const page = await openPage(view);
+ const rows = () => projectRows(page.show('proj-list')).map((row) => [row.name, row.needs, row.line]);
+ assert.deepEqual(rows(), [['alpha', '', 'nothing open'], ['beta', '1', '1 decision']], "beta's ask needs the person, from alpha too");
+ assert.equal(page.run('document.title'), '(1) alpha · Pullboard');
+ assert.equal(page.element('proj-elsewhere').textContent, '1 elsewhere', 'and on a phone');
+
+ box.run(beta.web, 'shout', 'coordinator', 'And the docs?', '--decision');
+ await page.run('refresh()');
+ assert.deepEqual(rows()[1], ['beta', '2', '2 decisions']);
+ box.run(beta.repo, 'answer', '1', 'yes');
+ box.run(beta.repo, 'answer', '2', 'after');
+ await page.run('refresh()');
+ assert.deepEqual(rows(), [['alpha', '', 'nothing open'], ['beta', '', 'nothing open']], 'answered, they need no one');
+ assert.equal(page.run('document.title'), 'alpha · Pullboard');
+ assert.equal(page.element('proj-elsewhere').hidden, true);
+ } finally {
+ await view.stop();
+ }
+});
test('each row says what it waits on [N26]', async () => {
const box = machine();
const lanes = { web: { owns: ['web/'], specs: ['G'] }, api: { owns: ['api/'], specs: ['G'] } };