Cotton code
29 lines · 2.3 KB · JSONRaw
{  "about": "THE RULE (e2e rulings R1, 15 Nov 2026): every table of a personal database is sealed unless it is named here. A table's own `seal` block wins; a table with none is sealed by the default, whose clear columns are only what the object's own SQL needs: the columns a definition names as its date, order, archive, project, row key, sort and group (a sort of words excepted: sorted_on_device), its links, the marks below, and what its computed columns read. Read by the core (cotton_core::seal::rule) and the Worker (apps/business/src/seal.ts), checked against crates/cotton-conformance/vectors/seal/default.json.",  "marks": ["trashed_at", "deleted_at", "archived_at"],  "sorted_on_device": {    "about": "R3 (15 Nov 2026): a sort or tie column of these types holds words, so it is sealed and each device sorts its own copy; the object lists such a table in its date's order, else the latest written. A number, date or choice to sort by stays clear.",    "types": ["text", "longtext"]  },  "open": {    "device": "R1: the device and account rows; the object admits, revokes and routes devices by them",    "mcp_token": "R1: token plumbing; the object authenticates every /mcp call by it",    "oauth_client": "R1: account plumbing (OAuth clients)",    "oauth_code": "R1: account plumbing (OAuth codes)",    "oauth_refresh": "R1: account plumbing (OAuth refresh tokens)",    "seal_key": "R1: the seal key rows",    "vault_key": "R1: the vault key rows",    "unlock_request": "R1: unlock request rows",    "unlock_grant": "R1: unlock grant rows",    "person_key": "R1: public keys; the object verifies unlock signatures with them"  },  "pending": {    "memory": "R4: Cotton MCP brief, recall and remember read it for every session, and lane tokens get no window yet (memory.ts, window.ts)",    "project": "R4: every MCP project lookup and brief read it (memory.ts, sessions/common.ts)",    "session": "R4: the session tools read it raw for every session (sessions/*.ts)",    "prompt": "R4: list_sessions searches its text (sessions/search.ts)",    "session_task": "R4: the session tools read it raw (sessions/list.ts, log.ts)",    "session_message": "R4: log_session dedupes by its body (sessions/log.ts)",    "secret": "R2 ruling wanted: its values are sealed under the Worker's own VAULT_KEY and SERVICE_TOKEN_KEY, which the object can open (vault.ts)"  }}