edu/ast_lol: ast.lol — auto-graded AST course from expressions to a SQL optimizer - #1451
Conversation
New client-side web app for ast.lol (Cloudflare Workers, same stack as 1d4_web): 6 tiers, 13 lessons, 16 challenges building from an expression language to AstQL — a SQL subset with resolution, logical plans, an instrumented executor, and a capstone optimizer graded on result equivalence plus a cost budget. Submissions run in a sandboxed Web Worker; failures report first-difference paths, per-test console output, mapped error lines, and hints; users can add oracle-graded custom tests. CI job test-ast-lol runs typecheck, vitest (224 tests incl. a frozen SQL parser corpus), and the build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7snNHsXg6msYZkBUHsViv
benchDb: replace the raw LCG (its low bit alternates, confining even-modulus columns to half their domains and emptying two capstone queries) with mulberry32; totals now derive from the ordered product. Executor: AND/OR/NOT coerce operands consistently, restoring TRUE AND x -> x soundness; pinned by new soundness and coercion tests. Grader: validate structuredClone before the grading try (uncloneable custom args passed any submission); worker-creation and rejection paths surface as error reports. Capstone: budgets are literals pinned to the formula by CI (nothing executes plans at module load; q1 is an explicit no-regression guard), and the solution is the composition of the three pass solutions. Plus doc/test-name accuracy fixes; 259 tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7snNHsXg6msYZkBUHsViv
The two new Function calls are the product — the learner's own code and test inputs, run in their own browser's worker, with no server and no cross-user boundary. Documented where CodeQL flags them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7snNHsXg6msYZkBUHsViv
|
On the two CodeQL Both sites execute the learner's own input in the learner's own browser — the submission, and their custom-test inputs — inside a Web Worker, same trust model as jsfiddle/codepen/leetcode-style client-side runners. There is no server-side execution, no persistence beyond that browser's localStorage, and no path by which one user's code reaches another user. Removing the dynamic evaluation would remove the product; no sanitization makes Recommended resolution: dismiss both alerts as won't fix (by design) in the code-scanning UI, which turns the CodeQL check green on the next run. The alternative — a path exclusion for Generated by Claude Code |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
1d4-web | 452f9dc | Commit Preview URL Branch Preview URL |
Aug 25 2026, 10:03 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
iili | 452f9dc | Commit Preview URL Branch Preview URL |
Aug 25 2026, 10:03 AM |
Review (Bugbot + manual pass)CI is green (21/21). Bugbot on the PR head reported no findings. A deeper pass over the grader client, ChallengeView drafts, SQL engine, and capstone found three issues worth folding in before merge — none block the curriculum/engine core, but two can mislead learners and one can mis-report timeouts near the budget. Survivors (see line threads):
Looked at and not raised: empty-column Panel note: prior panel findings on |
A timeout firing after a test's result no longer blames the finished test (running clears on test-result, and the synthesized row is guarded against completed ids). Timeout and skipped rows keep custom-test flags, so the 'yours' badge survives a hang. Editing back to the exact starter clears the stored draft instead of resurrecting it on the next visit. All three pinned by tests; 262 total. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C7snNHsXg6msYZkBUHsViv
|
All three findings verified and fixed in
Generated by Claude Code |
|
|
|
CI on |
New client-side web app for ast.lol (Cloudflare Workers, same stack as 1d4_web) at
domains/edu/apps/ast_lol: a tiered course on AST parsing and transformation for experienced programmers, building to SQL query parsing and rule-based plan optimization. 6 tiers, 13 lessons, 16 challenges; Tiers 1–2 build a toy expression language, Tiers 3–5 build "AstQL" (tokenize → Pratt parse → resolve → plan → execute with 3VL → optimize). The capstone optimizer is graded on row-for-row equivalence on two databases plus a hard cost budget from an instrumented executor.The grader runs submissions in a sandboxed Web Worker (timeout by termination); the same harness runs under vitest, which is what makes the CI contract real: every reference solution passes its own bank, every starter fails, custom-test placeholders build inputs the oracle accepts, capstone budget literals match the formula, and the SQL parser replays a frozen corpus. Failure output is the product: first-difference paths, per-test console capture, error lines mapped to user code, per-test hints, and user-authored custom tests graded by the reference solution as oracle.
What a reviewer can't see from the diff:
d5b2de3;0f3060ccarries its surviving findings (degenerate bench-DB RNG, AND/OR/NOT coercion soundness, an uncloneable-args false pass in the grader, capstone budgets moved off the module-load path). Findings kept deliberately are pinned by tests and recorded indocs/CURRICULUM.md.Deliberately not covered (see
docs/ROADMAP.md): TypeScript/functional-language submissions (the grader'slanguagefield is the seam), code splitting, GROUP BY/subqueries/outer joins.Also touches:
.github/workflows/branch.yml(newtest-ast-loljob mirroring the other web apps) and the web-app row indocs/WORKING_AGREEMENT.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01C7snNHsXg6msYZkBUHsViv
Generated by Claude Code