{"openapi":"3.1.0","info":{"title":"LAKA Volumetric Media Grammar API","version":"1.0.0","summary":"Public read API for the LAKA Volumetric Media Grammar, plus a production-rule engine and a schema validator.","description":"196 declarative IF/THEN production rules across 14 domains; 989 enumerated states in 62 dimensions plus 38 continuous dimensions; 12 JSON Schemas; 22 documentation chapters; a complete fictional worked example; POST /v1/evaluate runs the reference rule engine on a submitted context, and POST /v1/validate checks a document against a packaged schema. This API is a specification and reference — not an editing application or a completed production.","contact":{"name":"Bow Tie Kreative","url":"https://bowtiekreative.com"}},"servers":[{"url":"https://video.bowtiekreative.com"}],"paths":{"/v1":{"get":{"summary":"Service index","operationId":"index","responses":{"200":{"description":"Service metadata and endpoint list"}}}},"/v1/health":{"get":{"summary":"Liveness and corpus counts","operationId":"health","responses":{"200":{"description":"Status and counts"}}}},"/v1/openapi.json":{"get":{"summary":"This document","operationId":"openapi","responses":{"200":{"description":"OpenAPI 3.1"}}}},"/v1/manifest":{"get":{"summary":"Package manifest and inventory","operationId":"manifest","responses":{"200":{"description":"Manifest"}}}},"/v1/model":{"get":{"summary":"The volumetric model","operationId":"model","responses":{"200":{"description":"Change levels, meta-variables, decision variables and rule operators"}}}},"/v1/dimensions":{"get":{"summary":"List every dimension","operationId":"listDimensions","parameters":[{"name":"group","in":"query","schema":{"enum":["core","transcript","story","podcast","camera","lighting","generation","editing","graphics","audio","color_vfx","delivery","qa"]}},{"name":"kind","in":"query","schema":{"enum":["enumerated","continuous"]}}],"responses":{"200":{"description":"Dimension groups, enumerated dimensions and continuous dimensions"}}}},"/v1/dimensions/{id}":{"get":{"summary":"One dimension with its full state list","operationId":"getDimension","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"},"example":"shot_sizes"}],"responses":{"200":{"description":"The dimension","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dimension"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"const":"not_found"},"id":{"type":"string"}}}}}}}}},"/v1/rules":{"get":{"summary":"List the 196 production rules","operationId":"listRules","parameters":[{"name":"category","in":"query","schema":{"enum":["transcript","clip","story","podcast","camera","lighting","generation","editing","graphics","audio","color_vfx","delivery","qa","laka"]},"description":"Rule domain, e.g. camera or audio"},{"name":"type","in":"query","schema":{"enum":["hard","soft"]}},{"name":"min_priority","in":"query","schema":{"type":"integer"}},{"name":"q","in":"query","schema":{"type":"string"},"description":"Free-text filter over id, rationale and tags"},{"name":"limit","in":"query","schema":{"type":"integer","default":100}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"A list with facets","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"results":{"type":"array","items":{"$ref":"#/components/schemas/RuleSummary"}}}}}}}}}},"/v1/rules/{id}":{"get":{"summary":"One production rule","operationId":"getRule","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Z]{3}-\\d{3}$"},"example":"TXT-001"}],"responses":{"200":{"description":"The full rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Rule"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"const":"not_found"},"id":{"type":"string"}}}}}}}}},"/v1/schemas":{"get":{"summary":"List the JSON Schemas","operationId":"listSchemas","responses":{"200":{"description":"Schema list"}}}},"/v1/schemas/{name}":{"get":{"summary":"One JSON Schema","operationId":"getSchema","parameters":[{"name":"name","in":"path","required":true,"schema":{"enum":["beat","claim","clip","common","decision","production_rules","project","provenance","qa_issue","shot","timeline","transcript_unit"]},"example":"clip"}],"responses":{"200":{"description":"JSON Schema (draft 2020-12)"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"const":"not_found"},"id":{"type":"string"}}}}}}}}},"/v1/example":{"get":{"summary":"The fictional worked example — stage list","operationId":"example","responses":{"200":{"description":"Stage list"}}}},"/v1/example/{stage}":{"get":{"summary":"One example stage","operationId":"getExampleStage","parameters":[{"name":"stage","in":"path","required":true,"schema":{"enum":["transcript","claims","clips","candidates","ranked","weights","penalties","clip-score","shots","edit","timeline","rule-context","rule-evaluation","project","commands"]},"example":"clips"}],"responses":{"200":{"description":"Stage data (JSON) or raw text for YAML/DSL stages"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"const":"not_found"},"id":{"type":"string"}}}}}}}}},"/v1/docs":{"get":{"summary":"The documentation chapters","operationId":"docs","responses":{"200":{"description":"Chapter list"}}}},"/v1/docs/{slug}":{"get":{"summary":"One chapter, as markdown","operationId":"getDoc","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"example":"first-principles"}],"responses":{"200":{"description":"Markdown text","content":{"text/markdown":{"schema":{"type":"string"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"const":"not_found"},"id":{"type":"string"}}}}}}}}},"/v1/sources":{"get":{"summary":"The primary source register","operationId":"sources","responses":{"200":{"description":"Sources"}}}},"/v1/evaluate":{"post":{"summary":"Run the production-rule engine on a submitted context","operationId":"evaluate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["context"],"properties":{"context":{"type":"object","description":"The evaluation context; rule conditions read dotted paths from it."},"domains":{"type":"array","items":{"type":"string"},"description":"Optional domain filter, e.g. [\"transcript\",\"story\"]."},"matched_only":{"type":"boolean","default":true,"description":"Set false to include non-matching rules in the trace."}}},"example":{"context":{"transcript":{"unresolved_pronoun":true}}}}}},"responses":{"200":{"description":"Evaluation outcome","content":{"application/json":{"schema":{"type":"object","properties":{"state":{"type":"object","description":"Accumulated flags, proposals, requirements, human reviews and block status."},"blocked":{"type":"boolean"},"matched_count":{"type":"integer"},"evaluated_count":{"type":"integer"},"hard_matched":{"type":"array","items":{"type":"string"}},"soft_matched":{"type":"array","items":{"type":"string"}},"trace":{"type":"array","items":{"$ref":"#/components/schemas/TraceItem"}}}}}}},"400":{"description":"The body was not a valid evaluation request"}}}},"/v1/validate":{"post":{"summary":"Validate a document against one of the packaged schemas","operationId":"validate","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["schema","document"],"properties":{"schema":{"enum":["beat","claim","clip","common","decision","production_rules","project","provenance","qa_issue","shot","timeline","transcript_unit"]},"document":{"description":"The JSON document to validate."}}}}}},"responses":{"200":{"description":"Validation outcome","content":{"application/json":{"schema":{"type":"object","properties":{"schema":{"type":"string"},"valid":{"type":"boolean"},"error_count":{"type":"integer"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}}}}}}}}},"400":{"description":"Unknown schema name or missing document"}}}}},"components":{"schemas":{"Dimension":{"type":"object","properties":{"id":{"type":"string","example":"shot_sizes"},"name":{"type":"string"},"kind":{"enum":["enumerated","continuous"]},"group":{"type":"string"},"state_count":{"type":"integer"},"values":{"type":"array","items":{"type":"string"}}}},"RuleSummary":{"type":"object","properties":{"id":{"type":"string","example":"TXT-001"},"domain":{"type":"string"},"category":{"type":"string"},"type":{"enum":["hard","soft"]},"priority":{"type":"integer"},"rationale":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"href":{"type":"string"}}},"Rule":{"type":"object","properties":{"id":{"type":"string"},"domain":{"type":"string"},"priority":{"type":"integer"},"hard":{"type":"boolean"},"logic":{"enum":["all","any"]},"when":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"op":{"type":"string"},"value":{}}}},"then":{"type":"array","items":{"type":"object","properties":{"op":{"type":"string"},"path":{"type":"string"},"value":{}}}},"rationale":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}}},"TraceItem":{"type":"object","properties":{"rule_id":{"type":"string"},"domain":{"type":"string"},"priority":{"type":"integer"},"hard":{"type":"boolean"},"matched":{"type":"boolean"},"rationale":{"type":["string","null"]},"actions":{"type":"array","items":{"type":"object"}}}}}}}