@@ -136,6 +136,106 @@ components:
136136 tool_use : {}
137137 tool_results : {}
138138
139+ GraphScope :
140+ type : object
141+ properties :
142+ tenant_id : {type: string}
143+ project_id : {type: string}
144+ repository_id : {type: string}
145+
146+ GraphRef :
147+ type : object
148+ required : [kind, id]
149+ properties :
150+ kind :
151+ type : string
152+ enum : [system, knowledge, execution, policy, quality, operations]
153+ id : {type: string}
154+
155+ GraphProvenance :
156+ type : object
157+ required : [producer]
158+ properties :
159+ producer : {type: string}
160+ version : {type: string}
161+ source_id : {type: string}
162+ evidence :
163+ type : array
164+ items :
165+ type : object
166+ required : [uri]
167+ properties :
168+ uri : {type: string}
169+ digest : {type: string}
170+ media_type : {type: string}
171+
172+ GraphNode :
173+ type : object
174+ required : [id, kind, created_at, provenance]
175+ properties :
176+ id : {type: string}
177+ kind :
178+ type : string
179+ enum : [system, knowledge, execution, policy, quality, operations]
180+ scope : {$ref: "#/components/schemas/GraphScope"}
181+ created_at : {type: string, format: date-time}
182+ effective_at : {type: string, format: date-time}
183+ provenance : {$ref: "#/components/schemas/GraphProvenance"}
184+ attributes :
185+ type : object
186+ additionalProperties : {type: string}
187+
188+ GraphEdge :
189+ type : object
190+ required : [id, kind, from, to, created_at, provenance]
191+ properties :
192+ id : {type: string}
193+ kind :
194+ type : string
195+ enum : [contains, depends_on, references, produced, governed_by, validated_by]
196+ from : {$ref: "#/components/schemas/GraphRef"}
197+ to : {$ref: "#/components/schemas/GraphRef"}
198+ scope : {$ref: "#/components/schemas/GraphScope"}
199+ created_at : {type: string, format: date-time}
200+ effective_at : {type: string, format: date-time}
201+ provenance : {$ref: "#/components/schemas/GraphProvenance"}
202+ attributes :
203+ type : object
204+ additionalProperties : {type: string}
205+
206+ GraphEvent :
207+ type : object
208+ required : [id, type, subject, occurred_at, provenance]
209+ properties :
210+ id : {type: string}
211+ type :
212+ type : string
213+ enum : [created, updated, transitioned, observed, deleted]
214+ subject : {$ref: "#/components/schemas/GraphRef"}
215+ scope : {$ref: "#/components/schemas/GraphScope"}
216+ occurred_at : {type: string, format: date-time}
217+ correlation_id : {type: string}
218+ causation_id : {type: string}
219+ idempotency_key : {type: string}
220+ provenance : {$ref: "#/components/schemas/GraphProvenance"}
221+
222+ ExecutionGraph :
223+ type : object
224+ required : [schema_version, generated_at, scope, nodes, edges, events]
225+ properties :
226+ schema_version : {type: string, enum: [hawk.graph/v1]}
227+ generated_at : {type: string, format: date-time}
228+ scope : {$ref: "#/components/schemas/GraphScope"}
229+ nodes :
230+ type : array
231+ items : {$ref: "#/components/schemas/GraphNode"}
232+ edges :
233+ type : array
234+ items : {$ref: "#/components/schemas/GraphEdge"}
235+ events :
236+ type : array
237+ items : {$ref: "#/components/schemas/GraphEvent"}
238+
139239 PaginatedMessages :
140240 type : object
141241 properties :
@@ -259,6 +359,8 @@ tags:
259359 description : Session management
260360 - name : messages
261361 description : Message history
362+ - name : graphs
363+ description : Portable read-only execution graph projections
262364 - name : stats
263365 description : Usage statistics
264366 - name : review
@@ -458,6 +560,53 @@ paths:
458560 schema :
459561 $ref : " #/components/schemas/Error"
460562
563+ /v1/sessions/{id}/graph :
564+ get :
565+ tags : [graphs]
566+ summary : Project a persisted session as a portable execution graph
567+ parameters :
568+ - name : id
569+ in : path
570+ required : true
571+ schema : {type: string, maxLength: 128, pattern: '^[A-Za-z0-9._-]+$'}
572+ - name : repository
573+ in : query
574+ schema : {type: string, maxLength: 256}
575+ - name : trace_checkpoint
576+ in : query
577+ schema :
578+ type : array
579+ maxItems : 64
580+ items : {type: string, pattern: '^[0-9a-f]{12}$'}
581+ style : form
582+ explode : true
583+ responses :
584+ " 200 " :
585+ description : Portable execution graph
586+ content :
587+ application/json :
588+ schema : {$ref: "#/components/schemas/ExecutionGraph"}
589+ " 400 " :
590+ description : Invalid graph request
591+ content :
592+ application/json :
593+ schema : {$ref: "#/components/schemas/Error"}
594+ " 401 " :
595+ description : Unauthorized
596+ content :
597+ application/json :
598+ schema : {$ref: "#/components/schemas/Error"}
599+ " 404 " :
600+ description : Session not found
601+ content :
602+ application/json :
603+ schema : {$ref: "#/components/schemas/Error"}
604+ " 503 " :
605+ description : Graph projection unavailable
606+ content :
607+ application/json :
608+ schema : {$ref: "#/components/schemas/Error"}
609+
461610 /v1/stats :
462611 get :
463612 tags : [stats]
0 commit comments