Skip to content

Function metadata: usage examples, documentation URL, parameter descriptions (HF-300)#1705

Draft
marcin-kordas-hoc wants to merge 21 commits into
feature/hf-249-function-metadata-apifrom
feature/hf-300-metadata-enrichment
Draft

Function metadata: usage examples, documentation URL, parameter descriptions (HF-300)#1705
marcin-kordas-hoc wants to merge 21 commits into
feature/hf-249-function-metadata-apifrom
feature/hf-300-metadata-enrichment

Conversation

@marcin-kordas-hoc

Copy link
Copy Markdown
Collaborator

What & why

HF-300 enriches the function-metadata API (getFunctionDetails) so every built-in function returns, in addition to the existing short description and parameter names:

  • a usage example (≥1 per function),
  • a documentation URL — a single shared URL for all functions in v1 (https://hyperformula.handsontable.com/docs/guide/built-in-functions.html), and
  • a short description for each parameter.

Everything is English (translations are a later phase; the structure is already i18n-ready). Extends the SUM/SUMIF exemplar already on the base branch to the whole catalogue (363 functions).

Base: feature/hf-249-function-metadata-api (#1692). Sibling: #1699 (docs single source).

How

  • The single documentation URL is defined once as DEFAULT_DOCUMENTATION_URL in buildFunctionDescriptions.ts and applied as the built-in default — not repeated per function. Custom (user-registered) functions keep ''.
  • examples + per-parameter description authored per category file (categories/*.ts). Parameter counts/names and entry order are unchanged; only bodies were filled.

Testing (in the paired hyperformula-tests PR)

  • Coverage-parity: every listable built-in exposes the shared URL, ≥1 example, and a non-empty description for every parameter.
  • Example-validity: every authored example is built in HyperFormula and asserted not to be a parse (#ERROR!) or unknown-function (#NAME?) error.
  • Existing SUM/SUMIF assertions updated to the .html URL.
  • Arity guard (buildFunctionDetails) stays green across all 363 functions.

Local gates: tsc (src+test) clean · eslint clean · full jest 0 failures · metadata+coverage+example-validity specs pass.

Notes for review

  • No i18n changes — by design. DoD scopes HF-300 to English; no functions are added/renamed, so the 17-language-pack rule does not apply. English-form examples show under every locale for now (accepted "translations later" trade-off).
  • Operators (HF.ADD, …) are listable built-ins, so they get examples/descriptions per the DoD's "each function".
  • Aliases inherit their target's authored doc automatically (resolveFunctionMetadata), so they need no separate authoring.
  • Guide table untouched → the HF-249 bullet 3: generate built-in functions docs from the HF API (single source of truth) #1699 docs drift-check stays green (none of the new fields are rendered in the Function ID/Description/Syntax table).
  • Descriptions describe HyperFormula's actual behavior (verified against the plugins), not Excel where they diverge — e.g. MOD result takes the sign of the dividend, FILTER accepts a single row/column, XNPV's first date is the reference point.

Decisions and citations: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md.

Source: https://app.clickup.com/t/86caprtgj

🤖 Generated with Claude Code

marcin-kordas-hoc and others added 17 commits July 13, 2026 12:02
Author examples + per-parameter descriptions manually per category file;
single shared documentationUrl (with .html) centralized as a builder
default; English-only; arity-match constraint; HF behavior as the
semantic oracle. Audit-harness 100% PASS.

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…manipulation (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…se (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nd time (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ering (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ial (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ation (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…l (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… and reference (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nd trigonometry (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… functions (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…or (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tical (HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…HF-300)

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(HF-300)

Accuracy-review findings:
- MOD: result has the sign of the dividend (HF uses JS remainder), not the divisor.
- CEILING/FLOOR: Significance sign requirement is one-directional (only positive Number + negative Significance errors).
- XNPV: the first date is the reference point; other dates must fall on or after it (not the minimum date).
- COUNTBLANK: accepts repeating range/value arguments (repeatLastArgs).
- FILTER: SourceArray must be a single row or column (no 2-D range).
- EVEN/ODD: reworded 'nearest ... away from zero'; ARRAYFORMULA: stronger SUM example.

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@qunabu

qunabu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown

Performance comparison of head (114d1e5) vs base (8207bf3)

                                     testName |   base |   head |  change
-------------------------------------------------------------------------
                                      Sheet A | 484.09 | 502.65 |  +3.83%
                                      Sheet B | 151.24 | 156.07 |  +3.19%
                                      Sheet T | 137.52 |  139.2 |  +1.22%
                                Column ranges | 466.92 | 475.37 |  +1.81%
Sheet A:  change value, add/remove row/column |  14.07 |  15.88 | +12.86%
 Sheet B: change value, add/remove row/column | 122.15 | 137.62 | +12.66%
                   Column ranges - add column |  138.9 | 152.18 |  +9.56%
                Column ranges - without batch | 426.68 | 455.26 |  +6.70%
                        Column ranges - batch | 111.73 | 118.24 |  +5.83%

marcin-kordas-hoc and others added 3 commits July 13, 2026 15:52
Review findings (prep-flip T5b/T6):
- All 13 category headers said 'parameter descriptions are authored in a later phase' (now authored) and the migration-script overwrite footgun was warned in only one file. Reworded every header to note examples + descriptions are hand-authored and would be overwritten by re-running the generator; mirrored the fix in the generator template.
- Added an explicit overwrite WARNING to scripts/hf249-migrate-function-docs.ts.
- buildFunctionDetails JSDoc no longer claims parameter descriptions are 'empty for functions not yet authored' (contradicted the authored state).

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bare TRUE/FALSE literals are not recognized by HyperFormula (they resolve to
'Named expression TRUE not recognized' → #NAME?), so 51 example formulas across
logical/statistical/information/text would have surfaced an error to any user
running them. Switched to the TRUE()/FALSE() function form, which evaluates.

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
MS-Graph Excel cross-check flagged INT(-2.5): HF returns -2 (RoundingPlugin
truncates toward zero for negatives), Excel returns -3 (floors). The parameter
description wrongly said 'round down toward negative infinity' (Excel behavior);
corrected to HF's actual truncate-toward-zero semantics.

Source: https://app.clickup.com/t/86caprtgj
ADR: docs/adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.19%. Comparing base (8207bf3) to head (114d1e5).

Additional details and impacted files

Impacted file tree graph

@@                           Coverage Diff                            @@
##           feature/hf-249-function-metadata-api    #1705      +/-   ##
========================================================================
+ Coverage                                 97.17%   97.19%   +0.02%     
========================================================================
  Files                                       192      192              
  Lines                                     15446    15447       +1     
  Branches                                   3412     3412              
========================================================================
+ Hits                                      15009    15014       +5     
+ Misses                                      437      433       -4     
Files with missing lines Coverage Δ
...nterpreter/functionMetadata/FunctionDescription.ts 100.00% <ø> (ø)
...eter/functionMetadata/buildFunctionDescriptions.ts 96.00% <100.00%> (+0.16%) ⬆️
.../functionMetadata/categories/array-manipulation.ts 100.00% <ø> (ø)
...nterpreter/functionMetadata/categories/database.ts 100.00% <ø> (ø)
...reter/functionMetadata/categories/date-and-time.ts 100.00% <ø> (ø)
...rpreter/functionMetadata/categories/engineering.ts 100.00% <ø> (ø)
...terpreter/functionMetadata/categories/financial.ts 100.00% <ø> (ø)
...rpreter/functionMetadata/categories/information.ts 100.00% <ø> (ø)
...interpreter/functionMetadata/categories/logical.ts 100.00% <ø> (ø)
...unctionMetadata/categories/lookup-and-reference.ts 100.00% <ø> (ø)
... and 5 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants