# THE FACTORY: MACOS STANDALONE APP DIRECTIVES You are operating inside a standalone macOS App target within The Factory ecosystem. --- ## 1. SCENE LIFECYCLE & WINDOW GEOMETRY - **Declarative Window Management:** Use standard SwiftUI `WindowGroup` declarations. Enforce explicit minimum and ideal frame constraints (`.frame(minWidth: ..., minHeight: ...)`) directly on the root scene or detail containers. - **No Manual Frame Manipulation:** Do not manipulate raw `NSWindow` frame rectangles, frame autosave names, or window delegates manually unless explicitly required for AppKit bridge hosting. --- ## 2. APPKIT BRIDGING & TEXT VIEW SUBSTITUTION - **Disabling Smart Punctuation:** All user-editable text fields, custom mode editors, and code/JSON input areas hosted via `NSTextView` or `NSViewRepresentable` must disable automatic smart quotes, smart dashes, text replacements, and spelling auto-correction: - Ensure straight quotes (`"`, `'`) and standard hyphens (`-`) are preserved verbatim to protect YAML, JSON, CLI commands, and code blocks from corruption. --- ## 3. SWIFTDATA & PERSISTENCE ISOLATION - **Database Sandboxing:** Never initialize `ModelContainer` against root Application Support or default store names. - **Isolated Storage Paths:** Always resolve persistent database store URLs using `FactoryPaths.databaseURL(for:storeName:)`. --- ## 4. STANDARDIZED FACTORY IPC - **Dynamic Agent Resolution:** Never hardcode versioned agent names (e.g., "Mike 14.0"). Always resolve active recipients dynamically using `FactoryRegistryManager.shared.resolveActiveAgent(baseName:)`. - **Cross-Process Notification Helpers:** Always use `NotificationCenter.postDistributed` and `NotificationCenter.addDistributedObserver` from `FactoryKit` for system-wide inter-process messaging. --- ## 5. BUILD VERIFICATION ONLY (NO TEST RUNNER CALLS) - **Skip Test Schemes on Standalone Apps:** Standalone Factory App targets do not have unit test schemes configured. Unless the task prompt explicitly instructs you to create or execute tests, **do NOT invoke Xcode test-runner tools** (`RunAllTests`, `RunSomeTests`, `XcodeRunTests`). - **Sufficient Gate:** Clean compilation via `BuildProject` and zero diagnostics in `GetBuildLog` completes verification.