Repository Public License
1# 5. Architecture decisions to settle early23Write each as a short ADR (context, options, decision, consequences). A recommended default is given; override it if the repository or toolchain argues otherwise.45| ADR | Question | Recommended default |6|---|---|---|7| 0001 | Minimum macOS version and toolchain | Current macOS minus one major; decide from what is installed |8| 0002 | Blueprint / object format | JSON with canonical serialization, explicit `schemaVersion`, migrations from day one |9| 0003 | **How custom logic runs** when the catalog is not enough, given that arbitrary Swift must not be evaluated in the main process | A ladder: (1) declarative actions plus a small typed expression language; (2) scripts in a separate constrained process with no ambient file/network access; (3) real Swift generation only in the Tier C export |10| 0004 | SQLite access layer | One well-maintained library or a thin wrapper; no ORM magic |11| 0005 | **Satellite architecture and signing** | Prebuilt host that embeds the renderer/runtime so a satellite runs without PRISM open; manifest and data kept where they do not invalidate the signature, or the bundle is re-signed (ad hoc locally). Document exactly what Gatekeeper will do with a locally published app |12| 0006 | App Sandbox for PRISM itself | Decide explicitly: sandboxing constrains writing `.app` bundles and spawning workers. Record the trade-off and the real process-level controls used instead |13| 0007 | IPC between PRISM and satellites | XPC or an authenticated local transport; never an unauthenticated local HTTP server. Needed only for cross-app features, not for a satellite to launch |14| 0008 | Agent design | One coordinating agent with typed tools; "roles" are sections of its instructions, not separate running models. Add subagents only for measured gains |1516Also write `docs/security/threat-model.md` covering: generated code, malicious imported files, prompt injection, compromised components, credential exfiltration, cross-app access, local service impersonation, resource exhaustion, unsafe shell execution.17