//! THE ROUTE TABLE — every screen the phone has, as the path string it is //! reached by. //! //! Design P6: **the route STRINGS are wire protocol and do not move.** The //! Android keyboard's links carry them, //! `NOTIFICATION_ROUTES` maps to them, and `tinmen-cotton://capture` is a //! documented entry point. So they are declared here, in Rust, once — and 4b's //! Swift `Route` enum is held to this list rather than being a second opinion //! about what the app's screens are. //! //! **Why Rust owns the list even though the enum is Swift's.** The reads //! (`super::reads`) are named PER SCREEN, and the guard that makes that //! declaration mean anything is a totality test between the two tables. A test //! can only compare two tables it can both see, and only one of them is in a //! language that compiles on Linux. Putting the routes here also makes the //! Swift enum's job smaller: it is a parser and a formatter over a list //! somebody else already agreed, which is exactly what P6 asks for. //! //! The table is the app's screens, one path each — including `/activity`, the //! assistant-runs screen, which `read.activity` answers. //! //! The redesign (2026-09-14, phase 15) folded the two `/decide/*` screens //! into ONE `/decide` — every pending decision as a paper slip with a tick //! and a cross — and replaced `/find` with `/search`, the everything-search //! drawn as objects. `/inbox` and `/catalogue` never returned: the owner's //! earlier ruling ("add nothing new; move everything as it is") struck them by //! name, and the paper-kit spec is what settled the two that did change. //! //! **Step 5c deleted that app, and with it the derivation.** This table is now //! the DECLARATION rather than a copy of one, and two guards replace the walk //! that used to check it. Between them they catch the same failure from both //! ends: `RouteTableTests.swift` in the phone lane reads this file and holds //! the Swift `Route` enum to it, and `reads_tests.rs` holds every entry here //! to a read or a written deferral. A screen that exists and is not here is //! red in the first; an entry here that answers nothing is red in the second. //! A Rust test cannot do the first half itself — it cannot parse a Swift enum, //! and `cotton-ffi` compiles on Linux where the Swift package does not. /// Every route, sorted. A route added here needs a read beside it in /// [`super::reads`] or a line in that module's deferral list saying which /// sub-step owes one — which is the whole point of declaring both. pub const ROUTES: &[&str] = &[ "/", "/about", "/about/help", "/about/whats-new", "/activity", "/alarms", "/backup", "/bin", "/briefing", "/bring-in", "/calendar", "/calendar/event/[id]", "/calendar/event/edit", "/calendar/month", "/calls/call/[id]", "/calls/history", "/camera", "/capture", "/code", "/code/defaults", "/code/new", "/database", "/device", "/device/[page]", "/devices", "/devices/[id]", "/devices/[id]/storage", "/documents", "/documents/document/[id]", "/documents/document/[id]/viewer", "/documents/import", "/email", "/email/[id]", "/export", "/goals", "/goals/goal/[id]", "/home", "/journal", "/journal/[date]", "/keyboard-take", "/legal/privacy", "/legal/terms", "/lists/[table]", "/lists/[table]/[id]", "/locations", "/locations/location/[id]", "/me", "/meetings", "/meetings/meeting/[id]", "/meetings/record", "/members", "/members/[id]", "/members/admit", "/memory/[id]", "/memory/dropped", "/messages", "/messages/[thread]", "/messages/[thread]/info", "/messages/[thread]/media", "/messages/import", "/messages/new", "/messages/starred", "/money", "/money/accounts/[id]", "/money/statements/[id]", "/money/transactions/[id]", "/mood", "/news", "/news/edition/[id]", "/news/settings", "/news/topic/[id]", "/news/topic/new", "/notes", "/notes/journal-today", "/notes/note/[id]", "/passwords", "/passwords/[id]", "/people", "/people/import", "/people/person/[id]", "/people/person/[id]/[section]", "/photos", "/photos/album/[id]", "/photos/album/[id]/add", "/photos/albums", "/photos/duplicates", "/photos/people", "/photos/photo/[id]", "/projects", "/projects/[slug]", "/projects/[slug]/[section]", "/projects/[slug]/brand", "/projects/[slug]/code", "/projects/[slug]/feedback", "/projects/[slug]/feedback/[id]", "/projects/[slug]/memory", "/projects/[slug]/todos", "/reader", "/reader/page/[id]", "/rejected", "/search", "/server", "/sessions/[id]", "/sessions/[id]/terminal", "/settings/join-request/[id]", "/storage", "/storage/[id]", "/take", "/thoughts", "/thoughts/thought/[id]", "/todos", "/todos/done", "/todos/dropped", "/todos/todo/[id]", "/tools", "/tools/board/[id]", "/videos", "/videos/video/[id]", "/voice-words", "/voice-words/[id]", ]; /// Is this a route this app has? /// /// Exact, never a prefix match: `/todos/todo/[id]` and `/todos/done` are two /// screens, and a parser that answered "yes" to `/todos/anything` would send a /// notification tap to the wrong one. pub fn is_route(path: &str) -> bool { ROUTES.contains(&path) } /// The screens a record opens on, as `opens.screen` says them. pub const SCREENS: &[&str] = &["deck", "reader", "viewer", "chat", "group", "whole", "outside"]; /// WHERE A RECORD OPENS, answered from its table's definition and never /// from a list of table names: `shell.opened` (made cards), `shell.list` /// rows and `shell.today` cards carry it as `opens`, one shape for Swift /// and Android alike: /// /// ```json /// { "table", "id", "path", "screen": "deck|reader|viewer|chat|group|whole|outside", /// "opening": "reader|whole|group|conversation|viewer|reading|opened" } /// ``` /// /// - A row standing for another record (the definition's `opens`: a /// sighting's thread, a comment's record) opens THAT record — `table` and /// `id` are the one it stands for, read through `opens.column` and /// `opens.table` (else the table its `table_column` names, else the /// column's `link_to`), its path and /// screen that table's. /// - `path` is a route of [`ROUTES`] filled in: the definition's /// `record_route` with each parameter the record's id (`[table]` the /// table's own id), else the generic `/lists/