{
  "components": {
    "schemas": {
      "CacheRollbackEligibility": {
        "additionalProperties": false,
        "description": "Source-blind proof that the current previous-good pointer is usable.",
        "properties": {
          "eligible": {
            "title": "Eligible",
            "type": "boolean"
          },
          "reason": {
            "maxLength": 256,
            "minLength": 1,
            "title": "Reason",
            "type": "string"
          },
          "reason_code": {
            "enum": [
              "eligible",
              "no_previous_generation",
              "cache_pointer_invalid",
              "previous_generation_invalid",
              "previous_generation_verification_timeout",
              "previous_generation_verifying",
              "previous_generation_verification_failed",
              "different_reviewed_locks",
              "previous_generation_incompatible"
            ],
            "title": "Reason Code",
            "type": "string"
          },
          "target_generation": {
            "anyOf": [
              {
                "pattern": "^[0-9a-f]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Generation"
          },
          "verification": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CacheVerification"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "eligible",
          "reason_code",
          "reason"
        ],
        "title": "CacheRollbackEligibility",
        "type": "object"
      },
      "CacheVerification": {
        "additionalProperties": false,
        "properties": {
          "bytes_total": {
            "anyOf": [
              {
                "maximum": 8589934592.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytes Total"
          },
          "bytes_verified": {
            "anyOf": [
              {
                "maximum": 8589934592.0,
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytes Verified"
          },
          "component_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Component Id"
          },
          "generation_id": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Generation Id",
            "type": "string"
          },
          "last_activity_at": {
            "format": "date-time",
            "title": "Last Activity At",
            "type": "string"
          },
          "phase": {
            "enum": [
              "queued",
              "validating",
              "hashing"
            ],
            "title": "Phase",
            "type": "string"
          },
          "started_at": {
            "format": "date-time",
            "title": "Started At",
            "type": "string"
          },
          "state": {
            "enum": [
              "verifying",
              "timed_out",
              "failed"
            ],
            "title": "State",
            "type": "string"
          },
          "target": {
            "enum": [
              "active",
              "previous_good"
            ],
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "state",
          "target",
          "generation_id",
          "phase",
          "started_at",
          "last_activity_at"
        ],
        "title": "CacheVerification",
        "type": "object"
      },
      "CacheVerificationRetryRequest": {
        "additionalProperties": false,
        "properties": {
          "expected_generation": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Expected Generation",
            "type": "string"
          },
          "target": {
            "enum": [
              "active",
              "previous_good"
            ],
            "title": "Target",
            "type": "string"
          }
        },
        "required": [
          "target",
          "expected_generation"
        ],
        "title": "CacheVerificationRetryRequest",
        "type": "object"
      },
      "Finding": {
        "additionalProperties": false,
        "properties": {
          "code_snippet": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Code Snippet"
          },
          "end_column": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Column"
          },
          "end_line": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "End Line"
          },
          "file_path": {
            "title": "File Path",
            "type": "string"
          },
          "fingerprint": {
            "title": "Fingerprint",
            "type": "string"
          },
          "message": {
            "title": "Message",
            "type": "string"
          },
          "metadata": {
            "additionalProperties": true,
            "title": "Metadata",
            "type": "object"
          },
          "rule_id": {
            "title": "Rule Id",
            "type": "string"
          },
          "scanner": {
            "default": "unknown",
            "title": "Scanner",
            "type": "string"
          },
          "severity": {
            "enum": [
              "critical",
              "high",
              "medium",
              "low",
              "info"
            ],
            "title": "Severity",
            "type": "string"
          },
          "start_column": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Column"
          },
          "start_line": {
            "anyOf": [
              {
                "maximum": 2147483647.0,
                "minimum": 1.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Start Line"
          }
        },
        "required": [
          "rule_id",
          "severity",
          "file_path",
          "message",
          "fingerprint"
        ],
        "title": "Finding",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "RunFindingPageResponse": {
        "additionalProperties": false,
        "properties": {
          "findings_total": {
            "maximum": 50000.0,
            "minimum": 0.0,
            "title": "Findings Total",
            "type": "integer"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Finding"
            },
            "maxItems": 128,
            "minItems": 1,
            "title": "Items",
            "type": "array"
          },
          "items_bytes": {
            "maximum": 4177920.0,
            "minimum": 1.0,
            "title": "Items Bytes",
            "type": "integer"
          },
          "next_cursor": {
            "anyOf": [
              {
                "maxLength": 2048,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "page_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Page Digest",
            "type": "string"
          },
          "request_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Request Digest",
            "type": "string"
          },
          "result_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Result Digest",
            "type": "string"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "schema_version": {
            "const": 1,
            "default": 1,
            "title": "Schema Version",
            "type": "integer"
          },
          "start_ordinal": {
            "minimum": 1.0,
            "title": "Start Ordinal",
            "type": "integer"
          },
          "truncated": {
            "title": "Truncated",
            "type": "boolean"
          }
        },
        "required": [
          "run_id",
          "request_digest",
          "result_digest",
          "findings_total",
          "start_ordinal",
          "items",
          "items_bytes",
          "page_digest",
          "truncated"
        ],
        "title": "RunFindingPageResponse",
        "type": "object"
      },
      "RunListResponse": {
        "additionalProperties": false,
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/RunStateResponse"
            },
            "title": "Runs",
            "type": "array"
          }
        },
        "required": [
          "runs"
        ],
        "title": "RunListResponse",
        "type": "object"
      },
      "RunResultAckRequest": {
        "additionalProperties": false,
        "properties": {
          "request_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Request Digest",
            "type": "string"
          },
          "result_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Result Digest",
            "type": "string"
          }
        },
        "required": [
          "request_digest",
          "result_digest"
        ],
        "title": "RunResultAckRequest",
        "type": "object"
      },
      "RunResultAckResponse": {
        "additionalProperties": false,
        "properties": {
          "acknowledged": {
            "default": true,
            "title": "Acknowledged",
            "type": "boolean"
          },
          "request_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Request Digest",
            "type": "string"
          },
          "result_available": {
            "const": false,
            "default": false,
            "title": "Result Available",
            "type": "boolean"
          },
          "result_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Result Digest",
            "type": "string"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "schema_version": {
            "const": 1,
            "default": 1,
            "title": "Schema Version",
            "type": "integer"
          }
        },
        "required": [
          "run_id",
          "request_digest",
          "result_digest"
        ],
        "title": "RunResultAckResponse",
        "type": "object"
      },
      "RunResultManifest": {
        "additionalProperties": false,
        "properties": {
          "artifacts": {
            "items": {
              "$ref": "#/components/schemas/ScanArtifact"
            },
            "maxItems": 128,
            "title": "Artifacts",
            "type": "array"
          },
          "findings_bytes": {
            "maximum": 352321536.0,
            "minimum": 0.0,
            "title": "Findings Bytes",
            "type": "integer"
          },
          "findings_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Findings Digest",
            "type": "string"
          },
          "findings_total": {
            "maximum": 50000.0,
            "minimum": 0.0,
            "title": "Findings Total",
            "type": "integer"
          },
          "page_count": {
            "maximum": 50000.0,
            "minimum": 0.0,
            "title": "Page Count",
            "type": "integer"
          },
          "page_limit": {
            "const": 128,
            "default": 128,
            "title": "Page Limit",
            "type": "integer"
          },
          "result_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Result Digest",
            "type": "string"
          },
          "schema_version": {
            "const": 1,
            "default": 1,
            "title": "Schema Version",
            "type": "integer"
          },
          "status": {
            "enum": [
              "completed",
              "partial"
            ],
            "title": "Status",
            "type": "string"
          },
          "summary": {
            "additionalProperties": true,
            "title": "Summary",
            "type": "object"
          }
        },
        "required": [
          "status",
          "result_digest",
          "findings_digest",
          "findings_total",
          "findings_bytes",
          "page_count",
          "summary"
        ],
        "title": "RunResultManifest",
        "type": "object"
      },
      "RunStartRequest": {
        "additionalProperties": false,
        "properties": {
          "base_ref": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Base Ref"
          },
          "enabled_tools": {
            "items": {
              "maxLength": 64,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 32,
            "minItems": 1,
            "title": "Enabled Tools",
            "type": "array"
          },
          "head_ref": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Head Ref"
          },
          "mode": {
            "default": "full",
            "enum": [
              "full",
              "incremental_diff"
            ],
            "title": "Mode",
            "type": "string"
          },
          "repo_path": {
            "maxLength": 4096,
            "minLength": 1,
            "title": "Repo Path",
            "type": "string"
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "scan_id": {
            "exclusiveMinimum": 0.0,
            "maximum": 2147483647.0,
            "title": "Scan Id",
            "type": "integer"
          },
          "source_snapshot_digest": {
            "anyOf": [
              {
                "pattern": "^[0-9a-f]{64}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Snapshot Digest"
          },
          "target_kind": {
            "anyOf": [
              {
                "enum": [
                  "file",
                  "directory"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Kind"
          },
          "target_path": {
            "anyOf": [
              {
                "maxLength": 4096,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Path"
          }
        },
        "required": [
          "scan_id",
          "repo_path",
          "enabled_tools",
          "run_id"
        ],
        "title": "RunStartRequest",
        "type": "object"
      },
      "RunStateResponse": {
        "additionalProperties": false,
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "deadline_at": {
            "format": "date-time",
            "title": "Deadline At",
            "type": "string"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Detail"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "finished_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "request_digest": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Request Digest",
            "type": "string"
          },
          "result_available": {
            "default": false,
            "title": "Result Available",
            "type": "boolean"
          },
          "result_manifest": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/RunResultManifest"
              },
              {
                "type": "null"
              }
            ]
          },
          "run_id": {
            "format": "uuid",
            "title": "Run Id",
            "type": "string"
          },
          "started_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "status": {
            "enum": [
              "queued",
              "running",
              "cancelling",
              "completed",
              "failed",
              "cancelled"
            ],
            "title": "Status",
            "type": "string"
          }
        },
        "required": [
          "run_id",
          "request_digest",
          "status",
          "created_at",
          "deadline_at"
        ],
        "title": "RunStateResponse",
        "type": "object"
      },
      "ScanArtifact": {
        "additionalProperties": false,
        "properties": {
          "artifact_type": {
            "const": "sbom",
            "title": "Artifact Type",
            "type": "string"
          },
          "format": {
            "const": "cyclonedx-json",
            "title": "Format",
            "type": "string"
          },
          "path": {
            "title": "Path",
            "type": "string"
          },
          "scanner": {
            "const": "syft",
            "title": "Scanner",
            "type": "string"
          },
          "sha256": {
            "pattern": "^[0-9a-f]{64}$",
            "title": "Sha256",
            "type": "string"
          },
          "size_bytes": {
            "maximum": 8388608.0,
            "minimum": 0.0,
            "title": "Size Bytes",
            "type": "integer"
          }
        },
        "required": [
          "scanner",
          "artifact_type",
          "format",
          "path",
          "size_bytes",
          "sha256"
        ],
        "title": "ScanArtifact",
        "type": "object"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      }
    },
    "securitySchemes": {}
  },
  "info": {
    "description": "Static source preview reference. No server or executable console is provided. Broad source contracts remain broad; runtime checks and middleware are described separately.",
    "title": "Internal scanner protocol",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/cache/rollback-eligibility": {
      "get": {
        "description": "Return a read-only proof for the exact previous-good cache target.",
        "operationId": "scanner-get-cache-rollback-eligibility",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheRollbackEligibility"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Cache rollback eligibility",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L276"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L276"
        },
        "x-source-errors": [],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/cache/verification/retry": {
      "post": {
        "operationId": "scanner-post-cache-verification-retry",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CacheVerificationRetryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CacheVerification"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "description": "Refresh current revision and identity. A conflicting command must not be blindly repeated. See source-linked error catalog."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Retry cache verification",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L294"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L294"
        },
        "x-source-errors": [
          {
            "detail": null,
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L302",
            "status": 409
          }
        ],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/healthz": {
      "get": {
        "operationId": "scanner-get-healthz",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Healthz Healthz Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Healthz",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L247"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L247"
        },
        "x-source-errors": [],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/metrics": {
      "get": {
        "operationId": "scanner-get-metrics",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Prometheus text exposition."
          }
        },
        "summary": "Metrics",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L306"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L306"
        },
        "x-source-errors": [],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/runs": {
      "get": {
        "operationId": "scanner-get-runs",
        "parameters": [
          {
            "in": "query",
            "name": "active_only",
            "required": false,
            "schema": {
              "default": false,
              "title": "Active Only",
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunListResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "List runs",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1528"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1528"
        },
        "x-source-errors": [],
        "x-stability": "Internal protocol; unsupported for external integration"
      },
      "post": {
        "operationId": "scanner-post-runs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunStartRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunStateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "409": {
            "description": "Refresh current revision and identity. A conflicting command must not be blindly repeated. See source-linked error catalog."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Start run",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1506"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1506"
        },
        "x-source-errors": [
          {
            "detail": {
              "code": "run_id_conflict",
              "message": "run_id is already bound to a different request"
            },
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1510",
            "status": 409
          },
          {
            "detail": {
              "code": "scanner_capacity",
              "message": "scanner active-run capacity is exhausted"
            },
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1518",
            "status": 409
          }
        ],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/runs/{run_id}": {
      "delete": {
        "operationId": "scanner-delete-runs-run-id",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "request_digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Request Digest"
            }
          },
          {
            "in": "query",
            "name": "result_digest",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Result Digest"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunStateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Refresh the collection and verify the resource identity before retrying. See source-linked error catalog."
          },
          "409": {
            "description": "Refresh current revision and identity. A conflicting command must not be blindly repeated. See source-linked error catalog."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          }
        },
        "summary": "Cancel run",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1596"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1596"
        },
        "x-source-errors": [
          {
            "detail": "request_digest must be a lowercase SHA-256 digest",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1602",
            "status": 422
          },
          {
            "detail": "result_digest must be a lowercase SHA-256 digest",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1604",
            "status": 422
          },
          {
            "detail": "result_digest requires request_digest",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1606",
            "status": 422
          },
          {
            "detail": "scanner run was not found or its recovery window expired",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1614",
            "status": 404
          },
          {
            "detail": {
              "code": "run_id_conflict",
              "message": "run_id is already bound to a different request"
            },
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1616",
            "status": 409
          }
        ],
        "x-stability": "Internal protocol; unsupported for external integration"
      },
      "get": {
        "operationId": "scanner-get-runs-run-id",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunStateResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Refresh the collection and verify the resource identity before retrying. See source-linked error catalog."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "description": "Keep the operation identity and collect bounded, reviewed diagnostics. See source-linked error catalog."
          }
        },
        "summary": "Get run",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1533"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1533"
        },
        "x-source-errors": [
          {
            "detail": "scanner run was not found or its recovery window expired",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1537",
            "status": 404
          },
          {
            "detail": "scanner run recovery state failed its integrity check",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1539",
            "status": 500
          }
        ],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/runs/{run_id}/findings": {
      "get": {
        "operationId": "scanner-get-runs-run-id-findings",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "request_digest",
            "required": true,
            "schema": {
              "pattern": "^[0-9a-f]{64}$",
              "title": "Request Digest",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 2048,
                  "minLength": 1,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 128,
              "maximum": 128,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunFindingPageResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Refresh the collection and verify the resource identity before retrying. See source-linked error catalog."
          },
          "409": {
            "description": "Refresh current revision and identity. A conflicting command must not be blindly repeated. See source-linked error catalog."
          },
          "410": {
            "description": "Reconcile current state and review the linked handler before retrying. See source-linked error catalog."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "description": "Keep the operation identity and collect bounded, reviewed diagnostics. See source-linked error catalog."
          }
        },
        "summary": "Get run findings",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1543"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1543"
        },
        "x-source-errors": [
          {
            "detail": "scanner finding-page request is invalid",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1559",
            "status": 422
          },
          {
            "detail": "scanner run was not found or its recovery window expired",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1561",
            "status": 404
          },
          {
            "detail": {
              "code": "run_id_conflict",
              "message": "run identity or result binding does not match"
            },
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1563",
            "status": 409
          },
          {
            "detail": "scanner finding cursor is invalid or stale",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1568",
            "status": 422
          },
          {
            "detail": "scanner result was acknowledged or is unavailable",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1570",
            "status": 410
          },
          {
            "detail": "scanner result failed its sealed integrity check",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1572",
            "status": 500
          }
        ],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/runs/{run_id}/result/ack": {
      "post": {
        "operationId": "scanner-post-runs-run-id-result-ack",
        "parameters": [
          {
            "in": "path",
            "name": "run_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Run Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunResultAckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RunResultAckResponse"
                }
              }
            },
            "description": "Successful Response"
          },
          "404": {
            "description": "Refresh the collection and verify the resource identity before retrying. See source-linked error catalog."
          },
          "409": {
            "description": "Refresh current revision and identity. A conflicting command must not be blindly repeated. See source-linked error catalog."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "500": {
            "description": "Keep the operation identity and collect bounded, reviewed diagnostics. See source-linked error catalog."
          }
        },
        "summary": "Acknowledge run result",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1576"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1576"
        },
        "x-source-errors": [
          {
            "detail": "scanner run was not found or its recovery window expired",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1583",
            "status": 404
          },
          {
            "detail": {
              "code": "run_id_conflict",
              "message": "run identity or result binding does not match"
            },
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1585",
            "status": 409
          },
          {
            "detail": "scanner run has no completed result to acknowledge",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1590",
            "status": 409
          },
          {
            "detail": "scanner result could not be discarded safely",
            "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L1592",
            "status": 500
          }
        ],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    },
    "/tools": {
      "get": {
        "operationId": "scanner-get-tools",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "title": "Response Tools Tools Get",
                  "type": "object"
                }
              }
            },
            "description": "Successful Response"
          }
        },
        "summary": "Tools",
        "tags": [
          "Scanner"
        ],
        "x-audience": {
          "kind": "internal",
          "label": "Private service protocol. No public or third-party integration authority.",
          "source": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L258"
        },
        "x-error-coverage": "Literal HTTP errors in this handler and same-file helper call graph, plus control middleware. Dynamic and cross-module failures may add other errors; source links are authoritative.",
        "x-source": {
          "sha256": "c0135c0a765413af800c40e0abf0d237717f0c6d431e6f72484e8b313dd92714",
          "url": "https://github.com/lomolabs/lomo-codesecurity/blob/bccff297ea36ba46f1af1f3849fa233b66c72ad3/services/scanner/kodesec_scanner/main.py#L258"
        },
        "x-source-errors": [],
        "x-stability": "Internal protocol; unsupported for external integration"
      }
    }
  },
  "x-source": {
    "commit": "bccff297ea36ba46f1af1f3849fa233b66c72ad3",
    "repository": "https://github.com/lomolabs/lomo-codesecurity",
    "version": "0.1.0"
  }
}
