Repository Public License
1<!--2ORIX OS Automation3File: docs/architecture/environment-audit.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Environment audit — 2026-11-2189Everything below was observed with metadata-only commands on the development Mac. No secret value was read into a10terminal, a log or this repository.1112## Repository1314- No project existed. A new repository was created next to the other ORIX applications of the owner15 (`…/apple/ORIXAutomation`), following their conventions: XcodeGen `project.yml` (the `.xcodeproj` is generated, not16 committed), Swift packages under `Packages/`, release scripts under `Scripts/`, file headers, `dist/` + `build/` ignored.17- A parent folder carries an unrelated `CLAUDE.md` (another product). It is ignored, apart from the shared header convention.18- Git: local repository, branch `main`, no remote yet. Publishing to a remote is a decision left to the owner.1920## Toolchain2122| Item | Value |23|---|---|24| macOS | 27.0 (build 26A5425a), Apple Silicon (arm64) |25| Xcode | 27.2 (27B52), macOS SDK 27.2 |26| Swift | 6.4.2, language mode 6, strict concurrency |27| Tools present | `xcodegen`, `create-dmg`, `python3` (Homebrew), `node`, `/usr/bin/sandbox-exec`, JavaScriptCore `jsc` helper |28| Deployment target chosen | macOS 15.0 (same as the sibling apps); built and tested on 27.0 only |2930## Signing and notarization (metadata only)3132- `security find-identity -v -p codesigning`: one **Developer ID Application** identity (team `3YM54G49SN`) and two33 Apple Development identities. Hashes are not recorded here.34- `xcrun notarytool history --keychain-profile MacLustr-Notarize`: the existing keychain profile answers and lists35 accepted submissions from earlier today for sibling apps. It is reused as is; no credential was created, replaced,36 printed or exported.37- Sibling release scripts (`sign.sh`, `notarize.sh`, `package.sh`) were read and their approach is reused: Xcode signs38 the Release build with the Developer ID identity and Hardened Runtime, `notarytool submit --wait`, staple, `spctl`.3940## Distribution assessment4142| Channel | Verdict |43|---|---|44| Direct distribution (Developer ID + notarization) | **Chosen.** Required for Apple Events to arbitrary apps, Accessibility control, child processes, Seatbelt confinement of scripts and a user LaunchAgent. |45| Mac App Store | **Not targeted.** The App Sandbox forbids most of what the product does (unrestricted Apple Events, Accessibility control of other apps, spawning arbitrary tools, reading user-chosen folders from a background agent without bookmarks per file). No claim of App Store compliance is made. |4647The app is therefore **not sandboxed**. It runs with the Hardened Runtime and one entitlement,48`com.apple.security.automation.apple-events` (needed to send Apple Events under the Hardened Runtime). Its own49permission model (policy engine, grants, Seatbelt confinement of subprocesses) is what bounds the agent; macOS TCC50bounds the app.5152## macOS privacy permissions (TCC)5354None can be granted programmatically, and the app never tries. Each is requested through the standard system flow55when a feature first needs it, and its absence is reported as `BLOCKED_PERMISSION`:5657| Permission | Used by | How it is obtained |58|---|---|---|59| Automation (Apple Events), per target app | `applescript.*`, `jxa.*` | System prompt on first event to each app |60| Accessibility | `accessibility.*`, Watch & Learn | User enables the app in System Settings |61| Screen Recording | `screen.capture`, window titles | System prompt, then System Settings |62| Notifications | approvals, run summaries | System prompt |63| Files and Folders / Full Disk Access | reading protected folders | System prompt per folder; Full Disk Access is never required |6465Status during development: the test processes (`swift test` under the terminal) and the app have whatever the66terminal/app was granted on this Mac; each test suite prints which permission it had and what it skipped.6768## Development provider credentials (SP Chat)6970- Located through the owner's deployment tooling: the SP Chat deployment is a Node service on a cluster node, with71 provider keys injected as process environment variables from a deployment manifest. Variable **names** observed:72 `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `OPENROUTER_API_KEY` (plus others not used here). Values were only ever73 displayed as lengths.74- The operator keeps a copy of that environment in a secrets file outside any repository on this Mac.75- **Strategy:** `Scripts/test/with-dev-keys.sh` is a broker: it reads the three values from that file and places them76 in the environment of one child process (`ORIX_DEV_*_API_KEY`). Nothing is copied into this repository, a `.env`77 file, the Keychain, the app bundle, a fixture or a log. `--check` reports presence by length only (all three present).78- The only code that reads those variables is `DevEnvironmentCredentials`, compiled under `#if DEBUG` and absent from79 Release builds. The shipped app is BYOK: keys typed by the user, stored in the login Keychain.80- **Authorization and cost:** the product owner's brief designates these keys as the development test configuration.81 Live tests are smoke tests on the cheapest models with hard token caps; the whole live suite is budgeted well under82 US$0.05 per run. Results are recorded in `docs/release/live-provider-smoke.md`.8384## Constraints noted8586- The system language is French: scripts force `LC_ALL=C` when parsing tool output; UI tests pass87 `-AppleLanguages "(en)"` for English screenshots.88- Other sessions may use the screen: GUI automation tests are gated on real permission status and never prompt.89