{"openapi":"3.1.0","info":{"title":"ix — interaction store","version":"0.1.0"},"paths":{"/activity/ingest":{"post":{"summary":"Activity Ingest","operationId":"activity_ingest_activity_ingest_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/act/bind":{"get":{"summary":"Act Bind","description":"Claim a ticket for THIS host and THIS browser's td_session, set the act cookie, 302 to a validated next.\nEvery outcome redirects (no dead end); a failure leaves the hop guard so nothing loops.","operationId":"act_bind_auth_act_bind_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/act/vouch":{"get":{"summary":"Act Vouch","description":"A host holding a VALID act for this session hands a ticket to another act host (`to` in act_hosts, never\nitself) and sends the browser to that host's bind. Anything else: straight to the validated next.","operationId":"act_vouch_auth_act_vouch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/act/status":{"get":{"summary":"Act Status","description":"{subject, act} for the account page's 'verify this device' line: is this a cookie-only identity, and does\nTHIS host hold a valid act for its session? Read-only; never mints. CORS: the portal origins only (main.cors).","operationId":"act_status_auth_act_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Console Root","description":"markup.tongde.us/ (the user-facing address, Phil 2026-10-02) → 302 /markup/console (query kept; the browser\nkeeps any #a=<id> fragment). Only on a console host; every other Host keeps its old 404 at /.","operationId":"console_root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin-app.js":{"get":{"summary":"Admin Static Admin App Js","operationId":"admin_static_admin_app_js_admin_app_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin-app.css":{"get":{"summary":"Admin Static Admin App Css","operationId":"admin_static_admin_app_css_admin_app_css_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin-theme.js":{"get":{"summary":"Admin Static Admin Theme Js","operationId":"admin_static_admin_theme_js_admin_theme_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access.js":{"get":{"summary":"Admin Static Access Js","operationId":"admin_static_access_js_access_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/settings.js":{"get":{"summary":"Admin Static Settings Js","operationId":"admin_static_settings_js_settings_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/console.css":{"get":{"summary":"Admin Static Console Css","operationId":"admin_static_console_css_console_css_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/portal.js":{"get":{"summary":"Portal Js","operationId":"portal_js_portal_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/portal.css":{"get":{"summary":"Portal Css","operationId":"portal_css_portal_css_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/":{"get":{"summary":"Auth Landing","description":"account.tongde.us/auth/?next=…#<token>: the cookie-only magic-link landing. Portal hosts only (else 404).","operationId":"auth_landing_auth__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/auth.js":{"get":{"summary":"Auth Landing Js","operationId":"auth_landing_js_auth_auth_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/sites":{"get":{"summary":"Auth Sites","description":"The signed-in caller's own site list. 400 no session · 401 not signed in. Never another person's data.\nOnly the portal calls this, same-origin: a cross-origin caller (any Origin header that is not a portal host) is\nrefused 403, so an XSS on another tongde.us site cannot enumerate the caller's roles via the shared cookie.","operationId":"auth_sites_auth_sites_get","parameters":[{"name":"session","in":"query","required":false,"schema":{"type":"string","default":"","title":"Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/sessions":{"get":{"summary":"Auth Sessions","description":"The caller's live sign-ins: [{id, current, email, created_at, last_seen, via, browser, os, country, site}].","operationId":"auth_sessions_auth_sessions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/sessions/revoke":{"post":{"summary":"Auth Sessions Revoke","description":"Body {id} signs out one OTHER device, or {others: true} every device but this one. The current device signs\nout with the ordinary /auth/logout. → {ok, revoked: n}.","operationId":"auth_sessions_revoke_auth_sessions_revoke_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/activity":{"get":{"summary":"Auth Activity","description":"The caller's OWN timeline: {ok, email, rows:[…], next, page_views:{requested, available}}; filters kind / site /\nsince / q. 404 wrong host · 403 foreign origin / cross-site · 401 signed out · 400 bad parameter. Never another\nperson's rows or page views (my_activity.fetch).","operationId":"auth_activity_auth_activity_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/me":{"get":{"summary":"Annotate Me","description":"Is the caller an annotator on this Origin's site? Signed out / no explicit grant → 200\n{annotator:false} (P3; was 401/403). The module renders only when annotator is true. Also returns the\ncategory vocabulary for the UI.","operationId":"annotate_me_annotate_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/me":{"get":{"summary":"Annotate Me","description":"Is the caller an annotator on this Origin's site? Signed out / no explicit grant → 200\n{annotator:false} (P3; was 401/403). The module renders only when annotator is true. Also returns the\ncategory vocabulary for the UI.","operationId":"annotate_me_markup_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate":{"get":{"summary":"Annotate List","description":"All annotations for one page: ?site=&uid= (site defaults to the Origin's). Each carries its\nderived status + full event list. Withdrawn notes are left out unless ?include=withdrawn (D15).","operationId":"annotate_list_annotate_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Annotate Create","description":"Create. Body: {uid, anchor, category, intent: later|now, body?}. site = the Origin's site and\nauthor = the session's email; neither is taken from the body. intent=now records `queued_now` only.","operationId":"annotate_create_annotate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup":{"get":{"summary":"Annotate List","description":"All annotations for one page: ?site=&uid= (site defaults to the Origin's). Each carries its\nderived status + full event list. Withdrawn notes are left out unless ?include=withdrawn (D15).","operationId":"annotate_list_markup_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Annotate Create","description":"Create. Body: {uid, anchor, category, intent: later|now, body?}. site = the Origin's site and\nauthor = the session's email; neither is taken from the body. intent=now records `queued_now` only.","operationId":"annotate_create_markup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/live":{"get":{"summary":"Annotate Live","operationId":"annotate_live_annotate_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/live":{"get":{"summary":"Annotate Live","operationId":"annotate_live_markup_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/queue":{"get":{"summary":"Annotate Queue","description":"The SHARED team queue (R3). ?site= (omit = every site, which needs an 'All'-scoped grant),\n?intent=later|now (default later), ?status=active|any|<one status> (default active = open, queued,\nheld, failed or asked_claude), ?tag=<hashtag> (D11), ?limit= (≤500). Newest first. Status is derived, so the rows are read in pages of\nQUEUE_SCAN_MAX and filtered until `limit` match; `truncated` is true when QUEUE_SCAN_PAGES pages were\nwalked without reaching the oldest row (older matches may exist).","operationId":"annotate_queue_annotate_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/queue":{"get":{"summary":"Annotate Queue","description":"The SHARED team queue (R3). ?site= (omit = every site, which needs an 'All'-scoped grant),\n?intent=later|now (default later), ?status=active|any|<one status> (default active = open, queued,\nheld, failed or asked_claude), ?tag=<hashtag> (D11), ?limit= (≤500). Newest first. Status is derived, so the rows are read in pages of\nQUEUE_SCAN_MAX and filtered until `limit` match; `truncated` is true when QUEUE_SCAN_PAGES pages were\nwalked without reaching the oldest row (older matches may exist).","operationId":"annotate_queue_markup_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/{annotation_id}/event":{"post":{"summary":"Annotate Event","description":"Append a comment or a status change. Body: {kind: comment, body} | {kind: status, status, body?}.\nThe caller must hold an explicit grant for the ANNOTATION's site, not merely the Origin's.","operationId":"annotate_event_annotate__annotation_id__event_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/{annotation_id}/event":{"post":{"summary":"Annotate Event","description":"Append a comment or a status change. Body: {kind: comment, body} | {kind: status, status, body?}.\nThe caller must hold an explicit grant for the ANNOTATION's site, not merely the Origin's.","operationId":"annotate_event_markup__annotation_id__event_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/{annotation_id}/act":{"post":{"summary":"Annotate Act","description":"One card action on an annotation of a site the caller holds an explicit editor row on. See validate_act.","operationId":"annotate_act_annotate__annotation_id__act_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/{annotation_id}/act":{"post":{"summary":"Annotate Act","description":"One card action on an annotation of a site the caller holds an explicit editor row on. See validate_act.","operationId":"annotate_act_markup__annotation_id__act_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/handles":{"get":{"summary":"Annotate Handles","description":"The @mention vocabulary {handles: [{handle, you}], me}: Mattermost usernames from Grist Site_Grants.Handle.","operationId":"annotate_handles_annotate_handles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/handles":{"get":{"summary":"Annotate Handles","description":"The @mention vocabulary {handles: [{handle, you}], me}: Mattermost usernames from Grist Site_Grants.Handle.","operationId":"annotate_handles_markup_handles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/prefs":{"get":{"summary":"Annotate Prefs Get","description":"The signed-in editor's own Markup preferences (today: where the launcher sits).","operationId":"annotate_prefs_get_annotate_prefs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Annotate Prefs Set","description":"Save the signed-in editor's own Markup preferences. 400 bad shape · 413 larger than PREFS_MAX_BYTES.","operationId":"annotate_prefs_set_annotate_prefs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/prefs":{"get":{"summary":"Annotate Prefs Get","description":"The signed-in editor's own Markup preferences (today: where the launcher sits).","operationId":"annotate_prefs_get_markup_prefs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Annotate Prefs Set","description":"Save the signed-in editor's own Markup preferences. 400 bad shape · 413 larger than PREFS_MAX_BYTES.","operationId":"annotate_prefs_set_markup_prefs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sdk/annotate/loader-{n}.js":{"get":{"summary":"Annotate Loader","description":"Public + static: the pinned stable loader. No cookie, grant or store is read.","operationId":"annotate_loader_sdk_annotate_loader__n__js_get","parameters":[{"name":"n","in":"path","required":true,"schema":{"type":"string","title":"N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sdk/annotate/channel":{"get":{"summary":"Annotate Channel","description":"Public: which module version a site runs. Reads only ?site= (else the Origin header); never echoes raw input.","operationId":"annotate_channel_sdk_annotate_channel_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/sdk/annotate/{version}.js":{"get":{"summary":"Annotate Sdk","description":"Public + static: the pinned module file for one version. No cookie, grant or store is read.","operationId":"annotate_sdk_sdk_annotate__version__js_get","parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"string","title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/exec/queue":{"get":{"summary":"Exec Queue","description":"intent=now annotations still `queued`, OLDEST first, across every site. ?limit= (≤100, default 20).","operationId":"exec_queue_annotate_exec_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/exec/{annotation_id}/event":{"post":{"summary":"Exec Event","description":"Append ONE reserved event: {kind: applied|held|failed|undo, payload}. actor = executor@ix, always.\napplied/held/failed only from `queued`, undo only from `applied` (else 409 with the current status).","operationId":"exec_event_annotate_exec__annotation_id__event_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/exec/confirm_unknown":{"get":{"summary":"Exec Confirm Unknown","description":"P3.5 reconcile feed: held/failed teachings canonical annotations whose latest Confirm had an unknown\noutcome (a confirm_unknown comment after the latest held). Each carries `confirm_unknown`\n{marker_id, at, confirmed_by, uid, seg}; the executor looks for the `Annotation-Id: <id>` commit.","operationId":"exec_confirm_unknown_annotate_exec_confirm_unknown_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/exec/digest":{"get":{"summary":"Exec Digest","description":"The daily digest's data, read-only. ?since=<ISO-8601 with offset> (default: 24 h ago, max 8 days).","operationId":"exec_digest_annotate_exec_digest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console":{"get":{"summary":"Console Page","description":"F6: on a console host, a cookie-only identity whose browser holds no act cookie HERE takes ONE hop through a\nhost that has one (main → act.console_repair: vouch → bind → back, query kept, Cache-Control no-store, a loop guard).\nFails open: any error serves the page (R10).","operationId":"console_page_markup_console_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console":{"get":{"summary":"Console Page Legacy","description":"Static + public: the pre-rename console URL → 308 to /markup/console (query kept; the browser keeps the\n#a=<id> fragment). Same host rule as the page: anything but the console host → 404.","operationId":"console_page_legacy_annotate_console_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console.js":{"get":{"summary":"Console Js","operationId":"console_js_annotate_console_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console.js":{"get":{"summary":"Console Js","operationId":"console_js_markup_console_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console.css":{"get":{"summary":"Console Css","operationId":"console_css_annotate_console_css_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console.css":{"get":{"summary":"Console Css","operationId":"console_css_markup_console_css_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console-theme.js":{"get":{"summary":"Console Theme Js","operationId":"console_theme_js_markup_console_theme_js_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console/api/me":{"get":{"summary":"Console Me","description":"Who am I and which sites may I see? {email, sites:[…], all: bool}. No site → still 200 (empty).","operationId":"console_me_annotate_console_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console/api/me":{"get":{"summary":"Console Me","description":"Who am I and which sites may I see? {email, sites:[…], all: bool}. No site → still 200 (empty).","operationId":"console_me_markup_console_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console/api/queue":{"get":{"summary":"Console Queue","description":"Same query + answer as /annotate/queue (?site= omitted = every site, needs an 'All' editor row).","operationId":"console_queue_annotate_console_api_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console/api/queue":{"get":{"summary":"Console Queue","description":"Same query + answer as /annotate/queue (?site= omitted = every site, needs an 'All' editor row).","operationId":"console_queue_markup_console_api_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console/api/inbox":{"get":{"summary":"Console Inbox","description":"D10 Markup inbox 收件匣 — the items needing THIS person across every site they hold an explicit editor row on.\n?view=needs (default: needs-me, not done) | all (not done) | done · ?site= (one of theirs). Answer:\n{items, counts {unread, needs_me, needs_me_unread, open, done}, unread [{id, at}] (every live unread row — what\n\"Mark all read\" marks, whatever the view), system {count, newest_at, since} (the collapsed system-notes row),\ntruncated (the capped non-system read hit INBOX_ROWS_MAX → older rows may be missing), window_days, nudge}.\nCounts, `unread` and `system` cover ALL the caller's sites; `items` honors view + site. When the all-sites read\nwas truncated and ?site= is given, the items come from a second read of that site alone (so narrowing helps).","operationId":"console_inbox_markup_console_api_inbox_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/markup/console/api/inbox/mark":{"post":{"summary":"Console Inbox Mark","description":"D10: mark inbox rows for THIS person only — read | done | undone, one id or many (bulk \"mark all read\"), and/or\nthe collapsed system row. Every id must be an annotation on a site the caller holds an explicit editor row on;\notherwise the whole request is 404 (same answer for \"no such id\" and \"not yours\", as _person_event).","operationId":"console_inbox_mark_markup_console_api_inbox_mark_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console/api/{annotation_id}/event":{"post":{"summary":"Console Event","description":"comment | status on one annotation; needs an explicit editor role on the ANNOTATION's site.","operationId":"console_event_annotate_console_api__annotation_id__event_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/console/api/{annotation_id}/event":{"post":{"summary":"Console Event","description":"comment | status on one annotation; needs an explicit editor role on the ANNOTATION's site.","operationId":"console_event_markup_console_api__annotation_id__event_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/console/api/{annotation_id}/act":{"post":{"summary":"Console Act","description":"D15 card action from the console (same body as /markup/{id}/act); the grant is checked on the ANNOTATION's site.","operationId":"console_act_markup_console_api__annotation_id__act_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/console/api/handles":{"get":{"summary":"Console Handles","description":"D11 @mention vocabulary for the console: editors only (an explicit editor row on at least one site).","operationId":"console_handles_markup_console_api_handles_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console/api/{annotation_id}/undo":{"post":{"summary":"Console Undo","description":"P3.5 Undo (lane 1, R5 \"diff + Undo\"; lane 2 → the worker's /revert-annotation). Body: {retrace_ack?: true}. Needs an explicit editor role on the\nANNOTATION's site. The commit comes from the STORED `applied` event, never from the client, so an Undo can\nonly revert the commit this annotation's apply made; the worker's /revert enforces the rest (override-commit\nprefix, its own paths, reverse patch by pathspec, retrace_ack on 原訓). 200 → `undo` {revert_commit};\n502 → `undo` + deploy_failed; anything else → a `comment` \"Undo refused: …\" and the status is unchanged.","operationId":"console_undo_annotate_console_api__annotation_id__undo_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/console/api/{annotation_id}/undo":{"post":{"summary":"Console Undo","description":"P3.5 Undo (lane 1, R5 \"diff + Undo\"; lane 2 → the worker's /revert-annotation). Body: {retrace_ack?: true}. Needs an explicit editor role on the\nANNOTATION's site. The commit comes from the STORED `applied` event, never from the client, so an Undo can\nonly revert the commit this annotation's apply made; the worker's /revert enforces the rest (override-commit\nprefix, its own paths, reverse patch by pathspec, retrace_ack on 原訓). 200 → `undo` {revert_commit};\n502 → `undo` + deploy_failed; anything else → a `comment` \"Undo refused: …\" and the status is unchanged.","operationId":"console_undo_markup_console_api__annotation_id__undo_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/console/api/legacy-undo":{"post":{"summary":"Console Legacy Undo","description":"Body {uid, commit, retrace_ack?: true}. 201 {revert_commit, deeplink, deploy_failed} or the worker's refusal.","operationId":"console_legacy_undo_markup_console_api_legacy_undo_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/console/api/{annotation_id}/confirm":{"post":{"summary":"Console Confirm","description":"P3.5 canonical Confirm. Body: {retrace_ack: true} (a real JSON true, else 400 — checked HERE, and the\nworker checks it again). Needs an explicit editor role on the ANNOTATION's site. Relays the STORED proposal\nto the worker /apply. 200 / 502-with-commit → `applied` {commit, diff, owed, trace, confirmed_by} (Undo as\nlane 1) · drift / refusal → `failed` · unknown outcome (worker unreachable, 403, sha lost) or 'already\nreads NEW' → a `comment`, status unchanged · worker busy (503) → nothing recorded.","operationId":"console_confirm_annotate_console_api__annotation_id__confirm_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/markup/console/api/{annotation_id}/confirm":{"post":{"summary":"Console Confirm","description":"P3.5 canonical Confirm. Body: {retrace_ack: true} (a real JSON true, else 400 — checked HERE, and the\nworker checks it again). Needs an explicit editor role on the ANNOTATION's site. Relays the STORED proposal\nto the worker /apply. 200 / 502-with-commit → `applied` {commit, diff, owed, trace, confirmed_by} (Undo as\nlane 1) · drift / refusal → `failed` · unknown outcome (worker unreachable, 403, sha lost) or 'already\nreads NEW' → a `comment`, status unchanged · worker busy (503) → nothing recorded.","operationId":"console_confirm_markup_console_api__annotation_id__confirm_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/rescript/queue":{"get":{"summary":"Rescript Queue","description":"Annotations across EVERY site (the machine is not a Site_Grants principal), each with `rescript_turn` and\n`asked_claude` (D15: a person pressed the @claude 回批 button → status asked_claude, always counted in the turn).\n?status=active (default: open|held|failed|asked_claude — never the executor's queued) |any|<one status> ·\n?turn=mine (default: a person has the latest word) |all · ?site= · ?limit= (≤500, default 100).\nOldest first within the newest `limit` matches; `truncated` is true when older matches exist beyond `limit`\nOR the scan window ran out. Each item also carries `rescript_leave` (a person-clears reason, or null).\n?id=N returns exactly that annotation (any status/turn/site filter ignored) — never a windowed lookup.","operationId":"rescript_queue_annotate_rescript_queue_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/rescript/note":{"post":{"summary":"Rescript Note","description":"D14: Claude CREATES a task or an fyi for PEOPLE — {site, uid, anchor: {seg?, layer?, quote: {exact, prefix?,\nsuffix?}, pos?, rev?}, body, for_humans, kind?: task|fyi, category?, items?}. intent later, author claude@ix\n(fixed server-side). Bad/boilerplate for_humans or pure narration → 400. Idempotent: the same note (site, uid,\nseg, layer, quote, body) already there → 200 with `existing: true`, nothing written. Near-duplicate (30 days) →\n409 + existing_id; > RESCRIPT_NOTE_PER_PAGE_MAX Claude notes on the page → 409; the runaway guard (200 per site per hour, 500 per day; env-configurable) → 429.\n@handles / #tags in the body are recorded as a `mention` event by claude@ix (D11).","operationId":"rescript_note_annotate_rescript_note_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/rescript/auth-alerts":{"get":{"summary":"Rescript Auth Alerts","description":"Review round 2, H1a: ix's sign-in security events after ?after=<id> (a code tried for one of Phil's link-only\naddresses, an address locked out after wrong codes), oldest first, for the studio ask-Claude dispatcher to relay to\n#homelab as @alerts. Machine-only: the Rescript bearer, no browser Origin.","operationId":"rescript_auth_alerts_annotate_rescript_auth_alerts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/annotate/rescript/{annotation_id}/comment":{"post":{"summary":"Rescript Comment","description":"A Rescript reply on the thread: {body, kind?, agent?, commit?}. actor = claude@ix, always. Refused (409)\nwhile the item is the executor's (`queued`).","operationId":"rescript_comment_annotate_rescript__annotation_id__comment_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/rescript/{annotation_id}/propose":{"post":{"summary":"Rescript Propose","description":"A canonical 原訓 PROPOSAL for a person's Confirm (R4/D3): {proposal: {uid, seg, old, new}, diff?: {old, new},\nbody}. ix runs the worker DRY RUN itself (_rescript_dry_run) and stores its plan; a refused dry run → 409. Stored as a `held` {reason: canonical} event by claude@ix; the console's Confirm\n(retrace-借竅 ack, checked server-side) is the ONLY thing that can apply it, and the worker's whole-value CAS\nre-checks `old` then. teachings only; from open|held|failed; never mid-Confirm or over an unreconciled\nunknown-outcome Confirm (a new `held` would orphan its marker).","operationId":"rescript_propose_annotate_rescript__annotation_id__propose_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/annotate/rescript/{annotation_id}/status":{"post":{"summary":"Rescript Status","description":"{status: 'resolved', body}. Only after Claude's own reply is the latest word on the thread (reply first),\nnever over a canonical proposal still awaiting a person's Confirm, never mid-Confirm.","operationId":"rescript_status_annotate_rescript__annotation_id__status_post","parameters":[{"name":"annotation_id","in":"path","required":true,"schema":{"type":"integer","title":"Annotation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nudge/me":{"get":{"summary":"Nudge Me","description":"May the caller nudge? Signed out / not an editor → 200 {nudger:false} (quiet, like /annotate/me), so the\ntwo underlay pages that probe log no console error. Only a signed-in caller costs a Grist read.","operationId":"nudge_me_nudge_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/nudge/page/{uid}":{"get":{"summary":"Nudge Get","description":"The page's latest revision (full snapshot), the last HISTORY_ROWS revisions, published / pending state.","operationId":"nudge_get_nudge_page__uid__get","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nudge/page/{uid}/rev":{"post":{"summary":"Nudge Rev","description":"Autosave one change: {op: set|reset_all|revert, base_rev, drawing_sig, i?, label?, nudge?, to_rev?, hit?}.\n201 {rev: <new latest>} · 200 {unchanged} · 409 {reason, latest} · 429 rate-cap.","operationId":"nudge_rev_nudge_page__uid__rev_post","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nudge/page/{uid}/publish":{"post":{"summary":"Nudge Publish","description":"Ask the studio exporter to write revision `rev` (must be the latest) into the git sidecar.\n{rev, accept_miss?}: accept_miss=true lets a snapshot with MORE hit-check misses than git's current one\nthrough the exporter's gate (the editor ticked \"publish anyway\"). Idempotent for the same pending rev.","operationId":"nudge_publish_nudge_page__uid__publish_post","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nudge/exec/status":{"get":{"summary":"Exec Status","description":"Latest {uid, rev, drawing_sig, seed_rev} per seeded uid + every pending publish request (with its snapshot).","operationId":"exec_status_nudge_exec_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/nudge/exec/rev/{uid}/{rev}":{"get":{"summary":"Exec Get Rev","description":"One revision's snapshot (the exporter's hand-edit check reads the rev git was last exported from).","operationId":"exec_get_rev_nudge_exec_rev__uid___rev__get","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}},{"name":"rev","in":"path","required":true,"schema":{"type":"integer","title":"Rev"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nudge/exec/seed/{uid}":{"post":{"summary":"Exec Seed","description":"{drawing_sig, chars} from the git sidecar → rev 1 (or a reseed when git's drawing changed).","operationId":"exec_seed_nudge_exec_seed__uid__post","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/nudge/exec/event/{uid}":{"post":{"summary":"Exec Event","description":"{kind: exported|export_failed, request_id, commit?|reason?}. `exported` settles ANY unsettled request of\nthe uid (a superseded publish that did reach git must show as published — else ix and git split-brain);\n`export_failed` settles only the CURRENT pending one. 409 when already settled / not pending. Settling an\nolder request never touches the newer pending one (pending_request keys on the latest request).","operationId":"exec_event_nudge_exec_event__uid__post","parameters":[{"name":"uid","in":"path","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settings/console/api/me":{"get":{"summary":"Admin Me","description":"Which sites may the caller administer? {email, sites:[{site, keys}]}. None → 200 with an empty list.","operationId":"admin_me_settings_console_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/settings/console/api/site/{site}":{"get":{"summary":"Admin Get","operationId":"admin_get_settings_console_api_site__site__get","parameters":[{"name":"site","in":"path","required":true,"schema":{"type":"string","title":"Site"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settings/console/api/site/{site}/{action}":{"post":{"summary":"Admin Write","description":"set {key, value, expect} · bump {expect[, key]} · undo {event_id}. 201 {event, values} · 200 unchanged ·\n409 changed/epoch · 404 unknown event.","operationId":"admin_write_settings_console_api_site__site___action__post","parameters":[{"name":"site","in":"path","required":true,"schema":{"type":"string","title":"Site"}},{"name":"action","in":"path","required":true,"schema":{"type":"string","title":"Action"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/settings/{site}":{"get":{"summary":"Public Settings","description":"S1: every allowlisted key's effective value, nested by prefix. Public, short cache.","operationId":"public_settings_settings__site__get","parameters":[{"name":"site","in":"path","required":true,"schema":{"type":"string","title":"Site"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/me":{"get":{"summary":"Access Me","description":"{email, admin}. An admin also gets the site list and gate sites (no roster data here).","operationId":"access_me_access_console_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access/console/api/site/{site}":{"get":{"summary":"Access Site","operationId":"access_site_access_console_api_site__site__get","parameters":[{"name":"site","in":"path","required":true,"schema":{"type":"string","title":"Site"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/person/{email}":{"get":{"summary":"Access Person","operationId":"access_person_access_console_api_person__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/lastvisit/site/{site}":{"get":{"summary":"Access Lastvisit Site","description":"Last visit of each person listed on a site (invariant 7). Always 200 once the gate passes: a log or Umami that\ncannot answer is a sentence in `activity` / `umami`, never an error.","operationId":"access_lastvisit_site_access_console_api_lastvisit_site__site__get","parameters":[{"name":"site","in":"path","required":true,"schema":{"type":"string","title":"Site"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/lastvisit/person/{email}":{"get":{"summary":"Access Lastvisit Person","description":"Last visit per site and the newest sign-in of one person (invariant 7).","operationId":"access_lastvisit_person_access_console_api_lastvisit_person__email__get","parameters":[{"name":"email","in":"path","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/activity":{"get":{"summary":"Access Activity","description":"A person's full activity timeline (the one they see as \"My activity\"), for an All-tier admin (invariant 8).\nFilters (kind, site, since, q, limit, before) are my_activity.parse_params. Every successful read is an audit row,\n`access.view_activity`, naming the subject (throttled per session × subject), never the filters.","operationId":"access_activity_access_console_api_activity_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/pageviews":{"get":{"summary":"Access Pageviews","description":"Umami page views of one person, newest first, paged. Admin-only (the same _gate as every route here). Umami\nunavailable → 200 {ok:false, available:false, error:<sentence>}: the panel shows the sentence, never a stack.","operationId":"access_pageviews_access_console_api_pageviews_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","default":1,"title":"Page"}},{"name":"size","in":"query","required":false,"schema":{"type":"integer","default":25,"title":"Size"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/aid":{"get":{"summary":"Access Aid","operationId":"access_aid_access_console_api_aid_get","parameters":[{"name":"aid","in":"query","required":false,"schema":{"type":"string","default":"","title":"Aid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/groups":{"get":{"summary":"Access Groups","operationId":"access_groups_access_console_api_groups_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access/console/api/check":{"get":{"summary":"Access Check","operationId":"access_check_access_console_api_check_get","parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}},{"name":"site","in":"query","required":false,"schema":{"type":"string","default":"","title":"Site"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/access/console/api/lint":{"get":{"summary":"Access Lint","operationId":"access_lint_access_console_api_lint_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access/console/api/preview":{"post":{"summary":"Access Preview","operationId":"access_preview_access_console_api_preview_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access/console/api/apply":{"post":{"summary":"Access Apply","operationId":"access_apply_access_console_api_apply_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access/console/api/undo":{"post":{"summary":"Access Undo","operationId":"access_undo_access_console_api_undo_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/access/console/api/history":{"get":{"summary":"Access History","operationId":"access_history_access_console_api_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/gate":{"get":{"summary":"Auth Gate","operationId":"auth_gate_auth_gate_get","parameters":[{"name":"site","in":"query","required":false,"schema":{"type":"string","default":"","title":"Site"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sdk/analytics/umami-id-{n}.js":{"get":{"summary":"Umami Id Helper","description":"Public + static. Refuses (500) bytes that no longer match the pin.","operationId":"umami_id_helper_sdk_analytics_umami_id__n__js_get","parameters":[{"name":"n","in":"path","required":true,"schema":{"type":"string","title":"N"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/devnotes/me":{"get":{"summary":"Devnotes Me","description":"Is the caller Phil (and the notepad on)? The module asks this once before it builds anything: a 403 builds nothing.","operationId":"devnotes_me_devnotes_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes":{"get":{"summary":"Devnotes List","description":"?status=open|done (absent = both) &url=<page address> (only that page's notes). open_count = COUNT of open notes.","operationId":"devnotes_list_devnotes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Devnotes Create","description":"{body, url, title, uid}. site = the request Origin's host (never the body); author = the session's primary.","operationId":"devnotes_create_devnotes_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes/update":{"post":{"summary":"Devnotes Update","operationId":"devnotes_update_devnotes_update_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes/resolve":{"post":{"summary":"Devnotes Resolve","operationId":"devnotes_resolve_devnotes_resolve_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes/delete":{"post":{"summary":"Devnotes Delete","description":"200 even when the note is already gone (a delete is idempotent); its picture goes with it.","operationId":"devnotes_delete_devnotes_delete_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes/shot":{"post":{"summary":"Devnotes Shot Set","description":"{id, data: data:image/jpeg|png|webp;base64,...}. Over SHOT_CAP is refused from Content-Length before the body is read.","operationId":"devnotes_shot_set_devnotes_shot_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes/shot_err":{"post":{"summary":"Devnotes Shot Err","description":"{id, err}: WHY a note has no picture, as a code from SHOT_ERRS (\"other\" for anything else); only while it has none.","operationId":"devnotes_shot_err_devnotes_shot_err_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/devnotes/{nid}/shot":{"get":{"summary":"Devnotes Shot Get","operationId":"devnotes_shot_get_devnotes__nid__shot_get","parameters":[{"name":"nid","in":"path","required":true,"schema":{"type":"string","title":"Nid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sdk/devnotes/{name}.js":{"get":{"summary":"Devnotes Sdk","description":"Public + static (no cookie, grant or store read), like /sdk/analytics/*. Refuses (500) bytes that no longer match the pin.\nNeeds the wildcard CORS main.cors gives /sdk/devnotes/* (SRI + crossorigin=\"anonymous\" from any origin a page is built on).","operationId":"devnotes_sdk_sdk_devnotes__name__js_get","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string","title":"Name"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/me/prefs":{"get":{"summary":"Prefs Get","operationId":"prefs_get_me_prefs_get","parameters":[{"name":"app","in":"query","required":false,"schema":{"type":"string","default":"","title":"App"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Prefs Set","operationId":"prefs_set_me_prefs_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/search-log":{"post":{"summary":"Search Log","operationId":"search_log_search_log_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/csp-report":{"post":{"summary":"Csp Report","description":"Public + unauthenticated: always 204. Reads only ?s ?p, Content-Type/-Length, Origin, User-Agent, the client\nIP (memory only) and the body. Never a cookie, never the session.","operationId":"csp_report_csp_report_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/vote":{"post":{"summary":"Vote","description":"Sugar for the vote kind. Body: {uid, seg, register, language, rev, actor, dir, passcode}.\n\nGate: self-identify (`actor`) + the shared passcode. Both required.","operationId":"vote_vote_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/i":{"post":{"summary":"Interact","description":"Generic write. Body: {uid, seg, register, language, kind, value, actor, passcode}.\n\nkind='vote' is routed through the vote policy (clamp + upsert). Other kinds\nare appended verbatim — the store is ready for flag/comment/react later.","operationId":"interact_i_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"List Interactions","description":"List rows for a teaching. The `actor` column is deliberately NOT returned\n(public reads never expose reviewer identities). PRIVATE_KINDS are never returned\n(an explicit private kind → empty; no kind → excluded) — owners read them via /mine.","operationId":"list_interactions_i_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}},{"name":"kind","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/i/agg":{"get":{"summary":"Aggregate","description":"Tallies for a teaching. Aggregates ONLY — no actor PII.\n\nReturns per (seg, register, language, rev): score = SUM(dir), votes = COUNT(*).\n`rev` is included so the reader shows only the CURRENT-rev tally as the live\nscore, while prior-rev tallies remain available (version history of the score).","operationId":"aggregate_i_agg_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"vote","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/flag":{"post":{"summary":"Flag","description":"A reviewer flags a correction on a line. Body:\n{uid, seg, register, language, rev, actor, note, passcode}.\nAppends kind='flag', value={reviewer, note, status:'New'}. Soft-dedups an\nidentical flag from the same reviewer on the same line within a short window\n(belt-and-suspenders on top of the reader's own debounce). 中文 is NOT stored.","operationId":"flag_flag_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/reply":{"post":{"summary":"Reply","description":"A reply on a flag's sub-thread. Body:\n{uid, seg, register, language, actor, note, parent, passcode}.\nparent = the flag row id. Appends kind='comment', value={reviewer,note,parent}.","operationId":"reply_reply_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/resolve":{"post":{"summary":"Resolve","description":"An editor's disposition of a flag (used by the /flags-review loop). Body:\n{uid, seg, actor, parent, action, note, passcode}.  action ∈ applied|dismissed|\nescalated. Appends kind='resolution', value={reviewer,action,parent,note}. The\nflag's status is DERIVED from this (append-only — the flag row is never mutated).","operationId":"resolve_resolve_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/flags":{"get":{"summary":"Flags","description":"Flags for a teaching, WITH reviewer attribution and DERIVED status.\n\nShape mirrors the retired n8n communal-view GET so the reader's existing\nloadFlags() keeps working unchanged: {ok, uid, flags:[{id,seg,reviewer,note,\nstatus,ts,register}]}. status = a terminal value.status if the row carries one\n(migrated rows), else derived from any resolution post referencing the flag id,\nelse 'New'. A reviewer name is exposed here BY DESIGN (attributed review).","operationId":"flags_flags_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/thread":{"get":{"summary":"Thread","description":"The full review thread for a teaching: each flag with its replies + resolution\nnested. Powers the per-teaching inbox/thread view. Attributed (reviewer exposed).","operationId":"thread_thread_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads":{"get":{"summary":"Threads","description":"Teachings with review activity, newest-first — the data source for the nightly\ndigest and the in-app inbox. ?since=ISO8601 → only posts after that instant.\nGrouped by teaching: {uid, posts (count), last_ts, reviewers[], open_flags}.\nopen_flags = flags with no resolution (the actionable backlog per teaching).","operationId":"threads_threads_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Since"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/threads/open":{"get":{"summary":"Threads Open","description":"D16: COUNT-ONLY open review-mode flags per teaching: {ok, total, by_uid:{uid: n}}. No reviewer names, no notes.\nThe nightly stale-flag check reads THIS (not /threads), so the planned editor gate on /flags /thread /threads cannot\nblind it. Same definition as /threads open_flags: unresolved critiques (a 'comment' flag is stored as a critique\nsince the D16 grace, see /flag).","operationId":"threads_open_threads_open_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/start":{"post":{"summary":"Auth Start","description":"Begin sign-in. Body: {email}. Mints a magic token + short code, stores them\nhashed with a short TTL, and emails BOTH. Returns {ok:true} regardless of whether\nthe email is known (don't leak the roster).\n\nBody {email, channel:\"sms\"} (2026-10-01) texts the 6-digit code instead, ONLY to the\nphone on file for that email in the temple Directory → {ok, channel:\"sms\", hint} or\n409 no_phone / opted_out · 429 rate_limited · 503 sms_unavailable (bilingual\nmessage_zh/message_en). This path necessarily says whether a phone is on file and\nshows its last 4 digits — accepted in the spec. See _auth_start_sms.\n\nKnown addresses only (2026-10-20, README → \"Who may sign in\"): an address app/signin.py doesn't know gets NO\ncode and nothing is minted; the email answer is the same {ok:true} (decided AFTER the response, in a background\ntask, so the time taken can't tell known from unknown either) and the SMS answer is the same 409 no_phone a known\naddress without a phone gets. Each refusal is logged in auth_refused.","operationId":"auth_start_auth_start_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/verify":{"post":{"summary":"Auth Verify","description":"Complete sign-in via the magic LINK. Body: {token}. Anything else in the body (a `next`) is ignored: where the\nbrowser goes afterwards is the return_to stored at /auth/start (X11).","operationId":"auth_verify_auth_verify_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/verify-code":{"post":{"summary":"Auth Verify Code","description":"Complete sign-in via the cross-device short CODE. Body: {email, code, bind_existing?}.\nCaps guesses per pending row; invalidates the row after too many wrong tries. A6: the attempt is CLAIMED before\nthe comparison (`UPDATE … attempts < CODE_MAX_ATTEMPTS RETURNING`), so parallel wrong guesses get at most\nCODE_MAX_ATTEMPTS comparisons per row; the refused-address decoy path has the same shape, so real and decoy\nanswers stay identical (incorrect → 5-try cap → 429 → lockout; R1c).\nbind_existing (R6b, account page only): a correct code mints act for the browser's EXISTING session, no new one.","operationId":"auth_verify_code_auth_verify_code_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/me":{"get":{"summary":"Auth Me","description":"Resolve a session → {email, role} (role fresh from the grant table). Reads the\nsession from the ?session= query (legacy localStorage flow) OR the shared\ntd_session cookie (carry-over SSO — this is how a site learns the visitor is\nalready signed in from another *.tongde.us site). Slides last_seen; 401 if none.\nF1: the explicit ?session= goes through _session_token (stage rules); an explicit token of a cookie-only\nidentity is never re-planted as the cookie (stage ≥ 2), so the observe log can see cookie=absent honestly.\nF6: a valid act cookie on this host is re-planted (slides), an invalid one cleared; never minted here (X15).\n`act` is in the body for a cookie-only identity only (the account page's 'verify this device' line).","operationId":"auth_me_auth_me_get","parameters":[{"name":"session","in":"query","required":false,"schema":{"type":"string","default":"","title":"Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/logout":{"post":{"summary":"Auth Logout","description":"Sign out. Body: {session} (or the td_session cookie). Deletes the session row\nAND clears the carry-over cookie so every *.tongde.us site sees the sign-out.\nΔ4 / X10 (2026-10-21): when the body session and the cookie session DIFFER, both are revoked from\nIX_COOKIE_ONLY_STAGE 1 on (at the code default 0: today's single revoke; the clients' double POST is the backup). Their act rows go with them (auth_act ON DELETE CASCADE); this host's __Host- cookies are\ncleared with Secure (R7) — another host's act cookie is now dead and is cleared on its next refresh.","operationId":"auth_logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/track":{"post":{"summary":"Track","description":"Session-gated event write, attributed to the signed-in email (NOT a\nself-declared actor). Body: {uid, seg?, register?, language?, rev?, kind, value}.\nAuth = td_session cookie (carry-over SSO) or body `session`. 401 if not signed in.\nReads stay aggregate/anonymous like every other kind (actor is admin-side only).","operationId":"track_track_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/tags":{"get":{"summary":"List Tags","description":"Current tag vocabulary: latest kind='tag_def' row per slug (seg), active\nones only. Public read (mirrors /flags — attribution isn't the point here,\nthe vocabulary itself is).","operationId":"list_tags_tags_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/highlights":{"get":{"summary":"List Highlights","description":"Span highlights for a document, each with DERIVED current tags/note (the\nroot anchor row, or its latest edit if any — same derivation shape as flag\nstatus) and its comment thread (kind='comment' rows whose value.parent is\nthis highlight's id — literally what /reply already writes, just read back\ngrouped by a 'highlight' parent instead of a 'flag' parent). Attributed\n(creator/reviewer exposed) — same policy as flag/comment/resolution.","operationId":"list_highlights_highlights_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/mine":{"get":{"summary":"Mine","description":"The signed-in person's OWN rows of a PRIVATE kind — never anyone else's.\nAuth = td_session cookie or ?session=. The filter is actor = the SESSION's email;\nnothing in the request can name a different actor.","operationId":"mine_mine_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}},{"name":"kind","in":"query","required":true,"schema":{"type":"string","title":"Kind"}},{"name":"history","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"History"}},{"name":"session","in":"query","required":false,"schema":{"type":"string","default":"","title":"Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/override":{"post":{"summary":"Override","description":"Live canonical-中文 correction. Body: {uid, seg, old_zh, new_zh, session, dry_run?}.\nEditor-gated (session → Role=editor). Relays to the Studio worker /apply.","operationId":"override_override_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/override/revert":{"post":{"summary":"Override Revert","description":"Undo an override. Body: {uid, commit, session}. Editor-gated. Relays to /revert.","operationId":"override_revert_override_revert_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/vet/marks":{"get":{"summary":"Vet Marks","description":"The mark vocabulary + the vettable facet list (public read — the vocabulary\nitself is not sensitive, and the reader needs it to render the popover).","operationId":"vet_marks_vet_marks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/vet":{"post":{"summary":"Vet","description":"Record a senior vetting mark. Body:\n{uid, seg, register?, mark, note?, escalate_to?, contentHash?, session?}.\nAppend-only: a change of mind is a NEW row, never a mutation — the history is\nthe point. `actor` comes from the session, never the body.","operationId":"vet_vet_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"get":{"summary":"Vet Read","description":"All vetting marks for one page, grouped by address, with DERIVED state.\n\nDerived, never settable:\n  current    the most recent mark at an address\n  disputed   the two most recent marks are by DIFFERENT actors and disagree —\n             shown as a standoff; only a fresh human mark resolves it\n  history    every earlier mark, kept intact (Supersede-Don't-Delete)\n`stale` is NOT computed here: it is the comparison of a mark's stored\ncontentHash against the hash build.py emits for that scope right now, which\nonly the page itself knows. The client compares and renders it.","operationId":"vet_read_vet_get","parameters":[{"name":"uid","in":"query","required":true,"schema":{"type":"string","title":"Uid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cal/admin/config":{"put":{"summary":"Cal Admin Config","description":"Store calendars.json (the page's SOT) — X-IX-Cal-Token gated (cal-sync on Studio).","operationId":"cal_admin_config_cal_admin_config_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cal/admin/ics/{slug}":{"put":{"summary":"Cal Admin Ics","description":"Store one calendar's rendered ICS (private OR public — the viewer's /cal/events reads\nboth; only private ones are ever served as a feed) — X-IX-Cal-Token gated.","operationId":"cal_admin_ics_cal_admin_ics__slug__put","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cal/admin/revoke":{"post":{"summary":"Cal Admin Revoke","description":"Revoke feed tokens. Body: {token?} | {email?, slug?} (at least one). X-IX-Cal-Token gated.\nThe next /cal/links for that person mints a fresh URL (if they are still a member).","operationId":"cal_admin_revoke_cal_admin_revoke_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cal/admin/status":{"get":{"summary":"Cal Admin Status","description":"Freshness of the stored config/ICS + live-token counts (no emails). X-IX-Cal-Token gated.","operationId":"cal_admin_status_cal_admin_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cal/links":{"get":{"summary":"Cal Links Get","operationId":"cal_links_get_cal_links_get","parameters":[{"name":"session","in":"query","required":false,"schema":{"type":"string","default":"","title":"Session"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Cal Links Post","description":"Same as GET, but the fallback session travels in the body {session} (text/plain, no\npreflight) instead of the query string, so it never lands in an access log.","operationId":"cal_links_post_cal_links_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/cal/feed/{token}.ics":{"head":{"summary":"Cal Feed","description":"Serve a private calendar to a calendar APP (no session possible). Membership is\nre-checked on EVERY fetch; an unknown, revoked, or no-longer-entitled token is a plain\n404 (never reveals that the token or calendar exists).","operationId":"cal_feed_cal_feed__token__ics_head","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"summary":"Cal Feed","description":"Serve a private calendar to a calendar APP (no session possible). Membership is\nre-checked on EVERY fetch; an unknown, revoked, or no-longer-entitled token is a plain\n404 (never reveals that the token or calendar exists).","operationId":"cal_feed_cal_feed__token__ics_head","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cal/events":{"get":{"summary":"Cal Events Get","operationId":"cal_events_get_cal_events_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Cal Events Post","description":"Same as GET; the fallback session (and optionally from/to) travel in the body\n{session, from, to} (text/plain, no preflight) so the session never hits an access log.","operationId":"cal_events_post_cal_events_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}