Scale correctness for 1000-project workspaces + design-port wave 2 - #167
Merged
Conversation
…badges The first wave shipped under the new visual guard, which reported exactly the three touched pages and left the other six pixel-identical. - Callout: one banner primitive (warn/info/muted + icon) replacing five hand-rolled class strings across four views. - deltaBar column kind: a signed delta now reads as a diverging bar around a shared zero — faster left in green, slower right in red — with a flat band (max 5ms, 0.5% of the baseline) so trivial noise renders neutral instead of the full danger red every non-zero delta used to get. The scale is shared across rows, so +2s and -2s read equal. Reviewing the capture caught a regression before it landed: the first cut mapped a task present in only one run to a zero delta, making "new" read as "no change"; NaN plus a label fallback preserves it. - Ranking card: rankProjects has computed byHitRate since July with no view rendering it. Third axis added, and all three lists gained meters pinned to a 0..1 track, so a 3% failure rate renders as 3%. - status FactField kind renders the shared StatusBadge, so run detail stops showing an outcome as bare text. Baselines refreshed, which refreshes the docs screenshots. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RW7aso5j5CrBo7cjyET23D
…anks
Measured first. A probe seeding 1000 projects x 10 tasks (100k task_runs)
through the real ingest wire showed the failure is correctness, not
latency: /v1/projects?limit=500 returns a PAGE, and three dashboard
sources did "fetch a page then find in it", so
- every project past the page rendered a BLANK detail page,
- the ranking card claimed "vs 500 projects" when there were 1000, and
ranked within the page, and
- the Projects filter box could never reach a tail project.
Payloads were fine (103 KB / 143 ms for 500 projects). The data was wrong.
Fixed where it can be right — server-side. listProjects gains ILIKE
search and exact-name fetch (the point lookup); countProjects is the true
denominator; rankProject computes per-axis ranks with window functions
over every project in one query, returning top-N per axis plus the named
project with its TRUE rank. /v1/projects answers {projects, total}; new
/v1/projects/rank. The client-side ranker is replaced by a thin shaper,
and the Projects table now says "showing N of M" instead of implying the
page is the workspace.
The guard caught a bug in the fix itself: = ANY($1) binds a JS array as a
malformed array literal on this driver, which would have 500'd the
point-lookup route. IN ${sql(array)} is the form, per provenanceForHashes.
Pinned by a scale test seeding 620 projects: the tail project resolves by
exact fetch and by search, ranks #1 by avg exec with total === 620, and a
mid-pack project reports a true rank past the top-8 window.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RW7aso5j5CrBo7cjyET23D
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.
Two things landed on this branch. The scale fix is the important one.
1. Scale: a 1000-project workspace stopped rendering empty pages and wrong ranks
Measured first. A probe seeding 1000 projects × 10 tasks (100k
task_runs) through the real ingest wire showed the failure is correctness, not latency./v1/projects?limit=500returns a page, and three dashboard sources did fetch a page →.find()in it, so:projectSummaryfound nothing),Payloads were fine — 103 KB / 143 ms for 500 projects. The data was simply wrong.
Fixed server-side, the only place it can be right:
listProjects(ws, {limit, search, projects})— server-side ILIKE search + exact-name fetch (the point lookup).countProjects(ws)— the true denominator.rankProject(ws, project)— per-axis ranks via window functions over every project in one query, returning top-N per axis plus the named project with its true rank. Correct at any workspace size./v1/projectsanswers{projects, total}; new/v1/projects/rank(allowlisted).The guard caught a bug in the fix itself:
= ANY($1)binds a JS array as a malformed array literal on this driver —IN ${sql(array)}is the form (theprovenanceForHashesprecedent). That would have 500'd the point-lookup route in production.Pinned by a scale test seeding 620 projects (past the page): the tail project resolves by exact fetch and by search, ranks #1 by avg exec with
total === 620, and a mid-pack project reports a true rank beyond the top-8 window. Wire pinned in the server e2e.Still open (noted in the decision log): wiring server-side search into the table filter boxes (today the box filters the page and the notice tells the truth about it), and a point lookup for the flaky badge (
getFlakiest(100).find()degrades for a task outside the top 100 — degraded, not broken).2. Design-port wave 2
First wave shipped under the new visual guard (#166), which flagged exactly the three touched pages and left the other six pixel-identical.
Callout— one banner primitive replacing five hand-rolled class strings across four views.deltaBar— signed deltas as a diverging bar around a shared zero with a flat band, so trivial noise renders neutral instead of the full danger red every non-zero delta used to get. Reviewing the capture caught a regression before it landed: the first cut mapped a task present in only one run to a zero delta, making "new" read as "no change".rankProjectshad computed a hit-rate axis since July with no view rendering it. Third axis added; all three lists gained meters pinned to a 0..1 track.statusFactField renders the shared badge instead of bare text.Gates:
oxfmt --check .clean ·oxlint --type-aware --type-check0 · cloud 550/0 · core from root 1286/0 · visual guard 10/10 (the ranking card renders identically off the new server source — free functional-equivalence confirmation). No schema/CACHE bump.🤖 Generated with Claude Code
https://claude.ai/code/session_01RW7aso5j5CrBo7cjyET23D