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
test(search): capture timeout state [N26]
Corey Olson311a9ec74066
diff --git a/test/cockpit/search.test.js b/test/cockpit/search.test.jsindex 69f111df..581d3fcd 100644--- a/test/cockpit/search.test.js+++ b/test/cockpit/search.test.js@@ -7,6 +7,35 @@ import { join } from 'node:path';import { test } from 'node:test';import { SPEC, machine, project, startView, chromeExecutable, openSnapshotChrome, closeSnapshotChrome, searchFor, press } from './fixture.js';+/** Capture the current search page and its last real board-state request without exposing the session key. */+async function searchSetupState(chrome) {+ const caughtAt = new Date().toISOString();+ const requests = chrome.requests.filter(({ method, url }) => {+ let path;+ try { path = new URL(url).pathname; } catch { return false; }+ return method === 'GET' && /^\/api\/v1\/boards\/[^/]+\/state$/.test(path);+ });+ const last = requests.at(-1);+ let page = null, captureError = null;+ try {+ page = JSON.parse(await chrome.stable(`JSON.stringify({+ project: typeof data === 'object' && data?.project ? { root: data.project.root, name: data.project.name ?? null } : null,+ itemCount: typeof data === 'object' && Array.isArray(data?.project?.items) ? data.project.items.length : null+ })`));+ } catch (error) {+ captureError = `${error.name}: ${error.message}`;+ }+ return {+ caughtAt,+ pageObservedAt: new Date().toISOString(),+ project: page?.project ?? null,+ itemCount: page?.itemCount ?? null,+ lastStateRequest: last ? { method: last.method, path: new URL(last.url).pathname } : null,+ captureError,+ rootCauseStatus: 'NOT PROVEN',+ };+}+/** Commit between actual Git reads, preserving each real command's output and exit status. */function interleavedAges(file, when) {const box = machine();@@ -428,7 +457,25 @@ test('the search step names its state on timeout [N26]', { timeout: 60_000 }, asconst record = (error) => JSON.parse(error.message.slice(error.message.indexOf('{')));try {chrome = await openSnapshotChrome(executable, view.link.href, profile);- await chrome.waitFor("typeof data === 'object' && data?.project?.items?.length === 1");+ try {+ await chrome.waitFor("typeof data === 'object' && data?.project?.items?.length === 1");+ } catch (error) {+ // Snapshot the request list before the asynchronous page observation; never replace the wait failure.+ let capture;+ try {+ capture = await searchSetupState(chrome);+ } catch (captureError) {+ capture = {+ caughtAt: new Date().toISOString(), pageObservedAt: null,+ project: null, itemCount: null, lastStateRequest: null,+ captureError: `${captureError.name}: ${captureError.message}`,+ rootCauseStatus: 'NOT PROVEN',+ };+ }+ error.diagnostic = capture;+ error.message += `; search setup state observed after timeout ${JSON.stringify(capture)}`;+ throw error;+ }// A field that takes no typing: the step times out, and its message says how far the search got.await chrome.stable("document.querySelector('#q').disabled = true");let stalled;