perf(frontend): render bounded task-card trial preview - #1192
Merged
Conversation
One summary row per task version (exact card counters, status buckets, model-grouped cost inputs, last_run_at), refreshed inside the same transaction as every trial-population mutation: create/import, start/reset, completion, cancellation, retry/supersede, scoped deletion, experiment deletion, and default-version selection. Refreshes serialize per version with sorted transaction-scoped advisory locks because concurrent trial inserts hold KEY SHARE FK locks on task_versions. No reader change and no historical scan: the browse endpoint still aggregates on demand, and rows exist only for versions written to after deploy. The read cutover and historical population land separately. Split 1/4 of the #1152 re-land.
Data-only migration: reseed a summary row for every task version, zero every counter, then replay the scoped aggregate and cost-breakdown updates from task_browse_summary_001. Needed because the summary table survived the #1156 revert while write-through maintenance did not, so existing rows are frozen at the 2026-08-11 backfill, versions created since have no row at all, and versions whose scoped trials vanished need resetting. The default browse reader (next split) has no fallback scan when a summary row is missing or stale, so it needs this population to return correct ordering and exact counts for historical tasks. Split 2/4 of the #1152 re-land.
Default GET /tasks/browse ordering and exact card counters now come from task_version_browse_summaries: the page query orders current task versions by the summary's last_run_at and applies the 24-task limit before any trial aggregation, instead of grouping the organization's whole trial history first. Selected cards fetch at most 24 recent current-version trials through an indexed lateral query; total_trials stays exact and latest_trials_truncated marks a shortened preview. Advanced aggregate filters, comparisons, and non-default aggregate sorts keep the on-demand aggregation path. The cost rollup uses the corrected billed_cost_usd key (the billed_usd KeyError 500'd /tasks and caused the #1156 revert); billed-trial coverage now pins it. Split 3/4 of the #1152 re-land; requires the summary maintenance hooks and historical population from the previous splits. Local EXPLAIN (600 tasks / 31k trials): page selection 1,552 -> 161 buffers, 21,085 trial rows -> 0 read at selection time.
Task cards read exact status buckets (pass/partial/fail/harness/ skipped/pending) from the browse response instead of reducing over every returned trial, and show 'Showing the N most recent of M trials' when latest_trials_truncated is set. With the backend cutover capping latest_trials at 24, the hot 97-trial card drops from one tooltip square per historical trial (~8,500 DOM nodes / 3,600 listeners across the grid) to at most 24 squares plus exact counters. Split 4/4 of the #1152 re-land; requires the summary-first browse response fields from the backend cutover split.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 12, 2026
Contributor
Oddish previewCommit:
Vercel deployment URL: https://oddish-ms1t0u18c.oddish.app Plan:
This comment is updated by the PR Preview workflow. |
kyle-compute
changed the base branch from
perf/tasks-browse-cutover
to
staging
August 12, 2026 01:20
kyle-compute
dismissed
cursor[bot]’s stale review
August 12, 2026 01:20
The base branch was changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Why this PR exists
Split structure and merge order
Exact screen, request, and frequency
What this PR changes
What this PR does not change
Historical-data decision
Validation completed
Rollback
Note
Low Risk
Frontend-only reader change for browse cards. Risk is mainly dependency on the new browse response fields from the prior backend cutover.
Overview
Makes task cards work with the bounded browse preview: status breakdowns now come from server-provided counters (
pass_count,partial_count, etc.) instead of reducing over every returned trial.When
latest_trials_truncatedis set, the card shows a note like "Showing the N most recent of M trials" under the preview squares. Pending now uses the summary's single not-yet-terminal bucket rather than summing pending/queued/running preview statuses.Reviewed by Cursor Bugbot for commit dfe2f97. Bugbot is set up for automated code reviews on this repo. Configure here.