Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .claude/agents/ingest.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You ingest benchmark runs from `SemiAnalysisAI/InferenceX` GitHub Actions into t
cd /Users/quilicic/InferenceX-app/packages/db
DATABASE_WRITE_URL='<provided direct non-pooled write URL>' \
GITHUB_TOKEN=$(gh auth token) \
pnpm exec tsx src/ingest-ci-run.ts --download <RUN_ID> SemiAnalysisAI/InferenceX
bun src/ingest-ci-run.ts --download <RUN_ID> SemiAnalysisAI/InferenceX
```

Then refresh the materialized view (the script's auto-refresh sometimes races):
Expand Down Expand Up @@ -118,7 +118,7 @@ cd /Users/quilicic/InferenceX-app/packages/db
INGEST_RUN_ID=$RID INGEST_RUN_ATTEMPT=1 INGEST_ARTIFACTS_PATH=$TMPDIR INGEST_REPO=SemiAnalysisAI/InferenceX \
DATABASE_WRITE_URL='<provided direct non-pooled write URL>' \
GITHUB_TOKEN=$(gh auth token) \
pnpm exec tsx src/ingest-ci-run.ts
bun src/ingest-ci-run.ts
rm -rf $TMPDIR
```

Expand Down Expand Up @@ -162,7 +162,7 @@ If the user doesn't specify a description, DO NOT skip the entry and DO NOT bloc
- **Multi-attempt artifacts**: a single GitHub run can spill across runners (`h200-cw_00` + `h200-dgxc-slurm_1`); the logical-name dedup strips the `_<runner>_<attempt>` suffix.
- **Materialized view dedup tiebreaker**: `latest_benchmarks` picks rows by `date DESC, wr.run_started_at DESC`. Backfilling old data may not surface unless dates align with the user's date picker selection.
- **Date alignment for partial runs**: when a re-run only covers a subset of concs (`replace ONLY the points this run produces`), align dates with prior full sweep via `UPDATE benchmark_results.date = '<full-sweep-date>'` so the frontend's max-date-per-group dedup doesn't drop the older sweep.
- **Agentic interactivity normalization (`*_intvty`)**: for `agentic_traces` runs, interactivity MUST be the slow-tail reciprocal of the ITL percentile — `*_intvty = 1/*_itl` (so `p90_intvty = 1/p90_itl`). Some harness versions emit `*_intvty` as `p(1/ITL)` instead (fast-tail — inverts percentile order, e.g. p90 shows ~`1/p10(ITL)`), which silently contaminates cross-run Pareto comparisons. The ingest mapper (`benchmark-mapper.ts`) now **derives `*_intvty` from `*_itl` and discards the artifact's value** for agentic rows, so a normal ingest is self-correcting — no manual step needed. The frontend `agenticAliases` does the same for overlay / `?unofficialrun=` rows. If you ever load agentic data through a path that bypasses the mapper, run `pnpm --filter @semianalysisai/inferencex-db db:backfill-agentic-intvty --yes` (idempotent; rewrites `mean/p75/p90/p95 _intvty = 1/_itl`) then refresh the MV + purge cache. `std_intvty` is intentionally left alone (the reciprocal of a std is meaningless; the API strips it anyway).
- **Agentic interactivity normalization (`*_intvty`)**: for `agentic_traces` runs, interactivity MUST be the slow-tail reciprocal of the ITL percentile, so `p90_intvty = 1/p90_itl`. Some harness versions emit `p(1/ITL)` instead, which inverts percentile order and contaminates cross-run Pareto comparisons. The ingest mapper derives `*_intvty` from `*_itl` and discards the artifact value for agentic rows. The frontend `agenticAliases` does the same for overlay and `?unofficialrun=` rows. Do not ingest through a path that bypasses these normalizers; the retired one-shot backfill is no longer available. `std_intvty` stays unchanged because the reciprocal of a standard deviation is meaningless, and the API strips it.

## Process

Expand All @@ -180,7 +180,7 @@ This agent ingests **benchmark runs**. The HF agentic trace **datasets** (`semia

```bash
cd packages/db && DATABASE_WRITE_URL='<direct write url>' \
pnpm exec tsx src/ingest-weka-dataset.ts <hf-dataset-id> \
bun src/ingest-weka-dataset.ts <hf-dataset-id> \
[--label "…"] [--variant full|256k] [--description "…"] [--limit N]
```

Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/debug.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
allowed-tools: Bash(git log:*), Bash(git diff:*), Bash(git blame:*), Bash(pnpm test:*), Bash(pnpm typecheck*), Bash(pnpm lint*), Bash(pnpm dev*), Bash(curl:*), Read, Glob, Grep
allowed-tools: Bash(git log:*), Bash(git diff:*), Bash(git blame:*), Bash(bun run test:*), Bash(bun run typecheck*), Bash(bun run lint*), Bash(bun run dev*), Bash(curl:*), Read, Glob, Grep
description: Systematic debugging — root cause before fixes
---

Expand Down Expand Up @@ -57,7 +57,7 @@ BEFORE attempting ANY fix:

1. **Create Failing Test** — regression test reproducing the bug with exact triggering input (per CLAUDE.md testing requirements)
2. **Implement Single Fix** — address root cause, ONE change, no "while I'm here" improvements
3. **Verify Fix** — run `pnpm test:unit` and `pnpm typecheck`, confirm no other tests broken
3. **Verify Fix** — run `bun run test:unit` and `bun run typecheck`, confirm no other tests broken

## Red Flags — STOP and Return to Phase 1

Expand Down
10 changes: 5 additions & 5 deletions .claude/commands/fix.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
allowed-tools: Bash(pnpm build*), Bash(pnpm typecheck*), Bash(pnpm lint*), Bash(pnpm fmt*), Read, Edit, Glob, Grep
allowed-tools: Bash(bun run build*), Bash(bun run typecheck*), Bash(bun run lint*), Bash(bun run fmt*), Read, Edit, Glob, Grep
description: Incrementally fix build, type, and lint errors with minimal safe changes
---

Expand All @@ -12,14 +12,14 @@ Incrementally fix build and type errors with minimal, safe changes.
Run all checks and capture errors:

```bash
pnpm typecheck 2>&1
pnpm lint 2>&1
bun run typecheck 2>&1
bun run lint 2>&1
```

If both pass, run the full build:

```bash
pnpm build 2>&1
bun run build 2>&1
```

If everything passes, announce "All checks pass — nothing to fix." and stop.
Expand Down Expand Up @@ -47,7 +47,7 @@ For each error:
- A fix introduces **more errors than it resolves**
- The **same error persists after 3 attempts**
- The fix requires **architectural changes** or touching >3 files
- Errors stem from **missing dependencies** (need `pnpm install`)
- Errors stem from **missing dependencies** (need `bun install`)

## Step 5: Summary

Expand Down
14 changes: 7 additions & 7 deletions .claude/commands/verify.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
allowed-tools: Bash(pnpm test:*), Bash(pnpm typecheck*), Bash(pnpm lint*), Bash(pnpm build*), Bash(pnpm dev*), Bash(pnpm fmt*), Bash(curl:*), Bash(git diff:*), Bash(git status*), Read, Glob, Grep
allowed-tools: Bash(bun run test:*), Bash(bun run typecheck*), Bash(bun run lint*), Bash(bun run build*), Bash(bun run dev*), Bash(bun run fmt*), Bash(curl:*), Bash(git diff:*), Bash(git status*), Read, Glob, Grep
description: Verify work is complete before committing — evidence before claims
---

Expand Down Expand Up @@ -34,39 +34,39 @@ Run each step. Report the actual output — not what you expect.
### 1. Type checking

```bash
pnpm typecheck
bun run typecheck
```

Required: exit 0, no errors

### 2. Linting

```bash
pnpm lint
bun run lint
```

Required: exit 0, no errors

### 3. Formatting

```bash
pnpm fmt
bun run fmt
```

Required: exit 0, no formatting issues

### 4. Unit tests

```bash
pnpm test:unit
bun run test:unit
```

Required: all tests pass, 0 failures

### 5. Dev server starts

```bash
pnpm dev --hostname 0.0.0.0 --port 3000 &
bun run dev -- --hostname 0.0.0.0 --port 3000 &
curl --retry 10 --retry-delay 2 --retry-connrefused -sSf http://localhost:3000 >/dev/null
```

Expand All @@ -75,7 +75,7 @@ Required: server responds successfully
### 6. E2E tests

```bash
pnpm test:e2e
bun run test:e2e
```

Required: all tests pass
Expand Down
4 changes: 2 additions & 2 deletions .claude/commands/write-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ Use this format:
[Exact test code]

- [ ] **Step 2: Run test to verify it fails**
Run: `pnpm test:unit -- path/to/test`
Run: `bun run test:unit -- path/to/test`
Expected: FAIL

- [ ] **Step 3: Write minimal implementation**
[Exact implementation code]

- [ ] **Step 4: Run test to verify it passes**
Run: `pnpm test:unit -- path/to/test`
Run: `bun run test:unit -- path/to/test`
Expected: PASS

- [ ] **Step 5: Commit**
Expand Down
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"hooks": [
{
"type": "command",
"command": "pnpm fmt:fix; pnpm lint:fix; true",
"command": "bun run fmt:fix; bun run lint:fix; true",
"timeout": 10,
"async": true
}
Expand Down
4 changes: 2 additions & 2 deletions .claude/skills/write-inferencex-blog/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ The editor runs as a background Node process on `127.0.0.1:4747`, reads from and

While the user reviews in the browser, you can:

- Run `pnpm lint && pnpm typecheck` against the working tree to catch any MDX errors that would block the pre-commit hook later.
- Run `bun run lint && bun run typecheck` against the working tree to catch any MDX errors that would block the pre-commit hook later.
- Save the chart image into `packages/app/public/images/{slug}/benchmark-light.png` (and `benchmark-dark.png` if the user provided both) so the `<Figure>` placeholder in the preview shows a real path.

**Concurrent-edit collision warning.** The browser editor auto-saves the user's textarea ~800 ms after their last keystroke. If you re-edit a paragraph the user has open in CodeMirror, your `Edit` call writes to disk first, then the editor's debounced save overwrites your change with the user's stale buffer the next time they type or the timer fires. Failure mode: user asks you to expand a paragraph, you expand it on disk, user types one more character in the browser, the one-liner comes back. When you need to edit a section the user is actively working on, **tell the user explicitly to either close the browser tab or hit the "↻ Reload from disk" button before resuming editing**. Don't rely on them noticing the collision — it looks like nothing happened from their side.
Expand All @@ -342,7 +342,7 @@ git push -u origin blog/{slug}
gh pr create --title "feat(blog): ..." --body "..."
```

The pre-commit hook runs `oxlint`, `oxfmt`, and `tsc --noEmit`. All three must pass. If lint/format fails, run `pnpm lint:fix && pnpm fmt:fix` and re-commit (don't `--no-verify`).
The pre-commit hook runs `oxlint`, `oxfmt`, and `tsc --noEmit`. All three must pass. If lint/format fails, run `bun run lint:fix && bun run fmt:fix` and re-commit (don't `--no-verify`).

After the PR opens, expect Cursor Bugbot to flag correctness issues in the prose (numeric overstatement, claims contradicted by tables, wrong attribution). Treat its findings as real review comments — fix them in a follow-up commit, then resolve the threads. Branch protection on master requires resolved review threads before auto-merge fires.

Expand Down
8 changes: 4 additions & 4 deletions .github/claude/implement-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ This prompt is runtime context. Do not assume any file path from it without veri
- If you touched inference or evaluation, verify the unofficial-run overlay path too. AGENTS.md §"Unofficial Run Support" lists the exact code paths and the `?unofficialrun=<github-actions-run-id>` URL pattern; do not skip it.
- New interactive elements get a `track()` call per AGENTS.md §"Analytics Requirement" (`[section]_[action]` naming).
- Tests added/updated per `docs/testing.md` (unit tests colocated as `<module>.test.ts`; E2E tests in `packages/app/cypress/e2e/`). Missing or low-quality tests are blocking.
- Run `pnpm typecheck && pnpm lint && pnpm test:unit && pnpm test:e2e` — all green before commit.
- Run `bun run typecheck && bun run lint && bun run test:unit && bun run test:e2e` — all green before commit.
- code — backend / DB / ETL / ingest / lib / API-route logic, no UI surface:
- Add or update colocated unit tests (`<module>.test.ts`) per `docs/testing.md`; run `pnpm typecheck && pnpm lint && pnpm test:unit`.
- Add or update colocated unit tests (`<module>.test.ts`) per `docs/testing.md`; run `bun run typecheck && bun run lint && bun run test:unit`.
- Only if your change turns out to be user-visible: self-provision a browser (see "Browser verification"), then apply the `ui` rules above.
- docs — markdown / blog content / config / CI workflow files:
- Make the change; sanity-check links, frontmatter, and formatting. No app build, browser, or e2e ceremony is required. Run `pnpm typecheck` / `pnpm lint` only if you touched TS/JS.
- Make the change; sanity-check links, frontmatter, and formatting. No app build, browser, or e2e ceremony is required. Run `bun run typecheck` / `bun run lint` only if you touched TS/JS.
- question — a question or code explanation with no file change:
- Answer concisely and accurately, citing `file:line`. Do not modify code unless the user asks you to.

Expand All @@ -33,7 +33,7 @@ A browser MCP server is always wired (see "Routing" for which). Browsers and the

- Playwright MCP (server "playwright"): DOM interactions, screenshots, and coordinate-based mouse wheel + drag (needed for D3 zoom/pan). Console via `mcp__playwright__browser_console_messages`, network via `mcp__playwright__browser_network_requests`, JS via `mcp__playwright__browser_evaluate`.
- Chrome DevTools MCP (server "chrome"): uid-driven. Call `mcp__chrome__take_snapshot` BEFORE click/fill/hover (uids change after navigation — re-snapshot if one fails); screenshot with `take_screenshot`; debug with `list_console_messages` / `list_network_requests` / `evaluate_script`.
- If the dev server shows as "not started" but your task needs a browser: run `npx -y playwright install --with-deps chromium`, then `pnpm run dev > /tmp/next-dev.log 2>&1 &`, then wait for `curl -sSf http://localhost:3000`.
- If the dev server shows as "not started" but your task needs a browser: run `bunx playwright install --with-deps chromium`, then `bun run dev > /tmp/next-dev.log 2>&1 &`, then wait for `curl -sSf http://localhost:3000`.
- The app runs at http://localhost:3000. For docs or external URLs, use WebFetch.

## Workflow
Expand Down
4 changes: 2 additions & 2 deletions .github/claude/review-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ You are reviewing code for the InferenceX App — a Next.js frontend dashboard f

The PR's code is checked out and a Next.js dev server has been started (best-effort) at `http://localhost:3000`, backed by the **real read-only database** so charts render real data; its status is in the `dev server:` line at the very top of this prompt. **Don't just read the diff — verify the changed behavior actually works at runtime.** This runtime check is the thing the regular CI can't do; plain correctness is already covered (see step 3).

1. If the `dev server:` line is not `true`, start it yourself and wait: `pnpm run dev > /tmp/next-dev.log 2>&1 &` then poll `curl -sSf http://localhost:3000`. If it still won't start, `tail -n 200 /tmp/next-dev.log`, report that as a 🔴 BLOCKING finding, and fall back to a static review.
1. If the `dev server:` line is not `true`, start it yourself and wait: `bun run dev > /tmp/next-dev.log 2>&1 &` then poll `curl -sSf http://localhost:3000`. If it still won't start, `tail -n 200 /tmp/next-dev.log`, report that as a 🔴 BLOCKING finding, and fall back to a static review.
2. Use the **Playwright MCP** (`mcp__playwright__*`) to load the screens and flows this PR changes and confirm they work **as the PR intends**: charts render real data (no "No data available" / "Please change the model…"), the changed interactions/filters/zoom/tooltips behave, and there are no blocking console errors (`mcp__playwright__browser_console_messages`). Save screenshots as evidence. For inference/evaluation changes, also verify the `?unofficialrun=<github-actions-run-id>` overlay path (see AGENTS.md §"Unofficial Run Support").
3. Do NOT re-run the test suite. The dedicated CI workflows (`tests-unit`, `tests-e2e`, `lint`) already run `typecheck` / `lint` / `test:unit` and the fixtures-based Cypress e2e on this PR. Check their status with the GitHub CI tools (`mcp__github_ci__*`) or `gh pr checks`; if any is failing, pull the failing output and fold it into the review as a 🔴 BLOCKING finding. Do **not** run `pnpm test:e2e` here — Cypress integration needs a fixtures build (`E2E_FIXTURES=1` + `pnpm start`), not this real-data dev server, so it would fail spuriously. Use `Bash` only for targeted investigation of a specific failure.
3. Do NOT re-run the test suite. The dedicated CI workflows (`tests-unit`, `tests-e2e`, `lint`) already run `typecheck` / `lint` / `test:unit` and the fixtures-based Cypress e2e on this PR. Check their status with the GitHub CI tools (`mcp__github_ci__*`) or `gh pr checks`; if any is failing, pull the failing output and fold it into the review as a 🔴 BLOCKING finding. Do **not** run `bun run test:e2e` here — Cypress integration needs a fixtures build (`E2E_FIXTURES=1` + `bun run start`), not this real-data dev server, so it would fail spuriously. Use `Bash` only for targeted investigation of a specific failure.
4. Fold what you find — runtime breakage, console errors, charts that don't render, failing CI — into the review alongside the static findings below. Anchor inline comments to the responsible lines in the diff.

For changes with no UI surface (DB/ETL/lib/config), browser verification may not apply — lean on the static review and the CI status from step 3.
Expand Down
27 changes: 17 additions & 10 deletions .github/workflows/apply-run-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,40 @@ jobs:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: Setup Bun
id: setup-bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version-file: package.json
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
cache: pnpm
- name: Cache Bun packages
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ runner.arch }}-${{ steps.setup-bun.outputs.bun-version }}-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-${{ runner.arch }}-${{ steps.setup-bun.outputs.bun-version }}-
- name: Install dependencies
run: >-
pnpm install --frozen-lockfile
--filter @semianalysisai/inferencex-db...
--filter @semianalysisai/inferencex-app...
run: bun install --frozen-lockfile
env:
CYPRESS_INSTALL_BINARY: '0'

- name: Apply run overrides
env:
DATABASE_WRITE_URL: ${{ secrets.DATABASE_WRITE_URL }}
run: pnpm admin:db:apply-overrides --yes
run: bun run admin:db:apply-overrides --yes

- name: Verify database
env:
DATABASE_WRITE_URL: ${{ secrets.DATABASE_WRITE_URL }}
run: pnpm admin:db:verify
run: bun run admin:db:verify

- name: Invalidate production cache
env:
INVALIDATE_SECRET: ${{ secrets.VERCEL_INVALIDATE_SECRET }}
run: pnpm admin:cache:invalidate https://inferencex.semianalysis.com
run: bun run admin:cache:invalidate https://inferencex.semianalysis.com

- name: Warm production cache
run: pnpm admin:cache:warmup https://inferencex.semianalysis.com
run: bun run admin:cache:warmup https://inferencex.semianalysis.com
Loading
Loading