From b358d882deb88738d1704ac26dd26f1219087bfa Mon Sep 17 00:00:00 2001 From: Pedro Brito <74918167+pedrobritx@users.noreply.github.com> Date: Sun, 25 Oct 2026 00:52:02 -0300 Subject: [PATCH 1/4] test: add deployed-site acceptance and isolated handoff rehearsal --- package.json | 6 +- playwright.production.config.mjs | 65 +++++++++++++ tests/acceptance/production.spec.mjs | 137 +++++++++++++++++++++++++++ 3 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 playwright.production.config.mjs create mode 100644 tests/acceptance/production.spec.mjs diff --git a/package.json b/package.json index 2bfcde8..409779b 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,10 @@ "test:browser": "playwright test", "test:browser:all": "playwright test --browser=all", "test:motion:record": "MAC_SETUP_RECORD_VIDEO=1 playwright test tests/browser/motion.spec.mjs", - "format": "prettier --write docs/*.html docs/assets/*.{css,mjs} config/web-catalog.json tests/*.mjs tests/browser/*.mjs playwright.config.mjs package.json", - "check:format": "prettier --check docs/*.html docs/assets/*.{css,mjs} config/web-catalog.json tests/*.mjs tests/browser/*.mjs playwright.config.mjs package.json" + "test:production": "playwright test --config=playwright.production.config.mjs", + "test:production:local": "MAC_SETUP_SITE_URL=http://127.0.0.1:3419/ playwright test --config=playwright.production.config.mjs", + "format": "prettier --write docs/*.html docs/assets/*.{css,mjs} config/web-catalog.json tests/*.mjs tests/browser/*.mjs tests/acceptance/*.mjs playwright*.config.mjs package.json", + "check:format": "prettier --check docs/*.html docs/assets/*.{css,mjs} config/web-catalog.json tests/*.mjs tests/browser/*.mjs tests/acceptance/*.mjs playwright*.config.mjs package.json" }, "devDependencies": { "@axe-core/playwright": "4.14.0", diff --git a/playwright.production.config.mjs b/playwright.production.config.mjs new file mode 100644 index 0000000..369e7ee --- /dev/null +++ b/playwright.production.config.mjs @@ -0,0 +1,65 @@ +import { defineConfig } from "@playwright/test"; +import base from "./playwright.config.mjs"; + +const site = new URL( + process.env.MAC_SETUP_SITE_URL || "https://mac-setup.britx.me/", +); +const localOrigin = "http://127.0.0.1:3419"; +const productionOrigin = "https://mac-setup.britx.me"; +if ( + ![localOrigin, productionOrigin].includes(site.origin) || + site.pathname !== "/" || + site.search || + site.hash || + site.username || + site.password +) + throw new Error("Use the production origin or the isolated local rehearsal."); + +// An optional development proxy must not relax HTTPS certificate verification. +const proxy = process.env.MAC_SETUP_TEST_PROXY; +if (proxy) { + const url = new URL(proxy); + if ( + !["http:", "https:"].includes(url.protocol) || + url.username || + url.password || + url.pathname !== "/" || + url.search || + url.hash + ) + throw new Error( + "The test proxy must be an HTTP(S) URL without credentials.", + ); +} + +export default defineConfig({ + ...base, + testDir: "./tests/acceptance", + outputDir: "test-results/production", + reporter: [ + ["list", { printSteps: true }], + ["json", { outputFile: "test-results/production/results.json" }], + ["html", { outputFolder: "playwright-report/production", open: "never" }], + ], + metadata: { + target: site.origin, + mode: site.origin === localOrigin ? "local-rehearsal" : "production", + expectedCommit: + process.env.MAC_SETUP_EXPECTED_COMMIT || + process.env.GITHUB_SHA || + "working-tree", + proxied: Boolean(proxy), + }, + use: { + ...base.use, + baseURL: site.href, + ...(proxy + ? { proxy: { server: proxy, bypass: "127.0.0.1,localhost" } } + : {}), + }, + webServer: [ + ...(site.origin === localOrigin ? [base.webServer[0]] : []), + base.webServer[1], + ], +}); diff --git a/tests/acceptance/production.spec.mjs b/tests/acceptance/production.spec.mjs new file mode 100644 index 0000000..07bea01 --- /dev/null +++ b/tests/acceptance/production.spec.mjs @@ -0,0 +1,137 @@ +import { test, expect } from "@playwright/test"; +import { readFile } from "node:fs/promises"; + +const ready = (page) => + expect( + page.getByRole("radio", { name: "Essentials", exact: true }), + ).toBeVisible(); + +// Export from the real public UI; server-side validation happens at handoff. +async function exportPlan(page, testInfo) { + await page.goto("/"); + await ready(page); + await page.getByRole("searchbox").fill("Figma MCP"); + await page.getByRole("checkbox", { name: "Figma MCP", exact: true }).check(); + await page.getByRole("button", { name: "Review setup", exact: true }).click(); + await expect(page.locator("#continue-button")).toHaveText( + "Download plan & continue", + ); + const pending = page.waitForEvent("download"); + await page.locator("#continue-button").click(); + const download = await pending; + const file = testInfo.outputPath("production-plan.json"); + await download.saveAs(file); + const plan = JSON.parse(await readFile(file, "utf8")); + expect(Object.keys(plan)).toEqual([ + "schema", + "catalogVersion", + "profile", + "selected", + ]); + expect(plan.selected).toContain("mcp:figma"); + return { file, plan }; +} + +test("published pages and runtime assets match the checked-out deployment", async ({ + request, + baseURL, +}) => { + for (const asset of [ + "index.html", + "safety.html", + "assets/catalog.json", + "assets/liquid.mjs", + "assets/app.mjs", + ]) { + await test.step(asset, async () => { + const response = await request.get(new URL(asset, baseURL).href, { + headers: { "Cache-Control": "no-cache" }, + timeout: 15000, + }); + expect(response.status()).toBe(200); + expect(await response.body()).toEqual(await readFile("docs/" + asset)); + }); + } +}); + +test("the public site filters, exports, imports and opens Safety without installing", async ({ + page, +}, testInfo) => { + const errors = []; + const mutations = []; + page.on("pageerror", (error) => errors.push(error.message)); + page.on("request", (request) => { + if (!["GET", "HEAD"].includes(request.method())) + mutations.push({ method: request.method(), url: request.url() }); + }); + + await page.goto("/"); + await ready(page); + await page + .getByRole("button", { name: "Source All sources", exact: true }) + .click(); + await page.getByRole("option", { name: "App Store", exact: true }).click(); + await expect( + page.getByRole("checkbox", { name: "Slack", exact: true }), + ).toBeVisible(); + await expect( + page.getByRole("checkbox", { name: "Visual Studio Code", exact: true }), + ).toHaveCount(0); + + const { file, plan } = await exportPlan(page, testInfo); + await expect( + page.getByRole("heading", { name: "A small handoff to your Mac." }), + ).toBeVisible(); + await page.goto("/safety.html"); + await expect(page.locator("#main h1")).toContainText("Your Mac."); + await page.goto("/"); + await ready(page); + await page.locator("#plan-file").setInputFiles(file); + await expect( + page.getByRole("checkbox", { name: "Figma MCP", exact: true }), + ).toBeChecked(); + const persisted = JSON.parse( + await page.evaluate(() => localStorage.getItem("mac-setup.plan.v1")), + ); + expect(persisted.selected).toEqual(plan.selected); + expect(errors).toEqual([]); + expect(mutations).toEqual([]); +}); + +test("a public export completes only an isolated local dry run and downloads its report", async ({ + page, +}, testInfo) => { + const { file } = await exportPlan(page, testInfo); + await page.goto("http://127.0.0.1:3420/#session=browser-test-session-only"); + expect(new URL(page.url()).origin).toBe("http://127.0.0.1:3420"); + await expect( + page.getByText("Local companion · Dry-run preview", { exact: true }), + ).toBeVisible(); + await page.locator("#plan-file").setInputFiles(file); + await page.getByRole("button", { name: "Review setup", exact: true }).click(); + const start = page.getByRole("button", { + name: "Start dry-run preview", + exact: true, + }); + await expect(start).toBeDisabled(); + await page.locator("#confirm-install").check(); + await start.click(); + await expect( + page + .getByRole("region", { name: "Guided installation" }) + .getByText("Preview finished. No apps or preferences were changed.", { + exact: true, + }), + ).toBeVisible({ timeout: 40000 }); + await expect( + page.getByRole("heading", { name: "Figma MCP", exact: true }), + ).toBeVisible(); + const pending = page.waitForEvent("download"); + await page + .getByRole("button", { name: "Download install report", exact: true }) + .click(); + const report = await pending; + const reportFile = testInfo.outputPath("production-handoff-report.md"); + await report.saveAs(reportFile); + expect(await readFile(reportFile, "utf8")).toContain("**Mode:** dry-run"); +}); From 7550ab1224987df960c79cba0afba19cfc741c00 Mon Sep 17 00:00:00 2001 From: Pedro Brito <74918167+pedrobritx@users.noreply.github.com> Date: Sun, 25 Oct 2026 00:52:03 -0300 Subject: [PATCH 2/4] ci: add post-deploy checks and native macOS dry-run evidence --- .github/workflows/ci.yml | 29 +++++++ .github/workflows/production-smoke.yml | 51 ++++++++++++ tests/acceptance/native_macos.py | 108 +++++++++++++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 .github/workflows/production-smoke.yml create mode 100644 tests/acceptance/native_macos.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9969a8..fd62308 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,6 +63,8 @@ jobs: - run: npm test - run: npx playwright install --with-deps ${{ matrix.browser }} - run: npm run test:browser -- --browser=${{ matrix.browser }} + - name: Rehearse deployed-site acceptance locally + run: npm run test:production:local -- --browser=${{ matrix.browser }} - name: Preserve browser results and failure evidence if: always() uses: actions/upload-artifact@v4 @@ -73,3 +75,30 @@ jobs: playwright-report/ if-no-files-found: warn retention-days: 7 + + macos-dry-run: + name: Native macOS dry-run compatibility + runs-on: macos-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - run: npm run check:catalog + - run: npm test + - name: Check the system Bash and run isolated dry-run smoke checks + run: python3 tests/acceptance/native_macos.py + - name: Preserve native dry-run evidence + if: always() + uses: actions/upload-artifact@v4 + with: + name: native-macos-dry-run-${{ github.run_id }}-${{ github.run_attempt }} + path: test-results/native-macos/ + if-no-files-found: warn + retention-days: 7 diff --git a/.github/workflows/production-smoke.yml b/.github/workflows/production-smoke.yml new file mode 100644 index 0000000..db87f4f --- /dev/null +++ b/.github/workflows/production-smoke.yml @@ -0,0 +1,51 @@ +name: Deployed site acceptance + +on: + workflow_run: + workflows: ["pages build and deployment"] + types: [completed] + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +jobs: + production: + if: >- + github.event_name == 'workflow_dispatch' || + (github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.head_branch == 'main' && + github.event.workflow_run.head_repository.full_name == github.repository) + name: Live site and isolated dry run (${{ matrix.browser }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + browser: [webkit, chromium, firefox] + env: + MAC_SETUP_EXPECTED_COMMIT: ${{ github.event.workflow_run.head_sha || github.sha }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.workflow_run.head_sha || github.sha }} + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: npm + - run: npm ci --ignore-scripts + - run: npx playwright install --with-deps ${{ matrix.browser }} + - run: npm run test:production -- --browser=${{ matrix.browser }} + - name: Preserve deployed-site acceptance evidence + if: always() + uses: actions/upload-artifact@v4 + with: + name: deployed-site-${{ matrix.browser }}-${{ github.run_id }}-${{ github.run_attempt }} + path: | + test-results/production/ + playwright-report/production/ + if-no-files-found: warn + retention-days: 7 diff --git a/tests/acceptance/native_macos.py b/tests/acceptance/native_macos.py new file mode 100644 index 0000000..543d382 --- /dev/null +++ b/tests/acceptance/native_macos.py @@ -0,0 +1,108 @@ +"""Collect native dry-run evidence; never authorize a real installation.""" + +import argparse +import json +import os +from pathlib import Path +import platform +import subprocess +import tempfile + +ROOT = Path(__file__).resolve().parents[2] + + +def collect(output): + """Record only checks actually executed, including refusals and failures.""" + evidence = { + "platform": platform.system(), + "machine": platform.machine(), + "macOS": platform.mac_ver()[0], + "python": platform.python_version(), + "mode": "dry-run", + "realInstallationPerformed": False, + "status": "not_run", + "syntaxChecks": [], + "checks": [], + } + code = 0 + try: + if evidence["platform"] != "Darwin": + evidence["reason"] = "Native macOS is required for this evidence." + return 2 + evidence["sourceCommit"] = subprocess.check_output( + ["git", "rev-parse", "HEAD"], cwd=ROOT, text=True + ).strip() + evidence["worktreeDirty"] = bool(subprocess.check_output( + ["git", "status", "--porcelain"], cwd=ROOT, text=True + ).strip()) + evidence["systemBash"] = subprocess.check_output( + ["/bin/bash", "--version"], text=True + ).splitlines()[0] + evidence["status"] = "running" + scripts = subprocess.check_output( + ["git", "ls-files", "*.sh"], cwd=ROOT, text=True + ).splitlines() + for script in scripts: + result = subprocess.run( + ["/bin/bash", "-n", script], cwd=ROOT, timeout=60, check=False + ) + evidence["syntaxChecks"].append({ + "path": script, "exitCode": result.returncode, + }) + result.check_returncode() + with tempfile.TemporaryDirectory(prefix="mac-setup-native-qa-") as home: + # Do not inherit installer overrides from a developer's shell. + env = { + key: value for key, value in os.environ.items() + if not key.startswith("MAC_SETUP_") + } + env.update({ + "HOME": home, + "DRY_RUN": "1", + "MAC_SETUP_TEST": "1", + "MAC_SETUP_ROOT": str(ROOT), + "MAC_SETUP_STATE_DIR": str(Path(home) / "state"), + }) + for args in ( + ["--help"], ["--list"], ["--dry-run", "--yes"], + ["--dry-run", "--britx"], + ): + result = subprocess.run( + ["/bin/bash", "./install.sh", *args], + cwd=ROOT, env=env, timeout=60, check=False, + ) + evidence["checks"].append({ + "args": args, "exitCode": result.returncode, + }) + result.check_returncode() + evidence["status"] = "passed" + except (OSError, subprocess.SubprocessError) as error: + evidence["status"] = "failed" + evidence["error"] = str(error) + code = 1 + finally: + output.parent.mkdir(parents=True, exist_ok=True) + output.write_text(json.dumps(evidence, indent=2) + "\n") + print(f"Native acceptance evidence: {evidence['status']} — {output}") + summary = { + key: evidence[key] for key in ( + "platform", "machine", "macOS", "status", + "realInstallationPerformed", + ) + } + summary["syntaxCheckCount"] = len(evidence["syntaxChecks"]) + summary["smokeCheckCount"] = len(evidence["checks"]) + for key in ("sourceCommit", "error", "reason"): + if key in evidence: + summary[key] = evidence[key] + print(json.dumps(summary, sort_keys=True)) + return code + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument( + "--output", type=Path, + default=ROOT / "test-results/native-macos/summary.json", + ) + raise SystemExit(collect(parser.parse_args().output)) From 26811a9e5b511b811a3ea19215b23c6e319aa743 Mon Sep 17 00:00:00 2001 From: Pedro Brito <74918167+pedrobritx@users.noreply.github.com> Date: Sun, 25 Oct 2026 00:52:04 -0300 Subject: [PATCH 3/4] docs: record acceptance progress and human verification cases --- CONTRIBUTING.md | 5 ++ docs/ACCEPTANCE.md | 100 ++++++++++++++++++++++++++++++++++++++ outputs/verification.json | 39 +++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 docs/ACCEPTANCE.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a9ad74..1a3bff4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -86,6 +86,11 @@ If Docker is unavailable, record that limitation and the native Linux runtime versions. A Linux browser pass does not establish native macOS installation, real sudo/App Store behaviour, VoiceOver acceptance or production verification. +For live-site checks, isolated public-to-local handoff rehearsal, native macOS +dry-run evidence and the remaining human cases, use the +[acceptance guide](docs/ACCEPTANCE.md). Production checks have separate report +directories and keep HTTPS verification enabled. + Use `./web.sh --dry-run` for visual review. Keep installation tests in isolated homes/state directories and never apply a real setup to the developer's Mac. Browser plans are untrusted data: validate catalogue versions, prerequisites and diff --git a/docs/ACCEPTANCE.md b/docs/ACCEPTANCE.md new file mode 100644 index 0000000..f42fdf4 --- /dev/null +++ b/docs/ACCEPTANCE.md @@ -0,0 +1,100 @@ +# Acceptance evidence + +Use the tests below to distinguish deployed browser behaviour, native dry-run +compatibility and actual installation/human acceptance. A pass in one category +does not fill in the others. + +## Automated browser acceptance + +```bash +# Rehearse against local static files and an isolated dry-run companion. +npm run test:production:local -- --browser=all + +# Verify the live public site against this checkout, with the same isolated companion. +npm run test:production -- --browser=all +``` + +Use a checkout matching the deployed revision for live checks. The suite checks +the home/Safety pages, catalogue and runtime assets byte-for-byte; public source +filtering, plan export/import and Safety navigation; and a public export imported +into an isolated loopback companion. Starting its dry run requires confirmation, +and the downloaded report must explicitly identify dry-run mode. + +The suite starts its own test companion and refuses to reuse an existing server +on port 3420. It never connects to a person's running companion. Its only public +target is `https://mac-setup.britx.me/`; local rehearsal uses port 3419. +HTTPS verification stays enabled. An optional `MAC_SETUP_TEST_PROXY` is for +development environments with a trusted network proxy; it does not disable TLS +checks or accept credentials in the proxy URL. + +Prefer the Docker recipe in [CONTRIBUTING.md](../CONTRIBUTING.md), replacing its +last command with `npm run test:production:local -- --browser=all` as needed. +Reports are written under `test-results/production/` and +`playwright-report/production/`, separately from the existing browser suite. + +The normal CI matrix runs the local rehearsal on all three engines. The +`Deployed site acceptance` workflow is configured to run after a successful, +same-repository main-branch Pages workflow, and can also be dispatched manually. +It checks out the triggering deployment's source revision. The new workflow +must be merged to the default branch before its post-deployment trigger can be +verified; its configured trigger is not evidence that it has run. + +## Native macOS dry-run compatibility + +```bash +python3 tests/acceptance/native_macos.py +``` + +The native CI job and this command record the actual macOS version, architecture, +Python/system Bash versions, source commit, worktree state, Bash syntax checks +and four installer smoke commands. The smoke commands use an isolated temporary +home/state directory and explicitly enforce dry-run mode. Evidence is saved to +`test-results/native-macos/summary.json`, including a failure/refusal record. +On another OS the collector exits with code 2, records `not_run`, and executes +no installer checks. + +This evidence covers native command compatibility. It does not demonstrate a +fresh real installation, sudo/App Store approval or human accessibility. Run +installation acceptance on a disposable Mac or suitable isolated macOS VM. + +## Human and real-installation checklist + +Copy this table into a dated record for the exact source revision under review. +Leave every row unverified until the person performing it records what happened. +Keep credentials, recovery keys and private logs out of shared evidence. + +Environment/revision: ____________________ + +Reviewer/date: ____________________ + +| Case | Required observation | Status | Observed result / evidence | +| --- | --- | --- | --- | +| Fresh installation | Review a minimal plan, apply it on the disposable Mac, and compare installed results with the report. | Not run | | +| Idempotency | Repeat the same plan; satisfied actions skip and personal files remain intact. | Not run | | +| Sudo approval | Approve through Terminal and observe the selected operations only. | Not run | | +| Sudo cancellation | Cancel approval; verify the report and the actual unchanged system state. | Not run | | +| App Store signed out | Observe guidance or a truthful needs-attention outcome; no false success. | Not run | | +| Licensed/paid app | Use only an already-authorized entitlement; verify the outcome without making a purchase for this test. | Not run | | +| Vendor/MCP setup | Complete the requested connection with the account holder; record the outcome without tokens. | Not run | | +| VoiceOver | Navigate profiles, sources, details, review, handoff and progress; verify names, announcements and focus. | Not run | | +| Calm/reduced motion | Verify the native system preference and calm mode remain usable and readable. | Not run | | +| Safari / visual review | Inspect desktop/mobile layouts, contrast, floating summary and dialogs on actual supported browsers. | Not run | | +| Physical touch | Use real touch hardware for selections, scrolling and dismissal. | Not run | | +| Production performance | Measure fluid/calm frame behaviour on target hardware, recording conditions and measurements. | Not run | | +| Language review | A qualified reviewer checks meaning, terminology and truncation in each locale. | Not run | | +| Real production handoff | Export from the live site and complete the reviewed installation on the disposable Mac. | Not run | | + +## Evidence recorded in this follow-up + +- PR #9 merged at `508da303e135195e068d01900994f4336f2d0f9e`; its merged-main + CI and Pages deployment passed. +- Local rehearsal of this new suite passed all nine cases across WebKit, + Chromium and Firefox. +- The live Chromium suite passed all three cases, including the public export + and isolated companion dry run. The local managed-network CA was trusted in + a temporary browser profile; TLS validation was not disabled. +- The native collector's Linux refusal was executed and checked: exit 2, + `not_run`, no installer checks. Actual Darwin results belong to the native + CI artifact for the tested commit; they cannot be inferred from Linux. +- The historical motion timeout remains unreproduced. New acceptance coverage + does not retrospectively establish its internal cause. diff --git a/outputs/verification.json b/outputs/verification.json index bdda488..f848fd7 100644 --- a/outputs/verification.json +++ b/outputs/verification.json @@ -190,5 +190,44 @@ "allMatchMergedMainBytes": true, "interactiveAcceptancePerformed": false } + }, + "acceptanceFollowUp": { + "verifiedDateBrasilia": "2026-10-25", + "testedBaseCommit": "508da303e135195e068d01900994f4336f2d0f9e", + "mergedMainCi": "https://github.com/pedrobritx/mac-setup/actions/runs/40157941636", + "mergedMainCiConclusion": "success", + "evidence": "docs/ACCEPTANCE.md", + "sourceSha256": { + ".github/workflows/ci.yml": "3465a4561ee9057b732ded49af25aa2684583cfdd1273f14839846361bb4ad2a", + ".github/workflows/production-smoke.yml": "41e75a36de560fca86f600e1bf0814fa8803bd7b445cc9389198a7f8c8615ec9", + "playwright.production.config.mjs": "38b9ffaa21d2fdac9fe6f26499b264c067c10f8ac38f172861d9debdc33aba71", + "tests/acceptance/production.spec.mjs": "8de2bc8544ef4f1d8943a3e2997cbab2bdb10ebc9062b8e9def513fdc811b4f8", + "tests/acceptance/native_macos.py": "db29aefcaea5d338eace76d259e96fa82e7ec5040a68d1f8dada7b260a88ab2d", + "package.json": "68a253e6038247ba9d6fdb432ba8885af4ef639000e10b5cce53f8fb2ee8d237" + }, + "localRehearsal": { + "webkit": 3, + "chromium": 3, + "firefox": 3 + }, + "liveProduction": { + "target": "https://mac-setup.britx.me", + "chromium": 3, + "httpsVerificationEnabled": true, + "companionMode": "isolated-dry-run", + "realInstallationPerformed": false + }, + "nativeCollectorOnLinux": { + "exitCode": 2, + "status": "not_run", + "installerChecksExecuted": 0 + }, + "workflowLint": { + "tool": "actionlint", + "version": "1.7.12", + "result": "passed" + }, + "realMacInstallationPerformed": false, + "humanAcceptancePerformed": false } } From f9afcc272267eba8a913b9858d3fa39c64bed5b4 Mon Sep 17 00:00:00 2001 From: Pedro Brito <74918167+pedrobritx@users.noreply.github.com> Date: Sun, 25 Oct 2026 01:03:23 -0300 Subject: [PATCH 4/4] Make import acceptance sensitive and bound native smoke cleanup --- docs/ACCEPTANCE.md | 10 ++++++++++ outputs/verification.json | 19 ++++++++++++++++--- tests/acceptance/native_macos.py | 28 ++++++++++++++++++++++------ tests/acceptance/production.spec.mjs | 13 +++++++++++++ 4 files changed, 61 insertions(+), 9 deletions(-) diff --git a/docs/ACCEPTANCE.md b/docs/ACCEPTANCE.md index f42fdf4..36356a6 100644 --- a/docs/ACCEPTANCE.md +++ b/docs/ACCEPTANCE.md @@ -53,6 +53,12 @@ home/state directory and explicitly enforce dry-run mode. Evidence is saved to On another OS the collector exits with code 2, records `not_run`, and executes no installer checks. +Each native smoke command has a five-minute budget. The collector stops its +entire subprocess group before removing the temporary home, including on timeout. +The first hosted probe completed 31 syntax checks and three smoke commands, +then exceeded the original 60-second budget during the BRITX dry run. That is +collector failure evidence, not a failed real installation. + This evidence covers native command compatibility. It does not demonstrate a fresh real installation, sudo/App Store approval or human accessibility. Run installation acceptance on a disposable Mac or suitable isolated macOS VM. @@ -90,6 +96,10 @@ Reviewer/date: ____________________ CI and Pages deployment passed. - Local rehearsal of this new suite passed all nine cases across WebKit, Chromium and Firefox. +- The import check clears the saved plan and verifies the exported choice is + absent before import. Disabling the import handler in a local negative control + fails the post-import checkbox assertion. Native collector success and timeout + controls also verified descendant cleanup before removing its temporary home. - The live Chromium suite passed all three cases, including the public export and isolated companion dry run. The local managed-network CA was trusted in a temporary browser profile; TLS validation was not disabled. diff --git a/outputs/verification.json b/outputs/verification.json index f848fd7..ee5d390 100644 --- a/outputs/verification.json +++ b/outputs/verification.json @@ -201,8 +201,8 @@ ".github/workflows/ci.yml": "3465a4561ee9057b732ded49af25aa2684583cfdd1273f14839846361bb4ad2a", ".github/workflows/production-smoke.yml": "41e75a36de560fca86f600e1bf0814fa8803bd7b445cc9389198a7f8c8615ec9", "playwright.production.config.mjs": "38b9ffaa21d2fdac9fe6f26499b264c067c10f8ac38f172861d9debdc33aba71", - "tests/acceptance/production.spec.mjs": "8de2bc8544ef4f1d8943a3e2997cbab2bdb10ebc9062b8e9def513fdc811b4f8", - "tests/acceptance/native_macos.py": "db29aefcaea5d338eace76d259e96fa82e7ec5040a68d1f8dada7b260a88ab2d", + "tests/acceptance/production.spec.mjs": "b29b77582e57575e28301cda798fce436ddd4027f974e552f6349917a98241c9", + "tests/acceptance/native_macos.py": "38cdfbcaa7319cd0a941415613bfed22b8ae1db50a44fe1c78e45dd09cfe091e", "package.json": "68a253e6038247ba9d6fdb432ba8885af4ef639000e10b5cce53f8fb2ee8d237" }, "localRehearsal": { @@ -228,6 +228,19 @@ "result": "passed" }, "realMacInstallationPerformed": false, - "humanAcceptancePerformed": false + "humanAcceptancePerformed": false, + "importNegativeControlDetectedBrokenHandler": true, + "nativeCollectorProcessGroupCleanupControlsPassed": true, + "firstNativeProbe": { + "run": "https://github.com/pedrobritx/mac-setup/actions/runs/40159834603", + "platform": "Darwin", + "macOS": "26.6.2", + "machine": "arm64", + "syntaxChecksPassed": 31, + "smokeChecksPassed": 3, + "status": "failed", + "reason": "BRITX dry run exceeded original 60-second collector budget", + "realInstallationPerformed": false + } } } diff --git a/tests/acceptance/native_macos.py b/tests/acceptance/native_macos.py index 543d382..72c2a90 100644 --- a/tests/acceptance/native_macos.py +++ b/tests/acceptance/native_macos.py @@ -5,12 +5,30 @@ import os from pathlib import Path import platform +import signal import subprocess import tempfile ROOT = Path(__file__).resolve().parents[2] +def run_smoke(args, env, timeout=300): + """Stop installer descendants before cleaning their temporary HOME.""" + process = subprocess.Popen( + ["/bin/bash", "./install.sh", *args], cwd=ROOT, env=env, + start_new_session=True, + ) + try: + return process.wait(timeout=timeout) + finally: + # A timeout must not leave a module writing into a removed HOME. + try: + os.killpg(process.pid, signal.SIGKILL) + except ProcessLookupError: + pass + process.wait() + + def collect(output): """Record only checks actually executed, including refusals and failures.""" evidence = { @@ -67,14 +85,12 @@ def collect(output): ["--help"], ["--list"], ["--dry-run", "--yes"], ["--dry-run", "--britx"], ): - result = subprocess.run( - ["/bin/bash", "./install.sh", *args], - cwd=ROOT, env=env, timeout=60, check=False, - ) + returncode = run_smoke(args, env) evidence["checks"].append({ - "args": args, "exitCode": result.returncode, + "args": args, "exitCode": returncode, }) - result.check_returncode() + if returncode: + raise subprocess.CalledProcessError(returncode, args) evidence["status"] = "passed" except (OSError, subprocess.SubprocessError) as error: evidence["status"] = "failed" diff --git a/tests/acceptance/production.spec.mjs b/tests/acceptance/production.spec.mjs index 07bea01..33f5832 100644 --- a/tests/acceptance/production.spec.mjs +++ b/tests/acceptance/production.spec.mjs @@ -86,6 +86,19 @@ test("the public site filters, exports, imports and opens Safety without install await expect(page.locator("#main h1")).toContainText("Your Mac."); await page.goto("/"); await ready(page); + await page.getByRole("searchbox").fill("Figma MCP"); + await expect( + page.getByRole("checkbox", { name: "Figma MCP", exact: true }), + ).toBeChecked(); + // Returning from Safety preserves the plan. Import must also work from a + // different starting selection, rather than succeeding on saved state alone. + await page.evaluate(() => localStorage.removeItem("mac-setup.plan.v1")); + await page.reload(); + await ready(page); + await page.getByRole("searchbox").fill("Figma MCP"); + await expect( + page.getByRole("checkbox", { name: "Figma MCP", exact: true }), + ).not.toBeChecked(); await page.locator("#plan-file").setInputFiles(file); await expect( page.getByRole("checkbox", { name: "Figma MCP", exact: true }),