Repository navigation
HF-131 (1/7): every interpreter cell error carries a message - #1761
marcin-kordas-hoc wants to merge 8 commits into
Conversation
Fills in all 78 call sites in src/interpreter/ that constructed a CellError with no message, so a consumer no longer receives a bare #DIV/0! or #NUM! with an empty message string. Ten new catalogue entries in src/error-message.ts, not 78: the 46 division-by-zero sites share one ErrorMessage.DivisionByZero, and the 26 NUM sites mostly reuse entries that already existed (ValueLarge, ValueSmall, NotHex, NaN, BadMode, ComplexNumberExpected and others). New entries were added only where nothing existing was accurate -- NoBroadcastValue, SearchRangeDimension, NaFunction, TwoCashFlows, PositiveAndNegative, NonZeroPeriods, NoConvergence, RateGuess, MaturityLong. No error type changes and no signature changes; ArithmeticHelper.ts gains only a message literal inside divide(). Nothing under src/i18n/ is touched -- this slice is English-only by an explicit product decision. Produced by a prep-ship (`spec-to-ship`) run: `prep-ship ship hf131-messages --task-file ... --yes`. The run authored its acceptance specs first, then iterated implementation against them. It was killed by a process restart before reaching its own commit step, so this commit was made by hand from the work it left in the worktree, after verifying it: - 78 message-less sites -> 0, counted with the same command the task file gave. - tsc --noEmit and eslint --quiet both clean. - Full private suite: 5 failed / 6165 passed / 6173 total, against a baseline of 5 failed / 6157 passed / 6165 total. The 5 are a pre-existing test-repo branch-pinning mismatch, unrelated. The +8 are the run's own new specs, all passing. - The run also updated three pre-existing specs whose expectations had gone stale (error-address-preservation, arrays, matrix-plugin). Checked each: it added the message argument to detailedErrorWithOrigin, which strengthens those assertions rather than weakening them -- they still compare the address, and now the message too, via catalogue constants. No test was loosened to reach green. The ESLint rule that would stop a message-less CellError being reintroduced is deliberately NOT here: the harness commits only src, docs and CHANGELOG.md, so an .eslintrc.js change would have been silently dropped. It needs its own step. Test-side changes live in the private repo and are not part of this commit. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Enforces the guarantee this PR's message-filling work establishes: a message-less new CellError(...) construction under src/interpreter/ is now a lint error. Two selectors — a bare one-argument call, and an explicit literal undefined as the second argument (the exact shape the two CYCLE sites in src/Evaluator.ts still use; Evaluator.ts is outside src/interpreter/ so this rule doesn't reach them yet, and is unaffected by this commit). Verified: 0 lint errors on the full src/ tree (same pre-existing warning count as before this commit — no new warnings). The rule was proven to actually fire, not just parse, by temporarily reverting one src/interpreter/ plugin site to a bare 'new CellError(ErrorType.NUM)', observing the expected lint error, then restoring it (git diff empty afterward). Widened to all of src/ in the next PR in this stack (feat/hf-131-error-messages-outside-interpreter). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Task linked: HF-131 Verbose and actionable formula error messages |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
hyperformula-docs | 7673ddf | Commit Preview URL Branch Preview URL |
Oct 23 2026, 07:17 AM |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 84708e2. Configure here.
…messages # Conflicts: # CHANGELOG.md # src/error-message.ts # src/interpreter/plugin/ConditionalAggregationPlugin.ts # src/interpreter/plugin/ModuloPlugin.ts
Performance comparison of head (7673ddf) vs base (d143456) |
No engine changes -- the paired hyperformula-tests branch for this PR gained 4 new coverage-closing test cases after the initial CI run, and re-running the same commit isn't possible; this empty commit forces a fresh run so codecov/patch reflects them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Tobiadefami
left a comment
There was a problem hiding this comment.
Looks good. Verified the added error messages and that the lint rule rejects both missing messages and explicit undefined.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md # hyperformula/src/error-message.ts # hyperformula/src/interpreter/plugin/DatabasePlugin.ts # hyperformula/src/interpreter/plugin/NumericAggregationPlugin.ts
…s point Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1761 +/- ##
===========================================
+ Coverage 97.28% 97.31% +0.03%
===========================================
Files 207 207
Lines 16218 16229 +11
Branches 3556 3588 +32
===========================================
+ Hits 15777 15794 +17
+ Misses 433 427 -6
Partials 8 8
🚀 New features to boost your workflow:
|

Context
The PR makes every cell error built inside the interpreter carry a message that states its cause. It is part 1 of 7 of HF-131 (#1761 → #1767).
new CellError(...)calls in 15 files underhyperformula/src/interpreter/passed no message, soDetailedCellError.messagewas''for errors such as=1/0.ErrorMessageconstant. 45 of them are#DIV/0!and share the newErrorMessage.DivisionByZero.hyperformula/src/error-message.ts: 10 new constants.hyperformula/.eslintrc.js: ano-restricted-syntaxrule forsrc/interpreter/**/*.tsrejectsnew CellError(...)with no message or with an explicitundefined. HF-131 (2/7): the origin/propagation mechanism, plus the same guarantee outside the interpreter #1762 widens it to all ofsrc/.=1/0reportsDivision by zero.and=NA()reportsThe NA function always evaluates to the #N/A error.The error types do not change.The public
CellErrorconstructor is unchanged:messagestays optional for custom functions.How did you test your changes?
feat/hf-131-error-messages. It addsunit/error-messages.spec.tsand message assertions to theRATE,SKEW,SKEW.PandTTESTspecs.error-messages.spec.tswith theRATE,SKEWandTTESTspecs: 39 tests pass against this head; all 4 suites fail againstdevelop, where the new constants do not exist.new CellError(ErrorType.DIV_BY_ZERO)and one with an explicitundefinedmessage inModuloPlugin.tseach produce ano-restricted-syntaxerror.Compatibility with Excel and Google Sheets
Not applicable: the error types and the displayed values (
#DIV/0!,#NUM!,#N/A,#VALUE!) do not change. Only the message text does.Public API changes
None to signatures.
DetailedCellError.messageis now non-empty for these 77 errors.Out of scope and follow-ups
src/interpreter/: HF-131 (2/7): the origin/propagation mechanism, plus the same guarantee outside the interpreter #1762.Types of changes
Related issues
Checklist
dev-docs/pages this change affects – or none needed it.