Skip to content

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

Closed
warren-run-bot wants to merge 2 commits into
mainfrom
warren/run_wgvqec21kprf
Closed

warren-run-bot wants to merge 2 commits into
mainfrom
warren/run_wgvqec21kprf

Conversation

@warren-run-bot

Copy link
Copy Markdown
Collaborator

Summary

run detail Runtime+Spend facts (warren-b19e): runs.base_sha measured at reap + maxCostUsd overlay on the detail GET

Run

  • Warren run: run_wgvqec21kprf
  • Agent: pi
  • Cost: $1.66 (94.8k in / 34.5k out / 8.9M 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 (2)

  • 308164a run detail Runtime+Spend facts (warren-b19e): runs.base_sha measured at reap + maxCostUsd overlay on the detail GET
  • 7e027cb seeds: close warren-b19e (run detail base_sha + spend cap overlay)

Files changed

.mulch/expertise/runtime.jsonl                     |   1 -
 .mulch/expertise/telemetry.jsonl                   |   1 -
 .seeds/issues.jsonl                                |  14 +-
 .../scenarios/39-public-exposure.sd-stub.ts        |  26 --
 scripts/acceptance/scenarios/39-public-exposure.ts |  14 +-
 scripts/bundle-size-budgets.json                   |  13 +-
 src/cli/commands/plan-status.test.ts               |   5 +-
 src/cli/commands/run.test.ts                       |   5 +-
 src/cli/commands/show.test.ts                      |   5 +-
 src/cli/commands/wait.test.ts                      |   5 +-
 src/client/types.ts                                |  14 +-
 src/db/migrations/0055_abnormal_sunset_bain.sql    |   1 +
 src/db/migrations/0055_handy_la_nuit.sql           |   4 -
 src/db/migrations/meta/0055_snapshot.json          |  37 +--
 src/db/migrations/meta/_journal.json               |   4 +-
 src/db/migrations/postgres/0050_short_cloak.sql    |   1 +
 .../postgres/0050_third_thunderbolts.sql           |   4 -
 src/db/migrations/postgres/meta/0050_snapshot.json |  32 +-
 src/db/migrations/postgres/meta/_journal.json      |   4 +-
 src/db/repos/runs-outcome-facts.test.ts            |   4 +
 src/db/repos/runs-outcome-facts.ts                 |   9 +-
 src/db/repos/runs-stage.ts                         |  50 ---
 src/db/repos/runs.ts                               |  26 +-
 src/db/schema/postgres.ts                          |   9 +-
 src/db/schema/sqlite.ts                            |  57 ++--
 src/runs/reap/no-changes.test.ts                   |   8 +-
 src/runs/reap/outcome-facts.test.ts                |  34 +-
 src/runs/reap/outcome-facts.ts                     |  92 ++++--
 src/runs/reap/run.test.ts                          |  16 +-
 src/runs/reap/run.ts                               |  24 +-
 src/runs/reap/stage-timestamps.test.ts             | 172 ----------
 src/runs/reap/state.ts                             |   4 -
 src/runtime/k8s/pod-watcher.stage-ready.test.ts    | 101 ------
 src/runtime/k8s/pod-watcher.ts                     |  18 -
 src/runtime/local/boot-backend.ts                  |  12 +-
 src/runtime/local/drive.test.ts                    |  17 +-
 src/runtime/local/drive.ts                         |  15 -
 src/runtime/registry.ts                            |  12 -
 .../handlers/__golden__/envelopes/run-detail.json  |   8 +-
 src/server/handlers/index.test.ts                  |  20 +-
 src/server/handlers/ops-overview.test.ts           |   1 +
 src/server/handlers/projects.ts                    |  40 ++-
 .../handlers/projects.warren-config.public.test.ts | 152 ---------
 src/server/handlers/projects.warren-config.ts      | 125 -------
 src/server/handlers/route-table.ts                 |  17 +-
 src/server/handlers/runs.projection.test.ts        |  10 +-
 src/server/handlers/runs/lifecycle.ts              |  24 +-
 src/server/main/index.ts                           |  25 +-
 src/server/main/runtime-wiring.ts                  |  16 +-
 src/ui/src/api/types.ts                            |  38 +--
 src/ui/src/pages/project-detail-layout.ts          |  21 +-
 src/ui/src/pages/project-detail.panels.tsx         |  16 +-
 .../pages/project-detail.spectator-layout.test.ts  |  22 +-
 src/ui/src/pages/project-detail.tsx                |  45 +--
 src/ui/src/pages/run-detail/side-panels.test.ts    |  12 +
 src/ui/src/pages/run-detail/side-panels.tsx        |  29 +-
 .../src/pages/telemetry/economics-helpers.test.ts  |  72 ----
 src/ui/src/pages/telemetry/economics-helpers.ts    |  53 ---
 src/ui/src/pages/telemetry/economics-panels.tsx    | 364 ---------------------
 src/ui/src/pages/telemetry/economics-tab.tsx       |  31 +-
 60 files changed, 428 insertions(+), 1583 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_wgvqec21kprf

…at reap + maxCostUsd overlay on the detail GET

- add runs.base_sha to the sqlite+postgres drizzle schema (migration pair
  0055_abnormal_sunset_bain / 0050_short_cloak); the reap outcome-facts
  step now also measures the workspace HEAD SHA (764b133 on
  the still-live worktree, the fetched branch tip in the K8s clone) and
  persists it beside commits_ahead (src/runs/reap/outcome-facts.ts)
- classify baseSha public in PUBLIC_RUN_FIELDS; add it to the SDK and UI
  RunRow types; side-panels.tsx renders it as 'base commit', falling back
  to the dispatch-time pin labelled 'base pin'
- getRunHandler now overlays the same operator-only maxCostUsd cap the
  runs list applies, so the Spend panel can render 'OF $Y cap' without
  fabricating numbers (spectators still get no caps)
- update golden run-detail envelope, projection partition test, reap
  test-harness expectations, and UI guard tests; compress a few schema
  comment blocks to stay inside the frozen check:size budgets
@jayminwest

Copy link
Copy Markdown
Owner

Superseded: this branch's base_sha migration collides with #1218 (warren-7116, sqlite 0055 / postgres 0050) and the ref-dispatch repair path failed in warren's migration preflight (spawn.failed: git show origin/main:src/db/migrations/meta/0000_init_snapshot.json does not exist). Re-dispatching warren-b19e fresh on top of main.

@jayminwest jayminwest closed this Sep 3, 2026
@jayminwest
jayminwest deleted the warren/run_wgvqec21kprf branch September 3, 2026 23:13
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