Cotton code
33 lines · 4.0 KB · JSONRaw
{  "format_version": 1,  "id": "unlock_grant",  "name": "Unlock window",  "plural": "Unlock windows",  "visibility": "owner",  "title": "request_id",  "date": "granted_at",  "columns": [    { "key": "request_id", "name": "Request", "type": "text", "required": true, "readonly": true },    { "key": "token_id", "name": "Token", "type": "text", "required": true, "readonly": true },    { "key": "tables", "name": "Tables", "type": "text", "multiple": true, "required": true, "readonly": true },    { "key": "minutes", "name": "Minutes", "type": "number", "required": true, "readonly": true },    { "key": "wrapped_sha256", "name": "Wrap digest", "type": "text", "required": true, "readonly": true, "hidden": true },    { "key": "signer", "name": "Signed by", "type": "text", "required": true, "readonly": true },    { "key": "sig", "name": "Signature", "type": "text", "required": true, "readonly": true, "hidden": true },    { "key": "granted_at", "name": "Allowed", "type": "date", "format": "calendar-datetime", "required": true, "readonly": true },    { "key": "ends_at", "name": "Ends", "type": "date", "format": "calendar-datetime", "required": true, "readonly": true },    { "key": "standing", "name": "Until turned off", "type": "bool", "readonly": true },    { "key": "client", "name": "Assistant", "type": "text", "readonly": true },    { "key": "connection_id", "name": "Connection", "type": "text", "readonly": true, "indexed": true },    { "key": "ended_at", "name": "Ended", "type": "date", "format": "calendar-datetime", "readonly": true },    { "key": "ended_by", "name": "Ended by", "type": "choice", "choices": ["timer", "phone", "assistant", "token_revoked", "key_lost"], "readonly": true },    { "key": "account", "name": "Your Claude", "type": "bool", "readonly": true },    { "key": "member_id", "name": "Member", "type": "text", "readonly": true, "indexed": true },    { "key": "member_pub", "name": "Member key", "type": "text", "readonly": true, "hidden": true },    { "key": "withheld", "name": "Withheld", "type": "text", "multiple": true, "readonly": true },    { "key": "ask", "name": "Ask each time", "type": "text", "multiple": true, "readonly": true },    { "key": "off", "name": "Off", "type": "text", "multiple": true, "readonly": true }  ],  "instructions": "One row per window the owner allowed: an assistant's connection may read the named sealed tables until ends_at, which the object stamps on its own clock from minutes (15, 60 or 1440; 0 is a standing grant, until the owner turns it off, whose ends_at is 9999-12-31T23:59:59.999Z and standing true). The window binds to the assistant's connection (connection_id: an OAuth connection keeps it across token refreshes; a pasted token is its own connection), never to one access token. client names the assistant. The phone's unlock_allow act makes it: the table keys wrapped to the request's one-use key (kept only as wrapped_sha256, never the wrap), the person key's fingerprint as signer and its Ed25519 signature over the unlock statement. ended_at and ended_by say how it ended: timer at ends_at, phone when the owner ended it (the unlock_end act), assistant when the assistant ended it, token_revoked when the connection was revoked, key_lost when the object lost the key its window was kept under. After a window ends the object holds no key that opens anything, and the phone moves each table to its next key version. Never written by hand or over MCP. account is true for the standing grant to the person's own Claude: member_id and member_pub name the member key the keys are wrapped to (the object keeps its private half only inside that connection's tokens), withheld is the signed policy (every sealed table except these; code_credential, passkey and secret always among them), ask and off what the person set since (ask: a read files a timed card; off: refused). tables is every table whose keys the phone has handed so far. An account grant has no timer and ends only by Remove (ended_by phone) or when the object can no longer open it (key_lost).",  "add": false}