Cotton code
184 lines · 9.0 KB · SwiftRaw
// The two legal documents, word for word.//// Both routes carry a permanent// `DEFERRED` line in `crates/cotton-ffi/src/phone/reads.rs`// — "static text, and it will stay a read-less screen" — so nothing here is a// read and nothing here has an error path.//// **PORTED UNCHANGED, EXCEPT THE TWO SENTENCES THAT DESCRIBED A DIFFERENT// PRODUCT.** The privacy document used to say the database is "protected by// row-level security, so an account can only ever read its own records" and// that some people have a database of their own while "everyone else shares// one" — the hosted multi-account database, which is retired and was never// this data plane: one SQLite file per person, on the machine they run, opened// for the devices that machine has admitted (Cotton note "Devices — how a machine is admitted to your database",// `server-address.md`). The port carried both across on the ruling "add nothing// new; move everything as it is"; the phone walk found the sheet still saying// it, and a legal document describing somebody else's architecture is not a// port gap to keep. Both are rewritten here, the phrasing is retired in// `crates/cotton-core/src/language/retired_terms.rs` (`row-level-security`) so// the sweeps catch its return, and `LegalTests` holds what they now say.//// `BRAND.name` interpolated to "Cotton" for the reason `Strings+Local.swift`// gives: the app before this read a per-deployment brand, and this app has one// identity `project.yml` calls immutable.//// Every apostrophe is the STRAIGHT one and every dash the source's own em dash// — checked against the two files with a grep, not assumed.import Foundation/// One section of a legal document: a heading and one paragraph per entry.////// `body` stays a list rather than a joined string for the stated reason —/// "kept as data so the copy stays readable".public struct LegalSection: Identifiable, Equatable, Sendable {    public var heading: String    public var body: [String]    public var id: String { heading }    public init(heading: String, body: [String]) {        self.heading = heading        self.body = body    }}extension CottonStrings {    // ── /legal/privacy ────────────────────────────────────────────────────    public static var privacyTitle: String { ShellLines.line("legal", "privacy_title") }    /// A legal page that hides its date is hiding edits. The stamp is the    /// SOURCE's own — it is not a clock read, and it does not move when this    /// port lands.    public static var legalUpdated: String { ShellLines.line("legal", "legal_updated") }    // **A named deviation**, and it holds for every    // sentence in this file and in `Strings+Local.swift`. Seven lines across    // the two documents interpolate `${BRAND.name}`, which the app before this    // read as a per-deployment brand because the same tree could once ship as a    // second brand. `project.yml` calls this app's identity immutable, so every    // interpolation is RESOLVED to "Cotton" here rather than kept as a    // placeholder over a value that cannot vary. It becomes owed the day a    // second brand ships this tree.    public static var privacyIntro: String { ShellLines.line("legal", "privacy_intro") }    /// The seven sections, in the order the privacy document renders them.    public static var privacySections: [LegalSection] {        [            LegalSection(                heading: ShellLines.line("legal", "privacy.what_is_stored.heading"),                body: [                    ShellLines.line("legal", "privacy.what_is_stored.body.1"),                    // WHAT IS ACTUALLY TRUE. This sentence used to describe the                    // hosted multi-account database — "row-level security, so an                    // account can only ever read its own records" — which is                    // somebody else's architecture: there is no shared database                    // and no account row. It is one file, on a machine the                    // person owns, opened for the devices that machine has                    // admitted (Cotton note "Devices — how a machine is admitted to your database",                    // `server-address.md`). The retired phrasing is declared in                    // `crates/cotton-core/src/language/retired_terms.rs`                    // (`row-level-security`), so the language sweep fails if it                    // comes back anywhere.                    ShellLines.line("legal", "privacy.what_is_stored.body.2"),                ]            ),            LegalSection(                heading: ShellLines.line("legal", "privacy.voice_captures.heading"),                body: [                    ShellLines.line("legal", "privacy.voice_captures.body.1"),                    ShellLines.line("legal", "privacy.voice_captures.body.2"),                ]            ),            LegalSection(                heading: ShellLines.line("legal", "privacy.google_calendar.heading"),                body: [                    ShellLines.line("legal", "privacy.google_calendar.body.1")                ]            ),            // Gmail's read-only scope is RESTRICTED at Google, and an accurate,            // specific disclosure of what is read and why is part of what that            // costs.            LegalSection(                heading: ShellLines.line("legal", "privacy.gmail.heading"),                body: [                    ShellLines.line("legal", "privacy.gmail.body.1"),                    ShellLines.line("legal", "privacy.gmail.body.2"),                ]            ),            LegalSection(                heading: ShellLines.line("legal", "privacy.where_it_lives.heading"),                body: [                    // WHERE IT LIVES, as it actually lives. The ported sentence                    // offered a database "everyone else shares", which is the                    // hosted era and the wrong reassurance twice over: every                    // person has a file of their own, and it is on their own                    // machine rather than on anything Cotton runs. The relay is                    // named because a person reaching their Mac from outside                    // the house goes through one, and it holds no certificate                    // and reads nothing (`packages/relay`).                    //                    // (`${BRAND.name}` resolved to "Cotton" here as everywhere                    // — the dropped-behaviour row "`BRAND.name` is written out                    // as \"Cotton\"", marked at `privacyIntro` above.)                    ShellLines.line("legal", "privacy.where_it_lives.body.1")                ]            ),            LegalSection(                heading: ShellLines.line("legal", "privacy.diagnostics.heading"),                body: [                    ShellLines.line("legal", "privacy.diagnostics.body.1")                ]            ),            LegalSection(                heading: ShellLines.line("legal", "privacy.deleting_your_data.heading"),                body: [                    ShellLines.line("legal", "privacy.deleting_your_data.body.1")                ]            ),        ]    }    // ── /legal/terms ──────────────────────────────────────────────────────    public static var termsTitle: String { ShellLines.line("legal", "terms_title") }    public static var termsIntro: String { ShellLines.line("legal", "terms_intro") }    /// The five sections, in the order the terms document renders them.    public static var termsSections: [LegalSection] {        [            LegalSection(                heading: ShellLines.line("legal", "terms.your_account.heading"),                body: [                    ShellLines.line("legal", "terms.your_account.body.1")                ]            ),            LegalSection(                heading: ShellLines.line("legal", "terms.your_content_is_yours.heading"),                body: [                    ShellLines.line("legal", "terms.your_content_is_yours.body.1")                ]            ),            LegalSection(                heading: ShellLines.line("legal", "terms.what_we_ask_of_you.heading"),                body: [                    ShellLines.line("legal", "terms.what_we_ask_of_you.body.1")                ]            ),            LegalSection(                heading: ShellLines.line("legal", "terms.availability.heading"),                body: [                    ShellLines.line("legal", "terms.availability.body.1"),                    ShellLines.line("legal", "terms.availability.body.2"),                ]            ),            LegalSection(                heading: ShellLines.line("legal", "terms.changes.heading"),                body: [                    ShellLines.line("legal", "terms.changes.body.1")                ]            ),        ]    }}