Skip to content

Scale correctness for 1000-project workspaces + design-port wave 2 - #167

Merged
Exelord merged 2 commits into
mainfrom
claude/bold-cannon-hmsma2
Jul 26, 2026
Merged

Scale correctness for 1000-project workspaces + design-port wave 2#167
Exelord merged 2 commits into
mainfrom
claude/bold-cannon-hmsma2

Conversation

@Exelord

@Exelord Exelord commented Jul 26, 2026

Copy link
Copy Markdown
Member

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=500 returns a page, and three dashboard sources did fetch a page → .find() in it, so:

  • every project past the page rendered a BLANK detail page (projectSummary found nothing),
  • the ranking card claimed "vs 500 projects" when there were 1000, and ranked within the page,
  • the Projects filter box could never reach a tail project (it filters the fetched rows).

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/projects answers {projects, total}; new /v1/projects/rank (allowlisted).
  • The client-side ranker is replaced by a thin shaper; the Projects table now says "showing N of M projects" 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 — IN ${sql(array)} is the form (the provenanceForHashes precedent). 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".
  • Ranking cardrankProjects had 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.
  • status FactField renders the shared badge instead of bare text.

Gates: oxfmt --check . clean · oxlint --type-aware --type-check 0 · 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

claude added 2 commits July 26, 2026 07:58
…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
@Exelord Exelord changed the title Design-port wave 2: Callout, honest delta bars, ranking axis, status badges Scale correctness for 1000-project workspaces + design-port wave 2 Jul 26, 2026
@Exelord
Exelord merged commit 32faebc into main Jul 26, 2026
3 checks passed
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