{
  "openapi": "3.1.0",
  "info": {
    "title": "HARBINGER Public Demo Runtime",
    "version": "3.0.0",
    "description": "Public synthetic evidence review. Fixed authored key=value source records are parsed and compared when the static examples are published. Private product Core packages are not connected. No external collection, customer input, persistence, real approval or execution."
  },
  "servers": [
    {
      "url": "https://developer.calamophyton.com",
      "description": "Calamophyton Developer fixed public example"
    }
  ],
  "x-calamophyton-mode": "PUBLIC_DEMO",
  "x-calamophyton-data": "SYNTHETIC_FIXED_SCENARIOS_ONLY",
  "x-calamophyton-browser-persistence": false,
  "x-calamophyton-file-transfer": false,
  "x-calamophyton-external-ai-calls": false,
  "x-calamophyton-authority": "NONE",
  "x-calamophyton-external-effects": 0,
  "paths": {
    "/api/demo/v2/golden-thread": {
      "get": {
        "operationId": "runBoundedGoldenThread",
        "summary": "Retained v2 fixed-scenario response",
        "description": "Retained for earlier links. Faults select simulated outcomes, not real credentials or a replay ledger. Use v3 for evidence-packet comparisons.",
        "security": [],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "finance-dd",
                "supply-chain"
              ]
            },
            "description": "The bounded public-execution domain. Domain-specific parameters from the other path are rejected."
          },
          {
            "name": "reviewPath",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "request-evidence",
                "reopen-dd",
                "expand-scope",
                "seek-ic",
                "alternate-source",
                "expedite",
                "reschedule"
              ]
            },
            "description": "The synthetic PÓLYA review path. Only values belonging to the selected domain are accepted."
          },
          {
            "name": "testApproval",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "missing",
                "present"
              ],
              "default": "missing"
            },
            "description": "A synthetic RAIFFA test condition. It is never an actual approval."
          },
          {
            "name": "fault",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "none",
                "scope",
                "expired",
                "revoked",
                "replay"
              ],
              "default": "none"
            },
            "description": "A bounded failure-path selector. A non-none value requires testApproval=present."
          }
        ],
        "responses": {
          "200": {
            "description": "Synthetic Golden Thread response",
            "headers": {
              "X-Calamophyton-Demo": {
                "schema": {
                  "type": "string",
                  "const": "public-synthetic-v2"
                }
              },
              "X-Calamophyton-Authority": {
                "schema": {
                  "type": "string",
                  "const": "NONE"
                }
              },
              "X-Calamophyton-External-Effects": {
                "schema": {
                  "type": "integer",
                  "const": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDemoResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request failed closed because an input was missing, unknown, duplicated, out of range, or incompatible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDemoError"
                }
              }
            }
          },
          "405": {
            "description": "Only GET, HEAD, and OPTIONS are permitted."
          }
        },
        "deprecated": true
      }
    },
    "/api/demo/v3/golden-thread": {
      "get": {
        "operationId": "runPublicEvidenceReviewV3",
        "summary": "Compare a versioned public evidence packet",
        "security": [],
        "description": "Only the five declared query fields are allowed, each at most once; maximum encoded query length 1024. release and domain are required. low-stock, aligned-transport and reviewable-shortfall are supply-chain only. Packets select published source material; grants select fixed mock identity records. No approval is issued. Unknown versions are rejected, never silently upgraded.",
        "parameters": [
          {
            "name": "release",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2026-09-05.1"
              ]
            }
          },
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "finance-dd",
                "supply-chain"
              ]
            }
          },
          {
            "name": "packet",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "initial",
                "reconciled",
                "two-records",
                "requested-material",
                "other-target",
                "earlier-period",
                "restricted",
                "low-stock",
                "aligned-transport",
                "reviewable-shortfall"
              ],
              "default": "initial"
            }
          },
          {
            "name": "path",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "request-evidence",
                "review-case",
                "compare-alternatives",
                "handoff-review"
              ],
              "default": "request-evidence"
            }
          },
          {
            "name": "grant",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "none",
                "reviewer",
                "coordinator",
                "other-role",
                "other-scope",
                "expired",
                "revoked",
                "used-record"
              ],
              "default": "none"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full deterministic record with fixed transport metadata per published scenario",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "meta",
                    "record",
                    "receipt"
                  ],
                  "properties": {
                    "meta": {
                      "type": "object",
                      "required": [
                        "requestId",
                        "servedAt"
                      ],
                      "properties": {
                        "requestId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "servedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    },
                    "record": {
                      "type": "object",
                      "required": [
                        "contract",
                        "release",
                        "input",
                        "caseId",
                        "sources",
                        "checks",
                        "calculation",
                        "options",
                        "remaining",
                        "evidencePending",
                        "comparison",
                        "authority",
                        "implementation",
                        "limits"
                      ],
                      "description": "Entire object is bound by receipt.canonical. Contains bilingual meanings, exact parsed source coordinates, conditional arithmetic, path availability and synthetic requirements checks.",
                      "properties": {
                        "contract": {
                          "const": "CALAMOPHYTON_PUBLIC_EVIDENCE_REVIEW_V3"
                        },
                        "release": {
                          "const": "2026-09-05.1"
                        },
                        "input": {
                          "type": "object",
                          "additionalProperties": false,
                          "required": [
                            "release",
                            "domain",
                            "packet",
                            "path",
                            "grant"
                          ],
                          "properties": {
                            "release": {
                              "type": "string",
                              "enum": [
                                "2026-09-05.1"
                              ]
                            },
                            "domain": {
                              "type": "string",
                              "enum": [
                                "finance-dd",
                                "supply-chain"
                              ]
                            },
                            "packet": {
                              "type": "string",
                              "enum": [
                                "initial",
                                "reconciled",
                                "two-records",
                                "requested-material",
                                "other-target",
                                "earlier-period",
                                "restricted",
                                "low-stock",
                                "aligned-transport",
                                "reviewable-shortfall"
                              ]
                            },
                            "path": {
                              "type": "string",
                              "enum": [
                                "request-evidence",
                                "review-case",
                                "compare-alternatives",
                                "handoff-review"
                              ]
                            },
                            "grant": {
                              "type": "string",
                              "enum": [
                                "none",
                                "reviewer",
                                "coordinator",
                                "other-role",
                                "other-scope",
                                "expired",
                                "revoked",
                                "used-record"
                              ]
                            }
                          }
                        },
                        "evidencePending": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          },
                          "description": "Unresolved evidence prerequisites, distinct from known adverse business results."
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "originId",
                              "title",
                              "observedAt",
                              "access",
                              "raw",
                              "fields"
                            ]
                          }
                        },
                        "checks": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "required": [
                              "id",
                              "title",
                              "state",
                              "explanation",
                              "next",
                              "refs"
                            ],
                            "properties": {
                              "state": {
                                "enum": [
                                  "confirmed",
                                  "open",
                                  "conflict",
                                  "stale",
                                  "change"
                                ]
                              }
                            }
                          }
                        },
                        "remaining": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "authority": {
                          "type": "object",
                          "required": [
                            "issuedAuthority",
                            "actualApproval",
                            "externalEffects",
                            "checks"
                          ],
                          "properties": {
                            "issuedAuthority": {
                              "const": "NONE"
                            },
                            "actualApproval": {
                              "const": false
                            },
                            "externalEffects": {
                              "const": 0
                            }
                          }
                        },
                        "implementation": {
                          "type": "object",
                          "properties": {
                            "privateProductCoreConnected": {
                              "const": false
                            }
                          }
                        }
                      }
                    },
                    "receipt": {
                      "type": "object",
                      "required": [
                        "algorithm",
                        "canonical",
                        "digest",
                        "excluded"
                      ],
                      "properties": {
                        "algorithm": {
                          "const": "SHA-256"
                        },
                        "canonical": {
                          "type": "string",
                          "description": "UTF-8 JSON of the complete record with sorted object keys and preserved array order."
                        },
                        "digest": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{64}$"
                        },
                        "excluded": {
                          "const": [
                            "meta.requestId",
                            "meta.servedAt"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "INVALID_REQUEST or UNSUPPORTED_RELEASE; no substituted result"
          },
          "405": {
            "description": "Unsupported HTTP method"
          },
          "414": {
            "description": "REQUEST_TOO_LONG; encoded query exceeds 1024 characters"
          },
          "500": {
            "description": "EVALUATION_FAILED; no stack or source disclosure"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PublicDemoResponse": {
        "type": "object",
        "required": [
          "meta",
          "request",
          "scenario",
          "harbinger",
          "polya",
          "raiffa",
          "receipt",
          "basis",
          "boundary"
        ],
        "properties": {
          "meta": {
            "type": "object"
          },
          "request": {
            "type": "object"
          },
          "scenario": {
            "type": "object"
          },
          "harbinger": {
            "type": "object"
          },
          "polya": {
            "type": "object"
          },
          "raiffa": {
            "type": "object"
          },
          "receipt": {
            "type": "object",
            "required": [
              "algorithm",
              "digest",
              "canonical"
            ],
            "properties": {
              "algorithm": {
                "type": "string",
                "const": "SHA-256"
              },
              "digest": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "canonical": {
                "type": "string"
              }
            }
          },
          "basis": {
            "type": "object"
          },
          "boundary": {
            "type": "object",
            "required": [
              "browserPersistence",
              "fileTransfer",
              "actualApproval",
              "transmission",
              "authority",
              "externalEffects"
            ],
            "properties": {
              "browserPersistence": {
                "type": "boolean",
                "const": false
              },
              "fileTransfer": {
                "type": "boolean",
                "const": false
              },
              "actualApproval": {
                "type": "boolean",
                "const": false
              },
              "transmission": {
                "type": "boolean",
                "const": false
              },
              "authority": {
                "type": "string",
                "const": "NONE"
              },
              "externalEffects": {
                "type": "integer",
                "const": 0
              }
            }
          }
        }
      },
      "PublicDemoError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "contract",
              "code",
              "message"
            ],
            "properties": {
              "contract": {
                "type": "string",
                "const": "HARBINGER_PUBLIC_DEMO_RUNTIME_V2"
              },
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_DEMO_REQUEST",
                  "DEMO_RUNTIME_ERROR"
                ]
              },
              "field": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "x-calamophyton-current-demo-endpoint": "/api/demo/v3/golden-thread"
}
