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.

test: expose the default spec view row [N26]

Corey Olson4f01dc5ba39c
diff --git a/test/cockpit/perf.test.js b/test/cockpit/perf.test.js
index 6e5e04a1..324bd4af 100644
--- a/test/cockpit/perf.test.js
+++ b/test/cockpit/perf.test.js
@@ -27,6 +27,10 @@ test('the perf harness measures every action on a stress board [N26]', async (t)
assert.ok(Object.values(first.laneTotals).every((count) => count > 0), 'all four measured lanes are represented');
assert.ok(first.itemEvents > 150, 'the generated board contains long item histories');
assert.ok(first.shoutCount > 0 && first.milestoneRows > 0 && first.specRows > 0, 'the generated board covers feeds, roadmap and spec data');
+ assert.equal(first.specStatusTotals.draft, 1, 'one draft row is visible under the spec tab default filter');
+ assert.equal(first.specStatusTotals.approved, first.specRows - 1, 'the remaining generated spec rows stay approved');
+ assert.equal(Object.values(first.specStatusTotals).reduce((sum, count) => sum + count, 0), first.specRows,
+ 'the spec status distribution matches the generated row count');
const report = await run({ board: first, runs: 1, idleMs: 30_000, liveEveryMs: 5_000 });
t.diagnostic(JSON.stringify({ performanceReport: report }));
diff --git a/test/cockpit/perf/README.md b/test/cockpit/perf/README.md
index c567e111..46b18a4b 100644
--- a/test/cockpit/perf/README.md
+++ b/test/cockpit/perf/README.md
@@ -8,6 +8,6 @@ node test/cockpit/perf/run.mjs --seed pullboard-perf-606 --size 3000 --runs 5 --
The harness holds the shared browser-capable gate slot across fixture setup and measurement, creates a disposable board and machine home, starts the normal local view server, and uses an isolated real Chrome profile with real pointer and keyboard input. It measures first load, each cockpit tab, opening a small item and the longest-history item, search typing, and a 30-second idle interval while one board API writer adds a shout every five seconds. It reports each action's median and worst stable-paint time, counts Long Tasks longer than 50ms, and records resource request sizes. Unsupported Long Task observation is reported as unavailable rather than as zero tasks. The harness records measurements without applying a performance pass/fail threshold.
-The default size follows the measured 605-item board shape and scales its status mix, long histories, event stream, agents, roadmap and spec rows. The named test uses 150 items to check deterministic generation and action coverage; it does not assert timing values. Use the reported output as a measurement of the specific machine and run conditions, not as a guarantee for other environments.
+The default size follows the measured 605-item board shape and scales its status mix, long histories, event stream, agents, roadmap and spec rows. The generated spec keeps one draft row visible under the cockpit's default "Needs your decision" filter and the remaining rows approved; the status distribution appears in the board manifest and performance report. The named test uses 150 items to check deterministic generation and action coverage; it does not assert timing values. Use the reported output as a measurement of the specific machine and run conditions, not as a guarantee for other environments.
The generated board, home, machine state and browser profile are temporary after a successful run. Use `--keep` to retain the generated board for inspection; local view keys are kept in process memory and are not included in output. A failed run retains its private board, browser profile and failure summary for diagnosis.
diff --git a/test/cockpit/perf/generate.mjs b/test/cockpit/perf/generate.mjs
index 6a2f9d18..8fab01f8 100644
--- a/test/cockpit/perf/generate.mjs
+++ b/test/cockpit/perf/generate.mjs
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
import { basename, dirname, join, resolve } from 'node:path';
import { spawnSync } from 'node:child_process';
import { loadDoctrine } from '../../../src/doctrine.js';
-import { frozenCriterion, loadSpec } from '../../../src/spec.js';
+import { STATUSES, frozenCriterion, loadSpec } from '../../../src/spec.js';
import {
ACCEPT_REASON, addItem, addMilestone, allShouts, appendFact, claim, closeBoard,
ensureCoordinator, events, listAgents, listItems, milestones, openBoard, recordAttempt,
@@ -66,11 +66,11 @@ function cleanEnvironment() {
return Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith('PULLBOARD_')));
}
-/** Build an approved spec whose row count scales with the generated board size. */
+/** Build a spec whose row count scales with board size and whose first draft appears in the default view. */
function specText(seed, size) {
const count = Math.max(5, Math.round(size * 250 / 605));
const rows = Array.from({ length: count }, (_, index) =>
- `- P${index + 1} [approved, must] ${textOf(seed, `Spec row ${index + 1}`, 68)} | gate: none`);
+ `- P${index + 1} [${index === 0 ? 'draft' : 'approved'}, must] ${textOf(seed, `Spec row ${index + 1}`, 68)} | gate: none`);
return `# Generated stress board\n\n## P · Performance fixtures\n${rows.join('\n')}\n`;
}
@@ -316,6 +316,7 @@ export function generateStressBoard({ seed = 'pullboard-perf-606', size = 150, p
const actualItems = listItems(board, { all: true });
const statusTotals = Object.fromEntries(STATUS_NAMES.map((name) => [name, actualItems.filter((item) => item.item_status === name).length]));
const actualLaneTotals = Object.fromEntries(LANES.map((lane) => [lane, actualItems.filter((item) => item.item_lane === lane).length]));
+ const specStatusTotals = Object.fromEntries(STATUSES.map((status) => [status, spec.rows.filter((row) => row.status === status).length]));
if (JSON.stringify(statusTotals) !== JSON.stringify(Object.fromEntries(STATUS_NAMES.map((name) => [name, statuses.filter((status) => status === name).length])))) {
throw new Error('the generated board lifecycle does not match its planned state counts');
}
@@ -323,7 +324,7 @@ export function generateStressBoard({ seed = 'pullboard-perf-606', size = 150, p
const manifest = { version: 1, seed, size, digest: boardDigest, root, home, machineHome, boardFile, parent: resolve(parent),
smallItemId, smallItemTitle, longestHistoryItemId, longestHistoryTitle, liveWriter: agents.writer, itemEvents, shoutCount,
milestoneCount, milestoneRows: rowCount, specRows: Math.max(5, Math.round(size * 250 / 605)), statusTotals, laneTotals: actualLaneTotals,
- agentCount: listAgents(board).length };
+ specStatusTotals, agentCount: listAgents(board).length };
writeFileSync(join(workspace, 'stress-board.json'), `${JSON.stringify(manifest, null, 2)}\n`, { mode: 0o600 });
keepWorkspace = true;
return { ...manifest, workspace, env };
diff --git a/test/cockpit/perf/run.mjs b/test/cockpit/perf/run.mjs
index 559590a1..8f4a215c 100644
--- a/test/cockpit/perf/run.mjs
+++ b/test/cockpit/perf/run.mjs
@@ -522,7 +522,7 @@ async function runPerfHarnessInSlot({ board, runs = 1, idleMs = 30_000, liveEver
gate: { browser: lease.browser === true, waitMs: lease.waitMs },
boardShape: { statuses: board.statusTotals, lanes: board.laneTotals, agents: board.agentCount,
itemEvents: board.itemEvents, shouts: board.shoutCount, milestones: board.milestoneCount,
- milestoneRows: board.milestoneRows, specRows: board.specRows }, runs, idleMs, liveEveryMs,
+ milestoneRows: board.milestoneRows, specRows: board.specRows, specStatuses: board.specStatusTotals }, runs, idleMs, liveEveryMs,
browser: { input: 'real Chrome through CDP', executable, versions: captured.map(run => run.browserVersion) },
actions, table: renderTable(actions) };
writeFileSync(join(board.workspace, 'performance-report.json'), `${JSON.stringify(report, null, 2)}\n`, { mode: 0o600 });