Skip to content

fix(config): --ios must not silently run an android project#71

Merged
BenSheridanEdwards merged 1 commit into
mainfrom
fix/strict-platform-resolution
Jul 2, 2026
Merged

fix(config): --ios must not silently run an android project#71
BenSheridanEdwards merged 1 commit into
mainfrom
fix/strict-platform-resolution

Conversation

@BenSheridanEdwards

Copy link
Copy Markdown
Owner

Summary

  • resolveProject silently fell back to projects[0] when an explicit platform matched nothing — npx nativeproof --ios against an android-only config ran an Android suite, produced Android evidence, and reported success. It now fails loudly, listing the available projects (a typo'd --project already errored; a platform mismatch didn't).
  • The CLI preflight resolved the project from flags only, while the runner honors PLATFORM/NATIVEPROOF_PROJECT env vars — so PLATFORM=ios nativeproof ensured the uiautomator2 driver and skipped the "iOS requires macOS" guard, then ran the iOS project (late, cryptic session failure). The preflight now uses the same flags-then-env selection (runSelection), so it always preflights the project the runner will actually execute.

Proof

  • npm run check
    • Passed on fix/strict-platform-resolution.
  • npm test
    • Passed: 156/156 (new tests: unmatched explicit platform throws listing available projects; runSelection env fallback and flag precedence).
  • Generated project/device proof, or N/A:
    • Not applicable. Selection logic covered by unit tests; no device or generated-project surface changes (generated configs always contain the platform they were scaffolded for, so the loud-failure path only fires on genuine mismatches).
    • Screenshots: Not applicable; CLI/config resolution logic asserted in tests.

Risk

  • Low-to-moderate: this is a deliberate behaviour change. Anyone relying on --ios silently running a non-iOS first project now gets an error naming the fix. A stray PLATFORM env var that the runner was already (silently) honouring now fails fast at preflight instead of steering the run unnoticed.

Notes

  • Full device coverage not run: resolution happens before any device interaction.

PR Proof Law

  • I followed .agents/DEFINITION_OF_DONE.md and .agents/skills/pr-inline-screenshot-proof/SKILL.md.
  • Screenshots are committed and embedded inline with ![alt](...png?raw=1), or the proof section says Not applicable with the technical reason.
  • The PR body has no bare screenshot links, local paths, relative paths, or proof placeholders.

…rs runner env

resolveProject fell back to projects[0] when an explicit platform matched
nothing, so --ios against an android-only config silently ran an android
suite with android evidence. It now errors listing the available projects.

The CLI preflight also resolved the project from flags alone while the
runner honored PLATFORM/NATIVEPROOF_PROJECT, so PLATFORM=ios nativeproof
ensured the wrong Appium driver and skipped the macOS guard before running
the ios project. Preflight now reads the same env fallback (runSelection).
@BenSheridanEdwards BenSheridanEdwards force-pushed the fix/strict-platform-resolution branch from ea21af0 to 2c2dfe5 Compare July 2, 2026 21:02
@BenSheridanEdwards BenSheridanEdwards merged commit 376d610 into main Jul 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant