{"openapi":"3.1.0","info":{"title":"Downstream","description":"A stateful Emergency Action Plan drafting partner with explicit safety gates.","version":"0.2.0"},"paths":{"/downstream/fixtures/drawing":{"get":{"tags":["downstream"],"summary":"Drawing Fixture","operationId":"drawing_fixture_downstream_fixtures_drawing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Drawing Fixture Downstream Fixtures Drawing Get"}}}}}}},"/downstream/fixtures/drawing/image":{"get":{"tags":["downstream"],"summary":"Drawing Fixture Image","operationId":"drawing_fixture_image_downstream_fixtures_drawing_image_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/downstream/bonus":{"get":{"tags":["downstream"],"summary":"Bonus","operationId":"bonus_downstream_bonus_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Bonus Downstream Bonus Get"}}}}}}},"/downstream/research":{"get":{"tags":["downstream"],"summary":"Research","operationId":"research_downstream_research_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Research Downstream Research Get"}}}}}}},"/downstream/nid/search":{"get":{"tags":["downstream"],"summary":"Nid Search","operationId":"nid_search_downstream_nid_search_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":25,"minimum":1,"default":5,"title":"Limit"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Nid Search Downstream Nid Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces":{"post":{"tags":["downstream"],"summary":"Open Workspace","description":"Open a workspace. The trigger is the only human act in the opening sequence.","operationId":"open_workspace_downstream_workspaces_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Open Workspace Downstream Workspaces Post"}}}}}}},"/downstream/workspaces/{workspace_id}/autonomy":{"get":{"tags":["downstream"],"summary":"Workspace Autonomy","description":"The autonomy receipt, derived from the persisted timeline.","operationId":"workspace_autonomy_downstream_workspaces__workspace_id__autonomy_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Workspace Autonomy Downstream Workspaces  Workspace Id  Autonomy Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}":{"get":{"tags":["downstream"],"summary":"Get Workspace","operationId":"get_workspace_downstream_workspaces__workspace_id__get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Workspace Downstream Workspaces  Workspace Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}/audit":{"get":{"tags":["downstream"],"summary":"Workspace Audit","operationId":"workspace_audit_downstream_workspaces__workspace_id__audit_get","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Workspace Audit Downstream Workspaces  Workspace Id  Audit Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}/resume":{"post":{"tags":["downstream"],"summary":"Resume Workspace","operationId":"resume_workspace_downstream_workspaces__workspace_id__resume_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resume Workspace Downstream Workspaces  Workspace Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}/answer":{"post":{"tags":["downstream"],"summary":"Answer","operationId":"answer_downstream_workspaces__workspace_id__answer_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Answer Downstream Workspaces  Workspace Id  Answer Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}/answers/{question_id}/revise":{"post":{"tags":["downstream"],"summary":"Revise","operationId":"revise_downstream_workspaces__workspace_id__answers__question_id__revise_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"question_id","in":"path","required":true,"schema":{"type":"string","title":"Question Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revise Downstream Workspaces  Workspace Id  Answers  Question Id  Revise Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}/skip":{"post":{"tags":["downstream"],"summary":"Skip","operationId":"skip_downstream_workspaces__workspace_id__skip_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Skip Downstream Workspaces  Workspace Id  Skip Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/workspaces/{workspace_id}/feedback":{"post":{"tags":["downstream"],"summary":"Feedback","operationId":"feedback_downstream_workspaces__workspace_id__feedback_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Feedback Downstream Workspaces  Workspace Id  Feedback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/demo/run":{"post":{"tags":["downstream"],"summary":"Demo Run","description":"One request. Server-side. Trigger to reviewable draft, with nothing to click.\n\nA judge should not have to perform eleven interactions to find out whether the workflow\nworks. This runs the whole thing in one call and returns the receipt, the draft, and the\nmeasured context so the result can be checked rather than watched.\n\nThe owner answers here are synthetic and labelled as such. They stand in for the one\nthing the agent is not allowed to invent, so that everything the agent *is* allowed to do\ncan be seen end to end.","operationId":"demo_run_downstream_demo_run_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Demo Run Downstream Demo Run Post"}}}}}}},"/downstream/workspaces/{workspace_id}/live-proof":{"post":{"tags":["downstream"],"summary":"Arm Live Proof","description":"Register one wake on the real clock, then stop being involved.\n\nEverything else here runs on a clock the visitor advances, which is honest and labelled\nbut leaves the fair objection that a button was pressed. This answers it: nothing on this\npage executes the wake. Cloud Scheduler claims it and runs it, and the step it writes\ncarries the revision that did the work.","operationId":"arm_live_proof_downstream_workspaces__workspace_id__live_proof_post","parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Arm Live Proof Downstream Workspaces  Workspace Id  Live Proof Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/live-proof/{wake_id}":{"get":{"tags":["downstream"],"summary":"Check Live Proof","description":"Has the scheduler picked it up yet? Read-only; polling never causes the work.","operationId":"check_live_proof_downstream_live_proof__wake_id__get","parameters":[{"name":"wake_id","in":"path","required":true,"schema":{"type":"string","title":"Wake Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Check Live Proof Downstream Live Proof  Wake Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/downstream/proof":{"get":{"tags":["downstream"],"summary":"Proof","operationId":"proof_downstream_proof_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Proof Downstream Proof Get"}}}}}}},"/downstream/conformance":{"get":{"tags":["downstream"],"summary":"Conformance","operationId":"conformance_downstream_conformance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Conformance Downstream Conformance Get"}}}}}}},"/v1":{"get":{"tags":["beta-api"],"summary":"Api Info","operationId":"api_info_v1_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Api Info V1 Get"}}}}},"security":[{"BetaApiKey":[]}]}},"/v1/workspaces":{"post":{"tags":["beta-api"],"summary":"Open Workspace","operationId":"open_workspace_v1_workspaces_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenBetaWorkspaceRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Open Workspace V1 Workspaces Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"BetaApiKey":[]}]}},"/v1/workspaces/{workspace_id}/autonomy":{"get":{"tags":["beta-api"],"summary":"Workspace Autonomy","operationId":"workspace_autonomy_v1_workspaces__workspace_id__autonomy_get","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Workspace Autonomy V1 Workspaces  Workspace Id  Autonomy Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}":{"get":{"tags":["beta-api"],"summary":"Get Workspace","operationId":"get_workspace_v1_workspaces__workspace_id__get","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Workspace V1 Workspaces  Workspace Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/answer":{"post":{"tags":["beta-api"],"summary":"Answer","operationId":"answer_v1_workspaces__workspace_id__answer_post","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnswerRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Answer V1 Workspaces  Workspace Id  Answer Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/answers/{question_id}/revise":{"post":{"tags":["beta-api"],"summary":"Revise","operationId":"revise_v1_workspaces__workspace_id__answers__question_id__revise_post","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}},{"name":"question_id","in":"path","required":true,"schema":{"type":"string","title":"Question Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Revise V1 Workspaces  Workspace Id  Answers  Question Id  Revise Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/skip":{"post":{"tags":["beta-api"],"summary":"Skip","operationId":"skip_v1_workspaces__workspace_id__skip_post","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkipRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Skip V1 Workspaces  Workspace Id  Skip Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/feedback":{"post":{"tags":["beta-api"],"summary":"Feedback","operationId":"feedback_v1_workspaces__workspace_id__feedback_post","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Feedback V1 Workspaces  Workspace Id  Feedback Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/workspaces/{workspace_id}/resume":{"post":{"tags":["beta-api"],"summary":"Resume Workspace","operationId":"resume_workspace_v1_workspaces__workspace_id__resume_post","security":[{"BetaApiKey":[]}],"parameters":[{"name":"workspace_id","in":"path","required":true,"schema":{"type":"string","title":"Workspace Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Resume Workspace V1 Workspaces  Workspace Id  Resume Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/developer/config":{"get":{"tags":["developer-access"],"summary":"Config","operationId":"config_developer_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Config Developer Config Get"}}}}}}},"/developer/keys":{"post":{"tags":["developer-access"],"summary":"Issue Key","description":"Mint one temporary, tenant-scoped key.\n\nOpen by default. The ceilings are per caller network and generous enough that anyone\nevaluating the API will not meet them; they exist to stop a runaway script.","operationId":"issue_key_developer_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Issue Key Developer Keys Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/key":{"delete":{"tags":["developer-access"],"summary":"Revoke Key","operationId":"revoke_key_v1_key_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Revoke Key V1 Key Delete"}}}}},"security":[{"BetaApiKey":[]}]}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Health Get"}}}}}}},"/stack":{"get":{"summary":"Stack","description":"What this process is actually using. The live-stack badge renders exactly this.","operationId":"stack_stack_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Stack Stack Get"}}}}}}}},"components":{"schemas":{"AnswerRequest":{"properties":{"question_id":{"type":"string","maxLength":80,"minLength":2,"title":"Question Id"},"answer":{"type":"string","maxLength":1200,"minLength":1,"title":"Answer"},"did_not_understand":{"type":"boolean","title":"Did Not Understand","default":false}},"type":"object","required":["question_id","answer"],"title":"AnswerRequest"},"FeedbackRequest":{"properties":{"action":{"type":"string","title":"Action"},"reason":{"type":"string","maxLength":500,"title":"Reason","default":""},"revised_text":{"type":"string","maxLength":1200,"title":"Revised Text","default":""}},"type":"object","required":["action"],"title":"FeedbackRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"KeyRequest":{"properties":{"label":{"type":"string","maxLength":80,"minLength":2,"title":"Label"},"email":{"type":"string","maxLength":254,"title":"Email","default":""},"organisation":{"type":"string","maxLength":120,"title":"Organisation","default":""},"intended_use":{"type":"string","maxLength":400,"title":"Intended Use","default":""},"acknowledge_terms":{"type":"boolean","const":true,"title":"Acknowledge Terms"},"invitation_code":{"anyOf":[{"type":"string","format":"password","writeOnly":true},{"type":"null"}],"title":"Invitation Code"}},"type":"object","required":["label","acknowledge_terms"],"title":"KeyRequest","description":"What a developer tells us. None of it grants anything.\n\n`tenant_id` is deliberately absent: it used to be caller-supplied, which meant one holder of\na shared invitation code could mint a key naming another holder's tenant and read their\nworkspaces."},"OpenBetaWorkspaceRequest":{"properties":{"nid_id":{"type":"string","maxLength":20,"minLength":2,"pattern":"^[A-Za-z0-9_-]+$","title":"Nid Id"}},"type":"object","required":["nid_id"],"title":"OpenBetaWorkspaceRequest"},"RevisionRequest":{"properties":{"revised_answer":{"type":"string","maxLength":1200,"minLength":1,"title":"Revised Answer"},"reason":{"type":"string","maxLength":500,"minLength":2,"title":"Reason"}},"type":"object","required":["revised_answer","reason"],"title":"RevisionRequest"},"SkipRequest":{"properties":{"question_id":{"type":"string","maxLength":80,"minLength":2,"title":"Question Id"}},"type":"object","required":["question_id"],"title":"SkipRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BetaApiKey":{"type":"apiKey","description":"A workspace-scoped beta key. It is shown once when provisioned.","in":"header","name":"X-API-Key"}}}}