From 79ca475ca3929182240aec5223c482eb994bcc8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Sun, 8 Nov 2026 23:18:12 +0100 Subject: [PATCH 1/3] test(missions): upload the redacted schedule state with product failures The native schedule product qualification recently timed out intermittently in natural-cold-first-admission on the minimum runtime (PRs #1399 and #1400 on the same dev commit, while another variant passed in 1.4 s with the same bundle). The uploaded diagnostic records the stage and error but not the persisted schedule state, so a missed native wake, a carrier/transport failure and incomplete admission bookkeeping cannot be told apart. The fixture already captures failure-sql.json on failure. Apply the existing redactor to its strings, bound it to 512 KiB, and add it to the uploaded failure artifact. Assertions, deadlines, retries and product behaviour are unchanged. Forced failure-path copies with real SQLite produced redacted missed-wake, carrier and bookkeeping snapshots and a valid bound marker for oversized output; workflow/policy tests pass. --- .github/workflows/pr-build.yml | 1 + scripts/test-native-mission-schedule-product.mjs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build.yml b/.github/workflows/pr-build.yml index f9dbca67dc..3dae710718 100644 --- a/.github/workflows/pr-build.yml +++ b/.github/workflows/pr-build.yml @@ -288,6 +288,7 @@ jobs: path: | ${{ env.NATIVE_SCHEDULE_PRODUCT_FIXTURE }}/**/receipt.json ${{ env.NATIVE_SCHEDULE_PRODUCT_FIXTURE }}/**/failure-diagnostic.json + ${{ env.NATIVE_SCHEDULE_PRODUCT_FIXTURE }}/**/failure-sql.json if-no-files-found: ignore retention-days: 7 - name: Upload isolated schedule foundation failure diagnostics diff --git a/scripts/test-native-mission-schedule-product.mjs b/scripts/test-native-mission-schedule-product.mjs index 728b6083f9..f6c001f3eb 100644 --- a/scripts/test-native-mission-schedule-product.mjs +++ b/scripts/test-native-mission-schedule-product.mjs @@ -640,7 +640,10 @@ export default Plugin.define({id:"codenomad.product-provider-observer",effect:ct const detail = item => item && { name: redact(item.name), type: redact(item.type ?? item._tag), message: redact(item.message), stack: redact(item.stack) } result.status = "failed"; result.error = redact(error?.message ?? "qualification-failed") await save("failure-diagnostic", { stage: result.stage, error: detail(error), reason: detail(error?.reason), cause: detail(error?.cause), nativeErrorTail: redact(nativeErrorTail) }) - if (result.documentID) try { await save("failure-sql", snapshot(result.documentID)) } catch { /* Preserve the original failure. */ } + if (result.documentID) try { + const json = JSON.stringify(snapshot(result.documentID), (_key, value) => typeof value === "string" ? redact(value) : value) + await writeFile(path.join(root, "failure-sql.json"), Buffer.byteLength(json) <= 512 * 1024 ? json : '{"error":"failure-sql-bound"}') + } catch { /* Preserve the original failure. */ } throw Error(`Native product qualification failed at ${result.stage ?? "setup"}: ${result.error}; private redacted diagnostic saved`) } finally { From 015643d6c5e31f4b277ac2ec6b57d0b994b1182c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Mon, 9 Nov 2026 10:47:31 +0100 Subject: [PATCH 2/3] test(setup): scope executable-change reads to the status endpoint The executable-change fencing fixture counted every API request, allowing independent authentication or event reads to inflate the expected two status reads and overwrite the held response callback. Match the exact GET status endpoint before holding or counting it, following the neighboring coalescing test. Exercise an independent authentication request while retaining both stale-display assertions and the exact two-read assertion. Adding that request fails on the old handler and passes with the scoped handler; all 34 setup browser checks pass. The CI log does not identify the third request, so its exact identity remains unproven. No production logic or deadlines change. --- packages/ui/tests/browser/opencode-setup.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/ui/tests/browser/opencode-setup.test.ts b/packages/ui/tests/browser/opencode-setup.test.ts index e5236e3239..1a262056ce 100644 --- a/packages/ui/tests/browser/opencode-setup.test.ts +++ b/packages/ui/tests/browser/opencode-setup.test.ts @@ -791,6 +791,9 @@ test("changing executable fences an old read and its queued follow-up", async () const page = await browser.newPage() let hold = false, changed = false, release!: () => void, reads = 0 await page.route("**/api/**", async route => { + if (route.request().method() !== "GET" || new URL(route.request().url()).pathname !== "/api/opencode/update") { + return route.fulfill({ json: healthyStatus }) + } const status = { ...healthyStatus, binaryPath: changed ? "new-opencode" : "old-opencode", serviceState: changed ? "stopped" : "ready" } if (hold) { reads++; await new Promise(resolve => { release = resolve }) } else if (reads) reads++ @@ -811,6 +814,8 @@ test("changing executable fences an old read and its queued follow-up", async () release() await oldRead await page.evaluate(() => new Promise(resolve => setTimeout(resolve, 30))) + // Authentication reads must not count as status checks or overwrite the held read. + await page.evaluate(() => fetch("/api/auth/status")) assert.equal(await page.getByText("old-opencode", { exact: true }).count(), 0) assert.equal(await page.getByText("OpenCode is connected.", { exact: true }).count(), 0) assert.equal(reads, 2) From 280a03211a5d1e2226509473187127fd348fdb94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20Andr=C3=A9?= Date: Mon, 9 Nov 2026 12:54:48 +0100 Subject: [PATCH 3/3] test(integrations): freeze consent clocks without a running-clock race The removal consent test installed an advancing clock and then paused it at the installation instant. Scheduling between those calls can put the requested pause in the past. Use the public pauseAt operation directly at all three consent-clock sites; it installs the clock itself. A 20 ms scheduling-gap control reproduces the original failure and passes after removing the redundant install. No artificial gap is shipped, and all 499/600 ms consent, duplicate-dispatch and no-detach assertions remain unchanged. The complete validation also reproduces an independent Cancel-focus assertion failure on the unmodified base. Kobalte schedules initial focus on a zero-delay task, so wait for that exact button to become active before retaining the original focus assertion. All 86 attachment-action and installation checks pass with the exact head dependency graph. No production code or deadline changes. --- .../ui/tests/browser/integration-attachment-actions.test.ts | 1 - .../ui/tests/browser/integration-attachment-install.test.ts | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/ui/tests/browser/integration-attachment-actions.test.ts b/packages/ui/tests/browser/integration-attachment-actions.test.ts index ab26f81164..6cdfa1e3d9 100644 --- a/packages/ui/tests/browser/integration-attachment-actions.test.ts +++ b/packages/ui/tests/browser/integration-attachment-actions.test.ts @@ -67,7 +67,6 @@ test(`AC-C5 ${dismissal} cancels and restores the exact Status opener at ${width test("AC-C5 attachment rejects activation below 500ms and admits one double-click after 600ms", async () => { await withAttachment(async ({ page, model, calls }) => { const time = new Date("2026-11-03T12:00:00Z") - await page.clock.install({ time }) await page.clock.pauseAt(time) await launch(page) const confirm = picker(page).getByRole("button", { name: "Attach", exact: true }) diff --git a/packages/ui/tests/browser/integration-attachment-install.test.ts b/packages/ui/tests/browser/integration-attachment-install.test.ts index 48ddf668d5..c5780fa648 100644 --- a/packages/ui/tests/browser/integration-attachment-install.test.ts +++ b/packages/ui/tests/browser/integration-attachment-install.test.ts @@ -34,6 +34,7 @@ test("AC-C15 sessionless install/update needs fresh active native status and a p const dialog = await launchInstallation(page, name) assert.match(await dialog.innerText(), /Blender.*OpenCode for Blender 1\.2\.3/s) assert.match(await dialog.innerText(), /machine where OpenCode runs/) + await page.waitForFunction(element => element === document.activeElement, await dialog.getByRole("button", { name: "Cancel", exact: true }).elementHandle()) assert.equal(await dialog.getByRole("button", { name: "Cancel", exact: true }).evaluate(el => el === document.activeElement), true) await dialog.getByRole("button", { name: "Cancel", exact: true }).click() } @@ -77,7 +78,6 @@ test("AC-C5/C15 installer rejects sub-500ms activation and admits exactly one do await withAttachment(async ({ page, model, calls }) => { await installationReady(page, model) const time = new Date("2026-11-03T12:00:00Z") - await page.clock.install({ time }) await page.clock.pauseAt(time) const dialog = await launchInstallation(page) const confirm = dialog.locator("button.button-primary") @@ -255,7 +255,6 @@ async function launchRemoval(page: Page, surface: "plugins" | "section", guarded const item = page.getByRole("menuitem", { name: "Remove from Global", exact: true }) if (guardedClock) { const time = new Date("2026-11-03T12:00:00Z") - await page.clock.install({ time }) await page.clock.pauseAt(time) // Kobalte selects on pointer-up/Enter, then closes its menu on a zero-delay timer. await item.press("Enter")