{
  "components": {
    "examples": {
      "ProvisionSite": {
        "value": {
          "site_label": "agent-demo"
        }
      }
    },
    "parameters": {
      "ChangesetID": {
        "in": "path",
        "name": "changeset_id",
        "required": true,
        "schema": {
          "pattern": "^chg_[0-9a-f]{32}$",
          "type": "string"
        }
      },
      "CommandID": {
        "in": "path",
        "name": "command_id",
        "required": true,
        "schema": {
          "pattern": "^cmd_[0-9a-f]{32}$",
          "type": "string"
        }
      },
      "IdempotencyKey": {
        "in": "header",
        "name": "Idempotency-Key",
        "required": true,
        "schema": {
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        }
      },
      "LiveSessionID": {
        "in": "path",
        "name": "live_session_id",
        "required": true,
        "schema": {
          "pattern": "^live_[0-9a-f]{32}$",
          "type": "string"
        }
      },
      "LogCursor": {
        "description": "Opaque cursor returned by the preceding log page.",
        "in": "query",
        "name": "cursor",
        "required": false,
        "schema": {
          "maxLength": 342,
          "type": "string"
        }
      },
      "LogLimit": {
        "in": "query",
        "name": "limit",
        "required": false,
        "schema": {
          "default": 50,
          "maximum": 100,
          "minimum": 1,
          "type": "integer"
        }
      },
      "ReleaseID": {
        "in": "path",
        "name": "release_id",
        "required": true,
        "schema": {
          "pattern": "^rel_[0-9a-f]{32}$",
          "type": "string"
        }
      },
      "SiteID": {
        "in": "path",
        "name": "site_id",
        "required": true,
        "schema": {
          "pattern": "^site_[0-9a-f]{32}$",
          "type": "string"
        }
      },
      "SourcePath": {
        "description": "Normalized relative POSIX path. Absolute, traversal, .git, .nettipoika, backslash, symlink, and non-regular targets are rejected.",
        "in": "query",
        "name": "path",
        "required": true,
        "schema": {
          "maxLength": 1024,
          "minLength": 1,
          "type": "string"
        }
      }
    },
    "responses": {
      "Problem": {
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        },
        "description": "Stable machine-readable error"
      }
    },
    "schemas": {
      "ApplyFileOperationsRequest": {
        "additionalProperties": false,
        "properties": {
          "base_revision": {
            "minimum": 1,
            "type": "integer"
          },
          "operations": {
            "items": {
              "$ref": "#/components/schemas/FileOperation"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          }
        },
        "required": [
          "base_revision",
          "operations"
        ],
        "type": "object"
      },
      "ApplyLiveSessionRequest": {
        "additionalProperties": false,
        "properties": {
          "base_revision": {
            "minimum": 1,
            "type": "integer"
          },
          "operations": {
            "items": {
              "$ref": "#/components/schemas/FileOperation"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          },
          "runtime_generation": {
            "pattern": "^gen_[0-9a-f]{32}$",
            "type": "string"
          }
        },
        "required": [
          "runtime_generation",
          "base_revision",
          "operations"
        ],
        "type": "object"
      },
      "CapabilitiesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "capabilities": {
                "items": {
                  "$ref": "#/components/schemas/Capability"
                },
                "type": "array"
              },
              "contract_id": {
                "const": "nettipoika-agent-http-v1-operational"
              },
              "discovery": {
                "format": "uri",
                "type": "string"
              },
              "environment": {
                "enum": [
                  "lab",
                  "dev",
                  "prod"
                ]
              },
              "lab_capabilities": {
                "items": {
                  "$ref": "#/components/schemas/Capability"
                },
                "type": "array"
              },
              "mcp": {
                "format": "uri",
                "type": "string"
              },
              "openapi": {
                "format": "uri",
                "type": "string"
              },
              "origin": {
                "format": "uri",
                "type": "string"
              },
              "release": {
                "properties": {
                  "release_id": {
                    "type": "string"
                  },
                  "source_commit": {
                    "type": "string"
                  }
                },
                "required": [
                  "release_id",
                  "source_commit"
                ],
                "type": "object"
              }
            },
            "required": [
              "contract_id",
              "environment",
              "origin",
              "discovery",
              "openapi",
              "mcp",
              "release",
              "capabilities"
            ],
            "type": "object"
          }
        ]
      },
      "Capability": {
        "properties": {
          "async_operation": {
            "type": "boolean"
          },
          "auth": {
            "enum": [
              "anonymous",
              "site_token"
            ]
          },
          "id": {
            "type": "string"
          },
          "idempotency_required": {
            "type": "boolean"
          },
          "implementation_status": {
            "enum": [
              "implemented",
              "planned"
            ]
          },
          "method": {
            "enum": [
              "GET",
              "POST"
            ]
          },
          "mutating": {
            "type": "boolean"
          },
          "path": {
            "type": "string"
          },
          "phase": {
            "type": "string"
          },
          "required_scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "scope": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "method",
          "path",
          "auth",
          "mutating",
          "idempotency_required",
          "async_operation",
          "phase",
          "implementation_status"
        ],
        "type": "object"
      },
      "Changeset": {
        "additionalProperties": false,
        "properties": {
          "base_commit": {
            "type": "string"
          },
          "commit_started_at": {
            "format": "date-time",
            "type": "string"
          },
          "committed_at": {
            "format": "date-time",
            "type": "string"
          },
          "etag": {
            "type": "string"
          },
          "id": {
            "pattern": "^chg_[0-9a-f]{32}$",
            "type": "string"
          },
          "revision": {
            "minimum": 1,
            "type": "integer"
          },
          "source_commit": {
            "type": "string"
          },
          "state": {
            "enum": [
              "open",
              "committing",
              "committed"
            ]
          }
        },
        "required": [
          "id",
          "base_commit",
          "revision",
          "etag",
          "state"
        ],
        "type": "object"
      },
      "ChangesetDiff": {
        "additionalProperties": false,
        "properties": {
          "changeset": {
            "$ref": "#/components/schemas/Changeset"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/ChangesetDiffEntry"
            },
            "maxItems": 2000,
            "type": "array"
          }
        },
        "required": [
          "changeset",
          "entries"
        ],
        "type": "object"
      },
      "ChangesetDiffEntry": {
        "additionalProperties": false,
        "properties": {
          "change": {
            "enum": [
              "added",
              "modified",
              "deleted"
            ]
          },
          "new_bytes": {
            "minimum": 0,
            "type": "integer"
          },
          "new_etag": {
            "type": "string"
          },
          "new_type": {
            "enum": [
              "file",
              "directory"
            ]
          },
          "old_bytes": {
            "minimum": 0,
            "type": "integer"
          },
          "old_etag": {
            "type": "string"
          },
          "old_type": {
            "enum": [
              "file",
              "directory"
            ]
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "change"
        ],
        "type": "object"
      },
      "ChangesetDiffResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "diff": {
                "$ref": "#/components/schemas/ChangesetDiff"
              }
            },
            "required": [
              "diff"
            ],
            "type": "object"
          }
        ]
      },
      "ChangesetMutationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "changeset": {
                "$ref": "#/components/schemas/Changeset"
              },
              "replay": {
                "type": "boolean"
              }
            },
            "required": [
              "changeset",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "ChangesetResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "changeset": {
                "$ref": "#/components/schemas/Changeset"
              }
            },
            "required": [
              "changeset"
            ],
            "type": "object"
          }
        ]
      },
      "CloseLiveSessionRequest": {
        "additionalProperties": false,
        "properties": {
          "base_revision": {
            "minimum": 1,
            "type": "integer"
          },
          "runtime_generation": {
            "pattern": "^gen_[0-9a-f]{32}$",
            "type": "string"
          }
        },
        "required": [
          "runtime_generation",
          "base_revision"
        ],
        "type": "object"
      },
      "Command": {
        "additionalProperties": false,
        "properties": {
          "base_revision": {
            "minimum": 1,
            "type": "integer"
          },
          "cancel_requested": {
            "type": "boolean"
          },
          "changeset_id": {
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "duration_millis": {
            "minimum": 0,
            "type": "integer"
          },
          "exit_code": {
            "type": "integer"
          },
          "id": {
            "pattern": "^cmd_[0-9a-f]{32}$",
            "type": "string"
          },
          "output_limit_bytes": {
            "type": "integer"
          },
          "output_truncated": {
            "type": "boolean"
          },
          "result_revision": {
            "minimum": 1,
            "type": "integer"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "enum": [
              "pending",
              "running",
              "succeeded",
              "failed",
              "timed_out",
              "cancelled",
              "conflict",
              "interrupted"
            ]
          },
          "stderr_base64": {
            "contentEncoding": "base64",
            "type": "string"
          },
          "stdout_base64": {
            "contentEncoding": "base64",
            "type": "string"
          },
          "timeout_seconds": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "changeset_id",
          "state",
          "base_revision",
          "output_truncated",
          "cancel_requested",
          "timeout_seconds",
          "output_limit_bytes",
          "created_at"
        ],
        "type": "object"
      },
      "CommandMutationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "command": {
                "$ref": "#/components/schemas/Command"
              },
              "replay": {
                "type": "boolean"
              }
            },
            "required": [
              "command",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "CommandRequest": {
        "additionalProperties": false,
        "properties": {
          "argv": {
            "items": {
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 64,
            "minItems": 1,
            "type": "array"
          },
          "output_limit_bytes": {
            "default": 65536,
            "maximum": 262144,
            "minimum": 1,
            "type": "integer"
          },
          "timeout_seconds": {
            "default": 30,
            "maximum": 120,
            "minimum": 1,
            "type": "integer"
          },
          "working_directory": {
            "default": ".",
            "type": "string"
          }
        },
        "required": [
          "argv"
        ],
        "type": "object"
      },
      "CommandResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "command": {
                "$ref": "#/components/schemas/Command"
              }
            },
            "required": [
              "command"
            ],
            "type": "object"
          }
        ]
      },
      "CommitChangesetRequest": {
        "additionalProperties": false,
        "properties": {
          "base_revision": {
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "base_revision"
        ],
        "type": "object"
      },
      "CommitChangesetResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "changeset": {
                "$ref": "#/components/schemas/Changeset"
              },
              "operation": {
                "$ref": "#/components/schemas/Operation"
              },
              "replay": {
                "type": "boolean"
              }
            },
            "required": [
              "changeset",
              "operation",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "CreateReleaseRequest": {
        "additionalProperties": false,
        "properties": {
          "changeset_id": {
            "pattern": "^chg_[0-9a-f]{32}$",
            "type": "string"
          },
          "runtime_profile": {
            "default": "static",
            "enum": [
              "static",
              "django",
              "go"
            ]
          }
        },
        "required": [
          "changeset_id"
        ],
        "type": "object"
      },
      "CreateReleaseResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "operation": {
                "$ref": "#/components/schemas/Operation"
              },
              "release": {
                "$ref": "#/components/schemas/Release"
              },
              "replay": {
                "type": "boolean"
              }
            },
            "required": [
              "release",
              "operation",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "CreateSiteRequest": {
        "additionalProperties": false,
        "properties": {
          "site_label": {
            "pattern": "^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$",
            "type": "string"
          }
        },
        "required": [
          "site_label"
        ],
        "type": "object"
      },
      "CreateSiteResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "operation": {
                "$ref": "#/components/schemas/Operation"
              },
              "replay": {
                "type": "boolean"
              },
              "site": {
                "$ref": "#/components/schemas/Site"
              }
            },
            "required": [
              "site",
              "operation",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "DeploymentResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "operation": {
                "$ref": "#/components/schemas/Operation"
              },
              "release": {
                "$ref": "#/components/schemas/Release"
              },
              "replay": {
                "type": "boolean"
              }
            },
            "required": [
              "release",
              "operation",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "EmptyObject": {
        "additionalProperties": false,
        "maxProperties": 0,
        "type": "object"
      },
      "FileOperation": {
        "additionalProperties": false,
        "properties": {
          "content_base64": {
            "contentEncoding": "base64",
            "maxLength": 1398104,
            "type": "string"
          },
          "expected_etag": {
            "type": "string"
          },
          "from": {
            "type": "string"
          },
          "operation": {
            "enum": [
              "write",
              "delete",
              "move"
            ]
          },
          "path": {
            "type": "string"
          },
          "to": {
            "type": "string"
          }
        },
        "required": [
          "operation"
        ],
        "type": "object"
      },
      "FileResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "file": {
                "$ref": "#/components/schemas/SourceFile"
              }
            },
            "required": [
              "file"
            ],
            "type": "object"
          }
        ]
      },
      "LiveSession": {
        "additionalProperties": false,
        "properties": {
          "base_release_id": {
            "type": "string"
          },
          "base_source_commit": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "etag": {
            "type": "string"
          },
          "id": {
            "pattern": "^live_[0-9a-f]{32}$",
            "type": "string"
          },
          "last_operation_id": {
            "type": "string"
          },
          "pending_operation_id": {
            "type": "string"
          },
          "previous_recovery_image": {
            "type": "string"
          },
          "previous_recovery_image_digest": {
            "pattern": "^sha256:[0-9a-f]{64}$",
            "type": "string"
          },
          "previous_saved_revision": {
            "minimum": 0,
            "type": "integer"
          },
          "profile": {
            "enum": [
              "static",
              "django"
            ]
          },
          "recovery_image": {
            "type": "string"
          },
          "recovery_image_digest": {
            "pattern": "^sha256:[0-9a-f]{64}$",
            "type": "string"
          },
          "revision": {
            "minimum": 1,
            "type": "integer"
          },
          "runtime_generation": {
            "pattern": "^gen_[0-9a-f]{32}$",
            "type": "string"
          },
          "saved_revision": {
            "minimum": 0,
            "type": "integer"
          },
          "site_id": {
            "pattern": "^site_[0-9a-f]{32}$",
            "type": "string"
          },
          "source_commit": {
            "type": "string"
          },
          "state": {
            "enum": [
              "opening",
              "active",
              "updating",
              "closing",
              "closed",
              "recovery_pending",
              "failed"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "visible_revision": {
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "id",
          "site_id",
          "profile",
          "runtime_generation",
          "state",
          "revision",
          "visible_revision",
          "saved_revision",
          "previous_saved_revision",
          "etag",
          "base_source_commit",
          "source_commit"
        ],
        "type": "object"
      },
      "LiveSessionMutationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "live_session": {
                "$ref": "#/components/schemas/LiveSession"
              },
              "operation": {
                "$ref": "#/components/schemas/Operation"
              },
              "replay": {
                "type": "boolean"
              }
            },
            "required": [
              "live_session",
              "operation",
              "replay"
            ],
            "type": "object"
          }
        ]
      },
      "LiveSessionResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "live_session": {
                "$ref": "#/components/schemas/LiveSession"
              }
            },
            "required": [
              "live_session"
            ],
            "type": "object"
          }
        ]
      },
      "LogEntry": {
        "additionalProperties": false,
        "properties": {
          "category": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "level": {
            "enum": [
              "info",
              "warning"
            ]
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "category",
          "level",
          "message",
          "created_at"
        ],
        "type": "object"
      },
      "LogsResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "entries": {
                "items": {
                  "$ref": "#/components/schemas/LogEntry"
                },
                "maxItems": 100,
                "type": "array"
              },
              "next_cursor": {
                "type": "string"
              }
            },
            "required": [
              "entries",
              "next_cursor"
            ],
            "type": "object"
          }
        ]
      },
      "OpenLiveSessionRequest": {
        "additionalProperties": false,
        "properties": {
          "profile": {
            "enum": [
              "static",
              "django"
            ]
          }
        },
        "required": [
          "profile"
        ],
        "type": "object"
      },
      "Operation": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "provision_site",
              "commit_changeset",
              "build_release",
              "activate_release",
              "rollback_release",
              "live_edit_open",
              "live_edit_apply",
              "live_edit_close",
              "live_edit_recover"
            ]
          },
          "progress": {
            "items": {
              "$ref": "#/components/schemas/StageProgress"
            },
            "type": "array"
          },
          "site_id": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/OperationState"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "site_id",
          "kind",
          "state",
          "stage",
          "progress",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "OperationResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "operation": {
                "$ref": "#/components/schemas/Operation"
              }
            },
            "required": [
              "operation"
            ],
            "type": "object"
          }
        ]
      },
      "OperationState": {
        "enum": [
          "pending",
          "running",
          "retryable_failure",
          "succeeded",
          "terminal_failure"
        ]
      },
      "Problem": {
        "additionalProperties": false,
        "properties": {
          "api_version": {
            "const": "v1"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "operation": {
            "type": "string"
          },
          "reason": {
            "enum": [
              "authority_changed",
              "authority_unavailable",
              "stage_operational_failure"
            ],
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer"
          },
          "status": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail",
          "request_id",
          "api_version"
        ],
        "type": "object"
      },
      "Release": {
        "additionalProperties": false,
        "properties": {
          "artifact_digest": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "health_checked_at": {
            "format": "date-time",
            "type": "string"
          },
          "health_state": {
            "enum": [
              "pending",
              "passed",
              "failed"
            ]
          },
          "id": {
            "pattern": "^rel_[0-9a-f]{32}$",
            "type": "string"
          },
          "operation_id": {
            "type": "string"
          },
          "parent_release_id": {
            "type": "string"
          },
          "rollback_safe": {
            "type": "boolean"
          },
          "runtime_image": {
            "type": "string"
          },
          "runtime_inputs_digest": {
            "pattern": "^sha256:[0-9a-f]{64}$",
            "type": "string"
          },
          "runtime_profile": {
            "enum": [
              "static",
              "django",
              "go"
            ]
          },
          "site_id": {
            "type": "string"
          },
          "source_commit": {
            "type": "string"
          },
          "state": {
            "enum": [
              "building",
              "candidate",
              "active",
              "previous",
              "failed",
              "retired"
            ]
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "site_id",
          "source_commit",
          "runtime_profile",
          "state",
          "health_state",
          "rollback_safe",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "ReleasePreview": {
        "additionalProperties": false,
        "properties": {
          "content_base64": {
            "contentEncoding": "base64",
            "maxLength": 1398104,
            "type": "string"
          },
          "etag": {
            "type": "string"
          },
          "media_type": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "release_id": {
            "pattern": "^rel_[0-9a-f]{32}$",
            "type": "string"
          }
        },
        "required": [
          "release_id",
          "path",
          "etag",
          "media_type",
          "content_base64"
        ],
        "type": "object"
      },
      "ReleasePreviewResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "preview": {
                "$ref": "#/components/schemas/ReleasePreview"
              }
            },
            "required": [
              "preview"
            ],
            "type": "object"
          }
        ]
      },
      "ReleaseResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "release": {
                "$ref": "#/components/schemas/Release"
              }
            },
            "required": [
              "release"
            ],
            "type": "object"
          }
        ]
      },
      "ReleasesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "releases": {
                "items": {
                  "$ref": "#/components/schemas/Release"
                },
                "maxItems": 100,
                "type": "array"
              }
            },
            "required": [
              "releases"
            ],
            "type": "object"
          }
        ]
      },
      "ResponseMeta": {
        "properties": {
          "api_version": {
            "const": "v1"
          },
          "request_id": {
            "type": "string"
          }
        },
        "required": [
          "request_id",
          "api_version"
        ],
        "type": "object"
      },
      "Site": {
        "additionalProperties": false,
        "properties": {
          "active_release_id": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "state": {
            "enum": [
              "provisioning",
              "ready",
              "failed",
              "suspended"
            ]
          },
          "tenant_id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "tenant_id",
          "hostname",
          "state",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "SiteResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "site": {
                "$ref": "#/components/schemas/Site"
              }
            },
            "required": [
              "site"
            ],
            "type": "object"
          }
        ]
      },
      "SitesResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "sites": {
                "items": {
                  "$ref": "#/components/schemas/Site"
                },
                "maxItems": 1,
                "type": "array"
              }
            },
            "required": [
              "sites"
            ],
            "type": "object"
          }
        ]
      },
      "SourceFile": {
        "additionalProperties": false,
        "properties": {
          "changeset_id": {
            "type": "string"
          },
          "commit": {
            "type": "string"
          },
          "content_base64": {
            "contentEncoding": "base64",
            "maxLength": 1398104,
            "type": "string"
          },
          "etag": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "revision": {
            "type": "integer"
          }
        },
        "required": [
          "path",
          "etag",
          "content_base64"
        ],
        "type": "object"
      },
      "SourceTree": {
        "additionalProperties": false,
        "properties": {
          "changeset": {
            "$ref": "#/components/schemas/Changeset"
          },
          "commit": {
            "type": "string"
          },
          "entries": {
            "items": {
              "$ref": "#/components/schemas/TreeEntry"
            },
            "maxItems": 1000,
            "type": "array"
          },
          "etag": {
            "type": "string"
          },
          "total_bytes": {
            "maximum": 16777216,
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "entries",
          "total_bytes"
        ],
        "type": "object"
      },
      "SourceTreeResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "source": {
                "$ref": "#/components/schemas/SourceTree"
              }
            },
            "required": [
              "source"
            ],
            "type": "object"
          }
        ]
      },
      "StageProgress": {
        "additionalProperties": false,
        "properties": {
          "attempt": {
            "minimum": 0,
            "type": "integer"
          },
          "completed_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/Problem"
          },
          "message": {
            "type": "string"
          },
          "stage": {
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "type": "string"
          },
          "state": {
            "$ref": "#/components/schemas/OperationState"
          }
        },
        "required": [
          "stage",
          "state",
          "attempt",
          "message"
        ],
        "type": "object"
      },
      "TreeEntry": {
        "additionalProperties": false,
        "properties": {
          "etag": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "size": {
            "minimum": 0,
            "type": "integer"
          },
          "type": {
            "enum": [
              "file",
              "directory"
            ]
          }
        },
        "required": [
          "path",
          "type"
        ],
        "type": "object"
      },
      "Usage": {
        "additionalProperties": false,
        "properties": {
          "commands_running": {
            "type": "integer"
          },
          "limits": {
            "$ref": "#/components/schemas/UsageLimits"
          },
          "observed_at": {
            "format": "date-time",
            "type": "string"
          },
          "release_images_retained": {
            "type": "integer"
          },
          "source_bytes": {
            "type": "integer"
          },
          "source_entries": {
            "type": "integer"
          },
          "temporary_candidates": {
            "type": "integer"
          }
        },
        "required": [
          "observed_at",
          "source_bytes",
          "source_entries",
          "commands_running",
          "release_images_retained",
          "temporary_candidates",
          "limits"
        ],
        "type": "object"
      },
      "UsageLimits": {
        "additionalProperties": false,
        "properties": {
          "build_pool_memory_bytes": {
            "type": "integer"
          },
          "build_worker_memory_bytes": {
            "type": "integer"
          },
          "command_output_bytes": {
            "type": "integer"
          },
          "command_timeout_seconds": {
            "type": "integer"
          },
          "concurrent_builds_per_host": {
            "type": "integer"
          },
          "file_bytes": {
            "type": "integer"
          },
          "log_page_entries": {
            "type": "integer"
          },
          "runtime_memory_bytes": {
            "type": "integer"
          },
          "runtime_pids": {
            "type": "integer"
          },
          "runtime_temporary_bytes": {
            "type": "integer"
          },
          "source_bytes": {
            "type": "integer"
          },
          "source_entries": {
            "type": "integer"
          },
          "tenant_disk_bytes": {
            "type": "integer"
          },
          "tenant_inodes": {
            "type": "integer"
          }
        },
        "required": [
          "source_bytes",
          "source_entries",
          "file_bytes",
          "command_timeout_seconds",
          "command_output_bytes",
          "runtime_memory_bytes",
          "runtime_pids",
          "runtime_temporary_bytes",
          "tenant_disk_bytes",
          "tenant_inodes",
          "build_worker_memory_bytes",
          "build_pool_memory_bytes",
          "concurrent_builds_per_host",
          "log_page_entries"
        ],
        "type": "object"
      },
      "UsageResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ResponseMeta"
          },
          {
            "properties": {
              "usage": {
                "$ref": "#/components/schemas/Usage"
              }
            },
            "required": [
              "usage"
            ],
            "type": "object"
          }
        ]
      }
    },
    "securitySchemes": {
      "developmentBearer": {
        "description": "Administrator-issued provisioning fixture only. It cannot authorize tenant operations.",
        "scheme": "bearer",
        "type": "http"
      },
      "siteBearer": {
        "description": "Hashed, expiring, revocable development token bound to one site and explicit scopes. Never place it in a URL, prompt, log, evidence, or Git.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Environment-scoped operational API. Authentication and authorization remain server-enforced; discovery never grants authority.",
    "title": "Nettipoika Sivusto HTTP API",
    "version": "v1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/v1/capabilities": {
      "get": {
        "operationId": "platform.capabilities.get",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CapabilitiesResponse"
                }
              }
            },
            "description": "Capability registry"
          }
        },
        "security": [],
        "summary": "Discover implemented and planned operational capabilities"
      }
    },
    "/api/v1/sites": {
      "get": {
        "operationId": "site.list",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SitesResponse"
                }
              }
            },
            "description": "Bound site collection"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "List the one site bound to the development credential"
      }
    },
    "/api/v1/sites/{site_id}": {
      "get": {
        "operationId": "site.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SiteResponse"
                }
              }
            },
            "description": "Bound site"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read the site bound to the development credential"
      }
    },
    "/api/v1/sites/{site_id}/changesets": {
      "post": {
        "operationId": "changeset.create",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "template": {
                    "enum": [
                      "django-v1"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangesetMutationResponse"
                }
              }
            },
            "description": "Changeset created or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Create an isolated changeset from active source"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}": {
      "get": {
        "operationId": "changeset.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangesetResponse"
                }
              }
            },
            "description": "Changeset metadata",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read changeset metadata"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/commands": {
      "post": {
        "operationId": "command.start",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommandRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandMutationResponse"
                }
              }
            },
            "description": "Durable command accepted or replayed",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Start a bounded argv-only command in an ephemeral build container"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/commands/{command_id}": {
      "get": {
        "operationId": "command.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          },
          {
            "$ref": "#/components/parameters/CommandID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandResponse"
                }
              }
            },
            "description": "Current command status"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read durable bounded command status and output"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/commands/{command_id}/cancel": {
      "post": {
        "operationId": "command.cancel",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          },
          {
            "$ref": "#/components/parameters/CommandID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandMutationResponse"
                }
              }
            },
            "description": "Cancellation recorded or replayed"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Request cancellation of a bounded command"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/commit": {
      "post": {
        "operationId": "changeset.commit",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommitChangesetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommitChangesetResponse"
                }
              }
            },
            "description": "Durable commit operation completed or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Create an immutable source commit without changing active source"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/diff": {
      "get": {
        "operationId": "changeset.diff.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangesetDiffResponse"
                }
              }
            },
            "description": "Bounded structured changeset diff",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read the structured diff from the immutable changeset base"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/file": {
      "get": {
        "operationId": "changeset.file.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          },
          {
            "$ref": "#/components/parameters/SourcePath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            },
            "description": "Changeset source file",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read a bounded regular file from a changeset"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/file-operations": {
      "post": {
        "operationId": "changeset.files.apply",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyFileOperationsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangesetMutationResponse"
                }
              }
            },
            "description": "New changeset revision or replay",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          },
          "428": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Atomically apply bounded file operations to a changeset"
      }
    },
    "/api/v1/sites/{site_id}/changesets/{changeset_id}/tree": {
      "get": {
        "operationId": "changeset.tree.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ChangesetID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceTreeResponse"
                }
              }
            },
            "description": "Changeset source tree",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "List the immutable current changeset revision"
      }
    },
    "/api/v1/sites/{site_id}/live-sessions": {
      "post": {
        "description": "Requires both site:write and site:deploy. The operation succeeds only after the initial revision is publicly visible and saved as a verified recovery image.",
        "operationId": "live_session.open",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OpenLiveSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSessionMutationResponse"
                }
              }
            },
            "description": "Durable live-session open accepted or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Explicitly open a serialized live-edit session for the active compatible runtime"
      }
    },
    "/api/v1/sites/{site_id}/live-sessions/{live_session_id}": {
      "get": {
        "operationId": "live_session.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/LiveSessionID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSessionResponse"
                }
              }
            },
            "description": "Current live-session state",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read durable desired, visible and saved live revisions"
      }
    },
    "/api/v1/sites/{site_id}/live-sessions/{live_session_id}/close": {
      "post": {
        "description": "Requires both site:write and site:deploy and does not roll back database state.",
        "operationId": "live_session.close",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/LiveSessionID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CloseLiveSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSessionMutationResponse"
                }
              }
            },
            "description": "Durable live close accepted or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Close live mode onto its exact verified saved runtime"
      }
    },
    "/api/v1/sites/{site_id}/live-sessions/{live_session_id}/file": {
      "get": {
        "operationId": "live_session.file.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/LiveSessionID"
          },
          {
            "$ref": "#/components/parameters/SourcePath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            },
            "description": "Revision-bound live source file",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read one bounded file from the current live source revision"
      }
    },
    "/api/v1/sites/{site_id}/live-sessions/{live_session_id}/file-operations": {
      "post": {
        "description": "Requires both site:write and site:deploy. Public visibility and verified recovery saving are separate operation milestones; success requires both for the same revision.",
        "operationId": "live_session.files.apply",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/LiveSessionID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApplyLiveSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LiveSessionMutationResponse"
                }
              }
            },
            "description": "Durable serialized live update accepted or replayed",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          },
          "412": {
            "$ref": "#/components/responses/Problem"
          },
          "413": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Atomically apply and save one revision-aware live file batch"
      }
    },
    "/api/v1/sites/{site_id}/live-sessions/{live_session_id}/tree": {
      "get": {
        "operationId": "live_session.tree.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/LiveSessionID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceTreeResponse"
                }
              }
            },
            "description": "Revision-bound live source tree",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "List the complete current live source revision"
      }
    },
    "/api/v1/sites/{site_id}/logs": {
      "get": {
        "operationId": "logs.list",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/LogCursor"
          },
          {
            "$ref": "#/components/parameters/LogLimit"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogsResponse"
                }
              }
            },
            "description": "Newest control events without actor, request, credential, path or customer-output fields"
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read bounded redacted site control events"
      }
    },
    "/api/v1/sites/{site_id}/operations/{operation_id}": {
      "get": {
        "operationId": "operation.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "in": "path",
            "name": "operation_id",
            "required": true,
            "schema": {
              "pattern": "^op_[0-9a-f]{32}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OperationResponse"
                }
              }
            },
            "description": "Current persisted operation"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Poll a site-bound durable operation"
      }
    },
    "/api/v1/sites/{site_id}/releases": {
      "get": {
        "operationId": "release.list",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleasesResponse"
                }
              }
            },
            "description": "Release list"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "List bounded release metadata"
      },
      "post": {
        "operationId": "release.create",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReleaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateReleaseResponse"
                }
              }
            },
            "description": "Durable release build accepted or replayed",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Build and health-check an immutable supported-profile release candidate"
      }
    },
    "/api/v1/sites/{site_id}/releases/{release_id}": {
      "get": {
        "operationId": "release.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ReleaseID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleaseResponse"
                }
              }
            },
            "description": "Release metadata"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read immutable release and candidate health metadata"
      }
    },
    "/api/v1/sites/{site_id}/releases/{release_id}/activate": {
      "post": {
        "operationId": "release.activate",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ReleaseID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyObject"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentResponse"
                }
              }
            },
            "description": "Durable serialized activation accepted or replayed",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Activate and publicly verify one healthy immutable candidate"
      }
    },
    "/api/v1/sites/{site_id}/releases/{release_id}/preview": {
      "get": {
        "operationId": "release.preview",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/ReleaseID"
          },
          {
            "$ref": "#/components/parameters/SourcePath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReleasePreviewResponse"
                }
              }
            },
            "description": "Authenticated content preview bound to the release source commit and fixed static image recipe",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read one bounded file from a health-passed immutable release"
      }
    },
    "/api/v1/sites/{site_id}/rollbacks": {
      "post": {
        "operationId": "release.rollback",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyObject"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeploymentResponse"
                }
              }
            },
            "description": "Durable serialized rollback accepted or replayed",
            "headers": {
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Roll back to the healthy compatible previous immutable release"
      }
    },
    "/api/v1/sites/{site_id}/source/file": {
      "get": {
        "operationId": "source.file.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          },
          {
            "$ref": "#/components/parameters/SourcePath"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileResponse"
                }
              }
            },
            "description": "Active source file",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read a bounded regular file from active source"
      }
    },
    "/api/v1/sites/{site_id}/source/tree": {
      "get": {
        "operationId": "source.tree.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SourceTreeResponse"
                }
              }
            },
            "description": "Active source tree",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          },
          "404": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "List the active Git source tree"
      }
    },
    "/api/v1/sites/{site_id}/usage": {
      "get": {
        "operationId": "usage.get",
        "parameters": [
          {
            "$ref": "#/components/parameters/SiteID"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            },
            "description": "Site-scoped source, command and release usage with enforced limits"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "403": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "siteBearer": []
          }
        ],
        "summary": "Read safe site resource counts and enforced ceilings"
      }
    },
    "/dev/v1/provisioning-requests": {
      "post": {
        "description": "Development-only fixture endpoint; this is not the planned public enrollment flow.",
        "operationId": "development.site.provision",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "examples": {
                "static": {
                  "$ref": "#/components/examples/ProvisionSite"
                }
              },
              "schema": {
                "$ref": "#/components/schemas/CreateSiteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSiteResponse"
                }
              }
            },
            "description": "Durable provisioning operation accepted or replayed",
            "headers": {
              "Location": {
                "required": true,
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Problem"
          },
          "401": {
            "$ref": "#/components/responses/Problem"
          },
          "409": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "security": [
          {
            "developmentBearer": []
          }
        ],
        "summary": "Create a site from an administrator-controlled development entitlement"
      }
    }
  },
  "servers": [
    {
      "description": "Nettipoika dev operational origin",
      "url": "https://sivusto-dev.nettipoika.fi"
    }
  ],
  "x-nettipoika-canonical-discovery": "https://sivusto-dev.nettipoika.fi/llms.txt",
  "x-nettipoika-capability-registry": "/api/v1/capabilities",
  "x-nettipoika-environment": "dev",
  "x-nettipoika-product-index": "https://nettipoika.fi/llms.txt",
  "x-nettipoika-release": "dev-3a382c5",
  "x-nettipoika-source-commit": "3a382c557c1643ae17b0ea70ef7836d47c0a8bb4"
}