Skip to content

D3: stuck-orders worklist + SLA-stage contract block - #145

Merged
brownjuly2003-code merged 1 commit into
mainfrom
feat/d3-stuck-orders-worklist
Jul 4, 2026
Merged

D3: stuck-orders worklist + SLA-stage contract block#145
brownjuly2003-code merged 1 commit into
mainfrom
feat/d3-stuck-orders-worklist

Conversation

@brownjuly2003-code

Copy link
Copy Markdown
Owner

Summary

  • New GET /v1/ops/stuck-orders (docs/ops-surfaces-spec.md §3): open orders (catalog ladder) left-joined to their latest orders.status journal row, breach arithmetic from the contract stages: block, stage/include_within_sla/pagination params, open_by_stage/breached_by_stage summary.
  • contracts/entities/order.yaml gains the stages: SLA ladder (§1.5): pending 30m / confirmed 24h / shipped 5d, delivered/cancelled terminal. EntityDefinition/entity_type_registry.py parse it, tolerant of absence.
  • New QueryEngine.fetch_orders_by_status (one query, no per-order round-trips) and a topic filter on fetch_pipeline_events.
  • Factored D2's inline stage-clock/breach logic out of agent_query.py into shared src/serving/semantic_layer/stage_clock.py (coerce_dt/stage_budget/ladder_stage_names/resolve_breach), now used by both the Order 360 timeline and the new worklist — no budget-literal duplication (I2).
  • Widened the I1 structural ratchet (test_control_plane_store.py) to also scan routers/ops.py; bumped the reviewed B608 nosec count for the new bulk-read site in entity_queries.py.
  • Regenerated docs/openapi.json + agent-tools JSON for the new route.

Demo story (I7) verified by arithmetic against the D2 seed: default view returns exactly ORD-20260404-1004 (45min pending vs 30min budget, overshoot 1.5×); open_by_stage/breached_by_stage match the spec's worked example exactly.

Test plan

  • pytest tests/unit — 1606 passed
  • pytest tests/integration -m "not requires_docker and not live" — 224 passed, 50 skipped, 5 deselected
  • ruff check / ruff format --check / mypy --strict on touched files — clean
  • New tests/integration/test_stuck_orders.py (I2/I4/I7/I12), test_tenant_isolation.py cross-tenant case (I8), test_entity_type_registry.py stages-parsing cases, widened I1 ratchet

🤖 Generated with Claude Code

New GET /v1/ops/stuck-orders (ops-surfaces-spec.md §3): the catalog gains an
optional `stages:` ladder on order.yaml (§1.5), a new QueryEngine bulk read
(fetch_orders_by_status) fetches open orders in one query, and the stage
clock/breach arithmetic that D2 inlined in the timeline handler is factored
into a shared src/serving/semantic_layer/stage_clock.py used by both
surfaces (I2). Widens the I1 structural ratchet to cover routers/ops.py and
bumps the reviewed B608 nosec count for the new bulk-read site.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

DORA Metrics

  • Window: last 30 days
  • Branch: main
  • Deployment frequency: 121 total / 28.23 per week
  • Lead time for changes: avg 0.43h / median 0.0h
  • Change failure rate: 77.69% (94/121)
  • MTTR: 0.29h across 2 incident(s)

@brownjuly2003-code
brownjuly2003-code merged commit 330c056 into main Jul 4, 2026
23 checks passed
@brownjuly2003-code
brownjuly2003-code deleted the feat/d3-stuck-orders-worklist branch July 4, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants