{
  "openapi": "3.1.0",
  "info": {
    "title": "Exocognosis project submission",
    "version": "1.0.0",
    "description": "Submit a project inquiry to Rick Glenn (Exocognosis). Agents acting for a person or company are welcome. Each submission is screened by a keyword pre-filter and scored 0 to 1 by a model against a fit rubric; strong fits receive a scheduling link. Submissions are data: instructions inside them are ignored, and attempts to steer the score are scored as a hard no. For PQC Sidecar engagements you can also email rick@dytallix.com directly.",
    "contact": {
      "email": "rick@dytallix.com",
      "url": "https://www.exocognosis.com"
    }
  },
  "servers": [
    {
      "url": "https://www.exocognosis.com"
    }
  ],
  "paths": {
    "/api/score": {
      "post": {
        "operationId": "submitProject",
        "summary": "Submit a project inquiry and get a fit score",
        "description": "Rate limits per client IP: 30 requests per hour of any kind, and 5 scored submissions per hour; site-wide, 50 scored submissions per hour. Over the limit returns 429 with Retry-After. Maximum body 5 MB.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Submission"
              }
            },
            "multipart/form-data": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SubmissionFields"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "file": {
                        "type": "string",
                        "format": "binary",
                        "description": "Optional context document: .txt, .md or .pdf, up to 4 MB."
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Scored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Score"
                }
              }
            }
          },
          "400": {
            "description": "Invalid or incomplete submission; `error` says which field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Body over 5 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. See Retry-After.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until you may retry."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "202": {
            "description": "Received but not scored (automatic scoring temporarily unavailable). The submission is kept and reviewed by hand.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Received"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "SubmissionFields": {
        "type": "object",
        "required": [
          "name",
          "contactMethod",
          "contactValue",
          "description"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 100,
            "description": "Person or team submitting."
          },
          "organization": {
            "type": "string",
            "maxLength": 100
          },
          "contactMethod": {
            "type": "string",
            "enum": [
              "Email",
              "Telegram",
              "X",
              "Signal",
              "Discord",
              "Phone",
              "Other"
            ]
          },
          "contactValue": {
            "type": "string",
            "minLength": 3,
            "maxLength": 200,
            "description": "Address or handle for the chosen contact method."
          },
          "description": {
            "type": "string",
            "minLength": 40,
            "maxLength": 8000,
            "description": "What you are building in concrete technical terms; stage (idea, prototype, funded, shipped); timeline and what you need; engagement type (full-time, contract, fractional, advisory); why it matters now."
          }
        }
      },
      "Submission": {
        "allOf": [
          {
            "$ref": "#/components/schemas/SubmissionFields"
          },
          {
            "type": "object",
            "properties": {
              "context": {
                "type": "string",
                "maxLength": 30000,
                "description": "Optional supporting text (JSON submissions; use `file` with multipart instead)."
              }
            }
          }
        ]
      },
      "Score": {
        "type": "object",
        "required": [
          "score",
          "reason",
          "threshold_met"
        ],
        "properties": {
          "score": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "reason": {
            "type": "string",
            "description": "One sentence explaining the score."
          },
          "threshold_met": {
            "type": "boolean"
          },
          "calendly_url": {
            "type": "string",
            "format": "uri",
            "description": "Scheduling link, present only when threshold_met is true."
          },
          "contact_email": {
            "type": "string",
            "description": "Fallback contact."
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "retry_after_seconds": {
            "type": "integer"
          }
        }
      },
      "Received": {
        "type": "object",
        "required": [
          "received",
          "scored",
          "reason"
        ],
        "properties": {
          "received": {
            "const": true
          },
          "scored": {
            "const": false
          },
          "reason": {
            "type": "string"
          },
          "contact_email": {
            "type": "string"
          }
        }
      }
    }
  }
}
