// Code Custodian File ID: A82F6CBB-87C5-4165-85A3-E605BE9E6AAA # THE FACTORY: XCODE NATIVE AGENT DIRECTIVES (ZOOKEEPER) You are an autonomous Apple developer operating inside Xcode for The Factory on Apple Silicon. ### 1. File ID Directive (CRITICAL) ### 2. Factory Concurrency & Persistence Standards - **Strict Concurrency:** Enforce strict Swift 6 `@MainActor` boundaries. Never use `@unchecked Sendable` as a shortcut. - **SwiftData Isolation:** Never use `default.store` or generic `ModelContainer` setups. Always resolve persistent store URLs via `FactoryPaths.databaseURL(for: "ZooKeeper", storeName: "ZooKeeper.store")`. - **Modern State:** Use `@Observable` and `@Bindable`. Never use `@ObservedObject` or `@Published` for new components. - **Testing:** Use modern `import Testing` (`@Suite`, `@Test`, `#expect`), never `XCTest`. - **AppKit Text View Punctuation:** All user-editable text fields, custom mode editors, and code inputs hosted via `NSTextView` must disable automatic smart quotes, smart dashes, and autocorrect. Straight quotes (`"`, `'`) and hyphens (`-`) must be preserved verbatim. ### 3. Dynamic Agent Resolution & Standardized IPC - **Dynamic Resolution:** When writing code that targets Factory agents, NEVER hardcode versioned strings (e.g., "Frank 2.0", "Mike 14.0"). Always resolve dynamically using `FactoryRegistryManager.shared.resolveActiveAgent(baseName:)`. - **Standardized IPC:** NEVER use raw `DistributedNotificationCenter.default()`. Always use `NotificationCenter.postDistributed(...)` and `NotificationCenter.addDistributedObserver(...)` from `FactoryKit`. ### 4. Linked Framework Stubs (Strict Target Boundary) Files in `ZooKeeper/Framework_Stubs/*.api.swift` are read-only headers dynamically linked from `$SHARED_BINARIES`. Do NOT edit stubs or search for framework implementations. Linked Modules for ZooKeeper: * `AIKit.api.swift` ➔ `OpenRouterService`, `OllamaService` * `CacheKit.api.swift` ➔ `CacheKitController` * `DriveKit.api.swift` ➔ `KeychainHelper`, `DriveAuthManager`, `DriveSyncEngine` * `FactoryKit.api.swift` ➔ `FactoryPaths`, `FactoryRegistryManager`, `FactoryRegistry`, `FactoryProject`, `FactoryComms`, `PDSRouter`, `NotificationCenter.postDistributed` * `StreamlineFoundation.api.swift` ➔ `runCommand`, `runAppleScript`, `Date.standardTime`, String/Array utilities * `WarehouseKit.api.swift` ➔ `factoryToast`, `ColumnView`, `TokenField`, `SchemaGuardian` CRITICAL LINKING RULE: You are STRICTLY FORBIDDEN from importing or using unlinked bedrock frameworks (e.g. BrowserKit, CommerceKit, ServerKit, ThemeKit). Do NOT search external directories for unlinked binaries. ### 5. Project Bundles Off-Limits You are strictly FORBIDDEN from reading, searching, or editing `*.xcodeproj` or `project.pbxproj` files. File membership is handled automatically by Xcode via disk groups. ### 6. Directory & Reconnaissance Map DO NOT execute recursive `find` or exploratory `ls` commands. Consult this map for all external Factory paths: - Factory Root: /Users/dave/warezfactory (in Swift: FactoryPaths.root, in Shell: $FACTORY_HOME) - Master Rules: /Users/dave/warezfactory/config/master_roo_rules/ - Master Skills: /Users/dave/warezfactory/config/master_roo_skills/ - Zoo Code Settings: /Users/dave/Library/Application Support/Code/User/globalStorage/zoocodeorganization.zoo-code/settings/custom_modes.yaml - Factory Registry: /Users/dave/warezfactory/config/factory_registry.json - Web Monkey Logins: /Users/dave/warezfactory/config/Web Monkey Logins/ - Local Project Stubs: /Users/dave/warezfactory/xcode/Factory_Apps/ZooKeeper/ZooKeeper/Framework_Stubs/ ### 7. Task Completion & Reporting - **Option A (In-Memory MCP):** If the `crosstalk` MCP server is available, call `crosstalk.request_app_relaunch(project_name: "ZooKeeper")` followed by `crosstalk.report_task_complete`. - **Option B (Direct Dead Drop):** If running standalone without MCP tools, execute a direct, blind overwrite of `.sidecar_result.json` in the project root. Do NOT inspect, `sed`, or test for existing result files.