The v0.0.88 viability assessment identifies built-in function naming inconsistency as a source of agent hallucination errors. An audit of all ~68 built-in functions reveals four distinct naming patterns where there should ideally be one or two.
Pattern analysis
| Pattern |
Count |
Examples |
domain_verb (compound) |
~46 (68%) |
string_length, array_append, regex_match, md_parse |
| Prefix-less |
~11 (16%) |
abs, min, max, floor, ceil, strip, split, join |
to_target |
~4 (6%) |
to_string, to_float, to_upper, to_lower |
is_predicate |
~2 (3%) |
is_nan, is_infinite |
Specific inconsistencies
string_contains has the string_ prefix, but starts_with, ends_with, index_of don't
is_nan, is_infinite lack a float_ prefix that would match float_to_int
to_string is a redundant alias for int_to_string
- Math functions (
abs, min, max) are prefix-less while their domain peers use prefixes
replace is prefix-less while string_repeat, string_slice use string_ prefix
strip, split, join are prefix-less string/array operations
Impact on agents
When naming follows inconsistent patterns, LLMs hallucinate function names by applying the wrong pattern (e.g., guessing string_starts_with or string_strip). A consistent naming scheme reduces these errors.
Recommendation
Audit and standardise before v0.1.0 (breaking change). The dominant pattern (68% domain_verb) should be the standard. Math functions are the acceptable exception — abs, min, max are universally understood without a math_ prefix.
Cross-references
Related to #211 (combinators will add more function names), #133 (map/fold will add more names). This audit should happen before those features ship to establish the naming convention they should follow.
The v0.0.88 viability assessment identifies built-in function naming inconsistency as a source of agent hallucination errors. An audit of all ~68 built-in functions reveals four distinct naming patterns where there should ideally be one or two.
Pattern analysis
domain_verb(compound)string_length,array_append,regex_match,md_parseabs,min,max,floor,ceil,strip,split,jointo_targetto_string,to_float,to_upper,to_loweris_predicateis_nan,is_infiniteSpecific inconsistencies
string_containshas thestring_prefix, butstarts_with,ends_with,index_ofdon'tis_nan,is_infinitelack afloat_prefix that would matchfloat_to_intto_stringis a redundant alias forint_to_stringabs,min,max) are prefix-less while their domain peers use prefixesreplaceis prefix-less whilestring_repeat,string_sliceusestring_prefixstrip,split,joinare prefix-less string/array operationsImpact on agents
When naming follows inconsistent patterns, LLMs hallucinate function names by applying the wrong pattern (e.g., guessing
string_starts_withorstring_strip). A consistent naming scheme reduces these errors.Recommendation
Audit and standardise before v0.1.0 (breaking change). The dominant pattern (68%
domain_verb) should be the standard. Math functions are the acceptable exception —abs,min,maxare universally understood without amath_prefix.Cross-references
Related to #211 (combinators will add more function names), #133 (map/fold will add more names). This audit should happen before those features ship to establish the naming convention they should follow.