Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
51 changes: 51 additions & 0 deletions .github/workflows/production-smoke.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
110 changes: 110 additions & 0 deletions docs/ACCEPTANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 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.

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.

## 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 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.
- 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.
52 changes: 52 additions & 0 deletions outputs/verification.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,57 @@
"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": "b29b77582e57575e28301cda798fce436ddd4027f974e552f6349917a98241c9",
"tests/acceptance/native_macos.py": "38cdfbcaa7319cd0a941415613bfed22b8ae1db50a44fe1c78e45dd09cfe091e",
"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,
"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
}
}
}
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
65 changes: 65 additions & 0 deletions playwright.production.config.mjs
Original file line number Diff line number Diff line change
@@ -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],
],
});
Loading
Loading