Skip to content

Commit 9833b19

Browse files
test(native-qa): automate scoped native fixture checks
1 parent a0e86bf commit 9833b19

10 files changed

Lines changed: 801 additions & 5 deletions

File tree

‎Makefile‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,19 @@ DEVELOPER_DIR ?= /Applications/Xcode.app/Contents/Developer
66
export DEVELOPER_DIR
77
export DEVELOPMENT_TEAM
88

9-
verify: verify-context verify-fork-sync verify-image-compression test harness verify-harness-cli verify-appcast verify-release-metadata verify-release-notarization verify-release-publication verify-homebrew verify-signing-entitlements verify-native-qa verify-batch-rename-capture verify-batch-rename-access
9+
verify: verify-context verify-fork-sync verify-image-compression test harness verify-harness-cli verify-appcast verify-release-metadata verify-release-notarization verify-release-publication verify-homebrew verify-signing-entitlements verify-native-qa verify-native-checks-runner verify-batch-rename-capture verify-batch-rename-access
10+
11+
.PHONY: native-qa-plan verify-native-affected verify-native-checks-runner
12+
export NATIVE_QA_BASE NATIVE_QA_SUITES
13+
14+
native-qa-plan:
15+
python3 scripts/native_checks.py plan
16+
17+
verify-native-affected:
18+
python3 scripts/native_checks.py run
19+
20+
verify-native-checks-runner:
21+
python3 scripts/test_native_checks.py
1022

1123
.PHONY: verify-batch-rename-capture
1224
verify-batch-rename-capture:

‎docs/ACCEPTANCE.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,23 @@
33
Checked on 2026-09-14, macOS 26.6.2, Apple silicon. Minimum deployment target:
44
macOS 13. Release bundles contain arm64 and x86_64 executables.
55

6+
## Automatic native QA runner — 2026-10-16
7+
8+
On primary checkout `a0e86bf` plus local automation changes, the final offline
9+
`make verify` passed, including 20 runner regressions. Actual local execution of
10+
the nine selected native modes passed on arm64 macOS 27.2 / Xcode 27.1. Existing
11+
Developer ID identities, signing requirements and stable launch paths were reused.
12+
Repeated batch-rename, native-icon and design fixtures kept those identities while
13+
using different build IDs and data roots. An initial design-fixture startup race
14+
failed the run and was fixed by waiting for bounded template-recovery readiness;
15+
the original appearance/persistence/rollback assertions remain in place.
16+
17+
These results cover the connected fixture scenarios, not installed Finder
18+
callbacks, actual external authorization persistence, VoiceOver, Office-editor
19+
rendering or installed upgrade/migration acceptance. Signing keys remained local;
20+
production installation and publication were not changed. See the
21+
[task and exact local evidence](tasks/native-qa-automation.md#evidence).
22+
623
## Batch rename authorization review fixes — 2026-10-15
724

825
On primary checkout `aaf966e` plus the recorded changes, both reviewed P2 defects

‎docs/AI_PLAYBOOK.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ from the current task rather than replaying a transcript.
5151
covered scope. Explain the trigger for additional native QA and keep it to the
5252
affected scenarios. Routine work does not require a Debug package or a full
5353
GUI replay. Keep compilation, runtime acceptance and publication evidence distinct.
54+
- For affected native interactions, inspect `make native-qa-plan` and run
55+
`make verify-native-affected`. Use `NATIVE_QA_BASE` after committing or
56+
`NATIVE_QA_SUITES` for a reviewed shared-file scope. Follow
57+
[native execution](../specs/verification/native-qa.md#automated-local-checks)
58+
for reports, manual boundaries and unavailable environments.
5459
- Select checks for the current phase: analysis/planning has no default test run,
5560
documentation edits use documentation checks, and implementation tests run after
5661
completing the relevant change. Pre-change tests need a concrete diagnostic

‎docs/DEVELOPMENT.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,23 @@ native checks selected only for affected interactions and system boundaries.
2929
Source CI runs both `make verify` and the unsigned app/extension build on its
3030
macOS matrix. Compilation does not require installing or launching the result.
3131

32+
For changed native interactions, plan and run the existing isolated QA fixtures:
33+
34+
```sh
35+
make native-qa-plan
36+
make verify-native-affected
37+
make verify-native-affected NATIVE_QA_BASE=HEAD~1
38+
make verify-native-affected NATIVE_QA_SUITES=batch-rename,file-tools-settings
39+
```
40+
41+
The runner builds signed stable QA apps serially and writes a fresh JSON report
42+
with per-suite logs under `build/native-checks.noindex`. Exit 0 requires successful
43+
automatic checks in the selected scope; an empty plan is reported separately.
44+
Manual boundaries or unknown runtime paths remain blocked. Developer ID keys
45+
stay local, and the offline `make verify` only tests this runner's selection and
46+
failure handling. See [native QA](../specs/verification/native-qa.md#automated-local-checks)
47+
for suite coverage and requirements.
48+
3249
For an explicitly requested installed Debug check, generate the project and use
3350
the Debug configuration with a direct executable:
3451

‎docs/tasks/native-qa-automation.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Task: Repeatable native QA selected by changed scope
2+
3+
Status: complete
4+
Next action: Use `make native-qa-plan` for the next native interaction change, then run its reviewed scope.
5+
6+
## Objective and scope
7+
8+
- Connect existing self-checking native fixtures to one plan/run interface.
9+
- Select suites from working changes or an explicit base commit; allow explicit suites after reviewing shared-file behavior.
10+
- Preserve stable QA identities, local Developer ID signing, sandbox entitlements and isolated stores.
11+
- Accept a runtime check only after a fresh fixture build, successful exit and its expected completion marker.
12+
- Keep installed Finder callbacks, real authorization pickers, installer replacement and access migration as separate acceptance evidence.
13+
- No production installation, release publication, permission-database changes or signing keys in CI.
14+
15+
## Selected context
16+
17+
- Workflow: [AI Playbook](../AI_PLAYBOOK.md), [HARNESS](../../specs/HARNESS.md).
18+
- Native identities and execution: [Native QA](../../specs/verification/native-qa.md), [Finder/native checks](../../specs/verification/finder.md).
19+
- Domains for fixture adapters: [Creation](../../specs/domains/creation.md), [File tools](../../specs/domains/file-tools.md), [Startup/preferences](../../specs/domains/startup.md), [Updates](../../specs/domains/updates.md).
20+
- Entry points: `scripts/native_qa.py`, existing `build_*_harness.sh` and `*_smoke.swift`, `Makefile`.
21+
- Load additional product contracts before changing their assertions or runtime behavior.
22+
23+
## Decisions and progress
24+
25+
- `make verify` keeps running offline infrastructure tests. Actual signed GUI fixtures use a separate local command.
26+
- Nine automatic modes cover batch rename, template workflow/opening/update scheduling, open-with delivery, native icons, resource tools, design/settings and the headless favorite model.
27+
- The favorite-model probe is an additional headless native check.
28+
- Plans must retain manual boundaries and unknown runtime paths for review, rather than silently declaring them covered.
29+
- The first actual run caught a fixture startup race: appearance edits overlapped the production model's asynchronous template recovery. The automated design mode now waits for the same bounded ready state as the existing settings check, preserving all persistence, rollback and immediate-appearance assertions. Its focused rerun and the final full run passed.
30+
- Build-only project/CI edits do not start GUI checks. Config/entitlement changes still require scope review.
31+
- Actual run checks verify signatures and a new fixture build ID before execution; failed builds never launch retained bundles. Exit status, completion marker, timeout, manual requirements and source changes all participate in the result.
32+
33+
## Evidence
34+
35+
Tested commit/worktree: primary checkout based on `a0e86bf` plus the local implementation; only verification documentation was completed afterward.
36+
Environment: arm64 macOS 27.2, Xcode 27.1 (`27A9275`), Swift 6.4.
37+
38+
| Check / command | Status | Observed result / evidence link |
39+
| --- | --- | --- |
40+
| Offline runner regressions and final `make verify` | passed | 20 runner regressions; existing Core/Images/Harness/CLI and offline checks passed. Log: `build/native-qa-automation-20261016/verify-final.log` |
41+
| Initial native run | failed | 8 passed, design readiness failed; preserved report: `build/native-checks.noindex/run.thvg3bkt/report.json` |
42+
| Focused design rerun | passed | Appearance, persisted settings/rollback, native captures and window dimensions; `build/native-checks.noindex/run.0t2f8uy6/report.json` |
43+
| Final selected native run | passed | 9/9 modes; six Developer ID signed QA app kinds, plus headless favorite-model check. Report: `build/native-checks.noindex/run.j298ucf_/report.json` |
44+
| Repeated representative builds/runs | passed | Batch rename, native icons and design: same IDs/paths/designated requirements; different build run IDs and data roots. `build/native-qa-automation-20261016/repeatability.json` |
45+
46+
The nine final check commands took 50.33 seconds in total. GUI-fixture compilation,
47+
dependency preparation and preflight are recorded separately; the headless
48+
favorite-model command includes its compilation. This is one local observation,
49+
not a runtime guarantee. Office preview provider availability is recorded in the
50+
template log; a graceful unavailable-provider result does not prove rendering in
51+
an Office editor.
52+
53+
## Handoff
54+
55+
- Remaining implementation work: none for the connected automatic modes.
56+
- Known limits: injected fixtures do not prove installed Finder callbacks, persistent external grants or installed updates.
57+
- Interactive move/update authorization, isolated Sparkle replacement and access migration remain separate scenarios; no production installation, permission change, publication or remote CI execution was performed in this task.
58+
- Commands and scope rules are in the [native execution checklist](../../specs/verification/native-qa.md#automated-local-checks).

‎scripts/design_ui_smoke.swift‎

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,27 @@ final class DesignUISmoke: NSObject, NSApplicationDelegate {
129129
NSApp.mainMenu = bar
130130
NSApp.activate(ignoringOtherApps: true)
131131
print("READY isolated FileMint UI: \(root.path)")
132+
if CommandLine.arguments.contains("--verify-automation") {
133+
Task { @MainActor in
134+
do {
135+
try await waitForSettingsReady()
136+
print("CHECK automated design appearance"); fflush(nil)
137+
try checkAppearance(store: store, root: root)
138+
print("CHECK automated design settings"); fflush(nil)
139+
try await checkSettings(store: store, root: root)
140+
print("CHECK automated design window size"); fflush(nil)
141+
try await checkWindowSize()
142+
print("PASS automated design QA: appearance, settings edits/rollback, native captures and window size")
143+
fflush(nil)
144+
NSApp.terminate(nil)
145+
} catch {
146+
print("FAIL automated design QA: \(error)")
147+
fflush(nil)
148+
exit(1)
149+
}
150+
}
151+
return
152+
}
132153
if CommandLine.arguments.contains("--check-settings") {
133154
Task { @MainActor in
134155
do {
@@ -214,14 +235,21 @@ final class DesignUISmoke: NSObject, NSApplicationDelegate {
214235
}
215236
}
216237

238+
private func waitForSettingsReady() async throws {
239+
for _ in 0..<100 where model.isMutatingTemplates || model.templateRecoveryError != nil {
240+
try await Task.sleep(for: .milliseconds(100))
241+
}
242+
guard model.templateMutationAllowed else {
243+
throw NSError(domain: "SettingsReview", code: 1,
244+
userInfo: [NSLocalizedDescriptionKey: "Template recovery did not finish"])
245+
}
246+
}
247+
217248
private func checkSettings(store: FileMintPreferencesStore, root: URL) async throws {
218249
func require(_ value: Bool, _ message: String) throws {
219250
if !value { throw NSError(domain: "SettingsReview", code: 1, userInfo: [NSLocalizedDescriptionKey: message]) }
220251
}
221-
for _ in 0..<100 where model.isMutatingTemplates || model.templateRecoveryError != nil {
222-
try await Task.sleep(for: .milliseconds(100))
223-
}
224-
try require(model.templateMutationAllowed, "Template recovery did not finish")
252+
try await waitForSettingsReady()
225253
let original = model.preferences
226254
let templates = [model.preferences.templates.first { $0.document == nil }!,
227255
model.preferences.templates.first { $0.document != nil }!]
@@ -293,6 +321,7 @@ final class DesignUISmoke: NSObject, NSApplicationDelegate {
293321
private func checkAppearance(store: FileMintPreferencesStore, root: URL) throws {
294322
let original = model.preferences
295323
for choice in [AppAppearance.dark, .light, .system] {
324+
print("CHECK appearance \(choice.rawValue)"); fflush(nil)
296325
model.setAppearance(choice)
297326
guard store.load().appearance == choice else { throw ResourceError.failed }
298327
if choice == .system {

0 commit comments

Comments
 (0)