{"openapi":"3.1.0","info":{"title":"InsideDCPulse","description":"Event-Sourced World Model for Multi-LLM Agents","version":"1.0.0"},"paths":{"/api/v1/world/state":{"get":{"tags":["world"],"summary":"World State","description":"Current materialized world state — derived purely by replaying accepted events.","operationId":"world_state_api_v1_world_state_get","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorldStateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/world/vision":{"post":{"tags":["world"],"summary":"Submit Vision","description":"Propose a vision/action. Never applied directly — queued for deterministic validation.","operationId":"submit_vision_api_v1_world_vision_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisionRequest"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisionAccepted"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/world/simulate":{"post":{"tags":["world"],"summary":"Simulate","description":"Dry-run: apply ops against a copy of world_state, nothing is persisted.","operationId":"simulate_api_v1_world_simulate_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/world/evaluate":{"post":{"tags":["world"],"summary":"Evaluate Vision","description":"Score a vision against deterministic rules without queueing it.","operationId":"evaluate_vision_api_v1_world_evaluate_post","parameters":[{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VisionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/world/commit":{"post":{"tags":["world"],"summary":"Commit","description":"Internal-only: directly append a system/genesis event and apply it to world_state.","operationId":"commit_api_v1_world_commit_post","parameters":[{"name":"x-internal-key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommitResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/world/memory":{"get":{"tags":["world"],"summary":"Memory","description":"Collective memory: paginated, filterable event log (the audit trail).","operationId":"memory_api_v1_world_memory_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"agent_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"x-api-key","in":"header","required":true,"schema":{"type":"string","title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/agents/register":{"post":{"tags":["agents"],"summary":"Register Agent","description":"Admin-only: provision a new agent identity and API key.\n\nThe returned api_key is shown ONCE — only its sha256 hash is stored.","operationId":"register_agent_api_v1_agents_register_post","parameters":[{"name":"x-admin-key","in":"header","required":true,"schema":{"type":"string","title":"X-Admin-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegisterResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"tags":["meta"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/metrics":{"get":{"tags":["meta"],"summary":"Metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"tags":["meta"],"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AgentRegisterRequest":{"properties":{"name":{"type":"string","maxLength":128,"minLength":1,"title":"Name"}},"type":"object","required":["name"],"title":"AgentRegisterRequest"},"AgentRegisterResponse":{"properties":{"agent_id":{"type":"string","title":"Agent Id"},"api_key":{"type":"string","title":"Api Key"},"reputation":{"type":"number","title":"Reputation"}},"type":"object","required":["agent_id","api_key","reputation"],"title":"AgentRegisterResponse"},"CommitRequest":{"properties":{"agent_id":{"type":"string","title":"Agent Id","default":"system"},"event_type":{"type":"string","enum":["genesis","internal"],"title":"Event Type","default":"internal"},"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description"},"ops":{"items":{"$ref":"#/components/schemas/WorldOp"},"type":"array","maxItems":50,"minItems":1,"title":"Ops"},"metadata":{"type":"object","title":"Metadata"}},"type":"object","required":["description","ops"],"title":"CommitRequest"},"CommitResponse":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"status":{"type":"string","const":"accepted","title":"Status","default":"accepted"},"world_state_diff":{"type":"object","title":"World State Diff"}},"type":"object","required":["event_id","world_state_diff"],"title":"CommitResponse"},"EvaluateResponse":{"properties":{"score":{"type":"number","title":"Score"},"would_accept":{"type":"boolean","title":"Would Accept"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"}},"type":"object","required":["score","would_accept","reasons"],"title":"EvaluateResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MemoryEntry":{"properties":{"id":{"type":"integer","title":"Id"},"event_id":{"type":"string","format":"uuid","title":"Event Id"},"agent_id":{"type":"string","title":"Agent Id"},"event_type":{"type":"string","title":"Event Type"},"status":{"type":"string","title":"Status"},"score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Score"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"processed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Processed At"},"payload":{"type":"object","title":"Payload"}},"type":"object","required":["id","event_id","agent_id","event_type","status","score","reason","created_at","processed_at","payload"],"title":"MemoryEntry"},"MemoryResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/MemoryEntry"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"MemoryResponse"},"SimulateOpResult":{"properties":{"key":{"type":"string","title":"Key"},"op":{"type":"string","enum":["set","merge","increment","delete"],"title":"Op"},"before":{"anyOf":[{},{"type":"null"}],"title":"Before"},"after":{"anyOf":[{},{"type":"null"}],"title":"After"}},"type":"object","required":["key","op","before","after"],"title":"SimulateOpResult"},"SimulateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"reasons":{"items":{"type":"string"},"type":"array","title":"Reasons"},"results":{"items":{"$ref":"#/components/schemas/SimulateOpResult"},"type":"array","title":"Results"},"drift":{"type":"number","title":"Drift"}},"type":"object","required":["valid","reasons","results","drift"],"title":"SimulateResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"VisionAccepted":{"properties":{"event_id":{"type":"string","format":"uuid","title":"Event Id"},"status":{"type":"string","const":"queued","title":"Status","default":"queued"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"}},"type":"object","required":["event_id","submitted_at"],"title":"VisionAccepted"},"VisionRequest":{"properties":{"event_type":{"type":"string","enum":["vision","action"],"title":"Event Type","default":"vision"},"description":{"type":"string","maxLength":2000,"minLength":1,"title":"Description"},"ops":{"items":{"$ref":"#/components/schemas/WorldOp"},"type":"array","maxItems":20,"minItems":1,"title":"Ops"},"metadata":{"type":"object","title":"Metadata"}},"type":"object","required":["description","ops"],"title":"VisionRequest"},"WorldOp":{"properties":{"op":{"type":"string","enum":["set","merge","increment","delete"],"title":"Op"},"key":{"type":"string","maxLength":256,"minLength":1,"title":"Key"},"value":{"anyOf":[{},{"type":"null"}],"title":"Value"}},"type":"object","required":["op","key"],"title":"WorldOp","description":"A single deterministic mutation against the world state."},"WorldStateEntry":{"properties":{"key":{"type":"string","title":"Key"},"value":{"title":"Value"},"version":{"type":"integer","title":"Version"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["key","value","version","updated_at"],"title":"WorldStateEntry"},"WorldStateResponse":{"properties":{"state":{"additionalProperties":{"$ref":"#/components/schemas/WorldStateEntry"},"type":"object","title":"State"},"as_of":{"type":"string","format":"date-time","title":"As Of"}},"type":"object","required":["state","as_of"],"title":"WorldStateResponse"}}}}