Function metadata: usage examples, documentation URL, parameter descriptions (HF-300)#1705
Open
marcin-kordas-hoc wants to merge 31 commits into
Open
Conversation
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>
Contributor
|
Task linked: HF-300 Params descriptions, links and examples |
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>
Performance comparison of head (7dbd891) vs base (2d9196e) |
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>
…-300) MS-Graph cross-check surfaced examples that don't evaluate cleanly in a default engine: - DATEVALUE: '2020-03-30' (ISO) is not in HF's default dateFormats (DD/MM/YYYY) -> #VALUE!; switched to a parseable date. - MAXA/MINA: a literal text argument yields #VALUE! (text-as-0 applies to ranges, not literal args); use numeric+boolean literals instead. 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>
…iew (HF-300) Review round (sequba + line-by-line + prep-ultra): - MATCH/VLOOKUP/HLOOKUP: drop the 'HyperFormula skips empty cells when matching approximately' claim — that behavior (HF-223 / #1697) is not in this base branch, and approximate match returns #N/A on gapped data. Don't overstate. - INT: shortDescription said 'rounds down' (Excel floor) while the parameter description says 'toward zero' — self-contradictory. Reworded to HF's actual behavior (integer part, fractional part discarded). - DATE Year: drop the direct 'Excel' comparison per ADR dec_2 (describe HF behavior, not Excel); wording otherwise unchanged. 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-developer review: files under docs/ are built + sitemap-indexed by VuePress (sitemap excludes only /404.html, no citation-strip plugin active), so the ADR's internal [vrf_/dec_/con_] markers and task IDs would leak as a public page. Relocate to repo-root adr/ (not built by VuePress, not in the npm files allowlist). Source: https://app.clickup.com/t/86caprtgj ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ta-api' into feature/hf-300-metadata-enrichment # Conflicts: # CHANGELOG.md # src/interpreter/functionMetadata/categories/array-manipulation.ts # src/interpreter/functionMetadata/categories/database.ts # src/interpreter/functionMetadata/categories/date-and-time.ts # src/interpreter/functionMetadata/categories/engineering.ts # src/interpreter/functionMetadata/categories/financial.ts # src/interpreter/functionMetadata/categories/information.ts # src/interpreter/functionMetadata/categories/logical.ts # src/interpreter/functionMetadata/categories/lookup-and-reference.ts # src/interpreter/functionMetadata/categories/math-and-trigonometry.ts # src/interpreter/functionMetadata/categories/matrix-functions.ts # src/interpreter/functionMetadata/categories/operator.ts # src/interpreter/functionMetadata/categories/statistical.ts # src/interpreter/functionMetadata/categories/text.ts
…(HF-300) Post-merge with the updated base (snake_case params #1709 + new functions): - Author XIRR, VSTACK, HSTACK, and fill TBILLEQ/TBILLPRICE 'discount' (base-added). - Restore examples mis-attached during conflict resolution: SEQUENCE, XNPV, GCD. - Remove SUM's stale per-function documentationUrl re-introduced by the merge (the shared .html default supplies it; comment already said it's absent). Source: https://app.clickup.com/t/86caprtgj ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…300)
The base merge restored base's INT shortDescription ('Rounds a number down'),
re-introducing the self-contradiction with the toward-zero parameter description.
Re-apply the HF-accurate 'integer part' wording.
Source: https://app.clickup.com/t/86caprtgj
ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bugbot flagged INT shipping GCD examples (=GCD(24, 36) / =GCD(A1:A5)) — a valid-but-wrong-function mis-attach introduced during merge reconciliation. Restore INT's own examples (=INT(8.9) / =INT(-8.9)). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Source: https://app.clickup.com/t/86caprtgj ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md
…param backticks (HF-300) - BETA.DIST second example switched from the PDF-with-bounds form (=BETA.DIST(2,2,3,FALSE(),0,4) → HF 1.5 vs Excel 0.375, a known engine PDF-scaling bug) to the cumulative bounded form (=BETA.DIST(2,2,3,TRUE(),0,4) → 0.6875, matches Excel). Still exercises the optional A/B bounds args, but no longer ships an example whose output is wrong. - Removed backticks from six date-and-time PARAMETER descriptions (nullDate/dateFormats/timeFormats). The metadata field is plain text and every other parameter description in the catalogue is plain prose; backticks rendered literally for API consumers. shortDescription markdown links are migrated (#1692) content and left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Source: https://app.clickup.com/t/86caprtgj ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md
…it (HF-300) Source-traceability pass over all 366 catalogue entries (descriptions traced to plugin implementations + docs/guide) found 4 net-new authored parameter descriptions that over- or mis-stated behavior vs the code: - POISSON.DIST `mean`: "must be greater than 0" contradicted the typecheck (minValue: 0 — mean=0 is accepted and computed). → "must be non-negative". - GEOMEAN / HARMEAN `number1`: "whose positive values are averaged" implied non-positive values are filtered; actually any value <= 0 returns #NUM!. → state all values must be positive, else #NUM!. - SEQUENCE `rows`/`cols`: "must be a literal number ... causes #VALUE!" was too narrow (parse-time also accepts numeric-string/unary/boolean literals) and unconditional (#VALUE! only when the result spans more than one cell; =SEQUENCE(A1) with A1=1 is a 1x1 result, no error). → "resolvable at parse time" + qualified #VALUE! condition, matching SequencePlugin's own JSDoc. The audit found ZERO net-new defects in the other 362 entries; remaining flags are inherited migrated shortDescriptions (docs/guide-owned), reported separately. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Source: https://app.clickup.com/t/86caprtgj ADR: adr/2026-07-13-hf300-function-metadata-enrichment.md
The ADR is an internal decision record and doesn't belong in the published engine package; it now lives in the paired (private) hyperformula-tests repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Source: https://app.clickup.com/t/86caprtgj
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feature/hf-249-function-metadata-api #1705 +/- ##
=======================================================================
Coverage ? 96.86%
=======================================================================
Files ? 192
Lines ? 15590
Branches ? 3447
=======================================================================
Hits ? 15102
Misses ? 488
Partials ? 0
🚀 New features to boost your workflow:
|
sequba
requested changes
Jul 15, 2026
| parameters, | ||
| repeatLastArgs: metadata.repeatLastArgs ?? 0, | ||
| documentationUrl: doc.documentationUrl ?? '', | ||
| documentationUrl: doc.documentationUrl ?? DEFAULT_DOCUMENTATION_URL, |
Contributor
There was a problem hiding this comment.
I don't like this default. It may become obsolete easily. Set 'https://hyperformula.handsontable.com/docs/guide/built-in-functions.html' for all functions in FunctionDoc files.
| - Added the `getAvailableFunctions()` and `getFunctionDetails()` methods (both static and instance) for retrieving function metadata. [#1692](https://github.com/handsontable/hyperformula/pull/1692) | ||
| - Added new functions: VSTACK, HSTACK. [#1698](https://github.com/handsontable/hyperformula/pull/1698) | ||
| - Added a new function: `XIRR`. [#1701](https://github.com/handsontable/hyperformula/pull/1701) | ||
| - Enriched `getFunctionDetails()` to return a usage example, a documentation URL, and a per-parameter description for every built-in function. [#1705](https://github.com/handsontable/hyperformula/pull/1705) |
Contributor
There was a problem hiding this comment.
We don't need separate changelog for it
| * descriptions are hand-authored; re-running that script overwrites them. | ||
| */ | ||
| export const ${constName(category)}: Record<string, FunctionDoc> = { | ||
| ${body} |
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.
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:https://hyperformula.handsontable.com/docs/guide/built-in-functions.html), andEverything is English (translations are a later phase; the structure is already i18n-ready). Extends the
SUM/SUMIFexemplar 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
DEFAULT_DOCUMENTATION_URLinbuildFunctionDescriptions.tsand applied as the built-in default — not repeated per function. Custom (user-registered) functions keep''.examples+ per-parameterdescriptionauthored per category file (categories/*.ts). Parameter counts/names and entry order are unchanged; only bodies were filled.Testing (in the paired hyperformula-tests PR)
#ERROR!) or unknown-function (#NAME?) error.SUM/SUMIFassertions updated to the.htmlURL.buildFunctionDetails) stays green across all 363 functions.Local gates:
tsc(src+test) clean ·eslintclean · fulljest0 failures · metadata+coverage+example-validity specs pass.Notes for review
HF.ADD, …) are listable built-ins, so they get examples/descriptions per the DoD's "each function".resolveFunctionMetadata), so they need no separate authoring.MODresult takes the sign of the dividend,FILTERaccepts a single row/column,XNPV's first date is the reference point.Decisions and citations: ADR in the paired hyperformula-tests repo (
adr/2026-07-13-hf300-function-metadata-enrichment.md).Source: https://app.clickup.com/t/86caprtgj
Note
Low Risk
Documentation and metadata-only changes for the function catalogue API; formula evaluation paths are unchanged aside from richer getFunctionDetails output.
Overview
HF-300 fills out built-in function catalogue metadata so
getFunctionDetails()returns usage examples, per-parameter descriptions, and a documentation URL for every built-in (custom functions still get empty strings / empty arrays).buildFunctionDescriptionsnow definesDEFAULT_DOCUMENTATION_URLand uses it when a catalogue entry omitsdocumentationUrl, so callers always see the shared built-in-functions guide link instead of''. Type and builder comments inFunctionDescription.tsare updated to match this “fully authored” catalogue phase.The bulk of the change is hand-authored
examplesand non-emptyparameters[].descriptionacross allcategories/*.tsfiles (363 functions). Thehf249-migrate-function-docsscript is documented as destructive to those fields if re-run without merge preservation.SUM/SUMIFno longer set a per-functiondocumentationUrllocally—they rely on the shared default like other built-ins.Reviewed by Cursor Bugbot for commit 7dbd891. Bugbot is set up for automated code reviews on this repo. Configure here.