Repository improvement plan + phases 1–3: validator correctness, tests/CI, architecture cleanup#12
Merged
Conversation
Audit of validation accuracy, testing gaps, architecture, and UX, organized into 5 pillars with a phased roadmap and quick wins. https://claude.ai/code/session_01RQVRtRAigoNCzJc37A5Ses
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Phase 1-3 of the improvement plan: Validation accuracy - Reject non-SELECT/WITH and multi-statement queries so user SQL can no longer mutate the shared in-memory database (src/lib/sqlRunner.ts) - Compare rows as a multiset unless the solution has a top-level ORDER BY (per-level orderMatters override available) - Exact string comparison, relative float tolerance, case-insensitive column names, and specific failure messages per mismatch class - Cache expected results; snapshot seed for instant resetDatabase() - Fix epoch tags on levels 51-54 to match the displayed progression Tests + CI - Vitest suite: every level's solution executes, returns rows, and validates against itself; seed scaffolds must not already pass; validator comparison unit tests (270 tests) - GitHub Actions: lint, typecheck, test, build Architecture - Self-host sql.js from the npm package (script in scripts/) instead of loading 1.8.0 from a third-party CDN; drop the custom type shim for @types/sql.js - New src/lib/progression.ts as the single source of epochs, XP, ranks, and MAX_LEVEL - removes four duplicated copies and the hardcoded '/ 63' and epoch-divider sets - Extract seedDatabase to src/lib/seed.ts (pure, Node-testable) - Delete unused NextAuth wiring and next-auth/@auth/core/p5 deps; fix package name typo (sqlawk -> sqlwak); fix new react-hooks lint errors https://claude.ai/code/session_01RQVRtRAigoNCzJc37A5Ses
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.
Summary
Adds
IMPROVEMENT_PLAN.md(full audit + phased roadmap) and implements phases 1–3 of it.Validation accuracy (Phase 1)
src/lib/sqlRunner.ts): user SQL can no longerDROP/UPDATE/INSERTand silently corrupt the in-memory database for the rest of the session; one statement at a time, executed via prepare/step. A pristine seed snapshot enables instantresetDatabase().ORDER BY(windowOVER (ORDER BY …)and subqueries are ignored); per-levelorderMattersoverride available. Correct queries without an unrequestedORDER BYno longer fail.=is case-sensitive — the old.toLowerCase().trim()taught wrong semantics), relative float tolerance instead of absolute0.0001, case-insensitive column-name matching.Tests + CI (Phase 2)
Architecture (Phase 3)
public/vendorby a predev/prebuild script) instead of loading v1.8.0 from a third-party CDN while v1.14 sat unused in package.json; custom type shim replaced by@types/sql.js.src/lib/progression.tsas the single source of epochs, XP, ranks, ship species, andMAX_LEVEL— deletes four duplicated copies, the hardcoded/ 63, and the hardcoded epoch-divider set.src/lib/seed.ts(pure, reused by the Node test suite).next-auth/@auth/corebeta deps, unusedp5/@types/p5(~1 MB), bird-era types, no-oponSuccesscallback,sqlawkpackage-name typo; new react-hooks lint errors fixed.Still open (tracked in the plan): level 49 simplification, store tests,
levels.tssplit, Pillar 4 UX/a11y, LICENSE choice.Verification
npm run lint— clean (0 errors, 0 warnings)npm run typecheck— cleannpm test— 270/270 passingnpm run build— succeedshttps://claude.ai/code/session_01RQVRtRAigoNCzJc37A5Ses