Skip to content

Commit 45418ac

Browse files
brownjuly2003-codeJuliaEdomclaude
authored
D2: Order 360 timeline endpoint + stage-entry journal (#144)
* feat(ops): Order 360 timeline endpoint + stage-entry journal (D2) GET /v1/entity/order/{order_id}/timeline composes the QueryEngine and ControlPlaneStore ports (ADR 0011, no third path) into one read: order state, stage history + pipeline trail from the pipeline_events journal, the PII-free users_enriched customer block, and linked dead-letter exceptions. Makes the journal's entity_id axis real on the live write paths (local_pipeline.py's three insert sites, clickhouse_sink.py's mirror — previously only the demo seed populated it) and adds the orders.status stage-entry writer alongside every order upsert on both backends. Seeds stage trails for the 8 demo orders (ops-surfaces-spec.md §1.6): ORD-1004 is the sole SLA-breach candidate once D3 wires budgets, ORD-1001 carries the full pending->confirmed->shipped->delivered story. error_rate re-pins to 2/32 by arithmetic (B3 house rule). Excludes the new orders.status topic from /v1/lineage's scan so the existing ingestion-trail endpoint keeps reporting the platform-movement story, not warehouse stage moves. sla_minutes/breached stay null until D3 lands the stages: contract block (ops-surfaces-spec.md §1.5 is explicitly D3's, not D2's) — honest degradation per the spec's own tolerant-of-absence design, not a gap. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * fix(ops): satisfy the lint format gate and regenerate the OpenAPI/agent-tools contract for D2 ruff format --check flagged the new ratchet test's one-line wrap; the export_openapi.py --check drift was expected — the new timeline endpoint adds to the OpenAPI schema and both generated tool-call contracts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> --------- Co-authored-by: JuliaEdom <uedomskikh@gmail.com> Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 08e8211 commit 45418ac

15 files changed

Lines changed: 1304 additions & 14 deletions

‎docs/agent-tools/claude-tools.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,22 @@
106106
]
107107
}
108108
},
109+
{
110+
"name": "get_order_timeline_v1_entity_order__order_id__timeline_get",
111+
"description": "Get Order Timeline\n\nOrder 360: order state, stage history, pipeline trail, customer block,\nand linked exceptions \u2014 one composed read (ops-surfaces-spec.md \u00a72).\n\nSame tenant scoping and 404 semantics as GET /entity/order/{order_id}.\nNot cached: this is the \"now\" surface (ADR 0011 constraint 3, spec \u00a71.8).\n\nExample:\n GET /v1/entity/order/ORD-20260404-1001/timeline",
112+
"input_schema": {
113+
"type": "object",
114+
"properties": {
115+
"order_id": {
116+
"type": "string",
117+
"title": "Order Id"
118+
}
119+
},
120+
"required": [
121+
"order_id"
122+
]
123+
}
124+
},
109125
{
110126
"name": "get_metric_v1_metrics__metric_name__get",
111127
"description": "Get Metric\n\nGet a real-time metric value.\n\nSupported metrics: revenue, order_count, avg_order_value, conversion_rate,\nactive_sessions, error_rate.\n\nWindow options: 5m, 15m, 1h, 6h, 24h.\n\nExample:\n GET /v1/metrics/revenue?window=1h",

‎docs/agent-tools/openai-tools.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,25 @@
115115
}
116116
}
117117
},
118+
{
119+
"type": "function",
120+
"function": {
121+
"name": "get_order_timeline_v1_entity_order__order_id__timeline_get",
122+
"description": "Get Order Timeline\n\nOrder 360: order state, stage history, pipeline trail, customer block,\nand linked exceptions \u2014 one composed read (ops-surfaces-spec.md \u00a72).\n\nSame tenant scoping and 404 semantics as GET /entity/order/{order_id}.\nNot cached: this is the \"now\" surface (ADR 0011 constraint 3, spec \u00a71.8).\n\nExample:\n GET /v1/entity/order/ORD-20260404-1001/timeline",
123+
"parameters": {
124+
"type": "object",
125+
"properties": {
126+
"order_id": {
127+
"type": "string",
128+
"title": "Order Id"
129+
}
130+
},
131+
"required": [
132+
"order_id"
133+
]
134+
}
135+
}
136+
},
118137
{
119138
"type": "function",
120139
"function": {

0 commit comments

Comments
 (0)