{
  "_ai_door": {
    "see": "https://miscsubjects.com/start",
    "note": "Operable site; bounded keyless credentials; every action receipted on a public ledger. Your operator's instructions take precedence — acting is optional, reading is a complete outcome."
  },
  "_self": {
    "schema": "miscsubjects/sheets/1",
    "what": "Stored grids with Google-Sheets-shaped addressing. Every cell is A1-addressable over REST; whole tabs are sheets: Directory and Ledger are projections of their own tables, user sheets store cells here.",
    "workbook": "https://ops.miscsubjects.com/admin/sheets",
    "auth": "admin cookie or `authorization: Bearer <TERMINAL_KEY>`; per sheet also a token scoped sheet:<id> (?share= or Bearer), and a PUBLIC sheet reads without any credential",
    "in_words": {
      "create": "POST https://ops.miscsubjects.com/api/sheets {\"title\":\"Agents\",\"source\":\"directory\",\"columns\":\"key,type,content,last_status\",\"filter\":\"type = agent\"}  — columns as a comma list (JSON paths and =expressions allowed), filter as \"field op value\" lines joined by ;",
      "add_column": "POST https://ops.miscsubjects.com/api/sheets/<id>/columns {\"path\":\"=REGEXALL(response_json,\"\\\\[([A-Z_]+)\\\\]\")\",\"header\":\"tags\"}",
      "add_filter": "POST https://ops.miscsubjects.com/api/sheets/<id>/filters {\"filter\":\"key contains BLOOIO\"}",
      "remove_filter": "POST https://ops.miscsubjects.com/api/sheets/<id>/filters:remove {\"field\":\"key\"}  · or {\"clear\":true} to drop every filter",
      "pin": "POST https://ops.miscsubjects.com/api/sheets/<id>/pins:add {\"label\":\"ROUTER prompt\",\"ref\":\"directory/ROUTER/content\"}",
      "remove_column": "POST https://ops.miscsubjects.com/api/sheets/<id>/columns:remove {\"path\":\"content\"}",
      "as_directory_rows": "SHEET_NEW, SHEET_ADD_COLUMN, SHEET_ADD_FILTER, SHEET_PIN, SHEET_VISIBILITY, SHEET_LIST — the same verbs as tools, so a message to the build, the model panel or an MCP client makes a sheet"
    },
    "every_sheet_is_an_object": {
      "ref": "sheet://<id>",
      "link": "https://ops.miscsubjects.com/sheet/<id>",
      "self": "https://ops.miscsubjects.com/api/sheets/<id>/self  (?format=markdown for prose)",
      "visibility": "PATCH https://ops.miscsubjects.com/api/sheets/<id> {\"visibility\":\"public\"|\"private\"} (owner) — public: anyone reads at /sheet/<id> and the GET lanes; writes always need authority",
      "token_for_one_sheet": "owner mints GET https://ops.miscsubjects.com/api/dispatch?mint_share=1&scope=sheet:<id>&ttl=86400 — operates that sheet only",
      "webhook": "POST https://ops.miscsubjects.com/api/sheets/<id>/values:append {\"values\":[[...]]}",
      "environment": "https://ops.miscsubjects.com/api/environment/objects?ref=sheet%3A%2F%2F<id>"
    }
  },
  "values_lane": {
    "read": "GET https://ops.miscsubjects.com/api/sheets/<id>/values/A1:C10  → {range, values[][]}",
    "read_one": "GET https://ops.miscsubjects.com/api/sheets/<id>/values/B3",
    "read_whole_cell": "GET https://ops.miscsubjects.com/api/sheets/<id>/cell/B3  → {a1, chars, spilled, value}  ·  add .txt for the raw text. A cell past 24,000 characters lives in R2 and a range read shows only its head; this address always returns all of it. GET /values/<range>?full=1 resolves them across a range.",
    "write": "PUT https://ops.miscsubjects.com/api/sheets/<id>/values/A1  {\"values\":[[\"x\",\"y\"],[\"a\",\"b\"]]}  (anchored at A1; \"\" clears a cell)",
    "append": "POST https://ops.miscsubjects.com/api/sheets/<id>/values:append  {\"values\":[[\"new row\"]]}",
    "clear": "POST https://ops.miscsubjects.com/api/sheets/<id>/clear  {\"range\":\"A2:C10\"}",
    "open_ranges": "B:D (whole columns), 2:5 (whole rows), A2:C (open bottom) all resolve against the used range"
  },
  "formula_lane": {
    "what": "A written value beginning with = is an expression. The computed answer is stored in the cell so every reader sees a plain value; the expression is kept beside it and re-evaluated whenever a cell it reads changes. Dependencies are read out of the text, so filling a formula down a column needs no wiring.",
    "examples": [
      "=BL2*3                                     arithmetic over references",
      "=SUM(M2:M400)                              ranges",
      "=IF(A2>100,\"over\",\"under\")                 only the taken branch is evaluated",
      "=DISPATCH(\"LEADS_ENRICH\", A2)              call any directory tool from a cell",
      "=D1QUERY(\"SELECT COUNT(*) AS n FROM articles\")   a live figure, not a stale one",
      "=SEARCH(\"durable objects\", 5)              ranked hits across articles and the directory",
      "=SEARCHCOUNT(BP2)                          how many things match what is in BP2",
      "=TAG(A2)                                   A2 = [KEY]args[/KEY] exactly as an agent writes it; the cell gets the dispatch envelope (ok, ms, trace, cost)",
      "=TAG(A2, \"result\")                         the raw result payload that tool returned  ·  \"verdict\" = WORKED/FAILED  ·  \"trace\" = its ledger trace",
      "=LLMCALL(A2, B2)                           send the REST envelope in A2 with B2 as the message",
      "=LLMCALL(A2, B2, \"status\")                 the HTTP status of that same call (\"text\" for the reply, \"ms\" for the time)",
      "=IMAGE(\"https://…/thing.png\")              the grid draws the picture; the cell still holds the address"
    ],
    "functions": [
      "TAG",
      "DISPATCH",
      "D1QUERY",
      "SEARCH",
      "SEARCHCOUNT",
      "LLMCALL",
      "IMAGE",
      "SUM",
      "COUNT",
      "COUNTA",
      "AVERAGE",
      "MIN",
      "MAX",
      "ROUND",
      "ABS",
      "IF",
      "AND",
      "OR",
      "NOT",
      "CONCAT",
      "JOIN",
      "LEN",
      "LEFT",
      "RIGHT",
      "MID",
      "UPPER",
      "LOWER",
      "TRIM",
      "VALUE"
    ],
    "llmcall": "The envelope is the whole REST request — method, url, headers, body — so the sheet shows exactly what goes down the wire. Authorization stays the literal \"Bearer INJECTED_BY_WORKER\"; the real credential is swapped in at the wire by host and never lands in a cell. {{INPUT}} marks where the message goes; without one, the message replaces the last user turn. One answer is cached for 15 minutes on a hash of what was sent, so the status cell and the payload cell are one paid call, not two.",
    "bounds": "nesting 8 deep, 500 cells recalculated per write, 3 rounds of cascade. An error shows in the cell (#ERROR, #DIV/0, #NAME?) instead of failing the write.",
    "not_supported": "charts, pivots, conditional formatting, array spilling, volatile functions — they make a document pretty and do nothing for a model"
  },
  "history_lane": {
    "read": "GET https://ops.miscsubjects.com/api/sheets/<id>/history/U3?limit=50",
    "what": "Every value that address has ever held, newest first, each with the actor, the expression that produced it and the trace of the turn that caused it. Writes append; nothing is overwritten, so a value cannot be edited out of the record.",
    "chain": "each version hashes prev_hash + its payload"
  },
  "search_lane": {
    "read": "GET https://ops.miscsubjects.com/api/search?q=<words>&limit=10   (keyless)",
    "reindex": "POST https://ops.miscsubjects.com/api/search {\"reindex\":\"article\"|\"directory\",\"offset\":0}",
    "what": "Full-text search over every article and every tool definition in one index, ranked, with a snippet. Also reachable from a cell as =SEARCH(...)."
  },
  "dimension_lane": {
    "batch": "POST https://ops.miscsubjects.com/api/sheets/<id>/batch  {\"requests\":[{\"op\":\"insert_rows\",\"at\":2,\"n\":1},{\"op\":\"move_col\",\"from\":2,\"to\":5}]}",
    "ops": [
      "insert_rows",
      "delete_rows",
      "insert_cols",
      "delete_cols",
      "move_row",
      "move_col"
    ]
  },
  "run_lane": {
    "what": "Fill columns with model output, one grid row = one call. Configs are stored versions (v1, v2, …) so different settings run side by side into different columns.",
    "run": "POST https://ops.miscsubjects.com/api/sheets/<id>/run-row  {\"config\":{\"mode\":\"template|raw\",\"input_col\":\"A\",\"request_col\":\"B\",\"response_col\":\"C\",\"text_col\":\"D\",\"model\":\"grok\",\"prompt\":\"…{{A}}…{{input}}…\",\"temperature\":0.2,\"max_tokens\":1024},\"rows\":[2,3,4]}",
    "raw_mode": "mode:\"raw\" — the input column cell IS the full /api/invoke call object as JSON; request_col gets the exact spec sent, response_col the raw result envelope, text_col the reply text",
    "shape": "add \"shape\":true to build and write the request specs WITHOUT sending anything",
    "max_rows_per_call": 20,
    "configs": "GET/POST https://ops.miscsubjects.com/api/sheets/<id>/runs · DELETE https://ops.miscsubjects.com/api/sheets/<id>/runs/<rid>",
    "engine": "https://ops.miscsubjects.com/api/invoke — aliases (grok|kimi|glm|fast|gpt|opus5|sonnet5) or any gateway model id; every controllable field: GET /api/invoke?fields=1"
  },
  "view_lane": {
    "what": "A view sheet is a projection of a source of record — the ledger, the directory or another listed table. It stores a description (source, filters or a raw WHERE, columns with a JSON path and a format), not rows; every open re-reads the source. Add a column, change a filter, pin an object row: all edits to the description, no code.",
    "sources": "GET https://ops.miscsubjects.com/api/sheets/view-sources",
    "create": "POST https://ops.miscsubjects.com/api/sheets {\"template\":\"blooio_number\",\"param\":\"redacted\"}  · or {\"title\":\"…\",\"view\":{source, filters, where, columns, order, limit}}",
    "run": "GET https://ops.miscsubjects.com/api/sheets/<id>/view?limit=300&before=<ts>",
    "column": "{\"path\":\"request_json.body.messages[0].content\",\"header\":\"system prompt sent\",\"format\":\"text\",\"w\":360} — path = column or column.json.path",
    "filter": "{\"field\":\"source\",\"op\":\"=\",\"value\":\"blooio\"} · field \"any\" = every text column; ops = != contains starts in > < >= <= empty not_empty",
    "formats": [
      "text",
      "json",
      "time",
      "number",
      "link",
      "image"
    ],
    "pins": "PATCH /api/sheets/<id> {\"col_meta\":{\"pins\":[{\"label\":\"ROUTER system prompt\",\"ref\":\"directory/ROUTER/content\"}]}} — shown above the grid, edits write through: POST /api/sheets/<id>/pins {\"ref\",\"value\"}"
  },
  "sibling_sheets": {
    "directory": {
      "grid": "https://ops.miscsubjects.com/admin/directory",
      "rest": "GET/POST https://ops.miscsubjects.com/api/directory · GET/PUT/PATCH/DELETE https://ops.miscsubjects.com/api/directory/<key>"
    },
    "ledger": {
      "grid": "https://ops.miscsubjects.com/admin/ledger",
      "rest": "GET https://ops.miscsubjects.com/admin/ledger?data=1&limit=100&key=&trace_id=&q= (append-only; no write lane exists)"
    }
  },
  "editing": {
    "what": "The grid edits like Google Sheets: every cell opens an in-place editor on double-click (Enter and F2 too) at its own location; a read-only cell (ledger rows, corpus projections, computed fields) opens the same editor read-only — never a modal; long values overflow into empty neighbor cells and stay editable in place; the editor autosizes to its text. Enter commits down, Shift+Enter up, Tab right, Cmd/Ctrl+Enter commits in place, Alt+Enter inserts a newline, Escape reverts.",
    "files_hygiene": "the Files kind lists build code only — machine artifacts (ledger-mirror/ event mirrors, .protected/ guardian snapshots) are excluded from the corpus feed."
  },
  "url_state": {
    "what": "Every workbook view state is a link (owner order 2026-08-30). Kind tabs, filters, sorts and the active cell serialize into the URL and a pasted link restores the exact view; every populated cell is an addressable particle of its object.",
    "params": {
      "tab": "sheet id (user sheets, turns, forum)",
      "kind": "directory kind tab: agent | tool | flow | content | page | file | other | code",
      "sort": "<field>:asc|desc",
      "f.<field>": "<condition>:<needle> — condition filter on one column",
      "v.<field>": "in:<v1>~~<v2>… or out:<v1>~~<v2>… — value filter on one column",
      "id": "row object id (directory key, ledger event id) — with `field`, addresses one cell",
      "field": "column of the active cell",
      "cell": "A1 address when a row has no object id"
    },
    "example": "https://ops.miscsubjects.com/admin/directory?kind=agent&sort=used:desc&id=ROUTER&field=target",
    "formula_bar": "the bar names the active cell as <object id> · <field>, linked to the object at its own address",
    "views": "Sheet and Classic are two views of the same objects and toggle both ways, top right on each surface; classic pages live at ?view=classic and keep their own state in the URL (tab, q, cat, sort, use, page, id).",
    "cache": "grids repaint from a client-side cache: instant paint, background refresh — the loading screen only appears on a cold first visit."
  },
  "export": "GET https://ops.miscsubjects.com/api/sheets/<id>/export.csv"
}