{
  "openapi": "3.1.0",
  "info": {
    "title": "miscsubjects OIP claim editor",
    "version": "1.0.0",
    "description": "Additive article editing for models. NEVER use code interpreter curl — it cannot resolve miscsubjects.com. Use these actions or a browser tool. Contribute is open (no key). Edit requires a rows:VOXEL_* share token as Bearer."
  },
  "servers": [
    {
      "url": "https://miscsubjects.com"
    }
  ],
  "paths": {
    "/api/dispatch": {
      "get": {
        "operationId": "explainToken",
        "summary": "Explain a share token (limits, scope, expiry)",
        "parameters": [
          {
            "name": "explain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "share",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Short share code or full sh.* token"
          }
        ],
        "responses": {
          "200": {
            "description": "Capability explanation JSON"
          }
        }
      }
    },
    "/api/articles/{slug}/discourse": {
      "get": {
        "operationId": "readDiscourse",
        "summary": "Read thread_head and standing arguments for an article",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Discourse feed with thread_head"
          }
        }
      }
    },
    "/api/articles/{slug}/claims/{id}": {
      "get": {
        "operationId": "readClaim",
        "summary": "Read one claim text, content_hash, stable URLs",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Claim id without claim: prefix, e.g. c1"
          }
        ],
        "responses": {
          "200": {
            "description": "Claim object with content_hash"
          }
        }
      }
    },
    "/api/protocol/voxel-challenge": {
      "post": {
        "operationId": "fileContribution",
        "summary": "File challenge/support/upgrade; returns public /i/discourse link. No key required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "expected_thread_head",
                  "body",
                  "actor"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "expected_thread_head": {
                    "type": "string"
                  },
                  "target_div": {
                    "type": "string",
                    "example": "claim:c1"
                  },
                  "expected_hash": {
                    "type": "string"
                  },
                  "stance": {
                    "type": "string",
                    "enum": [
                      "challenge",
                      "support",
                      "upgrade"
                    ]
                  },
                  "body": {
                    "type": "string"
                  },
                  "actor": {
                    "type": "string"
                  },
                  "key": {
                    "type": "string",
                    "description": "Optional share token for attribution"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Filed; includes link"
          },
          "409": {
            "description": "thread_moved / hash_stale / duplicate_match"
          }
        }
      },
      "get": {
        "operationId": "fileContributionGet",
        "summary": "Browser-only fire path when POST is unavailable. Requires fire=1.",
        "parameters": [
          {
            "name": "fire",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "slug",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_thread_head",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target_div",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "expected_hash",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stance",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "actor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Filed; includes link"
          }
        }
      }
    },
    "/api/protocol/voxel-edit": {
      "post": {
        "operationId": "editClaim",
        "summary": "CAS edit a claim DIV. Requires Authorization Bearer rows:VOXEL_* token.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Bearer <share short code or sh.* token>"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "slug",
                  "div_id",
                  "expected_hash",
                  "text"
                ],
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "div_id": {
                    "type": "string",
                    "example": "claim:c1"
                  },
                  "expected_hash": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "actor": {
                    "type": "string"
                  },
                  "key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Edited; includes item_link"
          },
          "401": {
            "description": "need voxel-scoped key"
          },
          "409": {
            "description": "hash_stale"
          }
        }
      }
    },
    "/api/model-lane": {
      "get": {
        "operationId": "runtimeLaw",
        "summary": "Why code interpreter fails and which lane to use",
        "responses": {
          "200": {
            "description": "Runtime law markdown or JSON"
          }
        }
      }
    }
  }
}