refactor(dashboard): group run/db/artifact/hook lib modules into folders#63
Conversation
Pure move: git mv the run-*, db-run, db-batch, artifact-tokens,
trace-artifacts, artifacts, use-search-param, and use-copied-flag modules
in apps/dashboard/src/lib/ into runs/, db/, artifacts/, and hooks/
folders, and rewrite every @/lib/<old> specifier (plus the handful of
relative imports and doc-comment references) to match. No logic changes.
- run-columns.ts, run-diff.ts, run-outcome.ts, run-read-model.ts,
run-groups-page.ts, run-results-page.ts, runs-filters.ts,
runs-filters-where.ts, db-run.ts -> runs/{columns,diff,outcome,
read-model,groups-page,results-page,filters,filters-where,db}.ts
- db-batch.ts -> db/batch.ts
- artifact-tokens.ts, trace-artifacts.ts, artifacts.ts ->
artifacts/{tokens,trace,store}.ts
- use-search-param.ts, use-copied-flag.ts -> hooks/use-{search-param,
copied-flag}.ts
Deliberately no index.ts barrel files in runs/, db/, artifacts/, or
hooks/, matching the repo's existing no-barrel convention.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
wrightful | 285b525 | Jul 23 2026, 11:26 AM |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR adds shared database, run-query, filtering, run-diff, outcome, URL-state, copy-feedback, and trace-presence helpers. It updates dashboard consumers, tests, comments, schema references, and documentation to use canonical module paths. ChangesDashboard helpers and module paths
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/dashboard/src/lib/hooks/use-copied-flag.ts`:
- Around line 26-33: Update the useCopiedFlag hook’s flash callback and cleanup
to track whether the component is mounted, and return immediately when flash is
invoked after unmount. Ensure asynchronous callers such as artifacts-rail.tsx
and errors-tab.tsx cannot schedule a timer or call setCopied after cleanup.
In `@apps/dashboard/src/lib/runs/filters.ts`:
- Around line 90-94: Update parsePage to validate that raw is a complete numeric
token before conversion, rejecting values such as “2oops” and falling back to 1.
Apply the same full-token validation to the PR filter parsing logic around the
corresponding lines, preserving the documented invalid-input fallback and exact
PR filter behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b0837e9-253f-4c15-a5de-aa8037a04365
📒 Files selected for processing (122)
AGENTS.mdapps/dashboard/db/schema.tsapps/dashboard/middleware/00.cache.tsapps/dashboard/pages/invite/[token]/index.server.tsapps/dashboard/pages/oauth/consent.server.tsapps/dashboard/pages/settings/teams/[teamSlug]/audit.server.tsapps/dashboard/pages/settings/teams/[teamSlug]/general.server.tsapps/dashboard/pages/settings/teams/[teamSlug]/members.tsxapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.tsxapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/diff.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/diff.tsxapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/index.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests/[testId]/index.server.tsapps/dashboard/routes/api/artifacts/[id]/download.tsapps/dashboard/routes/api/artifacts/[id]/upload.tsapps/dashboard/routes/api/artifacts/register.tsapps/dashboard/routes/api/github/setup.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/export/runs.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/diff.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/groups.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/results.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/summary.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/replay.tsapps/dashboard/routes/api/v1/runs/[runId]/index.tsapps/dashboard/routes/api/v1/runs/[runId]/tests.tsapps/dashboard/routes/api/v1/runs/index.tsapps/dashboard/src/__tests__/artifact-origin-safety.workers.test.tsapps/dashboard/src/__tests__/artifact-response.workers.test.tsapps/dashboard/src/__tests__/artifact-tokens.workers.test.tsapps/dashboard/src/__tests__/artifacts-pipeline.test.tsapps/dashboard/src/__tests__/db-batch.workers.test.tsapps/dashboard/src/__tests__/download-route.workers.test.tsapps/dashboard/src/__tests__/export-where.workers.test.tsapps/dashboard/src/__tests__/github-pr-comment.workers.test.tsapps/dashboard/src/__tests__/mcp-server.workers.test.tsapps/dashboard/src/__tests__/pg-integration/analytics-numeric.test.tsapps/dashboard/src/__tests__/pg-integration/ingest.test.tsapps/dashboard/src/__tests__/pg-integration/pagination.test.tsapps/dashboard/src/__tests__/r2-live.test.tsapps/dashboard/src/__tests__/run-columns.test.tsapps/dashboard/src/__tests__/run-diff-resolve.workers.test.tsapps/dashboard/src/__tests__/run-diff.workers.test.tsapps/dashboard/src/__tests__/run-outcome-totals.workers.test.tsapps/dashboard/src/__tests__/run-read-model.workers.test.tsapps/dashboard/src/__tests__/run-results-page.workers.test.tsapps/dashboard/src/__tests__/runs-filters-pr-commit.workers.test.tsapps/dashboard/src/__tests__/runs-filters-where.workers.test.tsapps/dashboard/src/__tests__/scope-where.workers.test.tsapps/dashboard/src/__tests__/test-artifact-actions-signing.test.tsapps/dashboard/src/__tests__/trace-artifacts.test.tsapps/dashboard/src/__tests__/trace-viewer-dialog.test.tsxapps/dashboard/src/__tests__/usage.workers.test.tsapps/dashboard/src/__tests__/user-teardown.workers.test.tsapps/dashboard/src/components/artifacts-rail.tsxapps/dashboard/src/components/attempt-tabs.tsxapps/dashboard/src/components/run-history-branch-filter.tsxapps/dashboard/src/components/run-list-row.tsxapps/dashboard/src/components/run-progress-group.tsxapps/dashboard/src/components/run-progress.tsxapps/dashboard/src/components/runs-filter-bar.tsxapps/dashboard/src/components/trace-viewer-dialog.tsxapps/dashboard/src/components/visual-diff-dialog.tsxapps/dashboard/src/lib/action-errors.tsapps/dashboard/src/lib/analytics/filters.tsapps/dashboard/src/lib/api-response-types.tsapps/dashboard/src/lib/artifacts/serve.tsapps/dashboard/src/lib/artifacts/store.tsapps/dashboard/src/lib/artifacts/tokens.tsapps/dashboard/src/lib/artifacts/trace.tsapps/dashboard/src/lib/billing/polar-webhook.tsapps/dashboard/src/lib/command-search.tsapps/dashboard/src/lib/content-types.tsapps/dashboard/src/lib/date-range-presets.tsapps/dashboard/src/lib/db/batch.tsapps/dashboard/src/lib/db/query-tags.tsapps/dashboard/src/lib/db/sql-ops.tsapps/dashboard/src/lib/export.tsapps/dashboard/src/lib/github-checks.tsapps/dashboard/src/lib/github-pr-comment.tsapps/dashboard/src/lib/hooks/use-copied-flag.tsapps/dashboard/src/lib/hooks/use-search-param.tsapps/dashboard/src/lib/ingest.tsapps/dashboard/src/lib/invites.tsapps/dashboard/src/lib/mcp/queries.tsapps/dashboard/src/lib/mcp/server.tsapps/dashboard/src/lib/members-repo.tsapps/dashboard/src/lib/monitors/http/uptime-analytics.tsapps/dashboard/src/lib/monitors/monitors-repo.tsapps/dashboard/src/lib/monitors/scheduler.tsapps/dashboard/src/lib/owners-repo.tsapps/dashboard/src/lib/page-window.tsapps/dashboard/src/lib/project-teardown.tsapps/dashboard/src/lib/provisioning.tsapps/dashboard/src/lib/retention.tsapps/dashboard/src/lib/runs/columns.tsapps/dashboard/src/lib/runs/db.tsapps/dashboard/src/lib/runs/diff.tsapps/dashboard/src/lib/runs/filters-where.tsapps/dashboard/src/lib/runs/filters.tsapps/dashboard/src/lib/runs/groups-page.tsapps/dashboard/src/lib/runs/outcome.tsapps/dashboard/src/lib/runs/read-model.tsapps/dashboard/src/lib/runs/results-page.tsapps/dashboard/src/lib/schemas.tsapps/dashboard/src/lib/test-artifact-actions.tsapps/dashboard/src/lib/trace-presence.tsapps/dashboard/src/lib/usage.tsapps/dashboard/src/lib/user-teardown.tsapps/dashboard/src/realtime/project-feed.tsapps/dashboard/src/realtime/use-project-room.tsapps/dashboard/src/trace-viewer/components/errors-tab.tsxdocs/ARCHITECTURE.mdpackages/e2e/src/e2e.test.tspackages/e2e/tests-dashboard/test-replay.spec.tspackages/reporter/src/__tests__/contract.test.ts
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/dashboard/src/lib/hooks/use-copied-flag.ts`:
- Around line 26-33: Update the useCopiedFlag hook’s flash callback and cleanup
to track whether the component is mounted, and return immediately when flash is
invoked after unmount. Ensure asynchronous callers such as artifacts-rail.tsx
and errors-tab.tsx cannot schedule a timer or call setCopied after cleanup.
In `@apps/dashboard/src/lib/runs/filters.ts`:
- Around line 90-94: Update parsePage to validate that raw is a complete numeric
token before conversion, rejecting values such as “2oops” and falling back to 1.
Apply the same full-token validation to the PR filter parsing logic around the
corresponding lines, preserving the documented invalid-input fallback and exact
PR filter behavior.
🪄 Autofix (Beta)
❌ Autofix failed (check again to retry)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b0837e9-253f-4c15-a5de-aa8037a04365
📒 Files selected for processing (122)
AGENTS.mdapps/dashboard/db/schema.tsapps/dashboard/middleware/00.cache.tsapps/dashboard/pages/invite/[token]/index.server.tsapps/dashboard/pages/oauth/consent.server.tsapps/dashboard/pages/settings/teams/[teamSlug]/audit.server.tsapps/dashboard/pages/settings/teams/[teamSlug]/general.server.tsapps/dashboard/pages/settings/teams/[teamSlug]/members.tsxapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/index.tsxapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/diff.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/diff.tsxapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/index.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/index.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests/[testId]/index.server.tsapps/dashboard/routes/api/artifacts/[id]/download.tsapps/dashboard/routes/api/artifacts/[id]/upload.tsapps/dashboard/routes/api/artifacts/register.tsapps/dashboard/routes/api/github/setup.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/export/runs.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/diff.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/groups.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/results.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/summary.tsapps/dashboard/routes/api/t/[teamSlug]/p/[projectSlug]/runs/[runId]/tests/[testResultId]/replay.tsapps/dashboard/routes/api/v1/runs/[runId]/index.tsapps/dashboard/routes/api/v1/runs/[runId]/tests.tsapps/dashboard/routes/api/v1/runs/index.tsapps/dashboard/src/__tests__/artifact-origin-safety.workers.test.tsapps/dashboard/src/__tests__/artifact-response.workers.test.tsapps/dashboard/src/__tests__/artifact-tokens.workers.test.tsapps/dashboard/src/__tests__/artifacts-pipeline.test.tsapps/dashboard/src/__tests__/db-batch.workers.test.tsapps/dashboard/src/__tests__/download-route.workers.test.tsapps/dashboard/src/__tests__/export-where.workers.test.tsapps/dashboard/src/__tests__/github-pr-comment.workers.test.tsapps/dashboard/src/__tests__/mcp-server.workers.test.tsapps/dashboard/src/__tests__/pg-integration/analytics-numeric.test.tsapps/dashboard/src/__tests__/pg-integration/ingest.test.tsapps/dashboard/src/__tests__/pg-integration/pagination.test.tsapps/dashboard/src/__tests__/r2-live.test.tsapps/dashboard/src/__tests__/run-columns.test.tsapps/dashboard/src/__tests__/run-diff-resolve.workers.test.tsapps/dashboard/src/__tests__/run-diff.workers.test.tsapps/dashboard/src/__tests__/run-outcome-totals.workers.test.tsapps/dashboard/src/__tests__/run-read-model.workers.test.tsapps/dashboard/src/__tests__/run-results-page.workers.test.tsapps/dashboard/src/__tests__/runs-filters-pr-commit.workers.test.tsapps/dashboard/src/__tests__/runs-filters-where.workers.test.tsapps/dashboard/src/__tests__/scope-where.workers.test.tsapps/dashboard/src/__tests__/test-artifact-actions-signing.test.tsapps/dashboard/src/__tests__/trace-artifacts.test.tsapps/dashboard/src/__tests__/trace-viewer-dialog.test.tsxapps/dashboard/src/__tests__/usage.workers.test.tsapps/dashboard/src/__tests__/user-teardown.workers.test.tsapps/dashboard/src/components/artifacts-rail.tsxapps/dashboard/src/components/attempt-tabs.tsxapps/dashboard/src/components/run-history-branch-filter.tsxapps/dashboard/src/components/run-list-row.tsxapps/dashboard/src/components/run-progress-group.tsxapps/dashboard/src/components/run-progress.tsxapps/dashboard/src/components/runs-filter-bar.tsxapps/dashboard/src/components/trace-viewer-dialog.tsxapps/dashboard/src/components/visual-diff-dialog.tsxapps/dashboard/src/lib/action-errors.tsapps/dashboard/src/lib/analytics/filters.tsapps/dashboard/src/lib/api-response-types.tsapps/dashboard/src/lib/artifacts/serve.tsapps/dashboard/src/lib/artifacts/store.tsapps/dashboard/src/lib/artifacts/tokens.tsapps/dashboard/src/lib/artifacts/trace.tsapps/dashboard/src/lib/billing/polar-webhook.tsapps/dashboard/src/lib/command-search.tsapps/dashboard/src/lib/content-types.tsapps/dashboard/src/lib/date-range-presets.tsapps/dashboard/src/lib/db/batch.tsapps/dashboard/src/lib/db/query-tags.tsapps/dashboard/src/lib/db/sql-ops.tsapps/dashboard/src/lib/export.tsapps/dashboard/src/lib/github-checks.tsapps/dashboard/src/lib/github-pr-comment.tsapps/dashboard/src/lib/hooks/use-copied-flag.tsapps/dashboard/src/lib/hooks/use-search-param.tsapps/dashboard/src/lib/ingest.tsapps/dashboard/src/lib/invites.tsapps/dashboard/src/lib/mcp/queries.tsapps/dashboard/src/lib/mcp/server.tsapps/dashboard/src/lib/members-repo.tsapps/dashboard/src/lib/monitors/http/uptime-analytics.tsapps/dashboard/src/lib/monitors/monitors-repo.tsapps/dashboard/src/lib/monitors/scheduler.tsapps/dashboard/src/lib/owners-repo.tsapps/dashboard/src/lib/page-window.tsapps/dashboard/src/lib/project-teardown.tsapps/dashboard/src/lib/provisioning.tsapps/dashboard/src/lib/retention.tsapps/dashboard/src/lib/runs/columns.tsapps/dashboard/src/lib/runs/db.tsapps/dashboard/src/lib/runs/diff.tsapps/dashboard/src/lib/runs/filters-where.tsapps/dashboard/src/lib/runs/filters.tsapps/dashboard/src/lib/runs/groups-page.tsapps/dashboard/src/lib/runs/outcome.tsapps/dashboard/src/lib/runs/read-model.tsapps/dashboard/src/lib/runs/results-page.tsapps/dashboard/src/lib/schemas.tsapps/dashboard/src/lib/test-artifact-actions.tsapps/dashboard/src/lib/trace-presence.tsapps/dashboard/src/lib/usage.tsapps/dashboard/src/lib/user-teardown.tsapps/dashboard/src/realtime/project-feed.tsapps/dashboard/src/realtime/use-project-room.tsapps/dashboard/src/trace-viewer/components/errors-tab.tsxdocs/ARCHITECTURE.mdpackages/e2e/src/e2e.test.tspackages/e2e/tests-dashboard/test-replay.spec.tspackages/reporter/src/__tests__/contract.test.ts
🛑 Comments failed to post (2)
apps/dashboard/src/lib/hooks/use-copied-flag.ts (1)
26-33: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Guard
flash()after unmount.The cleanup only cancels timers that already exist.
artifacts-rail.tsxanderrors-tab.tsxcallflash()after asynchronous clipboard work; if the component unmounts first, this schedules a new timer and callssetCopiedafter unmount. Track mounted state or invalidateflashduring cleanup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/dashboard/src/lib/hooks/use-copied-flag.ts` around lines 26 - 33, Update the useCopiedFlag hook’s flash callback and cleanup to track whether the component is mounted, and return immediately when flash is invoked after unmount. Ensure asynchronous callers such as artifacts-rail.tsx and errors-tab.tsx cannot schedule a timer or call setCopied after cleanup.apps/dashboard/src/lib/runs/filters.ts (1)
90-94: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Reject partially numeric query values.
Number.parseInttreatspage=2oopsas page2andpr=123abcas PR123. This contradicts the documented invalid-input fallback and the exact PR filter contract, allowing malformed public/MCP queries to silently return different results. Validate the complete token before converting.Suggested validation
export function parsePage(raw: string | null): number { if (!raw) return 1; - const n = Number.parseInt(raw, 10); - if (!Number.isFinite(n) || n < 1) return 1; + if (!/^\d+$/.test(raw)) return 1; + const n = Number(raw); + if (!Number.isSafeInteger(n) || n < 1) return 1; return n; } function parsePr(raw: string | null): number | null { if (!raw) return null; - const n = Number.parseInt(raw.replace(/^`#/`, ""), 10); - if (!Number.isSafeInteger(n) || n < 1) return null; + const value = raw.replace(/^`#/`, ""); + if (!/^\d+$/.test(value)) return null; + const n = Number(value); + if (!Number.isSafeInteger(n) || n < 1) return null; return n; }Also applies to: 100-105
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/dashboard/src/lib/runs/filters.ts` around lines 90 - 94, Update parsePage to validate that raw is a complete numeric token before conversion, rejecting values such as “2oops” and falling back to 1. Apply the same full-token validation to the PR filter parsing logic around the corresponding lines, preserving the documented invalid-input fallback and exact PR filter behavior.
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
✅ Wrightful — 51 passed
View run report → · Compare to base → Commit: |
# Conflicts: # apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.server.ts # apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.server.ts # apps/dashboard/routes/api/artifacts/[id]/download.ts # apps/dashboard/src/lib/artifacts/store.ts # apps/dashboard/src/lib/ingest.ts # apps/dashboard/src/lib/invites.ts # apps/dashboard/src/lib/monitors/scheduler.ts # apps/dashboard/src/lib/provisioning.ts
There was a problem hiding this comment.
🧹 Nitpick comments (1)
apps/dashboard/src/__tests__/pg-integration/project-teardown.test.ts (1)
26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the canonical
@schemaimport.Line 26 imports
projectsvia../../../db/schema; dashboard TypeScript files accessing schema tables must use@schema.Proposed fix
-const { projects } = await import("../../../db/schema"); +const { projects } = await import("`@schema`");As per coding guidelines, schema tables must be imported from
@schema.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/dashboard/src/__tests__/pg-integration/project-teardown.test.ts` at line 26, Update the schema import in the project teardown integration test to use the canonical `@schema` alias instead of the relative ../../../db/schema path, while preserving the existing projects usage.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@apps/dashboard/src/__tests__/pg-integration/project-teardown.test.ts`:
- Line 26: Update the schema import in the project teardown integration test to
use the canonical `@schema` alias instead of the relative ../../../db/schema path,
while preserving the existing projects usage.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f62da1cd-23b6-4cc9-bc6f-5c6f1d8002f3
📒 Files selected for processing (22)
AGENTS.mdapps/dashboard/db/schema.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.server.tsapps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.server.tsapps/dashboard/routes/api/artifacts/[id]/download.tsapps/dashboard/src/__tests__/artifacts-pipeline.test.tsapps/dashboard/src/__tests__/download-route.workers.test.tsapps/dashboard/src/__tests__/pg-integration/ingest.test.tsapps/dashboard/src/__tests__/pg-integration/project-teardown.test.tsapps/dashboard/src/lib/artifacts/store.tsapps/dashboard/src/lib/ingest.tsapps/dashboard/src/lib/invites.tsapps/dashboard/src/lib/mcp/server.tsapps/dashboard/src/lib/monitors/monitors-repo.tsapps/dashboard/src/lib/project-teardown.tsapps/dashboard/src/lib/retention.tsapps/dashboard/src/lib/schemas.tsapps/dashboard/src/lib/usage.tspackages/reporter/src/__tests__/contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (19)
- apps/dashboard/src/lib/invites.ts
- apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/flaky.server.ts
- apps/dashboard/src/lib/usage.ts
- AGENTS.md
- apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/suite-size.server.ts
- apps/dashboard/src/tests/artifacts-pipeline.test.ts
- apps/dashboard/src/lib/artifacts/store.ts
- apps/dashboard/src/tests/pg-integration/ingest.test.ts
- apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/slowest-tests.server.ts
- apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/tests.server.ts
- packages/reporter/src/tests/contract.test.ts
- apps/dashboard/src/lib/ingest.ts
- apps/dashboard/db/schema.ts
- apps/dashboard/src/lib/schemas.ts
- apps/dashboard/src/lib/monitors/monitors-repo.ts
- apps/dashboard/routes/api/artifacts/[id]/download.ts
- apps/dashboard/src/lib/retention.ts
- apps/dashboard/pages/t/[teamSlug]/p/[projectSlug]/insights/run-duration.server.ts
- apps/dashboard/src/tests/download-route.workers.test.ts
# Conflicts: # apps/dashboard/src/components/run/history-branch-filter.tsx
Summary
Pure file-reorganization refactor of
apps/dashboard/src/lib/— moves + import-specifier rewrites only, no logic changes. Follows the same playbook as #61 (github-* modules ->lib/github/).File mapping
run-columns.tsruns/columns.tsrun-diff.tsruns/diff.tsrun-outcome.tsruns/outcome.tsrun-read-model.tsruns/read-model.tsrun-groups-page.tsruns/groups-page.tsrun-results-page.tsruns/results-page.tsruns-filters.tsruns/filters.tsruns-filters-where.tsruns/filters-where.tsdb-run.tsruns/db.tsdb-batch.tsdb/batch.tsartifact-tokens.tsartifacts/tokens.tstrace-artifacts.tsartifacts/trace.tsartifacts.tsartifacts/store.tsuse-search-param.tshooks/use-search-param.tsuse-copied-flag.tshooks/use-copied-flag.tsAll moves done via
git mvso rename detection stays clean. Noindex.tsbarrel files were added —runs/,db/,artifacts/, andhooks/all deliberately stay barrel-free, matching the existing repo convention (and the same call made in #61).Every
@/lib/<old>specifier was rewritten repo-wide to the new path (routes/, pages/, packages/reporter, packages/e2e, etc.), plus a handful of relative imports and doc-comment references (AGENTS.md,docs/ARCHITECTURE.md,db/schema.ts, a fewsrc/lib/*.tsdoc comments, and the reporter's cross-package contract test import oftrace.ts). Test files undersrc/__tests__/were not renamed.Verification
grep -rn '@/lib/run-\|@/lib/runs-\|@/lib/db-run\|@/lib/db-batch\|@/lib/artifact-tokens\|@/lib/trace-artifacts\|@/lib/use-search-param\|@/lib/use-copied-flag' --include='*.ts' --include='*.tsx' .-> zero hits@/lib/artifacts"/@/lib/artifacts'specifiers -> zero hits (only the intended@/lib/artifacts/{presign,serve,store,tokens,trace}subpaths remain)schemas.ts/artifacts/trace.ts), nothing elsepnpm test— dashboard: 116 files / 1360 tests passed; reporter: 17 files / 300 tests passedpnpm check— exit 0, 0 errors, 141 warnings (pre-existing, in untouched files)Notes for reviewers
artifacts.ts,invites.ts, and other lib files) and Cross-run failure clustering on persisted error signatures #59 (toucheserror-signature.ts,ingest.ts), plus in-flight PR refactor(dashboard): group github modules under lib/github/ #61 (github-* ->lib/github/), may need trivial rebases against this — git rename detection should auto-resolve most of it.src/components/run-*intocomponents/run/in parallel; the two may need a trivial rebase against each other since both touch call sites that import fromsrc/lib/run-*.Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Summary by CodeRabbit