Cotton code
1958 lines · 92.7 KB · YAMLRaw
# The app, as one declarative file.## THIS IS THE ONLY HAND-EDITED FILE in the Xcode half; `Cotton.xcodeproj` is# generated by `scripts/gen-ios-project.sh` and gitignored. That is the repo's# existing rule ("never edit `ios/` by hand; regenerate") with `expo prebuild`# swapped for a generator that is one readable file instead of a plugin pipeline# whose config-mod ORDER was load-bearing.## It also becomes the single readable statement of what twenty config plugins# were writing between them, which today no one file says: the four usage# strings, the background modes, the encryption declaration, the app group, and# portrait-only with no iPad.## Guard: the iOS project spec test — the exact background# modes, and usage strings that actually mention recording, are far cheaper to# assert against a static file than against a generated project.## TWO APPS, ONE SPEC — the owner's DEV MODE decision, 2026-10-03, which# supersedes the 2026-09-09 "there is no dev variant" ruling. The real Cotton# is FROZEN: it is the household's app, and nothing in development touches it.# Every local build, test and simulator run makes COTTON DEV instead, which# sits beside it on the same phone and never shares a byte with it.## ONE SETTING DECIDES WHICH: `COTTON_FLAVOR`, `dev` below and `real` only when# a release lane says so (the fastlane lane's xcargs `COTTON_FLAVOR=real`).# It switches, through Xcode's nested substitution# `$(COTTON_X_$(COTTON_FLAVOR))`, every identifier the phone has:##                    real                            dev#   app id           com.cottondb.cotton             com.cottondb.cotton.dev#   extension        <app id>.share-extension#   app group        group.<app id>#   label (both)     Cotton                         Cotton Dev#   URL scheme       tinmen-cotton                   cottondev#   icon set         AppIcon                         AppIconDev## and stamps `CottonFlavor: $(COTTON_FLAVOR)` into both Info.plists, which# is what `CottonMailbox/AppFlavor.swift` reads at run time (unstamped is dev).# `com.cottondb.cotton` came with its ASC record and its TestFlight# history and does not move (design P19); everything is DERIVED from the one# app id rather than written out, so a rename cannot half-apply. The guard# that the dev side resolves no real identifier, the way Xcode resolves it, is# the app-flavor test.name: Cottonoptions:  bundleIdPrefix: com.cottondb  deploymentTarget:    # iOS 26 is the floor for the app and its share extension: the on-device    # dictation engine's (`DictationFloorGuardTests`).    iOS: "26.0"  createIntermediateGroups: true  generateEmptyDirectories: false  groupSortPosition: top  xcodeVersion: "2650"attributes:  ORGANIZATIONNAME: December FMconfigs:  # `Debug` is the everyday configuration and `Release` is what the archive  # ships. They differ in optimisation and in `DEBUG`, and in NOTHING about  # identity: WHICH APP is `COTTON_FLAVOR`'s, never the configuration's.  Debug: debug  Release: releasesettings:  base:    DEVELOPMENT_TEAM: M7V3QVXZQH    SWIFT_VERSION: "6.0"    IPHONEOS_DEPLOYMENT_TARGET: "26.0"    # `1` is iPhone; `2` would be iPad. It is repeated on EVERY shipped target    # below, and that is not redundancy: xcodegen writes its own    # `TARGETED_DEVICE_FAMILY = 1,2` default into an iOS application target, and    # a TARGET setting beats this project-level one. The generated project said    # `1,2` while this line said `1`, and Apple's upload validator was the first    # thing to notice — three errors at once (an iPad 152x152 icon it could not    # find, and iPad multitasking demanding all four orientations). This line    # stays because it is the default every future target inherits.    TARGETED_DEVICE_FAMILY: "1" # iPhone only — supportsTablet: false    # THE PROJECT-LEVEL DEFAULT IS SAID OUT LOUD. xcodegen writes `SDKROOT =    # iphoneos` at project level only while EVERY target is iOS, and every    # target is (the Mac ships no extension); each target still sets its own, and a target setting beats    # this one, so it changes nothing about what is built.    SDKROOT: iphoneos    ENABLE_USER_SCRIPT_SANDBOXING: YES    SWIFT_STRICT_CONCURRENCY: complete    # WHICH APP THIS BUILD IS — see the header. `dev` unless a release lane    # passes `COTTON_FLAVOR=real`; the `_real`/`_dev` pairs below are the    # only places either side's identifiers are written.    COTTON_FLAVOR: dev    # The app group and the three identifiers, all derived from ONE id.    COTTON_APP_ID_real: com.cottondb.cotton    COTTON_APP_ID_dev: com.cottondb.cotton.dev    COTTON_APP_ID: $(COTTON_APP_ID_$(COTTON_FLAVOR))    COTTON_APP_GROUP: group.$(COTTON_APP_ID)    # ONE KEYCHAIN GROUP FOR EVERY COTTON APP ON THE PHONE (e2e rulings R9,    # 16 Nov 2026): the device key, the vault key and each database's data    # key live there, under the one service `AppFlavor.phoneKeychainService`,    # so the first app founds, an app installed later opens with no step, and    # deleting any one app changes nothing while another is installed. The    # Keys provider and Messages' notification extension read it too. Cotton    # and Cotton Dev never share one; a business app with no dev pair keeps a    # group of its own (`ios-spec-gate.ts`). The entitlement prefixes it with    # $(AppIdentifierPrefix).    COTTON_KEYCHAIN_GROUP_real: com.cottondb.vault    COTTON_KEYCHAIN_GROUP_dev: com.cottondb.vault.dev    COTTON_KEYCHAIN_GROUP: $(COTTON_KEYCHAIN_GROUP_$(COTTON_FLAVOR))    # The App Group EVERY Cotton app shares, real and dev alike, for the one    # thing a phone should hold once: the voice models (the voice plan, 17 Nov    # 2026; `CottonVoice/VoiceModelStore.swift`). A model is downloaded by    # whichever app asks first and every other app finds it ready. Each app's    # own group above stays its only channel to its extensions. One setting,    # so an app whose profile does not yet carry the group can be pointed back    # at its own group in one line while the profile is refreshed.    COTTON_SHARED_GROUP: group.com.cottondb.shared    # The label on the home screen, in both Info.plists.    COTTON_DISPLAY_NAME_real: Cotton    COTTON_DISPLAY_NAME_dev: Cotton Dev    COTTON_DISPLAY_NAME: $(COTTON_DISPLAY_NAME_$(COTTON_FLAVOR))    # The URL scheme — see `CFBundleURLTypes` on the app target.    COTTON_URL_SCHEME_real: tinmen-cotton    COTTON_URL_SCHEME_dev: cottondev    COTTON_URL_SCHEME: $(COTTON_URL_SCHEME_$(COTTON_FLAVOR))    # The icon set in `App/Cotton/Assets.xcassets`. `AppIconDev` is DERIVED    # from the one master (`scripts/derive-icons.ts`), never drawn.    COTTON_APPICON_NAME_real: AppIcon    COTTON_APPICON_NAME_dev: AppIconDev    COTTON_APPICON_NAME: $(COTTON_APPICON_NAME_$(COTTON_FLAVOR))    # The version, said ONCE. Two Info.plists carry it; two literals is one    # chance to ship a build number that disagrees with itself.    COTTON_MARKETING_VERSION: "1.0.0"    COTTON_BUILD_NUMBER: "1"    # The commit the bundle was built from, stamped into both Info.plists    # as `CottonBuildCommit` — the key the Mac's `build-app.sh` stamps, read by    # `CottonKit/Reporting.swift` (`BuildFacts.commit`), so a build that is not    # the release says which commit it is. EMPTY here, because a build setting    # cannot run git: whoever builds passes `COTTON_BUILD_COMMIT=<sha>[+changes]`    # on the command line — the local runners (`ios-install-device.sh`,    # `ios-launch-smoke.sh`) and the shipping lane's xcargs.    COTTON_BUILD_COMMIT: ""    # The Bugsink address, EMPTY here on purpose: a local build, a test host    # and a simulator report nothing (`CottonKit/Reporting.swift`'s three    # "no"s), and the shipping lane passes the real one as one xcargs setting    # — the fastlane lane `ios_beta!`, from `COTTON_SENTRY_DSN` in its    # environment, which the workflows take from the `COTTON_IOS_SENTRY_DSN`    # secret. Only the app's Info.plist reads it: the share extension keeps    # the dropping sink.    COTTON_SENTRY_DSN: ""    # THE EXTENSION GATE, and it defaults ON.    #    # It is not about which app this is (`COTTON_FLAVOR` is). What it is for    # is a build that does not want to sign an extension it is not testing:    # an extra target, a profile to resolve, and a codesign failure at the END    # of a long build if any of that has rotted. The everyday loop should not    # need a flag, so it defaults to YES.    #    # THE GATE IS APPLIED WHEN THE PROJECT IS GENERATED, not when it is built,    # because a build SETTING cannot drop a target: an extension stripped from    # the app afterwards still had to build and sign, and Xcode's own    # `ValidateEmbeddedBinary` then fails on the hole. This line is the    # DEFAULT; `scripts/gen-ios-project.sh` reads it and lets an environment    # variable of the same name override it:    #    #   COTTON_SHARE_ENABLED=NO pnpm ios:project    #    # It stays declared here as a build setting so the value is visible in    # Xcode and readable by a guard, and so there is ONE place the default    # lives.    COTTON_SHARE_ENABLED: YES  configs:    Debug:      # The ONLY per-configuration difference that is not optimisation. No      # identifier, no label and no URL scheme varies by CONFIGURATION: what      # the app IS varies by `COTTON_FLAVOR` alone, so a Release build of      # Cotton Dev is still Cotton Dev.      SWIFT_ACTIVE_COMPILATION_CONDITIONS: DEBUGpackages:  Cotton:    path: .  # The faces, the look and the values they draw from — a package with no Rust  # in it (`apps/loom/Package.swift`), which `Cotton` depends on by path.  Loom:    path: ../loom  # The ONE third-party package, on the app target only, pinned to the Mac's  # version so the build runner's SwiftPM cache pays for its half-gigabyte of  # binary targets once. `SourceGuardTests` pins both facts. Bugsink speaks the  # Sentry protocol; the SDK's own transport is the one connection this app  # opens that is not Rust's, and it reaches Bugsink, never a Cotton server.  sentry-cocoa:    url: https://github.com/getsentry/sentry-cocoa    exactVersion: 9.9.0# BUSINESS FLAVOURS — one app per business, built from this same tree# (19 Oct 2026). Each entry is a whole TARGET FAMILY: the app and its# share extension, cloned from `Cotton`'s two with this identity in place of# Cotton's, plus a scheme of the same name. The clone is written when the# project is GENERATED (`scripts/ios-spec-gate.ts`, `businessFamily`), so this# file says each business once and hand-copied targets cannot drift.## One identity whatever `COTTON_FLAVOR` says: a business app is one App Store# record, and `COTTON_FLAVOR` keeps deciding the core's side (real or dev) only.# `manifest` rides in the app's bundle as `flavour.json`; the app reads it at# launch (`CottonKit/FlavourManifest.swift`) and hands it to the core. `icons`# is the flavour's own asset catalogue, carrying `appIcon`.## Guard: `scripts/__tests__/business-flavour.test.ts`.businessFlavours:  # Cotton Books — the books kit's app over the owner's personal object  # (owner, 4 Nov 2026): its reader opens EPUB and PDF, so it declares both  # document types, ranked Alternate (it reads them, it does not own them) and  # opened as a COPY (`LSSupportsOpeningDocumentsInPlace` false): the share  # drain's book branch reads the file once and the book row keeps it. Its  # share sheet takes those two and a Goodreads export (`shareRule`). Like  # Cotton it is two apps by `COTTON_FLAVOR` (`dev`): Cotton Books Dev beside  # the real one, on the dev Worker.  books:    target: CottonBooks    appId: com.cottondb.books    displayName: Books.    urlScheme: cottonbooks    appIcon: AppIconBooks    dev:      appId: com.cottondb.books.dev      displayName: Books Dev.      urlScheme: cottonbooksdev      appIcon: AppIconBooksDev    icons: App/Flavours/books/Assets.xcassets    manifest: App/Flavours/books/flavour.json    info:      CFBundleDocumentTypes:        - CFBundleTypeName: EPUB book          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - org.idpf.epub-container        - CFBundleTypeName: PDF document          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - com.adobe.pdf      LSSupportsOpeningDocumentsInPlace: false    # Only a book or a Goodreads library export is shared into Cotton Books:    # an EPUB, a PDF or a CSV, one at a time. A predicate, because the    # dictionary form cannot name a type.    shareRule: >-      SUBQUERY(extensionItems, $item, SUBQUERY($item.attachments, $file,      ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "org.idpf.epub-container"      OR ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "com.adobe.pdf"      OR ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.comma-separated-values-text"      ).@count == 1).@count == 1  # Cotton Music — the music kit's app over the owner's personal object  # (owner, 4 Nov 2026), opening on the Music tool's Listening deck with the  # sync card last. It plays the audio it is handed, so it declares the common  # audio types, ranked Alternate (it plays them, it does not own them) and  # opened as a COPY (`LSSupportsOpeningDocumentsInPlace` false). FLAC needs  # no import of its own: iOS declares `org.xiph.flac` (MobileCoreTypes), and  # Ogg is Cotton's import, inherited. Its background modes are Cotton's,  # inherited whole: `audio` keeps a song playing with the screen locked. Like  # Cotton Books it is two apps by `COTTON_FLAVOR` (`dev`).  music:    target: CottonMusic    appId: com.cottondb.music    displayName: Music.    urlScheme: cottonmusic    appIcon: AppIconMusic    dev:      appId: com.cottondb.music.dev      displayName: Music Dev.      urlScheme: cottonmusicdev      appIcon: AppIconMusicDev    icons: App/Flavours/music/Assets.xcassets    manifest: App/Flavours/music/flavour.json    info:      CFBundleDocumentTypes:        - CFBundleTypeName: MP3 audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.mp3        - CFBundleTypeName: MPEG-4 audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.mpeg-4-audio        - CFBundleTypeName: FLAC audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - org.xiph.flac        - CFBundleTypeName: WAVE audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - com.microsoft.waveform-audio        - CFBundleTypeName: AIFF audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.aiff-audio        - CFBundleTypeName: Ogg audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - org.xiph.ogg        - CFBundleTypeName: Audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.audio      LSSupportsOpeningDocumentsInPlace: false    # Only audio is shared into Cotton Music: one file or many, a folder of    # them, or an album ZIP (a Bandcamp download, 7 Nov 2026), and every    # attachment audio, a folder or a ZIP — a photo beside a song turns the    # sheet away. A predicate, because the dictionary form cannot name a type.    shareRule: >-      extensionItems.@count > 0 AND      SUBQUERY(extensionItems, $item, $item.attachments.@count > 0      AND SUBQUERY($item.attachments, $file,      (ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.audio")      OR (ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.folder")      OR (ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.zip-archive")      ).@count == $item.attachments.@count).@count == extensionItems.@count  # Cotton Cinemas — the cinemas kit's app over the owner's personal object  # (owner, 5 Nov 2026), opening on Films (6 Nov 2026) with the sync card last.  # It plays the films it is handed, so it declares MP4, QuickTime, AVI and  # Matroska, ranked Alternate and opened as a COPY. iOS declares no Matroska  # type, so `org.matroska.mkv` is imported here, beside Cotton's Ogg and  # Opus. Its background modes are Cotton's without `audio`: a film stops when  # the phone locks or the app goes (picture in picture and AirPlay stay, and  # need no background audio). Two apps by `COTTON_FLAVOR` (`dev`).  cinemas:    target: CottonCinemas    appId: com.cottondb.cinemas    displayName: Cinemas    urlScheme: cottoncinemas    appIcon: AppIconCinemas    dev:      appId: com.cottondb.cinemas.dev      displayName: Cinemas Dev      urlScheme: cottoncinemasdev      appIcon: AppIconCinemasDev    icons: App/Flavours/cinemas/Assets.xcassets    manifest: App/Flavours/cinemas/flavour.json    # The streaming build's faces (assets/design/cinemas/cinemas-3.html): Big    # Shoulders Display and DM Sans, SIL OFL, the same files Android ships, so    # the two phones read alike. Bundled as the folder `font`.    resources:      - ../android/app/src/cinemas/res/font    info:      # Motion at the display's rate, 120 Hz on ProMotion (MOTION.md "Frame rate").      CADisableMinimumFrameDurationOnPhone: true      CFBundleDocumentTypes:        - CFBundleTypeName: MPEG-4 film          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.mpeg-4        - CFBundleTypeName: QuickTime film          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - com.apple.quicktime-movie        - CFBundleTypeName: AVI film          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.avi        - CFBundleTypeName: Matroska film          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - org.matroska.mkv      LSSupportsOpeningDocumentsInPlace: false      # A sealed film plays to an AirPlay TV from the phone's Wi-Fi address      # (cinemas-airplay, 18 Nov 2026), so the Local Network ask names that      # too. The sentence is the kit's line `cinemas.player.local_network`,      # held equal to it by business-flavour.test.ts. `NSAllowsLocalNetworking`      # (http to a private address, nothing wider) is Cotton's, inherited.      NSLocalNetworkUsageDescription: >-        Cotton Cinemas looks for your Mac on this network, and plays your films to a TV on the same Wi-Fi.      UIBackgroundModes:        - remote-notification        - fetch        - processing      UTImportedTypeDeclarations:        - UTTypeIdentifier: org.matroska.mkv          UTTypeDescription: Matroska film          UTTypeConformsTo:            - public.movie          UTTypeTagSpecification:            public.filename-extension:              - mkv            public.mime-type:              - video/x-matroska        - UTTypeIdentifier: org.xiph.ogg          UTTypeDescription: Ogg audio          UTTypeConformsTo:            - public.audio          UTTypeTagSpecification:            public.filename-extension:              - ogg              - oga            public.mime-type:              - audio/ogg        - UTTypeIdentifier: org.xiph.opus          UTTypeDescription: Opus audio          UTTypeConformsTo:            - org.xiph.ogg            - public.audio          UTTypeTagSpecification:            public.filename-extension:              - opus            public.mime-type:              - audio/opus    # Only films are shared into Cotton Cinemas: one file or many, or a folder    # of them, and every attachment a film or a folder — a photo beside a film    # turns the sheet away. A predicate, as Cotton Music's.    shareRule: >-      extensionItems.@count > 0 AND      SUBQUERY(extensionItems, $item, $item.attachments.@count > 0      AND SUBQUERY($item.attachments, $file,      (ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.movie")      OR (ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.folder")      ).@count == $item.attachments.@count).@count == extensionItems.@count  # Cotton Money — the money kit's app over the owner's personal object  # (owner, 6 Nov 2026): Money as it stands in Cotton, its views the fan's  # first tier. It takes no shares (`share: false`): Money's rows are written  # by an assistant over MCP (a statement filed, read and booked, a payment  # recorded), and a shared file in Cotton is a document, which this kit does  # not hold. Two apps by `COTTON_FLAVOR` (`dev`).  # The icons are Cotton's own until the painted one lands.  money:    target: CottonMoney    appId: com.cottondb.money    displayName: Money    urlScheme: cottonmoney    appIcon: AppIconMoney    dev:      appId: com.cottondb.money.dev      displayName: Money Dev      urlScheme: cottonmoneydev      appIcon: AppIconMoneyDev    icons: App/Flavours/money/Assets.xcassets    manifest: App/Flavours/money/flavour.json    share: false  # Cotton Vault (slug keys) — the keys kit's app over the owner's personal object,  # scaffolded by `pnpm app:provision` from its registry row. The icons are  # Cotton's own until the painted one lands.  keys:    target: CottonKeys    appId: com.cottondb.keys    displayName: Secrets    urlScheme: cottonkeys    appIcon: AppIconKeys    dev:      appId: com.cottondb.keys.dev      displayName: Secrets Dev      urlScheme: cottonkeysdev      appIcon: AppIconKeysDev    icons: App/Flavours/keys/Assets.xcassets    manifest: App/Flavours/keys/flavour.json    share: false    # Cotton's entitlements and the AutoFill credential provider's, which the    # identity store (`PasskeyIdentities`) needs beside the provider.    entitlements: App/Flavours/keys/Keys.entitlements    # Cotton Vault's faces, Inter and JetBrains Mono with their SIL OFL    # licences (`VaultFonts`); Cotton Health ships the same folder.    resources:      - App/Flavours/keys/VaultFonts      # Cotton Secrets' faces, Red Hat Text and Red Hat Mono (assets/design/keys/DECISIONS.md "The look"), and Look's      # four faces, all SIL OFL with their licences (`SecretsFonts`, `WritingFonts`).      - ../../assets/fonts/look    # The home-screen icon follows the ink (iPhone only; keys/DECISIONS.md    # "Look"): Plum's asterisk is the primary icon, one alternate per other ink,    # drawn by scripts/draw-app-icons.mjs secrets.    settings:      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Jade $(COTTON_APPICON_NAME)Garnet $(COTTON_APPICON_NAME)Indigo $(COTTON_APPICON_NAME)Graphite    # Cotton Secrets follows the phone's light or dark through the paper Look    # chose for each (Lilac and Night by default).    info:      UIUserInterfaceStyle: Automatic      # Scan their code, in the one-time check with a person (CONTRACT S1).      NSCameraUsageDescription: >-        Secrets uses the camera only to scan a person's check code.    # Cotton Keys is the passkey app: its family carries the passkey provider    # (`passkeyProvider` below), and no other flavour does — Cotton never.    provider: true  # Cotton Downloads — the downloads kit's app over the owner's personal object,  # scaffolded by `pnpm app:provision` from its registry row. The icons are  # Cotton's own until the painted one lands.  downloads:    target: CottonDownloads    appId: com.cottondb.downloads    displayName: Downloads    urlScheme: cottondownloads    appIcon: AppIconDownloads    dev:      appId: com.cottondb.downloads.dev      displayName: Downloads Dev      urlScheme: cottondownloadsdev      appIcon: AppIconDownloadsDev    icons: App/Flavours/downloads/Assets.xcassets    manifest: App/Flavours/downloads/flavour.json    # Its share sheet takes what becomes a download and nothing else: one web    # link, text (a magnet is text), or one .torrent file. A predicate, as    # Cotton Music's. A web page item carries a URL attachment too.    shareRule: >-      SUBQUERY(extensionItems, $item, SUBQUERY($item.attachments, $file,      ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"      OR ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text"      OR ANY $file.registeredTypeIdentifiers UTI-CONFORMS-TO "org.bittorrent.torrent"      ).@count >= 1).@count == 1    # The system names a .torrent only for an app that declares the type.    info:      UTImportedTypeDeclarations:        - UTTypeIdentifier: org.bittorrent.torrent          UTTypeDescription: BitTorrent file          UTTypeConformsTo:            - public.data          UTTypeTagSpecification:            public.filename-extension:              - torrent            public.mime-type:              - application/x-bittorrent  # Cotton Notes — the notes kit's app over the owner's personal object  # (owner, 11 Nov 2026): the Notebook tool and the note, with the projects and  # people a note's page links. The store says Cotton Notes; the home screen  # says Notes., Apple's Notes being an App Store name (ITMS-90129, as Books.).  # It takes no shares, as Todos: a note is written on the card or by an  # assistant over MCP.  notes:    target: CottonNotes    appId: com.cottondb.notes    displayName: Words    urlScheme: cottonnotes    appIcon: AppIconNotes    dev:      appId: com.cottondb.notes.dev      displayName: Words Dev      urlScheme: cottonnotesdev      appIcon: AppIconNotesDev    icons: App/Flavours/notes/Assets.xcassets    manifest: App/Flavours/notes/flavour.json    share: false    # Cotton Notes' faces (assets/design/notes/DECISIONS.md "Look"): Figtree    # for the words, JetBrains Mono for code, both SIL OFL with their    # licences (`NotesFonts`), carried by Notes alone.    resources:      - App/Flavours/notes/NotesFonts      # The faces Look offers in every redesigned app (shared/DECISIONS.md      # "Look"), all SIL OFL with their licences.      - ../../assets/fonts/look    # The home-screen icon follows the ink (iPhone only, owner, 23 Nov 2026;    # shared/DECISIONS.md "Look"): one alternate set per ink but the default,    # named after the primary (AppIconNotesRed, AppIconNotesDevRed), drawn by    # scripts/draw-app-icons.mjs.    settings:      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Red $(COTTON_APPICON_NAME)Green $(COTTON_APPICON_NAME)Black    # Only what this app uses (launch-ios, 22 Nov 2026; App Review 5.1.1(ii)    # and 2.5.4): Cotton's other prompts, background modes and tasks are    # dropped by the gate (`ownPermissions`). The core seals with its own    # X25519, AES-256-GCM and Ed25519 (crates/cotton-core), standard    # encryption beyond the exempt kinds, so export compliance is answered    # Yes, mass market (assets/design/LAUNCH.md section 4).    ownPermissions: true    privacyManifest: App/Flavours/notes/PrivacyInfo.xcprivacy    # Notes follows the phone's appearance (notes-new-ios, 19 Nov 2026): a    # look for light and one for dark, the core's (`notes.themes`).    info:      UIUserInterfaceStyle: Automatic      NSMicrophoneUsageDescription: >-        Words uses the microphone when you tap the mic, to write down what you        say in your note.      NSSpeechRecognitionUsageDescription: >-        Words turns what you say into text in your note. With on-device        recognition, your voice never leaves your phone.      NSCameraUsageDescription: >-        Words uses the camera when you take a picture to put in a note, and to        scan the code on your other device when you approve it.      NSPhotoLibraryAddUsageDescription: >-        Words saves a picture to your photo library when you choose Save Image.      NSFaceIDUsageDescription: >-        Words uses Face ID to check it is you before you approve another phone        or show your recovery code.  # Cotton People — the people kit's app over the owner's personal object  # (owner, 11 Nov 2026): the People tool and the person, with Birthdays  # folded in as People's views. The store says Cotton People; the home screen  # says People., as Notes. It takes no shares, as Notes: a person comes from  # the card, the phone's contacts on Plus, or an assistant over MCP.  people:    target: CottonPeople    appId: com.cottondb.people    displayName: People    urlScheme: cottonpeople    appIcon: AppIconPeople    dev:      appId: com.cottondb.people.dev      displayName: People Dev      urlScheme: cottonpeopledev      appIcon: AppIconPeopleDev    icons: App/Flavours/people/Assets.xcassets    manifest: App/Flavours/people/flavour.json    share: false  # Cotton Chat (Cotton Messages until 19 Nov 2026; bundle ids, target and slug  # keep the old name so nobody reinstalls) — the messages kit's app over the owner's personal object  # (owner, 11 Nov 2026): the Messages tool, its threads, messages, stories and  # the chat screen, with the people and contacts a thread's face names. The  # store says Cotton Messages; the home screen says Messages., Apple's  # Messages being an App Store name (as Books.). It takes no shares and  # imports nothing: its tables are to be sealed on the device first.  messages:    target: CottonMessages    appId: com.cottondb.messages    displayName: Comms    urlScheme: cottonmessages    appIcon: AppIconMessages    dev:      appId: com.cottondb.messages.dev      displayName: Comms Dev      urlScheme: cottonmessagesdev      appIcon: AppIconMessagesDev    icons: App/Flavours/messages/Assets.xcassets    manifest: App/Flavours/messages/flavour.json    share: false    # Communication Notifications (20 Nov 2026): the    # extension's rewritten push is a communication notification from its    # sender (`INSendMessageIntent`), drawn so only once the app carries    # App/Flavours/messages/Messages.entitlements. Turn it on with    # `entitlements: App/Flavours/messages/Messages.entitlements` once both    # App IDs have the Communication Notifications capability at Apple and    # their profiles are made again; before that it would not sign. Without    # it the notification still names the sender, without their picture.    # Cotton Chat's faces (assets/design/chat/DECISIONS.md "Look"): Hanken    # Grotesk for every word, and Noto Sans for the Indian scripts, matched in    # weight, all SIL OFL with their licences (`ChatFonts`), carried by Chat alone.    resources:      - App/Flavours/messages/ChatFonts      - ../../assets/fonts/look    # Cotton to Cotton chat (13 Nov 2026): the engine that keeps the chat key,    # the socket and the alert token (`CottonChat`), started by the shared app    # source under COTTON_CHAT, and the notification extension that rewrites a    # chat push to its sender and words (`notifications`). Push and the app    # group come with Cotton's entitlements.    # Calls inside Cotton Chat (19 Nov 2026): Calling's    # engine (`CottonCalls`: the call center, CallKit, PushKit, WebRTC)    # under Chat's own screens. The VoIP push needs the voip background mode,    # kept here with the base modes it would otherwise replace (the merge is    # shallow), and the App IDs need Push Notifications at Apple.    dependencies:      - package: Cotton        product: CottonChat      - package: Cotton        product: CottonCalls    # The home-screen icon follows the ink (iPhone only; shared/DECISIONS.md    # "Look"): Terracotta is the primary icon.    settings:      SWIFT_ACTIVE_COMPILATION_CONDITIONS: $(inherited) COTTON_CHAT      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Blue $(COTTON_APPICON_NAME)Green $(COTTON_APPICON_NAME)Black    notifications: true    info:      # An audio file opened into Comms becomes a recording (CONTRACT.md      # "Recordings", Import): Files and a share sheet's Open in list it.      CFBundleDocumentTypes:        - CFBundleTypeName: Audio          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - public.audio      LSSupportsOpeningDocumentsInPlace: false      NSMicrophoneUsageDescription: >-        Cotton Comms uses your microphone for the calls you make and answer,        for voice messages you record, when you tap the mic to dictate, and        for the meetings and notes you record yourself. Your voice goes        straight to the person you are talking to, encrypted end to end; a        recording stays sealed in your own copy.      NSCameraUsageDescription: >-        Cotton Comms uses your camera for video calls, only while a video call        is on and your camera is turned on, to take a picture you send, and to        scan the code on your other device when you approve it.      NSFaceIDUsageDescription: >-        Cotton Comms uses Face ID to check it is you before you approve another        device or show your recovery code.      # The communication notification's intent (`App/ChatNotifications`).      NSUserActivityTypes:        - INSendMessageIntent      # "Find people I know" (20 Nov 2026): asked only when      # the person chooses it; the numbers leave the phone only scrambled.      NSContactsUsageDescription: >-        Cotton Comms checks which of your contacts use Cotton Comms, only when        you ask it to. Their numbers leave your phone only in a scrambled form,        and Cotton Comms keeps none of them.      # Chat's Warm look has a night version that follows the phone's setting.      UIUserInterfaceStyle: Automatic      # You's Mail row opens Cotton Post when it is on the phone, else says it is not (COMMS WITHOUT MAIL).      LSApplicationQueriesSchemes:        - cottonmail        - cottonmaildev      UIBackgroundModes:        - voip        - audio        - remote-notification        - fetch        - processing  # Cotton Developer — the developer kit's app over the owner's personal object  # (owner, 11 Nov 2026): the Memories, Machines and Artifacts tools that lived  # in the parked all-in-one Cotton app, with the projects a memory and a page  # belong to. The store says Cotton Developer; the home screen says  # Developer., Apple's Developer being an App Store name. It takes no shares:  # a memory, a machine's row and an artifact are written by an assistant over  # MCP.  developer:    target: CottonDeveloper    appId: com.cottondb.developer    displayName: Developer.    urlScheme: cottondeveloper    appIcon: AppIconDeveloper    dev:      appId: com.cottondb.developer.dev      displayName: Developer Dev.      urlScheme: cottondeveloperdev      appIcon: AppIconDeveloperDev    icons: App/Flavours/developer/Assets.xcassets    manifest: App/Flavours/developer/flavour.json    share: false  # Cotton Photos — the photos kit's app over the owner's personal object  # (owner, 12 Nov 2026): albums and prints of the person's own photos and  # videos. The store says Cotton Photos; the home screen says Photos., Apple's  # Photos being an App Store name. A picture comes in by the phone's picker,  # the camera or Files, never by a shared file: it takes no shares.  photos:    target: CottonPhotos    appId: com.cottondb.photos    displayName: Photos.    urlScheme: cottonphotos    appIcon: AppIconPhotos    dev:      appId: com.cottondb.photos.dev      displayName: Photos Dev.      urlScheme: cottonphotosdev      appIcon: AppIconPhotosDev    icons: App/Flavours/photos/Assets.xcassets    manifest: App/Flavours/photos/flavour.json    share: false  # Cotton Journal — the journal kit's app over the owner's personal object  # (owner, 12 Nov 2026): a private daily journal, its entries sealed on the  # object from the first build. The store says Cotton Journal; the home  # screen says Journal., Apple's Journal being an App Store name. It takes no  # shares: an entry is written on its page, Plus opening a blank one.  journal:    target: CottonJournal    appId: com.cottondb.journal    displayName: Journal.    urlScheme: cottonjournal    appIcon: AppIconJournal    dev:      appId: com.cottondb.journal.dev      displayName: Journal Dev.      urlScheme: cottonjournaldev      appIcon: AppIconJournalDev    icons: App/Flavours/journal/Assets.xcassets    manifest: App/Flavours/journal/flavour.json    share: false  # Cotton Calling — the calling kit's app over the owner's personal object  # (owner, 12 Nov 2026): one-to-one audio and video calls between people who  # use Cotton, WebRTC peer to peer, signalled by the Worker's call room. The  # store says Cotton Calling; the home screen says Calling. Its urlScheme is  # the door another Cotton app opens to place a call  # (cottoncalling://call?person=<id>&video=0|1). It takes no shares.  #  # Cotton Health — the health kit's app over the owner's personal object  # (owner, 12 Nov 2026): Apple Health's numbers read from HealthKit on the  # iPhone, read-only, sealed on the object. The store says Cotton Health;  # the home screen says Health., Apple's Health being an App Store name. It  # takes no shares: its rows come from HealthKit, read-only. It links  # `CottonHealthKit` (no other app names HealthKit), carries the HealthKit  # entitlement with background delivery and no clinical records, and says  # why it reads; it never asks to write, so it has no update string.  # `COTTON_HEALTH` lets the shared app source attach its engine.  health:    target: CottonHealth    appId: com.cottondb.health    displayName: Health.    urlScheme: cottonhealth    appIcon: AppIconHealth    dev:      appId: com.cottondb.health.dev      displayName: Health Dev.      urlScheme: cottonhealthdev      appIcon: AppIconHealthDev    icons: App/Flavours/health/Assets.xcassets    manifest: App/Flavours/health/flavour.json    share: false    entitlements: App/Flavours/health/Health.entitlements    # Cotton Health draws in health.look, the same faces as Vault's (Inter    # and JetBrains Mono, SIL OFL), shipped from Vault's one folder.    resources:      - App/Flavours/keys/VaultFonts    dependencies:      - package: Cotton        product: CottonHealthKit    settings:      SWIFT_ACTIVE_COMPILATION_CONDITIONS: $(inherited) COTTON_HEALTH    info:      NSHealthShareUsageDescription: >-        Cotton Health reads what Apple Health keeps (activity, heart, sleep,        workouts, body measurements, vitals, mobility, hearing, nutrition and        cycle tracking) into your own database, sealed so only your devices        can read it. It never writes to Apple Health.      # Apple refuses an upload whose app holds the HealthKit entitlement      # without this second string, though Cotton Health asks for no write      # access and so never shows it.      NSHealthUpdateUsageDescription: >-        Cotton Health does not add or change anything in Apple Health. It only        reads what Apple Health keeps into your own database.      # Cotton Health follows the phone's light or dark, through health.look's two modes.      UIUserInterfaceStyle: Automatic  # Cotton Story — the story kit's app over the owner's personal object  # (owner, 17 Nov 2026): screenplays for someone who has never written one;  # scenes, characters, places and notes as cards, the whole script to read.  # The store says Cotton Story; the home screen says Story. A .fountain  # comes in by Stories' Plus or by "Open in", so it takes no shares.  story:    target: CottonStory    appId: com.cottondb.story    displayName: Story    urlScheme: cottonstory    appIcon: AppIconStory    dev:      appId: com.cottondb.story.dev      displayName: Story Dev      urlScheme: cottonstorydev      appIcon: AppIconStoryDev    icons: App/Flavours/story/Assets.xcassets    manifest: App/Flavours/story/flavour.json    # The faces Look offers (shared/DECISIONS.md "Look").    resources:      - ../../assets/fonts/look    # The home-screen icon follows the ink (iPhone only; shared/DECISIONS.md "Look").    settings:      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Red $(COTTON_APPICON_NAME)Green $(COTTON_APPICON_NAME)Black    share: false    # Story draws in the Ink look (assets/design/story/ink.html), light only    # for now, in Courier Prime and IBM Plex Mono (CottonPaper's fonts, the    # same files Android ships). It opens a    # screenplay (Fountain, Final Draft, a printed PDF, or plain text) from    # Files, Mail or AirDrop ("Open in"), ranked Alternate (it reads them, it    # does not own them) and opened as a COPY: the core reads the file once    # (`story.bring_in`) and the story it makes is what is kept.    # Only what this app uses (launch-ios, 22 Nov 2026; App Review 5.1.1(ii)    # and 2.5.4): Cotton's other prompts, background modes and tasks are    # dropped by the gate (`ownPermissions`). The core seals with its own    # X25519, AES-256-GCM and Ed25519 (crates/cotton-core), standard    # encryption beyond the exempt kinds, so export compliance is answered    # Yes, mass market (assets/design/LAUNCH.md section 4).    ownPermissions: true    privacyManifest: App/Flavours/story/PrivacyInfo.xcprivacy    info:      # Look decides light or dark (shared/DECISIONS.md "Look"): Grey, the      # default, is light in both halves, as Story was.      UIUserInterfaceStyle: Automatic      # Listen reads the script aloud and goes on with the screen off. Nothing      # else runs in the background.      UIBackgroundModes:        - audio      NSMicrophoneUsageDescription: >-        Story uses the microphone when you tap the mic, to write down the lines        you say.      NSSpeechRecognitionUsageDescription: >-        Story turns what you say into lines of your script. With on-device        recognition, your voice never leaves your phone.      NSCameraUsageDescription: >-        Story uses the camera when you take a picture for a character, a place        or a scene, and to scan the code on your other device when you approve it.      NSPhotoLibraryAddUsageDescription: >-        Story saves a picture to your photo library when you choose Save Image.      NSFaceIDUsageDescription: >-        Story uses Face ID to check it is you before you approve another phone        or show your recovery code.      UTImportedTypeDeclarations:        - UTTypeIdentifier: io.fountain.screenplay          UTTypeDescription: Fountain screenplay          UTTypeConformsTo:            - public.plain-text          UTTypeTagSpecification:            public.filename-extension:              - fountain            public.mime-type:              - text/x-fountain        - UTTypeIdentifier: com.finaldraft.fdx          UTTypeDescription: Final Draft screenplay          UTTypeConformsTo:            - public.xml          UTTypeTagSpecification:            public.filename-extension:              - fdx      CFBundleDocumentTypes:        - CFBundleTypeName: Screenplay          CFBundleTypeRole: Viewer          LSHandlerRank: Alternate          LSItemContentTypes:            - io.fountain.screenplay            - com.finaldraft.fdx            - com.adobe.pdf            - public.plain-text      LSSupportsOpeningDocumentsInPlace: false  # Cotton Days — calendar and to-dos in one app (owner, 20 Nov 2026;  # assets/design/days/DECISIONS.md): the days opening on today, and  # Sometime. Drawn in the Blue pen look (pen.html), light only, in DM Mono  # (CottonPaper's fonts, the same files Android ships); no fan, no board  # (`Days/DaysRoot.swift`). Its drawn marks are the core's  # catalogue strokes (`days.marks`). It takes no shares. It takes over  # Cotton Calendar and Cotton Todos (owner, 20 Nov 2026) and ships under  # Calendar's identity (com.cottondb.calendar, its App Store record and  # App Group), so a phone with Calendar updates into Days; Calendar's own  # target is gone (registry `retired`).  days:    target: CottonDays    appId: com.cottondb.calendar    displayName: Days    urlScheme: cottondays    appIcon: AppIconDays    dev:      appId: com.cottondb.calendar.dev      displayName: Days Dev      urlScheme: cottondays-dev      appIcon: AppIconDaysDev    icons: App/Flavours/days/Assets.xcassets    manifest: App/Flavours/days/flavour.json    # The faces Look offers (shared/DECISIONS.md "Look").    resources:      - ../../assets/fonts/look    # The home-screen icon follows the ink (iPhone only; shared/DECISIONS.md "Look").    settings:      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Red $(COTTON_APPICON_NAME)Green $(COTTON_APPICON_NAME)Black    share: false    # Only what this app uses (launch-ios, 22 Nov 2026; App Review 5.1.1(ii)    # and 2.5.4): Cotton's other prompts, background modes and tasks are    # dropped by the gate (`ownPermissions`). The core seals with its own    # X25519, AES-256-GCM and Ed25519 (crates/cotton-core), standard    # encryption beyond the exempt kinds, so export compliance is answered    # Yes, mass market (assets/design/LAUNCH.md section 4).    ownPermissions: true    privacyManifest: App/Flavours/days/PrivacyInfo.xcprivacy    info:      # Look decides light or dark (shared/DECISIONS.md "Look"): the paper standing      # for the phone's appearance sets the screens (LookStanding); Grey, the      # default, is light in both halves, as Days was.      UIUserInterfaceStyle: Automatic      NSMicrophoneUsageDescription: >-        Days uses the microphone when you tap the mic, to write down what you        want to add.      NSSpeechRecognitionUsageDescription: >-        Days turns what you say into a to-do or an event. With on-device        recognition, your voice never leaves your phone.      NSFaceIDUsageDescription: >-        Days uses Face ID to check it is you before you approve another phone        or show your recovery code.      # An event added or moved on another device alerts with Days closed      # (owner via the coordinator, 24 Nov 2026; DECISIONS "Alerts"): iOS's      # background refresh syncs a slice and the reminder pass runs after it,      # as Android's background sync does. Nothing else runs in the background.      UIBackgroundModes:        - fetch        - processing      BGTaskSchedulerPermittedIdentifiers:        - com.cottondb.catchup.refresh        - com.cottondb.catchup.processing      NSCameraUsageDescription: >-        Days uses the camera only to scan the code on your other device when        you approve it.  # Cotton Post (slug mail) — mail as its own app, out of Comms (owner, 25 Nov  # 2026; assets/design/mail/DECISIONS.md, CONTRACT.md): Mail, Senders, Files  # and You on its own root in the Stamp look (`Post/PostRoot.swift`), no fan  # and no board. The Stamp in franking green is the primary icon, one  # alternate per other ink (scripts/draw-app-icons.mjs post). It takes no  # shares yet; attachments are chosen inside Post.  mail:    target: CottonMail    appId: com.cottondb.mail    displayName: Post    urlScheme: cottonmail    appIcon: AppIconMail    dev:      appId: com.cottondb.mail.dev      displayName: Post Dev      urlScheme: cottonmaildev      appIcon: AppIconMailDev    icons: App/Flavours/mail/Assets.xcassets    manifest: App/Flavours/mail/flavour.json    share: false    # Instrument Sans, Newsreader and JetBrains Mono, and Look's other faces    # (mail/DECISIONS.md "The look"), all SIL OFL with their licences.    resources:      - ../../assets/fonts/look    settings:      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Teal $(COTTON_APPICON_NAME)Oxblood $(COTTON_APPICON_NAME)InkBlue $(COTTON_APPICON_NAME)Graphite    ownPermissions: true    privacyManifest: App/Flavours/mail/PrivacyInfo.xcprivacy    info:      # Look decides light or dark: Sage by day, Night at night by default.      UIUserInterfaceStyle: Automatic      NSFaceIDUsageDescription: >-        Post uses Face ID to check it is you before you approve another phone        or show your recovery code.      NSCameraUsageDescription: >-        Post uses the camera to scan the code on your other device when you        approve it, and to take a photo you attach to a mail.      NSPhotoLibraryUsageDescription: >-        Post opens your photos only to attach the ones you choose to a mail.      # Shared code links the recorder and speech recognition, and App Store processing reads the binary, so the      # strings must be here (the cuts of 852b2d03fa, refused at the archive, 26 Nov 2026).      NSMicrophoneUsageDescription: >-        Post uses the microphone only when you dictate, to write down what        you say.      NSSpeechRecognitionUsageDescription: >-        Post turns what you say into text. With on-device recognition, your        voice never leaves your phone.      # A link in a mail offers Open in Sites only when Sites is on the phone      # (mail/DECISIONS question 11).      LSApplicationQueriesSchemes:        - cottonsites        - cottonsitesdev      # This phone fetches: a round of the account's new mail in the time iOS gives Post in the background      # (mail CONTRACT row 12), in the catch-up's own two tasks (`Sync/BackgroundCatchUp.swift`).      UIBackgroundModes:        - fetch        - processing      BGTaskSchedulerPermittedIdentifiers:        - com.cottondb.catchup.refresh        - com.cottondb.catchup.processing  # Cotton Sites — the places he stays signed in, each with its own sign-in,  # out of Comms (owner, 25 Nov 2026; assets/design/sites/DECISIONS.md and  # CONTRACT.md row 15): the list, a site open with its bar and the thread,  # search in a place that keeps nothing, the chooser; its own screens, no fan  # and no board (`Sites/SitesRoot.swift`). Double Slash in Cranberry on Rose  # by day and Night by dark, in Instrument Sans. Each site's sign-in lives in  # WebKit's store named by its id; the list is sealed on this phone under the  # app's own key. It takes no shares yet (the share extension comes with the  # chooser inside it).  sites:    target: CottonSites    appId: com.cottondb.sites    displayName: Sites    urlScheme: cottonsites    appIcon: AppIconSites    dev:      appId: com.cottondb.sites.dev      displayName: Sites Dev      urlScheme: cottonsitesdev      appIcon: AppIconSitesDev    icons: App/Flavours/sites/Assets.xcassets    manifest: App/Flavours/sites/flavour.json    # Instrument Sans and Look's other faces, SIL OFL with their licences.    resources:      - ../../assets/fonts/look    # The home-screen icon follows the ink (iPhone only; sites/DECISIONS.md "The look").    settings:      ASSETCATALOG_COMPILER_ALTERNATE_APPICON_NAMES: $(COTTON_APPICON_NAME)Petrol $(COTTON_APPICON_NAME)Indigo $(COTTON_APPICON_NAME)Ochre $(COTTON_APPICON_NAME)Graphite    share: false    ownPermissions: true    info:      # Look decides light or dark: Rose by day, Night by dark, by default.      UIUserInterfaceStyle: Automatic      NSFaceIDUsageDescription: >-        Sites uses Face ID to show your hidden sites.      NSCameraUsageDescription: >-        Sites uses the camera only when a page asks you for a photo and you        choose Take a photo. The photo goes only to that page.      # Shared code links the recorder and speech recognition, and App Store processing reads the binary, so the      # strings must be here (the cuts of 852b2d03fa, refused at the archive, 26 Nov 2026).      NSMicrophoneUsageDescription: >-        Sites uses the microphone only when you dictate, to write down what        you say.      NSSpeechRecognitionUsageDescription: >-        Sites turns what you say into text. With on-device recognition, your        voice never leaves your phone.  # Cotton Albums — gives back a library he cannot reach: Sets of one moment  # keep their best few, Tidy lists the junk biggest first, albums make  # themselves by person, place and trip (assets/design/albums/DECISIONS.md).  # Every photo is looked at on this phone (PhotoKit and Vision, `Albums/`);  # the bytes stay in the phone's own library. Its own screens, no fan and no  # board (`Albums/AlbumsRoot.swift`). Kit `photos` until the core's Albums  # kit lands (ALBUMS CORE 1). The first pass runs in the phone's processing  # time, resumable (`Albums/AlbumsPass.swift`). It takes no shares yet.  albums:    target: CottonAlbums    appId: com.cottondb.albums    displayName: Albums    urlScheme: cottonalbums    appIcon: AppIconAlbums    dev:      appId: com.cottondb.albums.dev      displayName: Albums Dev      urlScheme: cottonalbumsdev      appIcon: AppIconAlbumsDev    icons: App/Flavours/albums/Assets.xcassets    manifest: App/Flavours/albums/flavour.json    share: false    resources:      - ../../assets/fonts/look    # The face identity model (HyperFace-50k, 8-bit) goes in by its pinned hash, from outside the repository: the    # build fails when it is absent or wrong (scripts/albums-face-model.sh, App/Flavours/albums/face-model.json).    scripts:      - name: Face model        script: bash "$SRCROOT/../../scripts/albums-face-model.sh"        inputFiles:          - $(SRCROOT)/App/Flavours/albums/face-model.json          - $(SRCROOT)/../../scripts/albums-face-model.sh    ownPermissions: true    # The first build only LOOKS (owner, 27 Nov 2026): no code that changes the photo library is compiled in    # (COTTON_NO_PHOTO_WRITES; scripts/__tests__/business-flavour.test.ts ("albums: the look-only build")), and it does not ask to add photos.    photoWrites: false    # PhotoKit's library is compiled into Albums alone (App/Cotton/AlbumsPhotos+Photos.swift): an app without a photo    # purpose string that references PHPhotoLibrary is refused by App Store processing (Sites, 27 Nov 2026).    conditions:      - COTTON_ALBUMS    info:      UIUserInterfaceStyle: Automatic      NSPhotoLibraryUsageDescription: >-        Albums looks through your photos on this phone to group them. Only        albums you choose to keep are uploaded.      NSFaceIDUsageDescription: >-        Albums uses Face ID to check it is you before you approve another phone        or show your recovery code.      NSCameraUsageDescription: >-        Albums uses the camera to scan the code on your other device when you        approve it.      # Shared code links the recorder and speech recognition, and App Store processing reads the binary, so the      # strings must be here (the cuts of 852b2d03fa, refused at the archive, 26 Nov 2026).      NSMicrophoneUsageDescription: >-        Albums uses the microphone only when you dictate, to write down what        you say.      NSSpeechRecognitionUsageDescription: >-        Albums turns what you say into text. With on-device recognition, your        voice never leaves your phone.      # The first pass carries on in the phone's processing time, while charging      # (`Albums/AlbumsPass.swift`): a continued task started by Start, then      # power-gated processing tasks with a checkpoint (RESEARCH.md §1).      UIBackgroundModes:        - processing      BGTaskSchedulerPermittedIdentifiers:        - com.cottondb.albums.pass        # A continued task's identifier starts with the bundle's own (live or Dev) and ends in a wildcard.        - $(PRODUCT_BUNDLE_IDENTIFIER).pass.*  # Cotton Data — the person's own tables, read and kept (owner, 25 Nov 2026;  # assets/design/data/DECISIONS.md and CONTRACT.md). Its iPhone screens come  # with their own lane; until then the target builds and opens on the shared  # host so its records and signing can be made. Ones and noughts is its icon  # (scripts/draw-app-icons.mjs data). It takes no shares yet. The link  # schemes are the ones its Android build already answers.  data:    target: CottonData    appId: com.cottondb.data    displayName: Data    urlScheme: cottondata    appIcon: AppIconData    dev:      appId: com.cottondb.data.dev      displayName: Data Dev      urlScheme: cottondata-dev      appIcon: AppIconDataDev    icons: App/Flavours/data/Assets.xcassets    manifest: App/Flavours/data/flavour.json    share: false    resources:      - ../../assets/fonts/look    ownPermissions: true    info:      UIUserInterfaceStyle: Automatic      NSFaceIDUsageDescription: >-        Data uses Face ID to check it is you before you approve another phone        or show your recovery code.      NSCameraUsageDescription: >-        Data uses the camera to scan the code on your other device when you        approve it.      # Shared code links the recorder and speech recognition, and App Store processing reads the binary, so the      # strings must be here (the cuts of 852b2d03fa, refused at the archive, 26 Nov 2026).      NSMicrophoneUsageDescription: >-        Data uses the microphone only when you dictate, to write down what        you say.      NSSpeechRecognitionUsageDescription: >-        Data turns what you say into text. With on-device recognition, your        voice never leaves your phone.  # Cotton Contacts — every person, organisation and assistant in one place, kept tidy from everything on the phone  # (PEOPLE-DESIGN.md section f; the core's answers in assets/design/shared/CONTACTS-ANSWERS.md). It reads the phone's  # address book when he asks, so it carries the Contacts string. It takes no shares yet.  contacts:    target: CottonContacts    appId: com.cottondb.contacts    displayName: Contacts.    urlScheme: cottoncontacts    appIcon: AppIconContacts    dev:      appId: com.cottondb.contacts.dev      displayName: Contacts Dev.      urlScheme: cottoncontacts-dev      appIcon: AppIconContactsDev    icons: App/Flavours/contacts/Assets.xcassets    manifest: App/Flavours/contacts/flavour.json    share: false    resources:      - ../../assets/fonts/look    ownPermissions: true    info:      UIUserInterfaceStyle: Automatic      NSContactsUsageDescription: >-        Cotton Contacts reads your phone's contacts when you ask, to keep everyone in        one place. They stay sealed on your phone and in your account.      NSFaceIDUsageDescription: >-        Cotton Contacts uses Face ID to check it is you before you approve another        phone or show your recovery code.      NSCameraUsageDescription: >-        Cotton Contacts uses the camera to scan the code on your other device when you        approve it.      NSMicrophoneUsageDescription: >-        Cotton Contacts uses the microphone only when you dictate, to write down what        you say.      NSSpeechRecognitionUsageDescription: >-        Cotton Contacts turns what you say into text. With on-device recognition, your        voice never leaves your phone.  # Cotton Meetings — one tap records a meeting or a voice memo; the words  # arrive with who said them (voice plan, 17 Nov 2026). The store says  # Cotton Meetings; the home screen says Meetings. Its kit is meetings  # (the meetings core), with its own iPhone parts. It keeps  # Cotton's `audio` background mode (a recording runs on with the phone  # locked) and follows the phone's appearance, light or dark, as Story does.  meetings:    target: CottonMeetings    appId: com.cottondb.meetings    displayName: Meetings    urlScheme: cottonmeetings    appIcon: AppIconMeetings    dev:      appId: com.cottondb.meetings.dev      displayName: Meetings Dev      urlScheme: cottonmeetingsdev      appIcon: AppIconMeetingsDev    icons: App/Flavours/meetings/Assets.xcassets    manifest: App/Flavours/meetings/flavour.json    share: false    # The recording's Live Activity and the control that starts one, in the    # widget extension cloned from `meetingsWidgets`; the intents they hand    # to the app live in `CottonMeetingsLive`, which only this family links.    widgets: true    dependencies:      - package: Cotton        product: CottonMeetingsLive    settings:      SWIFT_ACTIVE_COMPILATION_CONDITIONS: $(inherited) COTTON_MEETINGS    info:      UIUserInterfaceStyle: Automatic      NSSupportsLiveActivities: true      NSMicrophoneUsageDescription: >-        Cotton Meetings uses your microphone to record the meetings and voice        memos you start, only while a recording is on. The audio stays in        your own database.# THE CHAT NOTIFICATION EXTENSION — Cotton Messages' notification service# extension, a TEMPLATE rather than a target: `scripts/ios-spec-gate.ts` clones# it into each family whose flavour says `notifications: true` (Messages and# Messages Dev, as `CottonMessagesNotifications`, embedded in the app) and# drops it from every other. A chat push says only "New message"; this reads# the object's inbox with the door and the chat key the app keeps in the# shared keychain group, opens the newest box and says who and what# (`CottonMailbox/ChatAlert`). Lighter than the share extension: the mailbox# alone, never the core — it never opens the copy and never lands a row.# `ios-project-spec.test.ts` holds its dependencies to that one.chatNotifications:  type: app-extension  platform: iOS  sources:    - path: App/ChatNotifications  dependencies:    - package: Cotton      product: CottonMailbox  settings:    base:      PRODUCT_BUNDLE_IDENTIFIER: $(COTTON_APP_ID).notifications      TARGETED_DEVICE_FAMILY: "1"      CODE_SIGN_ENTITLEMENTS: App/ChatNotifications/ChatNotifications.entitlements  info:    path: App/ChatNotifications/Info.plist    properties:      CFBundleDisplayName: $(COTTON_DISPLAY_NAME)      CottonFlavor: $(COTTON_FLAVOR)      CottonURLScheme: $(COTTON_URL_SCHEME)      # The shared keychain group, as the app names it (`PasskeyKeychain.sharedGroup`).      CottonKeychainGroup: $(AppIdentifierPrefix)$(COTTON_KEYCHAIN_GROUP)      CFBundleShortVersionString: $(COTTON_MARKETING_VERSION)      CFBundleVersion: $(COTTON_BUILD_NUMBER)      CottonBuildCommit: $(COTTON_BUILD_COMMIT)      CottonBuildVariant: $(CONFIGURATION)      NSExtension:        NSExtensionPointIdentifier: com.apple.usernotifications.service        NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).NotificationService# THE MEETINGS WIDGETS — Cotton Meetings' widget extension, a TEMPLATE rather# than a target: `scripts/ios-spec-gate.ts` clones it into each family whose# flavour says `widgets: true` (Meetings and Meetings Dev, as# `CottonMeetingsWidgets`, embedded in the app) and drops it from every# other, so no other app draws on the lock screen. It holds the recording's# Live Activity (lock screen and Dynamic Island) and the control that starts# a recording from Control Centre, the lock screen or the Action Button. It# draws and hands acts to the app; it never records and never opens the core,# so it links `CottonMeetingsLive` alone and needs no app group.meetingsWidgets:  type: app-extension  platform: iOS  sources:    - path: App/MeetingsWidgets  dependencies:    - package: Cotton      product: CottonMeetingsLive    - sdk: WidgetKit.framework    - sdk: SwiftUI.framework  settings:    base:      PRODUCT_BUNDLE_IDENTIFIER: $(COTTON_APP_ID).widgets      TARGETED_DEVICE_FAMILY: "1"  info:    path: App/MeetingsWidgets/Info.plist    properties:      CFBundleDisplayName: $(COTTON_DISPLAY_NAME)      CottonFlavor: $(COTTON_FLAVOR)      CottonURLScheme: $(COTTON_URL_SCHEME)      CFBundleShortVersionString: $(COTTON_MARKETING_VERSION)      CFBundleVersion: $(COTTON_BUILD_NUMBER)      CottonBuildCommit: $(COTTON_BUILD_COMMIT)      CottonBuildVariant: $(CONFIGURATION)      NSExtension:        NSExtensionPointIdentifier: com.apple.widgetkit-extension# THE PASSKEY PROVIDER — Cotton Keys' iOS credential provider, a TEMPLATE# rather than a target: `scripts/ios-spec-gate.ts` clones it into each family# whose flavour says `provider: true` (Keys and Keys Dev, as `CottonKeysProvider`,# embedded in that app) and drops it from every other, so Cotton's own family# never builds it. The share extension's shape: the mailbox and the values,# never the core — it never opens the copy; key material lives in the shared# keychain group and everything else crosses through the passkey mailbox.# `ios-project-spec.test.ts` holds its dependencies to these two.passkeyProvider:  type: app-extension  platform: iOS  sources:    - path: App/KeysProvider  dependencies:    - package: Cotton      product: CottonMailbox    - package: Loom      product: CottonValues  settings:    base:      PRODUCT_BUNDLE_IDENTIFIER: $(COTTON_APP_ID).provider      TARGETED_DEVICE_FAMILY: "1"      CODE_SIGN_ENTITLEMENTS: App/KeysProvider/KeysProvider.entitlements  info:    path: App/KeysProvider/Info.plist    properties:      CFBundleDisplayName: $(COTTON_DISPLAY_NAME)      CottonFlavor: $(COTTON_FLAVOR)      CottonURLScheme: $(COTTON_URL_SCHEME)      # The shared keychain group, as the app names it (`PasskeyKeychain.sharedGroup`).      CottonKeychainGroup: $(AppIdentifierPrefix)$(COTTON_KEYCHAIN_GROUP)      CFBundleShortVersionString: $(COTTON_MARKETING_VERSION)      CFBundleVersion: $(COTTON_BUILD_NUMBER)      CottonBuildCommit: $(COTTON_BUILD_COMMIT)      CottonBuildVariant: $(CONFIGURATION)      UIUserInterfaceStyle: Light      NSFaceIDUsageDescription: >-        Cotton uses Face ID before it saves or signs with a passkey and before it fills a password.      NSExtension:        NSExtensionPointIdentifier: com.apple.authentication-services-credential-provider-ui        NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).CredentialProviderViewController        NSExtensionAttributes:          ASCredentialProviderExtensionCapabilities:            ProvidesPasskeys: true            # Passwords filled from the shared keychain's copy, and (iOS            # 26.2) a site's login saved into Keys on the person's word.            ProvidesPasswords: true            SupportsSavePasswordCredentials: true            SupportsConditionalPasskeyRegistration: true            # An import destination for Credential Exchange (iOS 26): the            # Passwords app offers Keys, then opens the APP with an            # NSUserActivity of type ASCredentialExchangeActivity whose            # userInfo[ASCredentialImportToken] is the token            # ASCredentialImportManager.importCredentials(token:) takes            # (`Boot/KeysImport.swift`). Spellings as SafariFoundation reads them.            SupportsCredentialExchange: true            SupportedCredentialExchangeVersions:              - "1.0"# The four usage strings, said ONCE. On the phone these were canonical constants# in `app.config.js` fed to five plugins that all write the same Info.plist keys# last-writer-wins; here there is one writer and one string.targets:  Cotton:    type: application    platform: iOS    sources:      - path: App/Cotton      # COTTON'S MANIFEST (owner, 19 Oct 2026: one app, one database): Personal      # alone, its tools, the shipped Home. Outside `App/Cotton` and named      # here, so the business families cloned from this target leave it out      # (`ios-spec-gate.ts`, `COTTON_MANIFEST`) and carry their own.      - path: App/CottonManifest/flavour.json        buildPhase: resources      # The generated palette, compiled into the APP's own catalogue as well      # as CottonUI's bundle, for ONE reader: the launch screen below names its      # colour by `UIColorName`, and the system looks that name up in the main      # bundle only. The same generated file, so there is no second copy of      # the ground's value to drift.      - path: ../loom/Sources/CottonPaper/Generated/Palette.xcassets        buildPhase: resources    dependencies:      - package: Cotton        product: CottonUI      - package: Cotton        product: CottonKit      - package: sentry-cocoa        product: Sentry      - target: CottonShareExtension        embed: true        codeSign: true    settings:      base:        PRODUCT_BUNDLE_IDENTIFIER: $(COTTON_APP_ID)        # See the base setting: xcodegen's own target default is `1,2`, and a        # target setting beats the project's.        TARGETED_DEVICE_FAMILY: "1"        # THE APP ICON. `ASSETCATALOG_COMPILER_APPICON_NAME` is Xcode's default        # `AppIcon` and is what makes actool emit `CFBundleIconName`; without a        # catalogue carrying that name the app builds, archives, signs, exports        # and is REFUSED by Apple's upload validator — measured, run 2463.        # Named explicitly rather than left to the default, because the default        # is the kind of thing a future Xcode changes quietly — and by flavor,        # so Cotton Dev is told apart on the home screen at a glance.        ASSETCATALOG_COMPILER_APPICON_NAME: $(COTTON_APPICON_NAME)        # The PRODUCT is `Cotton` in both flavors; the home-screen LABEL is        # `CFBundleDisplayName`, which is the flavor's. A product named        # `Cotton Dev` would put the space into the binary path, the dSYM name        # and every crash report.        PRODUCT_NAME: Cotton        INFOPLIST_KEY_UILaunchScreen_Generation: YES        CODE_SIGN_ENTITLEMENTS: App/Cotton/Cotton.entitlements        # The flavour-pictures phase below reads Loom's whole catalogue folder        # and runs actool over a catalogue of its own making, which a sandboxed        # script phase cannot do. It is this target's only script phase.        ENABLE_USER_SCRIPT_SANDBOXING: NO    # EACH FLAVOUR CARRIES ONLY ITS OWN PICTURES (14 Nov    # 2026). SwiftPM copies Loom's whole catalogue into every app (105 MB of    # every app's paintings in Books); this phase, after the bundle is in the    # app, compiles the flavour's own list from `apps/loom/materials.json` (the    # list the Android build reads too) into the bundle's Assets.car, and writes    # the names left out beside it so a debug build stops at the draw of one.    # A flavour with no list keeps the whole catalogue. Every family cloned    # from this target carries the phase (`ios-spec-gate.ts`).    postBuildScripts:      - name: Flavour pictures        script: python3 "$SRCROOT/../../scripts/ios-flavour-pictures.py"        basedOnDependencyAnalysis: false        inputFiles:          - $(SRCROOT)/../../scripts/ios-flavour-pictures.py          - $(SRCROOT)/../loom/materials.json    info:      path: App/Cotton/Info.plist      properties:        CFBundleDisplayName: $(COTTON_DISPLAY_NAME)        # Which app this is, for `CottonMailbox/AppFlavor.swift` (unstamped is dev).        CottonFlavor: $(COTTON_FLAVOR)        # The keychain group the vault key is kept in, shared by every Cotton        # app (`CottonKit/VaultKey.swift`, `VaultKey.accessGroup`): the        # entitlement's own string, so the app names exactly the group it holds.        CottonKeychainGroup: $(AppIdentifierPrefix)$(COTTON_KEYCHAIN_GROUP)        # The URL scheme this bundle's links carry (`CottonMailbox/DeepLinkScheme.swift`):        # a business flavour's own, not Cotton's.        CottonURLScheme: $(COTTON_URL_SCHEME)        CFBundleShortVersionString: $(COTTON_MARKETING_VERSION)        CFBundleVersion: $(COTTON_BUILD_NUMBER)        CottonBuildCommit: $(COTTON_BUILD_COMMIT)        # The Bugsink address, for `CottonKit/Reporting.swift` — the Mac's key,        # one name for one thing. Empty on every build the shipping lane did        # not stamp; see `COTTON_SENTRY_DSN` above.        CottonSentryDSN: $(COTTON_SENTRY_DSN)        # Build-variant truth for `CottonKit/Reporting.swift`: `Release` on an        # archive, `Debug` on everything else. In both plists because the        # share sheet reports under its own bundle id and has to be able to        # say which build it is.        CottonBuildVariant: $(CONFIGURATION)        # **LIGHT-ONLY, ENFORCED BY THE SYSTEM.** The app has no theme choice,        # no dark mode and no appearance preference: every colorset carries one        # colour, so a phone in dark mode would otherwise get a white app with        # a black status bar, black system keyboard accessory, black sheet        # grabbers and dark-tinted UIKit controls. This is the ONE place that is        # settled — a `.preferredColorScheme(.light)` on a view tree reaches        # only what SwiftUI draws, and it is per-window rather than per-app.        # Stated in BOTH plists: the extension is its own process with its        # own appearance, and a share sheet that went dark beside a light app        # is the same bug in a smaller frame.        UIUserInterfaceStyle: Light        # Without this the app runs LETTERBOXED in a compatibility window —        # black bars top and bottom, at a smaller logical size. Cotton's splash        # is painted by the app (`hideSplashOnce`, 4b), not by a storyboard;        # what the SYSTEM draws before it is one colour, and an empty        # dictionary made that colour white — a white flash before the ground.        # `groundMuted` is the page's ground token (the plaster tile over it is        # colourless relief, #654), read from the generated palette the app        # target carries above. `LaunchScreenTests` holds the name to a        # colorset that exists.        UILaunchScreen:          UIColorName: groundMuted        # Portrait only. A record screen is a column of text and a phone in a        # hand; there is no landscape design and never has been.        UISupportedInterfaceOrientations:          - UIInterfaceOrientationPortrait        # NO EXPORT KEY, in any app (22 Nov 2026). true is refused at upload        # without the code Apple issues for an approved document (90592), and        # false is kept off so the four apps are answered alike. Each build is        # answered after its upload instead (standard encryption, not in        # France) by the export-compliance step of pnpm phone:cut.        # scripts/ios-spec-gate.ts refuses either key.        # A ProMotion phone draws the app's own animations at 120 Hz only when        # this says so: without it every swipe between photos in the viewer        # is capped at 60 (`ViewerBudgetTests`).        CADisableMinimumFrameDurationOnPhone: true        # EXACTLY FOUR, no more and no fewer. Every one is justified by a        # user-facing feature (App Store guideline 2.5.4 — the rejection this        # rule came from was a background mode with no visible feature):        #   audio               — the meetings recorder, which keeps capturing        #                         while the phone is locked        #   remote-notification — a push wakes the app to catch up with its        #                         Mac, so what arrived is already there when        #                         the person opens it        #   fetch               — the short periodic catch-up (BGAppRefreshTask)        #   processing          — the long one, while charging: a backfill        #                         reaches the phone without it being opened        #                         (BGProcessingTask)        # The last two are one feature, said on the device's own page: this        # phone is level with its Mac when it is picked up        # (`CottonUI/Sync/BackgroundCatchUp.swift`).        UIBackgroundModes:          - audio          - remote-notification          - fetch          - processing        # The two tasks `BackgroundCatchUp` registers, by the SAME strings as        # `CatchUpTask`: iOS raises on an identifier that is not listed here.        # One pair for both flavours — an identifier is the app's own, and the        # two apps do not share a scheduler.        BGTaskSchedulerPermittedIdentifiers:          - com.cottondb.catchup.refresh          - com.cottondb.catchup.processing        # The microphone string must name RECORDING: the mic is        # what stays open in the background during a meeting, and this is the        # sentence App Review reads against the `audio` background mode.        NSMicrophoneUsageDescription: >-          Cotton uses your microphone when you tap the mic: to          write down what you say, to hear a spoken command, and to record          meetings. Recognition runs on your phone.        # The camera string says plainly what reading a        # code does with a frame. The code it reads is the ASSISTANT's sign-in        # code now: joining a server needs no camera and no code at all since        # the pairing secret went (a join presents a key and the person compares        # six digits).        NSCameraUsageDescription: >-          Cotton uses the camera for its Camera tool, whose photos are saved          into your own Cotton, and to read the sign-in code          on an assistant's consent page, whose frames are decoded on your          phone and never saved or uploaded.        # READ covers two very different asks and says both, because iOS shows        # one string for both: the picker (one image, chosen by the person) and        # the library sync, which needs FULL access — under Limited every        # PhotoKit call is filtered and a whole-library copy cannot work.        NSPhotoLibraryUsageDescription: >-          Cotton reads your photo library when you pick a picture. If you turn          on "Keep my photos in Cotton" in Settings, it also copies every new          photo and video into your own database, which needs Full Access; with          limited access only the pictures you pick are read.        # ADD is a separate string, and its absence once let a save work only        # because iOS fell back on the read string.        NSPhotoLibraryAddUsageDescription: >-          Cotton saves a picture to your photo library when you tap Save on it,          and saves the shots you take with Cotton's camera there too unless          you turn that off on the camera.        # AlarmKit's ONLY requirement beyond the framework. There is no        # `com.apple.developer.alarmkit` entitlement — that is a widely-repeated        # invention Apple's own DTS has called out, and adding it breaks device        # signing.        NSAlarmKitUsageDescription: >-          Allow Cotton to set alarms that ring even when your phone is silent.        # The contacts import: only the ones the person picks are copied, and        # the sentence says so, because "imports your contacts" reads as all of        # them.        NSContactsUsageDescription: >-          Cotton imports the contacts you choose so you can keep notes on who          they are and how you know them, and keeps those people up to date with          your address book. Only the contacts you select are copied. When you          ask it to tidy your contacts, it changes only the cards you approve.        # Dictation is ON-DEVICE, and the string says it: that is the whole        # reason this permission is acceptable to grant.        NSSpeechRecognitionUsageDescription: >-          Allow Cotton to turn your speech into text. With          on-device recognition, audio never leaves your phone.        # THE VAULT'S PROMPT. The vault key is guarded by user presence, and        # without this string iOS never offers Face ID for it and asks for the        # PASSCODE instead (the owner's phone, 12 Oct 2026). The sentence says        # the only two moments it is asked: before a password is shown or saved        # — never at launch (`CottonKit/VaultKeyring.swift`).        NSFaceIDUsageDescription: >-          Cotton uses Face ID to check it is you before you approve another          device, show your recovery code, or show or save a password.        # A request to a private address is refused outright unless the app        # declares why it uses the local network. This string IS the prompt.        #        # **It is asked at the Join step, the moment a household's name is        # submitted — never on a first screen, and never by the first copy's own        # dial** (architect, 11 Oct 2026). The phone takes its database from the        # Mac across the room when it can reach it; the first dial of a fresh        # install used to raise this prompt, which fails that dial at once, and        # the whole copy (246 MB) then went through the relay from the same        # Wi-Fi. `SystemCapabilityAuthority` asks; `BootModel.startTheCopy`        # waits for the answer.        NSLocalNetworkUsageDescription: >-          Cotton looks for your Mac on this network so your database arrives directly.        # THE ONE SERVICE THE ASK USES. iOS reports a Local Network answer only        # through a Bonjour browse, so the app advertises this service to itself        # and looks for it; the phone still FINDS its Mac by the household's        # name, never by browsing. A type missing from this list is refused        # silently and Cotton is never listed under Local Network.        NSBonjourServices:          - _cotton-find._tcp        # A Mac on this network is reached over PLAIN HTTP: it holds no        # certificate a phone would trust, and the relay — which does — is a        # different address entirely. `NSAllowsLocalNetworking` is the narrow        # form of that permission: http to a private address or a `*.local` name        # and NOTHING else, which is exactly the set `normalize_server_url`        # admits below the boundary. `NSAllowsArbitraryLoads` would say the same        # thing about the whole internet.        NSAppTransportSecurity:          NSAllowsLocalNetworking: true        # The URL scheme is WIRE PROTOCOL: the share extension knocks with        # it, and `tinmen-cotton://capture` is a documented entry point. One per        # flavor — `tinmen-cotton` real, `cottondev` dev — so a link from one        # app never opens the other; Swift's half is `AppFlavor.urlScheme`.        # The setting is referenced PLAIN: `$(VAR:identifier)` once rewrote        # the scheme to `tinmen-cotton_dev://` with no build error and nothing        # but the built Info.plist to say so, and no modifier is used here.        CFBundleURLTypes:          - CFBundleURLName: $(COTTON_APP_ID)            CFBundleURLSchemes:              - $(COTTON_URL_SCHEME)        # iOS ships NO type for Ogg or Opus. Without a declaration a WhatsApp        # voice note reaches the file picker as `public.data`, which an audio        # picker does not offer, so the file this owner shares in most often        # cannot be chosen at all. IMPORTED, not exported: these are Xiph's        # types and this app only claims to read them. The identifiers are        # mirrored in `MeetingImport.ogg` / `.opus`. Nor any for Matroska:        # Films' Add files names `org.matroska.mkv`, and undeclared it is a        # type no file has, so an MKV stood greyed in Cotton's picker while        # Cotton Cinemas, which imports it, took it (the 361 walk, 5 Nov 2026).        UTImportedTypeDeclarations:          - UTTypeIdentifier: org.xiph.ogg            UTTypeDescription: Ogg audio            UTTypeConformsTo:              - public.audio            UTTypeTagSpecification:              public.filename-extension:                - ogg                - oga              public.mime-type:                - audio/ogg          - UTTypeIdentifier: org.xiph.opus            UTTypeDescription: Opus audio            UTTypeConformsTo:              - org.xiph.ogg              - public.audio            UTTypeTagSpecification:              public.filename-extension:                - opus              public.mime-type:                - audio/opus          - UTTypeIdentifier: org.matroska.mkv            UTTypeDescription: Matroska film            UTTypeConformsTo:              - public.movie            UTTypeTagSpecification:              public.filename-extension:                - mkv              public.mime-type:                - video/x-matroska          # OPML, a podcast app's subscription list (Podcasts' Bring          # subscriptions in, 7 Nov 2026). Apple declares no OPML type, so          # undeclared `org.opml.opml` is a type no file has and the door's          # picker greys every list; it is the one NetNewsWire and the readers          # declare, and it is XML. The door's picker takes `public.xml` too          # (`DeckDoors.types`).          - UTTypeIdentifier: org.opml.opml            UTTypeDescription: OPML subscription list            UTTypeConformsTo:              - public.xml            UTTypeTagSpecification:              public.filename-extension:                - opml              public.mime-type:                - text/x-opml  CottonShareExtension:    type: app-extension    platform: iOS    sources:      - path: App/ShareExtension    dependencies:      # THE MAILBOX AND NOTHING UNDER IT. The extension copies, writes one      # mailbox entry and knocks; the APP drains, so the two must spell one key      # — and that contract is `CottonMailbox`, a product with no Rust core      # and no painted materials. Linking `CottonKit` or `CottonUI` here put a      # second copy of the core (92 MB) and of `CottonPaper`'s materials      # (67 MB) inside this extension; `ios-project-spec.test.ts` holds this      # list to these two.      - package: Cotton        product: CottonMailbox      # `CottonDate`, which the extension stamps a shared item with.      - package: Loom        product: CottonValues    settings:      base:        PRODUCT_BUNDLE_IDENTIFIER: $(COTTON_APP_ID).share-extension        TARGETED_DEVICE_FAMILY: "1"        CODE_SIGN_ENTITLEMENTS: App/ShareExtension/ShareExtension.entitlements    info:      path: App/ShareExtension/Info.plist      properties:        CFBundleDisplayName: $(COTTON_DISPLAY_NAME)        # Which app this is, for `CottonMailbox/AppFlavor.swift` (unstamped is dev).        CottonFlavor: $(COTTON_FLAVOR)        # The URL scheme this bundle's links carry (`CottonMailbox/DeepLinkScheme.swift`):        # a business flavour's own, not Cotton's.        CottonURLScheme: $(COTTON_URL_SCHEME)        CFBundleShortVersionString: $(COTTON_MARKETING_VERSION)        CFBundleVersion: $(COTTON_BUILD_NUMBER)        CottonBuildCommit: $(COTTON_BUILD_COMMIT)        # Build-variant truth for `CottonKit/Reporting.swift`: `Release` on an        # archive, `Debug` on everything else. In both plists because the        # share sheet reports under its own bundle id and has to be able to        # say which build it is.        CottonBuildVariant: $(CONFIGURATION)        # Light-only, like the app — see the app target's own line.        UIUserInterfaceStyle: Light        NSExtension:          NSExtensionPointIdentifier: com.apple.share-services          NSExtensionPrincipalClass: $(PRODUCT_MODULE_NAME).ShareViewController          NSExtensionAttributes:            # ALL SIX rules. A missing one is not a smaller share sheet, it is            # the app absent from it: a PDF or a Safari page shared with two            # rules simply does not offer it, and Photos offers an extension            # for its pictures only through the IMAGE and MOVIE rules — the            # file rule alone left Rigby out of Photos' sheet. Pictures, clips            # and files come TWENTY at a time, each its own mailbox entry            # (`ShareViewController.accept`): a handful of photos chosen in            # Photos is the ordinary share, not the exception.            NSExtensionActivationRule:              NSExtensionActivationSupportsWebURLWithMaxCount: 1              NSExtensionActivationSupportsWebPageWithMaxCount: 1              NSExtensionActivationSupportsText: true              NSExtensionActivationSupportsFileWithMaxCount: 20              NSExtensionActivationSupportsImageWithMaxCount: 20              NSExtensionActivationSupportsMovieWithMaxCount: 20  # THE TESTS ARE DECLARED TWICE, and the second declaration is not redundant.  # `Package.swift` declares them for SwiftPM; these declare the SAME folders as  # iOS unit-test bundles, because a `.xcodeproj` SHADOWS the package in its own  # directory: once this project exists, `xcodebuild` in `apps/cotton`  # resolves the project and the package's `Cotton-Package` scheme is no longer  # reachable. `pnpm ios:test` has to work whether or not the project has been  # generated, so the project runs the tests too.  #  # HOSTED BY `CottonTestHost`, never by Cotton (lane door, 23 Oct 2026). Since  # Xcode 27.1 a bundle with no host runs with no window scene, and since iOS 26  # a window with no scene is never on screen, so the tests that stand a stack  # in a window (`TileStackZoomTests`, `OnePageReadTests`) failed with "the  # host app has no window scene". The real app would boot the core at every  # launch and make every test able to fail for reasons that are not its own;  # the test host is one empty window and links nothing. `CottonKitTests` stays  # hostless: it needs no window.  CottonUITests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonUITests        excludes: [Fixtures]      # The book reader's two public-domain books, kept as one folder.      - path: Tests/CottonUITests/Fixtures        type: folder        buildPhase: resources    settings:      base:        TEST_HOST: $(BUILT_PRODUCTS_DIR)/CottonTestHost.app/CottonTestHost        BUNDLE_LOADER: $(TEST_HOST)        # Xcode 27.2 signs a test bundle only with an Info.plist of its own.        GENERATE_INFOPLIST_FILE: YES    dependencies:      - target: CottonTestHost      - package: Loom        product: CottonValues      - package: Cotton        product: CottonUI  # The app CottonUITests run inside: one scene, one empty window, nothing of  # the package (`App/TestHost/TestHostApp.swift`). Its own id, never derived  # from `COTTON_APP_ID`: it is no flavor of Cotton, ships nowhere and is built  # only for testing, as the test target's dependency.  CottonTestHost:    type: application    platform: iOS    sources:      - path: App/TestHost    settings:      base:        PRODUCT_BUNDLE_IDENTIFIER: com.cottondb.testhost        PRODUCT_NAME: CottonTestHost        # Two keychain groups, so VaultKeyGroupTests moves a vault key from        # one to the other in the simulator's own keychain.        CODE_SIGN_ENTITLEMENTS: App/TestHost/TestHost.entitlements        GENERATE_INFOPLIST_FILE: YES        INFOPLIST_KEY_UILaunchScreen_Generation: YES        INFOPLIST_KEY_UIApplicationSceneManifest_Generation: YES  CottonKitTests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonKitTests        excludes: [Fixtures]      - path: Tests/CottonKitTests/Fixtures        buildPhase: resources    settings:      base:        GENERATE_INFOPLIST_FILE: YES    dependencies:      - package: Cotton        product: CottonKit  # The shared composer's rules (`Tests/CottonComposerTests`): send's state,  # the area's seven lines, Return, the waveform and the pick chip.  CottonComposerTests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonComposerTests    settings:      base:        GENERATE_INFOPLIST_FILE: YES    dependencies:      - package: Cotton        product: CottonComposer  # The writing surface against a scripted core (`Tests/CottonWritingTests`):  # spans drawn, asks written back, blocks laid, the 50,000 character note  # measured. Hosted, as a text view lays out only in a window.  CottonWritingTests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonWritingTests    settings:      base:        TEST_HOST: $(BUILT_PRODUCTS_DIR)/CottonTestHost.app/CottonTestHost        BUNDLE_LOADER: $(TEST_HOST)        GENERATE_INFOPLIST_FILE: YES    dependencies:      - target: CottonTestHost      - package: Cotton        product: CottonWriting  # Cotton Calling's engine against a scripted core and fake ports  # (`Tests/CottonCallsTests`): no phone, network, camera or CallKit screen.  # The one test bundle that links `CottonCalls`, so the WebRTC framework it  # brings rides in a test build and no app but Calling.  CottonCallsTests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonCallsTests    settings:      base:        GENERATE_INFOPLIST_FILE: YES    dependencies:      - package: Cotton        product: CottonCalls  # Cotton chat's engine against a scripted core, a fake socket and clock,  # and the notification extension's opener against the core's own boxes  # (`Tests/CottonChatTests`): no network, Keychain or push.  CottonChatTests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonChatTests    settings:      base:        GENERATE_INFOPLIST_FILE: YES    dependencies:      - package: Cotton        product: CottonChat  # Every HealthKit type the core names, held to HealthKit on the simulator  # (`Tests/CottonHealthKitTests`): identifiers, unit strings and the  # statistics each type can give, from `health.types` as the core answers  # it. No store is opened and nothing is asked.  CottonHealthKitTests:    type: bundle.unit-test    platform: iOS    sources:      - path: Tests/CottonHealthKitTests        excludes: [Fixtures]      - path: Tests/CottonHealthKitTests/Fixtures        buildPhase: resources    settings:      base:        GENERATE_INFOPLIST_FILE: YES    dependencies:      - package: Cotton        product: CottonHealthKit# ONE Xcode scheme, for both flavors — named for the real app's URL scheme,# which is what it was called before Cotton Dev existed. Its name is not wire# protocol; the flavor is the `COTTON_FLAVOR` setting, never a second scheme.## The ACTIONS carry what the two schemes used to: run and test in `Debug` (the# everyday loop, and `pnpm ios:test` with it), archive in `Release` (what# fastlane ships). That is Xcode's own default split, and it is why deleting# the dev scheme costs the local loop nothing.schemes:  tinmen-cotton:    build:      targets:        Cotton: all    run:      config: Debug    test:      config: Debug      targets:        - CottonUITests        - CottonKitTests        - CottonCallsTests        - CottonChatTests        - CottonComposerTests        - CottonWritingTests        - CottonHealthKitTests    archive:      config: Release