Skip to content

run detail Runtime + Spend facts: base commit is blank because runs.bas… - #1224

Merged
jayminwest merged 4 commits into
mainfrom
warren/run_4yfhqbtark5n
Sep 3, 2026
Merged

jayminwest merged 4 commits into
mainfrom
warren/run_4yfhqbtark5n

Conversation

@warren-run-bot

Copy link
Copy Markdown
Collaborator

Summary

copy sweep for pages no other child opens: instance.tsx:180 ('Server id… (#1219)

Run

  • Warren run: run_4yfhqbtark5n
  • Agent: pi
  • Cost: $1.80 (183.8k in / 32.1k out / 9.4M cache-r)

Seeds

  • warren-b19e — run detail Runtime + Spend facts: base commit is blank because runs.base_commit is only the dispatch-time pin (dispatch.ts:148,190) and nothing writes the resolved workspace HEAD — add runs.base_sha written at finalize/reap where commits_ahead is measured (reap/outcome-facts.ts), classify public, render it at side-panels.tsx:85 with the pin as fallback labelled 'base pin'; apply the maxCostUsd overlay in getRunHandler (lifecycle.ts:249-261, today only projectRunsWithCaps does it; RunRow.maxCostUsd? already typed 'absent for detail GETs') so the Spend panel can show '$X of $Y cap'.

Commits (4)

Files changed

.mulch/expertise/analytics.jsonl                   |    1 -
 .mulch/expertise/runtime.jsonl                     |    1 +
 .seeds/issues.jsonl                                |    6 +-
 src/cli/commands/plan-status.test.ts               |    1 +
 src/cli/commands/run.test.ts                       |    1 +
 src/cli/commands/show.test.ts                      |    1 +
 src/cli/commands/wait.test.ts                      |    1 +
 src/client/types.ts                                |   11 +
 src/db/migrations/0056_brown_tiger_shark.sql       |    1 +
 src/db/migrations/meta/0056_snapshot.json          | 1478 ++++++++++++++++++
 src/db/migrations/meta/_journal.json               |    7 +
 src/db/migrations/postgres/0051_wet_purple_man.sql |    1 +
 src/db/migrations/postgres/meta/0051_snapshot.json | 1600 ++++++++++++++++++++
 src/db/migrations/postgres/meta/_journal.json      |    7 +
 src/db/repos/runs-outcome-facts.test.ts            |    4 +
 src/db/repos/runs-outcome-facts.ts                 |    8 +-
 src/db/repos/runs.ts                               |    1 +
 src/db/schema/postgres.ts                          |    2 +
 src/db/schema/sqlite.ts                            |    3 +
 src/runs/reap/outcome-facts.test.ts                |   46 +-
 src/runs/reap/outcome-facts.ts                     |   89 +-
 src/runs/reap/run.test.ts                          |   14 +-
 src/runs/reap/test-helpers.ts                      |   36 +-
 .../handlers/__golden__/envelopes/run-detail.json  |    4 +-
 src/server/handlers/ops-overview.test.ts           |    1 +
 src/server/handlers/runs.projection.test.ts        |   13 +-
 src/server/handlers/runs/lifecycle.ts              |   15 +
 src/ui/src/api/types.ts                            |   16 +-
 src/ui/src/pages/dispatch-plan.tsx                 |    3 +-
 src/ui/src/pages/dispatch-plan/walk-form.tsx       |   12 +-
 src/ui/src/pages/dispatch.tsx                      |    4 +-
 src/ui/src/pages/dispatch/dispatch-form.tsx        |   29 +-
 src/ui/src/pages/event-explorer.tsx                |    3 +-
 src/ui/src/pages/instance.tsx                      |   18 +-
 src/ui/src/pages/login.tsx                         |    2 +-
 .../pages/operations/operations.helpers.test.ts    |    1 +
 src/ui/src/pages/plan-runs.tsx                     |    2 +-
 src/ui/src/pages/project-detail.panels.tsx         |    5 +-
 src/ui/src/pages/run-detail/side-panels.test.ts    |   14 +
 src/ui/src/pages/run-detail/side-panels.tsx        |   40 +-
 src/ui/src/pages/runs.tsx                          |    2 +-
 src/ui/src/pages/runs/runs-card.helpers.test.ts    |    2 +
 src/ui/src/pages/runs/runs-format.test.ts          |    1 +
 src/ui/src/pages/runs/runs-table.test.tsx          |    1 +
 src/ui/src/pages/setup.helpers.ts                  |    3 +-
 src/ui/src/pages/setup.tsx                         |    3 +-
 46 files changed, 3384 insertions(+), 130 deletions(-)

Prompt

Show prompt
Work seeds issue warren-b19e. First run `sd show warren-b19e --json` from the repo root. The issue description is the spec (it carries file:line sites and root causes); this prompt is only a digest.

Context on main: warren-57fb merged the run-detail UI cleanup (Budget -> Spend, SpendPanel, branch row). Build on that. If warren-7116 has also merged (stage timestamp columns on runs), add your column beside them in the same style; otherwise add it standalone.

Scope: (1) the run-detail base commit is blank because runs.base_commit is only the dispatch-time pin and nothing writes the resolved workspace HEAD. Add runs.base_sha (sqlite + postgres drizzle schema, `bun run db:generate` migration pair, drift parity test green) written at finalize/reap where commits_ahead is measured (src/runs/reap/outcome-facts.ts); classify it public in PUBLIC_RUN_FIELDS; add it to RunRow (SDK + UI types, optional); render it in side-panels.tsx with the pin as fallback labelled 'base pin'. (2) Apply the maxCostUsd overlay in getRunHandler in src/runs/lifecycle.ts — today only projectRunsWithCaps does it and RunRow.maxCostUsd is typed 'absent for detail GETs' — so the Spend panel can show '$X of $Y cap'; keep it operator-only like the list overlay. Update the run detail golden/partition tests, `bun run gen:docs` / `bun run gen:openapi` for the run shape.

Repo notes:
- The UI is its own package in src/ui (React + Vite). Run `bun run ui:install` once if node_modules is missing, then `bun run build:ui`. A module the UI imports from outside src/ui must be listed in `include` in src/ui/tsconfig.app.json or the build fails with TS6307.
- If your change alters the UI bundle, run `bun run check:bundle-size --update` and commit the resulting scripts/bundle-size-budgets.json diff (it auto-raises within the cap). Never hand-edit the budget.
- Copy assertions can live in *.test.tsx and __golden__ fixtures; update them together with the copy. Do not put architecture explainers ('control plane', 'materialize', 'harness', 'this instance') in UI copy; label the UI.
- Do only this issue. Do not touch unrelated issues or refactor beyond scope.

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

When done, close the issue with `sd close <id> --reason "<one-paragraph summary of what changed>"` (substitute the issue id), then commit everything including .seeds/. Warren pushes the branch and opens the PR for you; do not open a PR or create another branch yourself.


🤖 Opened by warren run run_4yfhqbtark5n

Add runs.base_sha (sqlite + postgres drizzle schemas, generated migration
pair) — the resolved workspace base SHA, measured at reap where
commits_ahead is measured: outcome-facts now reads git merge-base of the
diff base and the workspace HEAD alongside the numstat pass (single fetch
under the K8s clone path), stamped through RunOutcomeFacts /
RunsRepo.setOutcomeFacts. Classified public in PUBLIC_RUN_FIELDS, added to
the SDK + UI RunRow types, and rendered in the run-detail Runtime panel
with the dispatch-time base_commit pin as a labelled 'base pin' fallback.

Apply the maxCostUsd dispatch-context overlay in getRunHandler too —
today only the runs list did it — so the Spend panel can render '$X of
$Y cap' (plus the mobile % OF CAP arm when both cost and cap exist).
Operator-only, same posture as the list overlay; the run-detail golden
envelope and the projection tests pin the new detail shape.

UI tests, the reap run-row facts test, and the fakeExec helper all
updated for the fifth measured fact.
@jayminwest
jayminwest enabled auto-merge (squash) September 3, 2026 22:42
@jayminwest
jayminwest merged commit 25310f6 into main Sep 3, 2026
8 of 9 checks passed
@jayminwest
jayminwest deleted the warren/run_4yfhqbtark5n branch September 3, 2026 22:44
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