test: increase project coverage and set patch goal
What and why
Add meaningful coverage for CSV storage, desktop startup, graph transformations, and API routes, and ask agents to aim for at least 95% patch coverage. This is a draft: the finalized project coverage for commit a2715763 is 85.77%, above the unchanged 85% CI gate but below the at-least-95% project goal.
Local validation (Node 24.18.0):
npx eslint 'app/api/graph/[graph]/[element]/route.test.ts'andnpx eslint app/api/chat/ai-routes.test.ts— passed.npx tsc --noEmit --incremental false— passed.npm run test:coverage— passed, 1,397 tests; the 100% result applies only to the selected unit coverage gate, not the whole project.node --test --experimental-test-coverage --test-coverage-include='app/api/graph/*/*/*route.ts' --test-coverage-include='app/api/graph/*/*/*/route.ts' 'app/api/graph/?graph?/?element?/route.test.ts'— passed, 11 tests; all three route files reported 100% line coverage. Session and database boundaries are simulated.node --test --experimental-test-coverage --test-coverage-include='app/api/chat/fix/route.ts' --test-coverage-include='app/api/chat/optimize/route.ts' app/api/chat/ai-routes.test.ts— passed, 6 tests; both routes reported 100% line coverage. Session, database and AI provider boundaries are simulated.- Full lint, production build and E2E tests were not rerun locally for this batch.
CI for a2715763 completed: coverage/project is 85.77%, while coverage/patch reports no changed lines to cover, not a measured 95%. Two Playwright tests passed only on retry, so the draft is not ready.
Checklist
- Tests added/updated;
npm run lint,npx tsc --noEmit,npm run test:coveragepass; patch coverage ≥ 95% (CI enforces 85%) - Docs updated (README / swagger spec (enforced for API routes) /
.env.local.template/ Helm) — or not needed - Design doc in
docs/design/created/updated — or not needed - Code is concise, efficient and clear (no dead code, duplication or speculative options)
- All AI and human review threads are answered and resolved, after at least 3 AI review rounds
- Superpowers code review (
requesting-code-review) run on the full diff; every Critical/Important finding fixed or answered - CI is green on the final commit (watched to the end) with zero dangling tests (none failing, flaky or newly skipped)
Summary by cubic
Adds test coverage across CSV storage, chat and model discovery, graph listing, count, info, memory, config, stubs, transformation and mutation routes, connections, tokens, session migration, Auth.js options and origin guard, swagger, release cache, and other API routes, Cypher completion and Monaco linting glue, upload progress and previews, Cypher batch uploads, desktop startup, and UDF, query history, and data panel E2E flows. Sets a 95% patch-coverage goal for agents and raises the enforced CI floor from 80% to 85%.
- Oversized uploads are now rejected outright instead of being silently truncated.
- Graph count routes now always run read-only, so a count racing a delete can't recreate a just-deleted graph.
- Disconnecting now navigates away before clearing cookies, so a late in-flight session response can't restore the cookie and break the logout flow.
- The E2E settings specs now run after the parallel shard projects, since their server-wide graph config empties or times out queries other projects run meanwhile.
- The header graph-count test now asserts against a fixed graph list instead of comparing to a second live API read, which could disagree under parallel workers.
- Query history storage is now keyed by connection scope, and its E2E tests verify the scoped key, fallback behavior, and profile history against the authenticated connection.