Skip to content

GET /analytics/dispatch: created_at-windowed dispatch-context report + … - #998

Merged
warren-auto-merge[bot] merged 3 commits into
mainfrom
warren/run_5hsgxbe2ph9m
Aug 19, 2026
Merged

GET /analytics/dispatch: created_at-windowed dispatch-context report + …#998
warren-auto-merge[bot] merged 3 commits into
mainfrom
warren/run_5hsgxbe2ph9m

Conversation

@warren-forge-bnnl24

Copy link
Copy Markdown
Contributor

Summary

seeds: sync 2026-08-19

Agent notes

Descriptive read surface over dispatch_context: join run outcomes, group
counts by origin/retry_kind/provider-model/queue depth. Windows on
created_at so never-started dispatches stay in the corpus. SDK type +
gen:docs/gen:openapi.

Run

  • Warren run: run_5hsgxbe2ph9m
  • Agent: pi
  • Cost: $1.24 (192.6k in / 26.6k out / 2.3M cache-r)

Seeds

  • warren-5423 — GET /analytics/dispatch: created_at-windowed dispatch-context report + gen:docs/gen:openapi

Commits (2)

  • 2d7cf0f seeds: sync 2026-08-19
  • 126ab34 feat(analytics): GET /analytics/dispatch created_at-windowed report (warren-5423)

Files changed

docs/http-api.md                                   |   3 +-
 docs/openapi.yaml                                  |  15 ++
 src/client/types.ts                                |  17 ++
 src/db/repos/dispatch-context.test.ts              |  68 ++++++
 src/db/repos/dispatch-context.ts                   |  76 +++++-
 src/runs/analytics/dispatch-analytics.test.ts      | 114 +++++++++
 src/runs/analytics/dispatch-analytics.ts           |  95 ++++++++
 src/runs/index.ts                                  |   7 +
 src/server/handlers/index.test.ts                  |   1 +
 src/server/handlers/route-table.ts                 |  10 +-
 .../handlers/runs.analytics-dispatch.test.ts       | 266 +++++++++++++++++++++
 src/server/handlers/runs/analytics-dispatch.ts     |  40 ++++
 src/server/handlers/runs/index.ts                  |   1 +
 13 files changed, 710 insertions(+), 3 deletions(-)

Prompt

Show prompt
Work seeds issue warren-5423. First run `sd show warren-5423 --json` from the repo root — the issue body is the full spec; this summary is only a digest.

Context: this is step 5, the final step of Track A (dispatch-context log) of plan pl-a37b for v0.18.0. Everything upstream is MERGED on main and in your workspace: the dispatch_context table + repo (warren-36e7), the provenance fields (warren-9ce3), queue counts + provider kind (warren-e1f1), and the spawnRun writer that populates rows on every dispatch (warren-d6ca). Your job is the read surface.

Scope: add GET /analytics/dispatch to ROUTE_TABLE (src/server/handlers/route-table.ts), policy readOperator, handler beside src/server/handlers/runs/analytics.ts reusing parseAnalyticsWindow. Window on created_at, NOT started_at — listForAnalytics clips on started_at and silently drops never-started dispatches, the rows this report most needs; add a created_at-windowed query. Report: rows joined to run outcome (state, failure_reason, cost_usd, pr_state), grouped counts by dispatch_origin, retry_kind, provider/model, and queue depth at dispatch. Facts and counts only — no scores, no recommendations. Regenerate and commit the generated docs: `bun run gen:docs` and `bun run gen:openapi` (both gates enforce). SDK response type re-exported per the wire-vocabulary rules (src/core/wire.ts is the canonical home if any new enum-shaped wire value appears; check:wire-types guards the run/event/agent stems). No UI page.

Quality gates are terminal: `bun run check:all` must be green before you commit and report done.

When the work is verified, close the issue with `sd close warren-5423 --reason "<one-line evidence>"`, then commit everything.


🤖 Opened by warren run run_5hsgxbe2ph9m

…warren-5423)

Descriptive read surface over dispatch_context: join run outcomes, group
counts by origin/retry_kind/provider-model/queue depth. Windows on
created_at so never-started dispatches stay in the corpus. SDK type +
gen:docs/gen:openapi.
@warren-auto-merge
warren-auto-merge Bot enabled auto-merge (squash) August 19, 2026 19:00
@warren-auto-merge
warren-auto-merge Bot merged commit fad7fe6 into main Aug 19, 2026
8 checks passed
@warren-auto-merge
warren-auto-merge Bot deleted the warren/run_5hsgxbe2ph9m branch August 19, 2026 19: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