swipium 2.0.1 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +32 -20
  3. package/THREAT_MODEL.md +109 -21
  4. package/dist/automationGen/run.js.map +1 -1
  5. package/dist/cli/init.js +101 -11
  6. package/dist/cli/init.js.map +1 -1
  7. package/dist/cli/verify.js +2 -2
  8. package/dist/cli/verify.js.map +1 -1
  9. package/dist/consent/consent.js +365 -17
  10. package/dist/consent/consent.js.map +1 -1
  11. package/dist/context/projectRoot.js +9 -4
  12. package/dist/context/projectRoot.js.map +1 -1
  13. package/dist/context/protocolEra.js +15 -0
  14. package/dist/context/protocolEra.js.map +1 -0
  15. package/dist/drivers/DirectDriver.js +5 -2
  16. package/dist/drivers/DirectDriver.js.map +1 -1
  17. package/dist/featureTesting/executionBootstrap.js +85 -77
  18. package/dist/featureTesting/executionBootstrap.js.map +1 -1
  19. package/dist/flows/run.js +9 -5
  20. package/dist/flows/run.js.map +1 -1
  21. package/dist/lib/abortScope.js +36 -3
  22. package/dist/lib/abortScope.js.map +1 -1
  23. package/dist/lib/android.js +15 -6
  24. package/dist/lib/android.js.map +1 -1
  25. package/dist/lib/codexEnv.js +112 -0
  26. package/dist/lib/codexEnv.js.map +1 -0
  27. package/dist/lib/logger.js +18 -0
  28. package/dist/lib/logger.js.map +1 -1
  29. package/dist/lib/result.js +188 -10
  30. package/dist/lib/result.js.map +1 -1
  31. package/dist/lib/schemaHash.js +20 -31
  32. package/dist/lib/schemaHash.js.map +1 -1
  33. package/dist/lib/simctl.js +102 -3
  34. package/dist/lib/simctl.js.map +1 -1
  35. package/dist/lib/toolSchema.js +143 -0
  36. package/dist/lib/toolSchema.js.map +1 -0
  37. package/dist/lib/wda.js +5 -2
  38. package/dist/lib/wda.js.map +1 -1
  39. package/dist/mobileAudit/runner.js +12 -4
  40. package/dist/mobileAudit/runner.js.map +1 -1
  41. package/dist/oracle/failures.js +2 -2
  42. package/dist/oracle/failures.js.map +1 -1
  43. package/dist/orchestration/testThis/execute.js +21 -4
  44. package/dist/orchestration/testThis/execute.js.map +1 -1
  45. package/dist/orchestration/testThis/pipeline.js +2 -0
  46. package/dist/orchestration/testThis/pipeline.js.map +1 -1
  47. package/dist/orchestration/testThis/plan.js.map +1 -1
  48. package/dist/server.js +564 -139
  49. package/dist/server.js.map +1 -1
  50. package/dist/services/prepareAndroid.js +3 -2
  51. package/dist/services/prepareAndroid.js.map +1 -1
  52. package/dist/services/prepareIos.js +31 -4
  53. package/dist/services/prepareIos.js.map +1 -1
  54. package/dist/services/smoke.js +38 -4
  55. package/dist/services/smoke.js.map +1 -1
  56. package/dist/session/processRegistry.js +12 -1
  57. package/dist/session/processRegistry.js.map +1 -1
  58. package/dist/snapshot/parse.js +64 -9
  59. package/dist/snapshot/parse.js.map +1 -1
  60. package/dist/snapshot/present.js +14 -4
  61. package/dist/snapshot/present.js.map +1 -1
  62. package/dist/snapshot/settle.js +14 -3
  63. package/dist/snapshot/settle.js.map +1 -1
  64. package/dist/tools/act.js +694 -670
  65. package/dist/tools/act.js.map +1 -1
  66. package/dist/tools/agent.js +15 -16
  67. package/dist/tools/agent.js.map +1 -1
  68. package/dist/tools/appControl.js +4 -4
  69. package/dist/tools/appControl.js.map +1 -1
  70. package/dist/tools/appMap.js +11 -13
  71. package/dist/tools/appMap.js.map +1 -1
  72. package/dist/tools/build.js +4 -6
  73. package/dist/tools/build.js.map +1 -1
  74. package/dist/tools/bundletool.js +3 -3
  75. package/dist/tools/bundletool.js.map +1 -1
  76. package/dist/tools/clearOverlay.js +2 -3
  77. package/dist/tools/clearOverlay.js.map +1 -1
  78. package/dist/tools/device.js +4 -3
  79. package/dist/tools/device.js.map +1 -1
  80. package/dist/tools/doctor.js +23 -11
  81. package/dist/tools/doctor.js.map +1 -1
  82. package/dist/tools/explore.js +15 -21
  83. package/dist/tools/explore.js.map +1 -1
  84. package/dist/tools/featureTesting.js +22 -6
  85. package/dist/tools/featureTesting.js.map +1 -1
  86. package/dist/tools/firstRun.js +4 -5
  87. package/dist/tools/firstRun.js.map +1 -1
  88. package/dist/tools/flow.js +13 -17
  89. package/dist/tools/flow.js.map +1 -1
  90. package/dist/tools/flowRepair.js +3 -5
  91. package/dist/tools/flowRepair.js.map +1 -1
  92. package/dist/tools/generate.js +10 -11
  93. package/dist/tools/generate.js.map +1 -1
  94. package/dist/tools/getArtifact.js +114 -10
  95. package/dist/tools/getArtifact.js.map +1 -1
  96. package/dist/tools/health.js +2 -1
  97. package/dist/tools/health.js.map +1 -1
  98. package/dist/tools/ios.js +35 -13
  99. package/dist/tools/ios.js.map +1 -1
  100. package/dist/tools/issues.js +8 -8
  101. package/dist/tools/issues.js.map +1 -1
  102. package/dist/tools/jobs.js +26 -10
  103. package/dist/tools/jobs.js.map +1 -1
  104. package/dist/tools/metro.js +4 -5
  105. package/dist/tools/metro.js.map +1 -1
  106. package/dist/tools/mobileAudit.js +11 -10
  107. package/dist/tools/mobileAudit.js.map +1 -1
  108. package/dist/tools/note.js +2 -3
  109. package/dist/tools/note.js.map +1 -1
  110. package/dist/tools/prepareIosTarget.js +102 -31
  111. package/dist/tools/prepareIosTarget.js.map +1 -1
  112. package/dist/tools/prepareTarget.js +3 -5
  113. package/dist/tools/prepareTarget.js.map +1 -1
  114. package/dist/tools/report.js +4 -5
  115. package/dist/tools/report.js.map +1 -1
  116. package/dist/tools/resolveArtifact.js +2 -3
  117. package/dist/tools/resolveArtifact.js.map +1 -1
  118. package/dist/tools/resolveTarget.js +3 -6
  119. package/dist/tools/resolveTarget.js.map +1 -1
  120. package/dist/tools/screenRecord.js +2 -3
  121. package/dist/tools/screenRecord.js.map +1 -1
  122. package/dist/tools/screenshot.js +2 -2
  123. package/dist/tools/screenshot.js.map +1 -1
  124. package/dist/tools/smoke.js +4 -2
  125. package/dist/tools/smoke.js.map +1 -1
  126. package/dist/tools/snapshot.js +6 -7
  127. package/dist/tools/snapshot.js.map +1 -1
  128. package/dist/tools/startSession.js +12 -16
  129. package/dist/tools/startSession.js.map +1 -1
  130. package/dist/tools/suite.js +2 -4
  131. package/dist/tools/suite.js.map +1 -1
  132. package/dist/tools/testSuite.js +13 -19
  133. package/dist/tools/testSuite.js.map +1 -1
  134. package/dist/tools/testThis.js +28 -13
  135. package/dist/tools/testThis.js.map +1 -1
  136. package/dist/tools/visual.js +7 -9
  137. package/dist/tools/visual.js.map +1 -1
  138. package/dist/tools/wait.js +130 -21
  139. package/dist/tools/wait.js.map +1 -1
  140. package/dist/tools/wda.js +199 -60
  141. package/dist/tools/wda.js.map +1 -1
  142. package/dist/version.js +1 -1
  143. package/docs/README.md +4 -4
  144. package/docs/ci-reports.md +39 -7
  145. package/docs/concepts.md +37 -25
  146. package/docs/flows.md +1 -1
  147. package/docs/mcp-server.md +281 -76
  148. package/docs/physical-devices.md +4 -4
  149. package/docs/tools.md +59 -30
  150. package/package.json +4 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,70 @@
2
2
 
3
3
  All notable public changes to Swipium are documented here.
4
4
 
5
+ ## 2.2.0 - 2026-10-05
6
+
7
+ Swipium 2.2.0 moves to the MCP TypeScript SDK v2, adds the MCP 2026-07-28 protocol revision next to the 2025 ones, and changes the shape of element lists in `structuredContent` for every client. It also makes Swipium usable from headless and non-Claude clients (`codex exec`, `claude -p`, Codex in general), keeps waits under common client tool timeouts, and makes cancellation actually stop work. No tools were added or removed (still 55). Work through the upgrade checklist before upgrading.
8
+
9
+ ### Upgrade checklist
10
+
11
+ Items tagged **You** need an action from you. Items tagged **Automatic** happen on their own and are listed so they don't surprise you.
12
+
13
+ 1. **You:** restart your MCP client so it reloads the server instructions and tool list. The schema hash changed (descriptions were trimmed and `qa_wait` gained `wda_ready` and `simulator_booted`), so update any `qa_doctor { expectedSchemaHash }` check.
14
+ 2. **You (scripts reading results):** `structuredContent.elements` from `qa_snapshot` and `qa_act` are now `@eN` strings, not objects. Pass `responseMode: "verbose"` to keep the objects, or parse the lines (see Breaking changes).
15
+ 3. **You (Codex):** Codex passes MCP servers only a small whitelist of environment variables. Add the `env_vars = [...]` line that `swipium init codex` prints under `[mcp_servers.swipium]`, or `SWIPIUM_TEST_*`, `ANDROID_HOME` and `JAVA_HOME` exported in your shell never reach Swipium. Keep `tool_timeout_sec = 600`: some synchronous steps can still take longer than Codex's 60 s default (a large `qa_ios install`, `qa_flow_run`, `qa_smoke`, `qa_mobile_audit`, `qa_generate { target:"appium" }`). `qa_doctor` checks the env part when it runs under Codex.
16
+ 4. **You (headless runs):** `codex exec` and `claude -p` answer consent prompts automatically, so boots, installs and builds were always refused there. To allow specific actions without a prompt, list them in `SWIPIUM_CONSENT_PREAPPROVE` in the MCP server env (see Added). For Codex, set it literally in the `env = { ... }` table: `init` deliberately doesn't forward it from your shell.
17
+ 5. **You (iOS automation):** `qa_wda build` now returns a `jobId` right away (poll `qa_job_status`), `qa_wda start` can return `status:"starting"` after 45 s (poll `qa_wait { for:"wda_ready" }`), `qa_ios boot` can return `status:"booting"` after 40 s (poll `qa_wait { for:"simulator_booted" }`), and `qa_prepare_ios_target` can hand a slow boot to a job (poll `qa_job_status`). Agents that waited on one long call need the extra poll.
18
+ 6. **You (resource clients):** reading a missing `swipium://` resource now fails with `-32602` instead of `-32603`, and `qa_get_artifact` returns `INVALID_ARGUMENT` for an unknown URI.
19
+ 7. **Automatic:** waits and long-polls end within about 50 s. `qa_job_status` long-polls at most 50 s (was 120 s, recommended `waitMs` is now 45000), and larger `timeoutMs` values on `qa_wait`, `qa_act` and `qa_test_this` are clamped to 50000 with a note instead of being rejected.
20
+ 8. **Automatic:** Claude Code 2.1.285 and later connect on MCP 2026-07-28. Consent prompts look the same, but Swipium no longer asks those clients for MCP roots; Claude Code sets `CLAUDE_PROJECT_DIR`, so the project root still resolves to the open project.
21
+
22
+ ### Breaking changes
23
+
24
+ - **Element lists are compact lines, for every client.** `qa_snapshot` and `qa_act` return `structuredContent.elements` as one-line strings, the same lines as the text block, instead of one JSON object per element. For example: `@e3 [button] "Log in" #login_btn [40,200][1040,245] (focused)`. That's about 40% smaller, and it's what Claude Code and Codex show the model. Lines carry bounds, the text when it differs from the label, and a `secure` flag; names are JSON-escaped and capped at 80 characters after redaction. Programmatic readers that expect objects should pass `responseMode: "verbose"`, which still returns them, or parse the lines ([format](docs/tools.md#element-lines)).
25
+ - **`qa_wda build` is a job, and `qa_wda start` doesn't wait for WebDriverAgent forever.** `build` returns a `jobId` at once (the xcodebuild timeout goes from 3 to 10 minutes). `start` waits at most 45 s, then returns `ok` with `status:"starting"` while WebDriverAgent keeps booting.
26
+ - **Shorter waits.** `qa_job_status` `waitMs` is capped at 50000 (was 120000). `qa_wait` `timeoutMs` defaults to 45000 (was 60000, or 180000 for `device_online`) and `qa_test_this` `waitForCompletion` `timeoutMs` to 45000 (was 120000). Values above 50000 on those two and on `qa_act` are clamped with a note. Negative values, and non-integers on `qa_wait` and `qa_test_this`, return `INVALID_ARGUMENT`.
27
+ - **Missing resources.** Reading a `swipium://` URI that matches a template but names nothing that exists returns JSON-RPC `-32602` with the URI in `error.data.uri`, in every protocol era. 2.0.1 sent `-32603` (internal error). Clients should also accept the older `-32002`.
28
+
29
+ ### Added
30
+
31
+ - **MCP 2026-07-28 (dual-era stdio).** Swipium answers `server/discover` for 2026-07-28 clients and `initialize` for 2025-06-18 and 2025-11-25 clients; the client's first message picks the era for the whole connection. Claude Code probes 2026-07-28 from 2.1.285 (verified on 2.1.289); Codex 0.146 stays on 2025-06-18. On a 2026-07-28 connection:
32
+ - Consent prompts travel as an `InputRequiredResult` (the same one-checkbox form) and the answer comes back on the client's retry of the tool call. The `requestState` is a single-use server-side handle bound to the tool, its arguments and the session: a forged, reused or re-targeted one fails with `-32602` and nothing runs.
33
+ - `tools/list` is sorted by name, and list results carry cache hints: `ttlMs: 3600000`, `cacheScope: "public"` for tools, prompts, resource templates and `server/discover`; `ttlMs: 0`, `cacheScope: "private"` for `resources/list` and `resources/read`.
34
+ - MCP roots are never requested (roots are deprecated in that revision). The project root comes from `projectRoot`, `SWIPIUM_PROJECT_ROOT`, `CLAUDE_PROJECT_DIR` or the working directory.
35
+ - **Operator consent pre-approval** for headless clients. `SWIPIUM_CONSENT_PREAPPROVE` is a comma-separated list of exact consent action names (for example `prepare_plan,install_app`) approved without a prompt, on any client and in both protocol eras.
36
+ - It's read only from the server process environment, never from `.swipium/` or any repository file. No wildcards; unknown names are ignored with a startup warning that suggests the closest valid name.
37
+ - Actions that run repository- or model-chosen code (`build_from_source`, `flow_mutation_run`, `ocr_run`, `seed_state`, `start_metro`, `suite_fresh_state_replay`, `wda_build`, `wda_start`) also need `SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE=1`. Pre-approving `test_this_plan` doesn't cover a plan with a build step unless `build_from_source` is pre-approved that way too.
38
+ - `wda_non_loopback` can never be pre-approved; use `SWIPIUM_ALLOW_REMOTE_WDA`.
39
+ - Approvals stay single-use and session-bound, are recorded in the mutation ledger as `operator-policy`, and each one is logged at `warn` with the action and its exact command.
40
+ - `qa_wait { for:"wda_ready" }` polls the session's WebDriverAgent `/status`, and `qa_wait { for:"simulator_booted" }` polls the session's bound iOS Simulator after a boot that returned `status:"booting"`.
41
+ - `SWIPIUM_LOG_LEVEL` (`debug`, `info`, `warn`, `error`; default `info`; unknown values fall back to `info`). At `debug`, one stderr line per tool call with the tool, session, duration, error code and whether it was cancelled, plus the protocol era of each connection. Argument values are never logged.
42
+ - **Codex setup.** `swipium init codex` writes an `env_vars` line covering every variable Swipium and its toolchains read, except the approval grants (`SWIPIUM_CONSENT_PREAPPROVE`, `SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE`, `SWIPIUM_ALLOW_REMOTE_WDA`), plus a commented `enabled_tools` core profile that includes every tool the server instructions point to. It honours `CODEX_HOME`, detects an existing `[mcp_servers.swipium]` or `[mcp_servers."swipium"]` table, and then prints only the missing `env_vars` line.
43
+ - `qa_doctor` adds `codex-env` and `codex-tool-timeout` rows when the client is Codex (or `client:"codex"`). `codex-env` lists the Swipium variables the server can see and warns when no Android SDK or JDK is found.
44
+ - A device-driving tool called while a background job is still driving the same device gets a note that the two may interleave.
45
+
46
+ ### Changed
47
+
48
+ - **MCP SDK v2.** Swipium moved from `@modelcontextprotocol/sdk` 1.x to `@modelcontextprotocol/server` and `@modelcontextprotocol/client` 2.3.1, and zod is `^4.2.0` (was `^3.25`). A production install goes from 100 packages to 21, and picks up the SDK's UriTemplate ReDoS fix ([GHSA-cqwc-fm46-7fff](https://github.com/advisories/GHSA-cqwc-fm46-7fff), CVE-2026-0621; 2.0.1 allowed SDK versions below the 1.25.2 fix). For 2025-era clients the move itself is invisible: tool results are byte-identical, and so is `tools/list` apart from `qa_act`'s `for.selector`, which is now inlined instead of a `$ref`.
49
+ - Argument validation, unknown-argument rejection and stale-client mapping no longer patch private SDK internals. Swipium answers `tools/list` and `tools/call` through the public request-handler API and validates each call against one strict schema per tool.
50
+ - Successful results carry the summary headline and next steps in `structuredContent` (`summary`, `next`). Claude Code and Codex show the model `structuredContent` instead of the text block, so hints such as "call qa_report" were invisible before. `next` lists only real tool calls and is left out when the payload already has next-step fields.
51
+ - Consent declines and cancels include `action`, `answeredInMs` and `likelyAutomatic` (answered in under 1.5 s). Only when `likelyAutomatic` is true does the error name `SWIPIUM_CONSENT_PREAPPROVE` and tell the agent not to re-call in a loop; a real human decline is never nudged toward pre-approval. A prompt that failed (timeout, transport error, aborted call) reports `likelyAutomatic: false` and an `elicitationFailure` reason.
52
+ - `qa_get_artifact` defaults to metadata for every non-text artifact (recordings included, not only images), never decodes binaries as text, applies the same size caps as `resources/read`, and returns `INVALID_ARGUMENT` for an unknown URI.
53
+ - Missing, wrong-typed or out-of-range arguments return the typed `INVALID_ARGUMENT` envelope with per-field `invalidArguments` instead of a raw validation dump.
54
+ - Server instructions are 1,900 characters (were 2,518), under Claude Code's 2,048-character limit, and their first 512 characters stand alone. They recommend `waitMs: 45000`.
55
+ - `tools/list` is about 9% smaller (63.5 KB, was 69.6 KB): descriptions were trimmed, and no parameters were removed.
56
+ - `swipium init` writes a `node` path that survives a Homebrew upgrade (`/opt/homebrew/opt/<formula>/bin/node` instead of the versioned `Cellar` path).
57
+ - MCP roots requests (2025-era connections) time out after 5 s instead of 60 s.
58
+
59
+ ### Fixed
60
+
61
+ - **Simulator boots no longer block a call.** `qa_ios { action:"boot" }` waits at most 40 s; a slower cold boot returns ok `status:"booting"` (`udid`, `name`, `elapsedMs`, `next`) with the simulator already bound, and the new `qa_wait { for:"simulator_booted" }` polls until it is up. `qa_prepare_ios_target` waits at most 30 s for a boot, then returns `status:"booting"` with a `jobId`: a `prepare_ios` job finishes boot, install, launch and the WDA check under the consent already given. `qa_test_feature` (execute without `sessionId`) now boots, installs and launches inside its job, so the call returns at once.
62
+ - A Metro bundler started through `npx` is now reaped after a server crash. Under load, Swipium could record it during the brief moment `npx` titles itself a bare `npm`, so the startup sweep could never verify it and left it holding port 8081.
63
+ - Cancelling a call now stops its work. `qa_wait`, the `qa_job_status` long-poll, element waits in `qa_act` and flows, UI settling, emulator boot and appear waits, WebDriverAgent startup and UI dump retries used to keep running until their deadline.
64
+ - Cancelled smoke runs and mobile audits are no longer recorded as failures, findings or issues, and a cancelled mobile audit restores the device network instead of leaving it offline.
65
+ - The server exits when the client closes stdin, even during a long call. Before, it lingered until the call finished. On shutdown, running jobs are cancelled before device network state is restored.
66
+ - `resources/read` caps what it returns: text over 1 MB comes back as the head (the tail for logs) with a marker naming the local file, binaries over 8 MB are not inlined, non-text files are returned as blobs instead of being decoded as text, and a cut never splits a UTF-8 character.
67
+ - Errors no longer echo unbounded caller input. A multi-MB argument (or argument name) used to produce an error larger than a client's read buffer, and the client dropped the connection. Names and paths are cut at 100 characters, and long messages keep both their start and their end, where the deciding line of a command failure usually is.
68
+
5
69
  ## 2.0.1 - 2026-09-30
6
70
 
7
71
  A small maintenance release. No behavior changes for agents or flows.
package/README.md CHANGED
@@ -30,7 +30,7 @@ Agent > qa_test_this { sessionId: "3f9c2a1b", mode: "execute", goal: "smoke" }
30
30
  • install_apk: adb install -r -g android/app/.../app-release.apk
31
31
  You: Approve (one prompt covers boot + install)
32
32
  state: "running", jobId: "a41c09e2"
33
- Agent > qa_job_status { sessionId: "3f9c2a1b", jobId: "a41c09e2", waitMs: 60000 }
33
+ Agent > qa_job_status { sessionId: "3f9c2a1b", jobId: "a41c09e2", waitMs: 45000 }
34
34
  status: "done", result.state: "completed"
35
35
  reportSummary: "PASS app · COVERED coverage · PASS tool. Read swipium://session/3f9c2a1b/report/…"
36
36
  Agent: The app launched and passed the smoke checks with no crashes or error screens.
@@ -48,12 +48,14 @@ The report behind that summary, rendered with `npx swipium report --latest --for
48
48
 
49
49
  ## Contents
50
50
 
51
- [Requirements](#requirements) · [Quickstart](#quickstart) · [Starter prompts](#starter-prompts) · [How it works](#how-it-works) · [Tools](#tools) · [Where results go](#where-results-go) · [Configuration](#configuration--environment-variables) · [CLI](#cli-reference) · [CI](#ci) · [Upgrading from 1.5](#upgrading-from-15) · [Troubleshooting](#troubleshooting) · [Security](#security)
51
+ [Requirements](#requirements) · [Quickstart](#quickstart) · [Starter prompts](#starter-prompts) · [How it works](#how-it-works) · [Tools](#tools) · [Where results go](#where-results-go) · [Configuration](#configuration--environment-variables) · [CLI](#cli-reference) · [CI](#ci) · [Upgrading](#upgrading) · [Troubleshooting](#troubleshooting) · [Security](#security)
52
52
 
53
53
  ## Requirements
54
54
 
55
55
  **Node.js 20 or newer.** Swipium works with emulators and simulators only; physical devices are refused with `PHYSICAL_DEVICE_UNSUPPORTED` ([why](docs/physical-devices.md)).
56
56
 
57
+ **MCP:** a stdio server that speaks protocol revisions 2025-06-18, 2025-11-25 and 2026-07-28; the client's first message picks one. Claude Code 2.1.285 and later connect on 2026-07-28, Codex 0.146 on 2025-06-18. Any stdio MCP client should work ([protocol versions](docs/mcp-server.md#protocol-versions)).
58
+
57
59
  | Host | Android Emulator | iOS Simulator |
58
60
  | --- | --- | --- |
59
61
  | macOS | Supported | Supported (Xcode with a Simulator runtime) |
@@ -81,6 +83,10 @@ npx -y swipium init claude --scope project --apply # writes .mcp.json, then ru
81
83
 
82
84
  The same command handles `codex`, `gemini`, `cursor`, and `vscode` (`swipium init <client> --apply`). Claude Desktop, Windsurf, manual configs, and per-client details are in **[docs/mcp-server.md](docs/mcp-server.md)**.
83
85
 
86
+ **Codex:** `swipium init codex --apply` appends a `[mcp_servers.swipium]` block to `~/.codex/config.toml` (or `$CODEX_HOME/config.toml`) with longer timeouts and an `env_vars` line. Codex doesn't pass your shell environment to MCP servers, so without that line `SWIPIUM_TEST_*`, `ANDROID_HOME` and `JAVA_HOME` never reach Swipium. If you already have a block, `init` prints the line to add. Keep `tool_timeout_sec = 600` ([Codex setup](docs/mcp-server.md#codex)).
87
+
88
+ **Headless runs** (`codex exec`, `claude -p`, CI): these clients answer consent prompts automatically, so nothing gated (boot, install, build) runs unless you pre-approve exact actions with `SWIPIUM_CONSENT_PREAPPROVE` in the server env ([Headless runs](docs/mcp-server.md#headless-runs)).
89
+
84
90
  **2. Restart the client** and check that it lists `qa_test_this`, `qa_doctor`, and `qa_report`.
85
91
 
86
92
  **3. Ask the agent to test the app:**
@@ -98,7 +104,7 @@ If a tool returns `PROJECT_ROOT_UNRESOLVED`, name the absolute project path in y
98
104
  ### What you'll see
99
105
 
100
106
  - **One approval prompt** listing the exact build, boot, and install commands. Clients with MCP elicitation show a real prompt; others return `requiresConsent`, which the agent must relay to you.
101
- - **The first build can take minutes.** The run is a background job the agent polls with `qa_job_status`.
107
+ - **The first build can take minutes.** The run is a background job the agent polls with `qa_job_status` (each poll waits up to about 45 s).
102
108
  - **Two states.** The job `status` is `running`, `done`, `failed`, or `cancelled`. The run's `result.state` is `completed` or `needs_input` (job `done`), or `blocked` or `unsafe` (job `failed`). `needs_input` means one question for you, such as login credentials.
103
109
  - **A report** with separate verdicts for the app, coverage, and Swipium itself. Read it with `npx swipium report --latest --format markdown`.
104
110
 
@@ -119,7 +125,7 @@ Clients that support MCP prompts can use the built-in ones instead: `swipium_set
119
125
  ```text
120
126
  qa_test_this {mode:"plan"} > qa_test_this {mode:"execute"} > consent > job
121
127
  │
122
- qa_job_status {waitMs} ◄──────────────────────────────┘
128
+ qa_job_status {waitMs} <──────────────────────────────┘
123
129
  ├─ completed / blocked / unsafe > report (qa_get_artifact reportUri)
124
130
  └─ needs_input > ask you one question > qa_continue_from_blocker
125
131
  ```
@@ -164,7 +170,9 @@ Every tool carries MCP annotations: read-only tools declare `readOnlyHint:true`
164
170
 
165
171
  ## Configuration & environment variables
166
172
 
167
- Set these in the MCP server's `env` block (or your shell, for CLI commands). This is the complete list.
173
+ Set these in the MCP server's `env` block (or your shell, for CLI commands). This is the complete list of variables Swipium reads.
174
+
175
+ **Codex** forwards only the names listed in `env_vars` (plus a fixed whitelist such as `HOME` and `PATH`); `swipium init codex` writes that line for you. It deliberately leaves out `CLAUDE_PROJECT_DIR`, `SWIPIUM_DISABLE_DEVICE_DISCOVERY` and the approval grants (`SWIPIUM_CONSENT_PREAPPROVE`, `SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE`, `SWIPIUM_ALLOW_REMOTE_WDA`): set those literally in `env = { ... }` so an inherited shell export or a direnv file in a cloned repo can't grant approvals. Add your own custom `SWIPIUM_*` flow variables to the list. Details: [docs/mcp-server.md](docs/mcp-server.md#codex).
168
176
 
169
177
  | Variable | Purpose |
170
178
  | --- | --- |
@@ -176,14 +184,20 @@ Set these in the MCP server's `env` block (or your shell, for CLI commands). Thi
176
184
  | `APPIUM_HOME` | Extra location searched for an Appium-installed WDA (besides `~/.appium` and global npm). |
177
185
  | `WDA_PROJECT_PATH`, `WEBDRIVERAGENT_PROJECT` | Extra `WebDriverAgent.xcodeproj` candidates reported by `qa_doctor` and `qa_wda` status (to build one, pass `wdaProjectPath`). |
178
186
  | `SWIPIUM_ALLOW_REMOTE_WDA` | Comma-separated exact non-loopback WDA base URLs you pre-approve. Set it in your client config, never in the repository. |
179
- | `SWIPIUM_TEST_*` | Test-account values: `_EMAIL`, `_USERNAME`, `_PASSWORD`, `_OTP`, `_TOKEN`, `_PIN`. Flows and `qa_act` use `${SWIPIUM_TEST_EMAIL}`; `fixtures.json` uses `"var": "SWIPIUM_TEST_EMAIL"`. |
187
+ | `SWIPIUM_TEST_*` | Test-account values: `_EMAIL`, `_USERNAME`, `_PASSWORD`, `_OTP`, `_TOKEN`, `_PIN` (and `_DEEP_LINK` for the starter flows). Flows and `qa_act` use `${SWIPIUM_TEST_EMAIL}`; `fixtures.json` uses `"var": "SWIPIUM_TEST_EMAIL"`. |
180
188
  | Other `SWIPIUM_*` | Flows and fixtures read **only** `SWIPIUM_*` names from the environment (never `${HOME}` or `${AWS_SECRET_ACCESS_KEY}`). Names containing `pass`, `secret`, `token`, `otp`, `pin`, `cvv`, `key`, or `code` are secrets and redacted. |
181
189
  | `SWIPIUM_OCR_CMD` | OCR command for `qa_visual` `find_text` (none bundled; consent-gated). `{image}` becomes a PNG path; it prints `[{"text","confidence","bbox"}]` JSON. `ocrCommand` in `config.json` wins. |
182
190
  | `SWIPIUM_VISUAL_MASK_CMD` | Masks screenshots before OCR and visual providers see them (`visualMaskCommand` in config wins). |
183
- | `SWIPIUM_REQUIRE_ELICITATION=1` | Refuse every consent-gated action (`CONSENT_REFUSED`) when the client can't show a real consent prompt. |
191
+ | `SWIPIUM_REQUIRE_ELICITATION=1` | Refuse every consent-gated action (`CONSENT_REFUSED`) when the client can't show a real consent prompt. Operator pre-approval still applies. |
192
+ | `SWIPIUM_CONSENT_PREAPPROVE` | Comma-separated exact consent action names approved without a prompt (for example `prepare_plan,test_this_plan`), for headless clients such as `codex exec` or `claude -p` that answer prompts automatically. No wildcards; unknown names are ignored with a warning. Actions that run code also need `SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE=1`, and `wda_non_loopback` is never accepted (use `SWIPIUM_ALLOW_REMOTE_WDA`). Read only from the server process env, never the repository. Each approval is still single-use and is logged at `warn` with the exact command. See [Operator pre-approval](docs/concepts.md#operator-pre-approval). |
193
+ | `SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE` | `1` lets `SWIPIUM_CONSENT_PREAPPROVE` cover actions that run repository- or model-chosen code (`build_from_source`, `flow_mutation_run`, `ocr_run`, `seed_state`, `start_metro`, `suite_fresh_state_replay`, `wda_build`, `wda_start`, and a `test_this_plan` that includes a build). Under `codex exec` that code runs outside the client's sandbox. Trusted repositories only. |
184
194
  | `SWIPIUM_RETENTION_DAYS` | Age limit in days for `~/.swipium/runs` session directories (default 30). `0` or `off` disables the automatic prune; `swipium gc` still works. |
185
195
  | `SWIPIUM_RETENTION_KEEP` | Number of newest sessions per project always kept (default 20). |
196
+ | `SWIPIUM_LOG_LEVEL` | Minimum stderr log level: `debug`, `info` (default), `warn`, or `error`. `debug` adds one line per tool call (tool, session, duration, error code; never argument values). |
197
+ | `JAVA_HOME` | JDK used by Gradle builds; `qa_doctor` flags a missing JDK under Codex. |
198
+ | `CODEX_HOME` | Where `swipium init codex` finds `config.toml` (default `~/.codex`). |
186
199
  | `CI` | When set, reports label the run environment as CI. |
200
+ | `GITHUB_SHA`, `GITHUB_REF_NAME`, `GITHUB_SERVER_URL`, `GITHUB_REPOSITORY`, `GITHUB_RUN_ID`, `CI_COMMIT_SHA`, `CI_COMMIT_REF_NAME`, `CI_PIPELINE_URL`, `BITBUCKET_COMMIT`, `BITBUCKET_BRANCH` | Source revision (commit, branch, run URL) recorded in reports and the issue ledger. |
187
201
  | `SWIPIUM_DISABLE_DEVICE_DISCOVERY` | Test-suite isolation only: disables device auto-discovery. Not for normal use. |
188
202
 
189
203
  Generated flows, suites, and code never contain credential values; they reference `SWIPIUM_TEST_*`, `SWIPIUM_SECRET_N`, or `SWIPIUM_GEN_<FIELD>`, which you set when replaying. Generated Appium projects read their own variables (`SWIPIUM_PLATFORM`, `APPIUM_HOST`, `ANDROID_*`, `IOS_*`, …), documented in their README.
@@ -206,20 +220,14 @@ With no subcommand, `swipium` runs the stdio MCP server (what clients launch). `
206
220
 
207
221
  ## CI
208
222
 
209
- `swipium report` renders a finished run as JUnit, SARIF, a GitHub job summary, Markdown, or JSON; `--fail-on-gate` fails the job when the `.swipium/policy.json` release gate blocks. The CLI does not drive devices: CI still needs an agent (such as headless Claude Code) calling the MCP tools, including `qa_flow_run` to replay saved flows. Nobody can approve consent in CI, so install the app before the agent step. Recipe: **[docs/ci-reports.md](docs/ci-reports.md)**.
223
+ `swipium report` renders a finished run as JUnit, SARIF, a GitHub job summary, Markdown, or JSON; `--fail-on-gate` fails the job when the `.swipium/policy.json` release gate blocks. The CLI does not drive devices: CI still needs an agent (such as `claude -p`) calling the MCP tools, including `qa_flow_run` to replay saved flows. Nobody answers consent prompts in CI, so either install the app in the workflow before the agent step (safest) or [pre-approve](docs/ci-reports.md#pre-approving-consents-in-ci) the exact actions the agent needs. Recipe: **[docs/ci-reports.md](docs/ci-reports.md)**.
210
224
 
211
- ## Upgrading from 1.5
225
+ ## Upgrading
212
226
 
213
- 2.0.0 removes and renames tools and tightens defaults. Work through this list:
227
+ Restart your MCP client after every upgrade; a client still running the old server gets `STALE_CLIENT` errors.
214
228
 
215
- 1. **Restart your MCP client.** A client still running the old server gets `STALE_CLIENT` for removed tools and old call shapes.
216
- 2. **Rename environment variables your flows and fixtures read** so they start with `SWIPIUM_` (for example `${TEST_PASSWORD}` becomes `${SWIPIUM_TEST_PASSWORD}`). Other names are no longer read from the environment.
217
- 3. **CI: every app install now asks for consent**, including an APK inside the project. Install the app yourself before the agent step ([docs/ci-reports.md](docs/ci-reports.md)).
218
- 4. **Saved prompts and scripts:** replace removed tools using the [migration table](CHANGELOG.md#migrating-from-150) (also in [docs/tools.md](docs/tools.md#migrating-from-150)), and drop arguments a tool doesn't declare; they now fail with `INVALID_ARGUMENT` instead of being ignored.
219
- 5. **Remote WDA:** `ios.wda.allowNonLoopbackUrls` in `.swipium/config.json` no longer pre-approves a URL. Pass `allowNonLoopback:true` and approve the consent, or list the URL in `SWIPIUM_ALLOW_REMOTE_WDA` in your client config.
220
- 6. **Scripts calling `swipium <unknown>`** now exit 2 instead of starting the server.
221
- 7. **Metro and WDA processes started by 1.5.x** are not cleaned up automatically. Stop them yourself: the Metro process on port 8081 and any old WebDriverAgent `xcodebuild`.
222
- 8. **Known issue:** the first time an iOS session from before the upgrade is rebound, the app may be relaunched once.
229
+ - **From 2.0.x to 2.2.0:** element lists in `structuredContent` are now `@eN` strings (pass `responseMode:"verbose"` for objects), Codex needs the `env_vars` line, `qa_wda build` returns a job, and waits end within about 50 s. See the [2.2.0 upgrade checklist](CHANGELOG.md#220---2026-10-05).
230
+ - **From 1.5.x:** 2.0 removed and renamed tools, reads only `SWIPIUM_*` variables in flows and fixtures, and asks consent for every install. Work through the [2.0.0 upgrade checklist](CHANGELOG.md#200---2026-09-30) and the [migration table](CHANGELOG.md#migrating-from-150) first, then the 2.2.0 one.
223
231
 
224
232
  ## Troubleshooting
225
233
 
@@ -236,11 +244,15 @@ Every error has a `failureCode`, `nextSteps`, and `retrySafe`. `qa_explain_block
236
244
  | `EXPO_PREBUILD_REQUIRED` | The Expo project has no native directories. | Run `npx expo prebuild`, then retry. |
237
245
  | `WDA_UNREACHABLE` | WebDriverAgent isn't running or answering. | `qa_wda {action:"status"}`, then `start` or `attach`. For a plain smoke check, use `goal:"smoke"`, which works visual-only. |
238
246
  | `BACKEND_UNSUPPORTED` | The action needs WDA (iOS visual-only mode). | Attach WDA with `qa_wda`, or use `qa_visual` and `qa_screenshot`. |
239
- | `CONSENT_DECLINED` / `CONSENT_CANCELLED` / `CONSENT_REFUSED` | Nothing ran: you declined, the prompt was dismissed or timed out, or `SWIPIUM_REQUIRE_ELICITATION=1` blocked it. | Re-call to get a fresh prompt if you want the action. |
247
+ | `CONSENT_DECLINED` / `CONSENT_CANCELLED` / `CONSENT_REFUSED` | Nothing ran: you declined, the prompt was dismissed, timed out or failed (`elicitationFailure` says why), or `SWIPIUM_REQUIRE_ELICITATION=1` blocked it. | Re-call for a fresh prompt if you want the action. `likelyAutomatic: true` means a headless client answered in under 1.5 s: don't loop, pre-approve the named `action` with `SWIPIUM_CONSENT_PREAPPROVE` ([Headless runs](docs/mcp-server.md#headless-runs)). |
248
+ | `CANCELLED` | The call or job was cancelled. Not a failure, never recorded as a finding. | Re-call if you still want it. Cancelling a call doesn't stop a background job; `qa_job_cancel` does. |
249
+ | `INVALID_ARGUMENT` | An undeclared, missing, or wrong-typed argument, or an unknown `sessionId`, `jobId` or artifact URI. Nothing ran. | Fix the argument; the result lists `acceptedParameters`. Over-large `waitMs` / `timeoutMs` values are clamped to 50000 with a note, not rejected. |
250
+
251
+ If tool calls time out in the client, raise its tool timeout (Codex `tool_timeout_sec = 600`): waits and job polls end within about 50 s, but a few synchronous steps, such as an iOS Simulator cold boot, can take longer.
240
252
 
241
253
  ## Security
242
254
 
243
- Swipium is a local stdio process with no network listener. Actions with side effects need your [consent](docs/concepts.md#consent), known secret values are [redacted](docs/concepts.md#secrets-and-redaction) from snapshots, artifacts, and reports, and generated output is checked for leaked secrets. A cloned repository's `.swipium/` is treated as untrusted: repo-supplied commands are shown verbatim in the consent prompt, flows read only `SWIPIUM_*` variables, and Swipium never runs `git`. Screenshots are never redacted, so use `qa_start_session { sensitive: true }` to refuse all screen captures when that matters. Details: [Threat Model](THREAT_MODEL.md). Report vulnerabilities privately per the [Security Policy](SECURITY.md).
255
+ Swipium is a local stdio process with no network listener. Actions with side effects need your [consent](docs/concepts.md#consent); each approval is single-use and bound to its session, and only the server's own environment can pre-approve actions (`SWIPIUM_CONSENT_PREAPPROVE`), never a repository file or the model. Known secret values are [redacted](docs/concepts.md#secrets-and-redaction) from snapshots, artifacts, and reports, and generated output is checked for leaked secrets. A cloned repository's `.swipium/` is treated as untrusted: repo-supplied commands are shown verbatim in the consent prompt, flows read only `SWIPIUM_*` variables, and Swipium never runs `git`. Screenshots are never redacted, so use `qa_start_session { sensitive: true }` to refuse all screen captures when that matters. Details: [Threat Model](THREAT_MODEL.md). Report vulnerabilities privately per the [Security Policy](SECURITY.md).
244
256
 
245
257
  ## Contributing and license
246
258
 
package/THREAT_MODEL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Swipium Threat Model
2
2
 
3
- Last updated: 2026-09-30 (Swipium 2.0.1)
3
+ Last updated: 2026-10-05 (Swipium 2.2.0)
4
4
 
5
5
  This document describes what Swipium protects, where its trust boundaries are, who it defends
6
6
  against, and which controls enforce each defense. Every control listed here is implemented in the
@@ -12,7 +12,9 @@ Swipium is a local stdio MCP server. An MCP client (Claude Code, Codex, Gemini C
12
12
  Claude Desktop, Windsurf, or another host) starts it as a child process and drives Android
13
13
  Emulators and iOS Simulators on the developer's own machine. Swipium opens no network listener and
14
14
  has no authentication surface and no multi-tenant state. It runs with the privileges of the user
15
- who started the client.
15
+ who started the client. One binary serves both MCP protocol eras over stdio: `initialize` for
16
+ 2025-06-18 and 2025-11-25 clients, `server/discover` for 2026-07-28 clients. The controls below apply
17
+ to both unless a bullet says otherwise.
16
18
 
17
19
  ## Assets
18
20
 
@@ -51,27 +53,83 @@ Swipium.
51
53
  is single-use and bound to the exact action and affected target (a consent for one package
52
54
  cannot approve another). It is also bound to the session that minted it, expires after
53
55
  30 minutes, and at most 200 are pending at once.
54
- - **Out-of-band elicitation** (`src/server.ts`). When the client advertises MCP form elicitation,
55
- Swipium asks the human directly before the model ever sees a challenge. Only an explicit accept
56
- runs the action. A decline returns `CONSENT_DECLINED`. A dismissed prompt, 10 minutes without an
57
- answer, an aborted call or a transport error returns `CONSENT_CANCELLED`. In both cases the
56
+ - **Out-of-band prompt** (`routePendingConsent` in `src/server.ts`). When the client supports MCP
57
+ form elicitation, Swipium asks the human directly before the model ever sees a challenge. How the
58
+ prompt travels depends on the protocol era the client opened with:
59
+ - **2025-06-18 / 2025-11-25**: an `elicitation/create` request, sent when the client advertised
60
+ form elicitation at `initialize`.
61
+ - **2026-07-28**: that revision has no server-to-client requests, so the same form goes back
62
+ inside an `InputRequiredResult`, sent when that request's `_meta` client capabilities declare
63
+ form elicitation. The client's retry of the tool call carries the user's answer
64
+ (`inputResponses`) and the `requestState` Swipium issued (see the next control).
65
+
66
+ Outcomes are the same on both eras. Only an explicit accept with `approve: true` runs the action,
67
+ once. A decline (or `approve: false`) returns `CONSENT_DECLINED`; a dismissed prompt, no answer
68
+ within 10 minutes, an aborted call or a transport error returns `CONSENT_CANCELLED`. Either way the
58
69
  challenge is burned, so a later `approve:true` re-call cannot revive it, and a `refused` row goes
59
- into the mutation ledger. If the action changes while the prompt is open, the approval is
60
- discarded and nothing runs.
61
- - **`SWIPIUM_REQUIRE_ELICITATION=1`**. Without elicitation support, the fallback is the portable
62
- re-call (`consentId` + `approve:true`). This variable removes that fallback for every consent-gated
63
- action, whatever its risk. Such actions then fail with `CONSENT_REFUSED`.
70
+ into the mutation ledger. While a prompt is open, an `approve:true` re-call cannot approve it, and
71
+ if the action changes under the prompt the approval is discarded and nothing runs. A decline or
72
+ cancel answered in under 1.5 s is flagged `likelyAutomatic` and only then points at
73
+ `SWIPIUM_CONSENT_PREAPPROVE`; a failed prompt (timeout, transport error, aborted call) is never
74
+ flagged and its refusal reason is tagged `transport/abort`. Without form elicitation, the
75
+ challenge goes back to the model as the portable envelope (`consentId` + `approve:true` re-call).
76
+ - **Single-use `requestState`** (2026-07-28 only; `issueConsentPrompt` / `redeemConsentPrompt` in
77
+ `src/consent/consent.ts`, `resumeConsentPrompt` in `src/server.ts`). The spec treats
78
+ `requestState` as attacker-controlled. Swipium's is an opaque 256-bit random handle to a
79
+ server-side record (consentId, tool name, SHA-256 of the canonical call arguments, sessionId,
80
+ issue time); nothing in it is decoded or trusted. It is deleted on first presentation, whatever
81
+ the outcome, so a replay fails. A handle presented with a different tool, different arguments or
82
+ another session fails and burns the consent. Unknown, forged, reused or re-targeted handles are
83
+ rejected with JSON-RPC `-32602` before the tool runs. A retry without an answer gets a fresh
84
+ prompt. The model never receives the `consentId` on this path. Handles live in the server
85
+ process, so a restarted server rejects them and the tool has to be called again.
86
+ - **`SWIPIUM_REQUIRE_ELICITATION=1`**. Removes the portable re-call fallback for every
87
+ consent-gated action, whatever its risk: without form elicitation such actions fail with
88
+ `CONSENT_REFUSED`.
89
+ - **`SWIPIUM_CONSENT_PREAPPROVE`** (operator pre-approval, `CONSENT_ACTION_TIERS` in
90
+ `src/consent/consent.ts`). Headless clients (`codex exec`, `claude -p`) advertise elicitation but
91
+ decline or cancel every prompt themselves. The operator can list exact action names that are
92
+ approved without asking. Rules:
93
+ - It is read only from the server process environment (what the MCP client passes, such as the
94
+ Codex `env` table, plus anything inherited from the launching shell), never from `.swipium/` or
95
+ other repository files, so a compromised model or a cloned project cannot grant it.
96
+ `swipium init codex` deliberately leaves it (and `SWIPIUM_ALLOW_REMOTE_WDA`) out of the
97
+ `env_vars` it forwards, so a shell export or a per-directory env tool such as direnv in a
98
+ cloned repo can't reach a Codex-launched server that way.
99
+ - Exact names only: no wildcards or risk thresholds. Unknown names are ignored with a warning.
100
+ - Actions that run repository- or model-chosen code (`build_from_source`, `flow_mutation_run`,
101
+ `ocr_run`, `seed_state`, `start_metro`, `suite_fresh_state_replay`, `wda_build`, `wda_start`)
102
+ are honoured only with `SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE=1` as well.
103
+ - `test_this_plan` does not cover a bundled sub-step that runs code (such as a
104
+ `build_from_source` step) unless that action is itself pre-approved; otherwise the user is
105
+ asked.
106
+ - `wda_non_loopback` is never pre-approvable by name (see the WebDriverAgent control below).
107
+ - It is checked before any prompt on both eras and wins over `SWIPIUM_REQUIRE_ELICITATION=1`
108
+ (an explicit operator decision).
109
+
110
+ Pre-approved challenges stay single-use and session-bound, are ledgered as `operator-policy`, and
111
+ each use is logged to stderr at `warn` with the exact command. The honoured names are logged once
112
+ at startup.
64
113
  - **Prompt sanitising**. The elicitation text quotes every interpolated field. It strips control
65
114
  characters, newlines, bidi overrides and zero-width characters, and caps each field and the whole
66
115
  message in length. A flow name or URL therefore cannot forge an extra "Will run:" line.
67
116
  - **Exact commands shown**. Challenges carry the exact argv or target: the resolved build command,
68
117
  `adb install -r -g <path>`, a SHA-256 for APKs from outside the project, and seed and provider
69
118
  argv labelled with their origin.
70
- - **Audit trail**. The mutation ledger records how each consent was decided: `elicitation`,
71
- `client-assertion` or `policy`.
72
- - **Strict arguments**. Top-level arguments a tool does not declare are rejected with
73
- `INVALID_ARGUMENT` before the handler runs. For example, `appId` is refused on a tool that would
119
+ - **Audit trail**. The mutation ledger records how each consent was decided: `elicitation` (either
120
+ era), `client-assertion`, `operator-policy` or `policy`.
121
+ - **Strict arguments**. Each tool's arguments are validated against one strict schema
122
+ (`src/lib/toolSchema.ts`) before the handler runs. Undeclared top-level arguments are rejected
123
+ with `INVALID_ARGUMENT`, not stripped: for example, `appId` is refused on a tool that would
74
124
  otherwise act on the session's app.
125
+ - **Bounded responses** (`src/lib/result.ts`, `src/lib/toolSchema.ts`, `src/tools/getArtifact.ts`).
126
+ A caller cannot inflate a response past a client's read buffer, which used to drop the
127
+ connection. Errors cap every string that echoes caller input (`what` and each next step at 2,000
128
+ characters, keeping head and tail; strings inside extra fields at 8,000), list at most 20 unknown
129
+ or invalid arguments with names cut at 100 characters, and drop their extra fields when the
130
+ envelope still exceeds 64 KB. `resources/read` and `qa_get_artifact` return text over 1 MB as a
131
+ head (or, for logs, a tail) with a marker and never inline binaries over 8 MB. `resources/list`
132
+ is capped at 100 entries.
75
133
  - **Guardrail speed bumps**. On debug React Native and Expo builds, data wipes also require
76
134
  `acknowledgeBundleRisk:true`. This guards against accidents. It is not a boundary, because a
77
135
  client can pass the flag.
@@ -97,7 +155,8 @@ A developer clones an untrusted repository and points Swipium at it.
97
155
  `src/services/prepareIos.ts`). Only `localhost`, `127.0.0.0/8` and `[::1]` are used without
98
156
  asking. A non-loopback URL needs `allowNonLoopback:true` and a per-call consent. The repository's
99
157
  `ios.wda.allowNonLoopbackUrls` is ignored as a pre-approval. The only pre-approval is the user's
100
- own `SWIPIUM_ALLOW_REMOTE_WDA` exact-URL list in the MCP server environment. iOS preparation
158
+ own `SWIPIUM_ALLOW_REMOTE_WDA` exact-URL list in the MCP server environment
159
+ (`SWIPIUM_CONSENT_PREAPPROVE` ignores `wda_non_loopback`). iOS preparation
101
160
  never auto-connects to a non-loopback configured URL.
102
161
  - **Path confinement**. Image templates, visual baselines and `qa_flow_repair` targets must resolve
103
162
  inside the project root after symlinks are followed (`src/flows/paths.ts`, `src/tools/visual.ts`).
@@ -177,26 +236,55 @@ their limits.
177
236
  visual capture and device or WDA log for the session (`SENSITIVE_MODE_REFUSED`). Structured
178
237
  snapshots and health checks still work.
179
238
  - **Resource listing scope** (`src/server.ts`). `resources/list` shows only artifacts and app maps
180
- under the current client's project roots (its MCP roots plus the roots of sessions in this server
181
- process). It never lists sensitive-mode sessions and is capped at 100 entries. Unlisted
182
- artifacts stay readable by exact URI.
239
+ under the current client's project roots: the roots of sessions in this server process, plus the
240
+ client's MCP roots on 2025-era connections (requested with a 5 s timeout). On 2026-07-28 MCP
241
+ roots are never requested, since that revision cannot send `roots/list`. It never lists
242
+ sensitive-mode sessions and is capped at 100 entries. Unlisted artifacts stay readable by exact
243
+ URI.
183
244
 
184
245
  ## Environment hygiene
185
246
 
186
247
  - Network changes record the original state and are restored when the report is generated, on
187
248
  `restore`, and on server shutdown.
188
- - Screen recorders and Metro are stopped on shutdown. Managed WDA is left running on purpose, so the
189
- next server can reuse it. `qa_wda stop` stops it.
249
+ - Shutdown runs on `SIGINT`, `SIGTERM`, and when the client goes away: stdin EOF or a closed
250
+ transport, even in the middle of a long call. It cancels every running job first, so none can
251
+ flip device state back afterwards, then restores network state and stops screen recorders and
252
+ Metro. Managed WDA is left running on purpose, so the next server can reuse it. `qa_wda stop`
253
+ stops it.
254
+ - Cancelling a call (`notifications/cancelled`) stops its polling loops and spawned commands, and
255
+ cancelled work is never recorded as a failure or an issue.
190
256
  - `qa_resolve_target include:["plan"]` marks `fresh_start` as unsafe with reason
191
257
  `bundle_cache_loss` on debug React Native and Expo builds.
192
258
 
193
259
  ## Residual risks
194
260
 
261
+ - **The client answers the prompt**. On both protocol versions the answer to the consent form comes
262
+ from the MCP client. A client that fabricates `accept` (on 2026-07-28: retries with
263
+ `inputResponses` saying `approve: true` without showing the user) approves the action; the
264
+ `requestState` handle only guarantees the answer belongs to that one call, once. The
265
+ `likelyAutomatic` flag (answer under 1.5 s) and the ledger are the remaining signals. This is the
266
+ same trust placed in `elicitation/create` on 2025-era clients.
195
267
  - **Self-approval without elicitation**. On a client without elicitation, the re-call is made by
196
268
  the client. A compromised or prompt-injected agent can approve its own challenge. The remaining
197
269
  controls are the human reading the transcript, where both the challenge and the approving call
198
270
  are visible, and the mutation ledger (`client-assertion`). Set `SWIPIUM_REQUIRE_ELICITATION=1`
199
271
  to close this path.
272
+ - **Operator pre-approval is blanket for its actions**. Every call of a listed action runs without
273
+ a prompt, whatever the model asks for, including targets the operator never saw. The ledger
274
+ (`operator-policy`) and a `warn` line on stderr record each use with its exact command; with
275
+ `SWIPIUM_LOG_LEVEL=error` that stderr line is suppressed and only the ledger remains. List only
276
+ what the run needs.
277
+ - **`SWIPIUM_CONSENT_PREAPPROVE_RUN_CODE=1` escapes the client sandbox**. With it, listed actions
278
+ run repository- or model-chosen code (build scripts, seed scripts, OCR commands, `xcodebuild` on a
279
+ model-chosen project, the project's Metro config) with the user's privileges. Under `codex exec`
280
+ that code runs in the Swipium server process, outside the client's sandbox. Set it only for
281
+ trusted repositories.
282
+ - **Inherited environment can grant approvals**. The server reads both variables from its own
283
+ process environment, which includes whatever the client forwards and, for clients that pass the
284
+ launching shell's environment through, that shell's exports. A value exported in a shell profile
285
+ can then silently pre-approve actions in every later session. Codex only forwards what its config
286
+ names, and `swipium init codex` never names these. Set them per client config (for Codex, the
287
+ `env` table), not globally, and check the startup log line that lists the honoured names.
200
288
  - **Approved commands are not sandboxed**. An approved build, seed script or provider command runs
201
289
  with the user's privileges.
202
290
  - **On-screen prompt injection**. Swipium cannot stop an agent from believing text the app shows.
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"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