Lane 11 PR 4: the sheet evaluator in the browser, held to the Python engine by the shared fixtures (#737) #965
Loading…
Reference in a new issue
No description provided.
Delete branch "build/lane11-4-js-evaluator"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lane 11 (#737) PR 4 (IS-405 in the browser). It's a JavaScript port of PR 2's engine, used for live recalculation while someone edits a sheet (PR 10). The server's values always win on save.
webapp/frontend/src/sheets/:expr.js: tokenizer, parser (tokenize first), evaluator and helpers.evaluate.js: compile the definition (repeat expansion, dependency order, cycle issues) and run it, returning the same shape as Python:{values, derivations, absent, errors}. It never throws.dice-display.js: reads a kept roll for theDicecomponent. There's no rolling in the browser (D85).index.js: the exports.Held to Python:
conformance.test.jsruns every shared fixture inwebapp/backend/app/sheets/conformance/, read by path from the checkout: 309/309 expression cases, 13/13 sheet cases and 2/2 generic fixtures, with nothing weakened or skipped. A harness check replaces floored%with JS%and watches 5 cases fail.%and rounding half away from zero, by formula;@constructoris null;-0normalised away.Tests:
src/sheetspasses (408), and so does the full vitest suite (3174).Next: PR 2b (label expressions,
first/last/join, and two Python robustness fixes found while porting) is stacked on this one and follows it.Changelog:
changelog.d/737-lane11-js-evaluator.added.md.🤖 Generated with Claude Code
src/sheets/{expr,evaluate,dice-display,index}.js: a port of app/sheets' expression language and evaluator that passes every shared conformance fixture (conformance/expr, conformance/sheet, builtin/*/fixtures), read from the backend by the repository layout. Dice are display-only (D85). Unit tests for limits, code-point offsets and ordering, totality, the compile cache, and dice records. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>