From c44b692a4f6230569abc510f9a5195a46de842e8 Mon Sep 17 00:00:00 2001 From: Pedro Brito <74918167+pedrobritx@users.noreply.github.com> Date: Mon, 26 Oct 2026 18:32:19 -0300 Subject: [PATCH] Wait for initial companion restoration before visual capture --- docs/CI_RELIABILITY.md | 26 ++++++++++++++++++++++++++ outputs/verification.json | 33 +++++++++++++++++++++++++++++++++ tests/browser/visual.spec.mjs | 9 ++++----- 3 files changed, 63 insertions(+), 5 deletions(-) diff --git a/docs/CI_RELIABILITY.md b/docs/CI_RELIABILITY.md index d2bfbf4..2408703 100644 --- a/docs/CI_RELIABILITY.md +++ b/docs/CI_RELIABILITY.md @@ -89,6 +89,32 @@ records three-engine deployed browser/local-companion dry-run success for merged main `18abe0a`. It supersedes the interactive automated-acceptance gap above; real installation and human checks remain open. +## Companion restoration readiness — 26 October 2026 + +Merged-main `67d334b` passed Chromium, Firefox, native dry-run and lint checks, +but [WebKit CI](https://github.com/pedrobritx/mac-setup/actions/runs/40402855500/job/121852965633) +passed 25/26 cases and timed out finding the Essentials radio in the companion +capture. The [retained trace](https://github.com/pedrobritx/mac-setup/actions/runs/40402855500/artifacts/12690630070) +shows `Return to choices.isVisible()` returning false while startup restoration +was still rendering. The actual `/api/state` payload was a completed dry run; +the final snapshot shows its progress view with Return to choices visible. + +The session banner is populated before the initial state is applied. An eager +visibility probe can therefore skip returning to choices, then wait forever on +radios hidden by the restored progress view. The capture now registers the +initial state-response wait before navigation, branches on its real status and +lets the return-button click wait for rendering. An idle companion remains on +choices. Application behaviour, assertions and the 60-second test budget are +unchanged. + +Local Chromium validation passed three controlled delayed-state probes and three +real companion capture runs, covering idle and previously completed state. The +controlled old branch skipped the return action and could not check the hidden +radio; the response-based branch restored choices. These diagnostic fixtures +were not added to product code. Firefox/WebKit were unavailable locally; hosted +revalidation is required. This evidenced race is separate from the unreproduced +historical PR #8 timeout. + ## Evidence links - [Historical failed PR workflow](https://github.com/pedrobritx/mac-setup/actions/runs/39888755209) diff --git a/outputs/verification.json b/outputs/verification.json index 3bf1793..9d1c9b5 100644 --- a/outputs/verification.json +++ b/outputs/verification.json @@ -322,5 +322,38 @@ "timedOut": 1, "boundary": "screenshot capture at the 60-second journey deadline" } + }, + "companionRestoreReadinessFollowUp": { + "verifiedDate": "2026-10-26", + "testedBaseCommit": "67d334bfa8fa0f91154557a44396afb04bf3b47a", + "failedMainCI": "https://github.com/pedrobritx/mac-setup/actions/runs/40402855500", + "failedWebkitJob": 121852965633, + "retainedFailureArtifact": 12690630070, + "traceRestoredStatus": "complete", + "traceEagerReturnVisibility": false, + "cause": "Session banner precedes initial run restoration; eager visibility skipped Return to choices and later waited on hidden radios.", + "fix": "Wait for initial /api/state response, branch on actual status, and auto-wait for return-button rendering.", + "localChromium": { + "controlledDelayedStateProbes": 3, + "realCompanionCaptures": 3, + "allPassed": true, + "retries": 0 + }, + "testTimeoutMsUnchanged": 60000, + "applicationCodeChanged": false, + "localWebkitAvailable": false, + "localFirefoxAvailable": false, + "liveProbeFor67d334b": { + "assetEqualityPassed": 7, + "interactiveCasesPassed": 0, + "interactiveCasesBlocked": 2, + "error": "net::ERR_CERT_AUTHORITY_INVALID in local proxied Chromium", + "httpsVerificationDisabled": false + }, + "realInstallationPerformed": false, + "humanAcceptancePerformed": false, + "sourceSha256": { + "tests/browser/visual.spec.mjs": "585f0a467e53365f3286eef19a70be0e5ef8e485478b0824ade92e7931c3b574" + } } } diff --git a/tests/browser/visual.spec.mjs b/tests/browser/visual.spec.mjs index 14182b2..474a2d5 100644 --- a/tests/browser/visual.spec.mjs +++ b/tests/browser/visual.spec.mjs @@ -43,15 +43,14 @@ test("capture the real catalogue, mobile layout and review", async ({ }); test("capture a completed isolated companion preview", async ({ page }) => { + // The session banner precedes restored-run rendering. Decide from the actual + // startup response, then let click wait for the restored view when needed. + const initialState = page.waitForResponse("http://127.0.0.1:3420/api/state"); await page.goto("http://127.0.0.1:3420/#session=browser-test-session-only"); await expect( page.getByText("Local companion · Dry-run preview", { exact: true }), ).toBeVisible(); - if ( - await page - .getByRole("button", { name: "Return to choices", exact: true }) - .isVisible() - ) { + if ((await (await initialState).json()).status !== "idle") { await page .getByRole("button", { name: "Return to choices", exact: true }) .click();