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.

fix(view): view files never quote the owner or name a machine [N26]

Corey Olsonffbccecd89f0
diff --git a/test/cockpit/items.test.js b/test/cockpit/items.test.js
index d08fdc92..3eb90998 100644
--- a/test/cockpit/items.test.js
+++ b/test/cockpit/items.test.js
@@ -1107,7 +1107,7 @@ test('list rows hold their shape: one-line titles end in an ellipsis, every row
const config = JSON.parse(readFileSync(configPath, 'utf8'));
config.agents = { names: 'prefix' };
writeFileSync(configPath, JSON.stringify(config, null, 2));
- box.run(demo.web, 'join', 'web', '--model', 'claude-opus-designer-on-the-studio');
+ box.run(demo.web, 'join', 'web', '--model', 'claude-opus-designer-on-a-long-review-model-name');
await chrome.stable('refresh()');
for (const width of [375, 1280]) {
await chrome.send('Emulation.setDeviceMetricsOverride', { width, height: 900, deviceScaleFactor: 1, mobile: false });
diff --git a/test/cockpit/open-board.test.js b/test/cockpit/open-board.test.js
index 2875565d..63bc4809 100644
--- a/test/cockpit/open-board.test.js
+++ b/test/cockpit/open-board.test.js
@@ -268,7 +268,7 @@ test('each open-board state shows alone with its words [N26,H5]', { timeout: 150
assert.deepEqual(absent.live, ['Still looking on this computer'], 'a live line says the page keeps looking');
// A request waiting for the person on this device, as relay/browser-devices.js puts in the page, is never hidden
// behind a screen: it stays where they can answer it.
- assert.equal(await chrome.stable("(() => { const panel = document.createElement('section'); panel.id = 'phone-approvals'; panel.className = 'card-panel'; panel.textContent = 'Link notes from studio?'; document.querySelector('main').prepend(panel); const shown = panel.getClientRects().length > 0; panel.remove(); return shown; })()"), true, 'a waiting request on this device shows beside the screen');
+ assert.equal(await chrome.stable("(() => { const panel = document.createElement('section'); panel.id = 'phone-approvals'; panel.className = 'card-panel'; panel.textContent = 'Link notes from this device?'; document.querySelector('main').prepend(panel); const shown = panel.getClientRects().length > 0; panel.remove(); return shown; })()"), true, 'a waiting request on this device shows beside the screen');
await pressCopy(chrome, '#local-note .ob-cmd button', 'pullboard view');
// Pullboard on this computer speaks another version of the page's protocol: one command updates it, and a dashed
diff --git a/test/cockpit/privacy-scan.test.js b/test/cockpit/privacy-scan.test.js
new file mode 100644
index 00000000..9a4c19f1
--- /dev/null
+++ b/test/cockpit/privacy-scan.test.js
@@ -0,0 +1,36 @@
+/** @pullboard-test-input test-tree */
+/** @pullboard-test-input source-tree */
+/** View files never quote the owner or name a private machine, and this scan keeps it that way [N26]. */
+import assert from 'node:assert/strict';
+import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
+import { join, resolve } from 'node:path';
+import { test } from 'node:test';
+
+const ROOT = resolve(import.meta.dirname, '../..');
+const SELF = 'test/cockpit/privacy-scan.test.js';
+// The view lane's paths, as `pullboard lanes` prints them.
+const VIEW = ['src/cockpit.js', 'src/serve.js', 'src/view.css', 'src/view', 'test/cockpit.test.js', 'test/cockpit', 'test/journeys.test.js'];
+// Names written in pieces so this file never contains them whole; the scan also finds the pieces joined.
+const NAMES = [['Stu', 'dio'], ['Mac', 'Book'], ['M', 'BP'], ['Cor', 'ey'], ['ol', 'son']].map(parts => parts.join(''));
+const PATTERN = new RegExp(`\\b(?:${NAMES.join('|')})\\b|\\(the person,`, 'iu');
+
+/** Every file under a view-lane path, recursively, in a stable order; a missing path has none. */
+function filesUnder(path) {
+ const full = join(ROOT, path);
+ if (!existsSync(full)) return [];
+ if (statSync(full).isFile()) return [path];
+ return readdirSync(full).sort().flatMap(name => filesUnder(join(path, name)));
+}
+
+test('view files never quote the owner or name a private machine [N26]', () => {
+ const scanned = VIEW.flatMap(filesUnder).filter(path => path !== SELF && /\.(?:m?js|css)$/u.test(path));
+ assert.ok(scanned.length >= 50, `the scan reads the whole view lane, not ${scanned.length} files`);
+ const found = [];
+ for (const path of scanned) {
+ readFileSync(join(ROOT, path), 'utf8').split('\n').forEach((line, index) => {
+ if (PATTERN.test(line)) found.push(`${path}:${index + 1}`);
+ });
+ }
+ assert.deepEqual(found, [], 'remove the attribution or machine name from these lines; reword it so the comment still explains why');
+ assert.ok(PATTERN.test('on the ' + NAMES[0]) && PATTERN.test('(the person, 18 Oct)'), 'the pattern catches each kind of mention');
+});