feature - add function registry foundation (#31)#42
Merged
dannymeijer merged 3 commits intoMay 24, 2026
Conversation
19cdaf2 to
44c7be0
Compare
44c7be0 to
09a62d6
Compare
09a62d6 to
f181c86
Compare
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.
Summary
This PR implements the RFC 014 function registry foundation for the current InQL public helper surface. The registry follows the declaration-side registration model: public helpers register themselves with
@FUNCTION_REGISTRY.add("name", deterministic_spec(...)), and the typed spec passed to that decorator is the machine-readable source of truth.The old split-brain shape is gone: no authored function-ref constants, no central hardcoded
function_registry_entries()list, and no separate decorator/link surface. Stable function refs are derived from canonical names, and runtime registry entries are produced by the decorator calls on the helpers themselves.Lifecycle metadata is part of the registry payload: each helper carries a typed
FunctionLifecycle(since=v0_1, changed=[], deprecated=None)record, withFunctionVersion,FunctionChange, andFunctionDeprecationavailable for future catalog evolution. The version values are lowercaseconstmodel values, not uppercase static workarounds.Type of change
docs/rfcs/*)Area(s)
Select the primary areas touched (labels sync from checked lines when the triage workflow runs):
Key details
col,lit,sum,count,add,mul,eq, andgtremain available with the same behavior, but are now registered with stable function refs for generated docs, diagnostics, Prism/lowering metadata, and backend capability checks.src/function_registry.incndefines the typed registry primitives andFunctionRegistry.add(...).src/functions.incnowns the package registry instance and each helper supplies its metadata in the decorator call attached to that helper.FunctionVersion,FunctionChange,FunctionDeprecation,FunctionLifecycle) and verifies the current helper set is introduced inv0_1with no changes/deprecation yet.SourceKindpolicy insrc/session/source_formats.incn, so Session schema planning and DataFusion source registration consume one policy boundary instead of duplicating source-kind dispatch.scripts/check_function_registry_metadata.incnvalidates runtime registry entries against checked API metadata: helper presence, exactly oneFUNCTION_REGISTRY.adddecorator, canonical-name agreement, argument names, argument types, return type, duplicate refs/names, and unmatched registry decorators.INCAN_REF(release/v0.3) instead of trackingmain, then runs formatting, style, registry metadata, build, package tests, and pub-consumer smoke checks.constlifecycle model values require Incan #658/#659 as fixed by incan PR #660, or an equivalent release/v0.3 compiler containing that fix.Testing / verification
make ci(or equivalent target breakdown)Manual verification notes:
incan test tests/test_session.incn; 22 session tests passed after the source-format policy cleanup.make ci; formatting, style, registry metadata, library build, 96 tests, and pub-consumer smoke passed before the lifecycle const/lowercase update./private/tmp/incan-660-verify/target/debug/incan test tests/test_function_registry.incn; 7 registry tests passed with the #660 compiler.make registry-metadata INCAN=/private/tmp/incan-660-verify/target/debug/incan; metadata check passed for 17 helpers.make fmt-check INCAN=/private/tmp/incan-660-verify/target/debug/incan; formatting passed.make build test INCAN=/private/tmp/incan-660-verify/target/debug/incan; library build and 96 package tests passed.make test-style; test style passed.make smoke-consumer INCAN=/private/tmp/incan-660-verify/target/debug/incan; pub-consumer smoke passed.incan architect /Users/danny/Development/encero/tmp/inql-30-rfc013-orchestrator --format text; the previous.source_kindfinding is gone, leaving only the scalar-expression dispatch finding deferred to RFC 015.Docs impact
If docs updated:
docs/rfcs/014_function_registry.md,docs/language/reference/functions/index.md,docs/release_notes/v0_1.md,docs/rfcs/README.mdChecklist
Closes #31