5
1
Fork
You've already forked spindle-rust
2

feat: add extension function mechanism (Phase 1) #26

Open
claireb wants to merge 1 commit from feat/extension-interface into main
pull from: feat/extension-interface
merge into: anuna:main
anuna:main
anuna:spec/predicate-model-vocabulary
anuna:feat/lean-verification-all
anuna:hence/plan-IMPL-016
anuna:hence/plan-IMPL-015
anuna:hence/plan-IMPL-020
anuna:hence/plan-IMPL-018
anuna:fix/fold-determinism
anuna:feat/dates-times
anuna:feat/extensions-stratification-documentation
anuna:feat/stratification-and-aggregation
anuna:feat/builtins-as-extensions
anuna:fix/bug-hunt-fixes
anuna:feat/lean-verification

Introduce a principled mechanism for registering external pure functions
callable from bind expressions during grounding. This is the foundation
for aggregation and other extension use-cases.

  • Add FunctionRegistry, ExtensionFunction trait, EvalContext, and
    supporting types in new function_registry module
  • Add ArithExpr::Call variant and ArithError::{UnknownFunction,FunctionError}
  • Add eval_with_context() on ArithExpr and ArithConstraint, threading
    EvalContext through the grounding call chain
  • Update parser to emit Call nodes for unknown names in expression position
  • Add validation of Call nodes against registry (existence + arity)
  • Add function_registry field to PipelineContext and PrepareOptions
  • Zero existing behaviour changes: programs without extension functions
    behave identically (1827 existing tests pass unchanged)

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

fix: remove redundant Arity::describe(), fix pluralization, add test coverage

  • Remove Arity::describe() in favor of the identical Display impl
  • Fix "expects N arguments" → "expects N argument(s)" for grammatical correctness
  • Add integration tests: range arity, non-numeric return, nested calls,
    call in body predicate argument, and zero-arg function
  • Add unit tests for ArithExpr::Call evaluation paths
  • Apply cargo fmt to touched files

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

test: add extension function test coverage for non-integer returns, e2e reasoning, multi-function

  • Add end-to-end reasoning test through reason_with_options() with extension functions
  • Add Decimal return type test (HalfFunction)
  • Add Float return type test (SqrtFunction with FiniteFloat)
  • Add multiple extension functions in one theory test
  • Add TODO comment in query/mod.rs for function_registry threading

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

fix: struct initialisation

Introduce a principled mechanism for registering external pure functions callable from `bind` expressions during grounding. This is the foundation for aggregation and other extension use-cases. - Add FunctionRegistry, ExtensionFunction trait, EvalContext, and supporting types in new function_registry module - Add ArithExpr::Call variant and ArithError::{UnknownFunction,FunctionError} - Add eval_with_context() on ArithExpr and ArithConstraint, threading EvalContext through the grounding call chain - Update parser to emit Call nodes for unknown names in expression position - Add validation of Call nodes against registry (existence + arity) - Add function_registry field to PipelineContext and PrepareOptions - Zero existing behaviour changes: programs without extension functions behave identically (1827 existing tests pass unchanged) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> fix: remove redundant Arity::describe(), fix pluralization, add test coverage - Remove Arity::describe() in favor of the identical Display impl - Fix "expects N arguments" → "expects N argument(s)" for grammatical correctness - Add integration tests: range arity, non-numeric return, nested calls, call in body predicate argument, and zero-arg function - Add unit tests for ArithExpr::Call evaluation paths - Apply cargo fmt to touched files Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> test: add extension function test coverage for non-integer returns, e2e reasoning, multi-function - Add end-to-end reasoning test through reason_with_options() with extension functions - Add Decimal return type test (HalfFunction) - Add Float return type test (SqrtFunction with FiniteFloat) - Add multiple extension functions in one theory test - Add TODO comment in query/mod.rs for function_registry threading Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> fix: struct initialisation
feat: add extension function mechanism (Phase 1)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
57b6b31daa
Introduce a principled mechanism for registering external pure functions
callable from `bind` expressions during grounding. This is the foundation
for aggregation and other extension use-cases.
- Add FunctionRegistry, ExtensionFunction trait, EvalContext, and
 supporting types in new function_registry module
- Add ArithExpr::Call variant and ArithError::{UnknownFunction,FunctionError}
- Add eval_with_context() on ArithExpr and ArithConstraint, threading
 EvalContext through the grounding call chain
- Update parser to emit Call nodes for unknown names in expression position
- Add validation of Call nodes against registry (existence + arity)
- Add function_registry field to PipelineContext and PrepareOptions
- Zero existing behaviour changes: programs without extension functions
 behave identically (1827 existing tests pass unchanged)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: remove redundant Arity::describe(), fix pluralization, add test coverage
- Remove Arity::describe() in favor of the identical Display impl
- Fix "expects N arguments" → "expects N argument(s)" for grammatical correctness
- Add integration tests: range arity, non-numeric return, nested calls,
 call in body predicate argument, and zero-arg function
- Add unit tests for ArithExpr::Call evaluation paths
- Apply cargo fmt to touched files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
test: add extension function test coverage for non-integer returns, e2e reasoning, multi-function
- Add end-to-end reasoning test through reason_with_options() with extension functions
- Add Decimal return type test (HalfFunction)
- Add Float return type test (SqrtFunction with FiniteFloat)
- Add multiple extension functions in one theory test
- Add TODO comment in query/mod.rs for function_registry threading
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: struct initialisation
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
This pull request has changes conflicting with the target branch.
  • crates/spindle-core/src/query/mod.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/extension-interface:feat/extension-interface
git switch feat/extension-interface

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff feat/extension-interface
git switch feat/extension-interface
git rebase main
git switch main
git merge --ff-only feat/extension-interface
git switch feat/extension-interface
git rebase main
git switch main
git merge --no-ff feat/extension-interface
git switch main
git merge --squash feat/extension-interface
git switch main
git merge --ff-only feat/extension-interface
git switch main
git merge feat/extension-interface
git push origin main
Sign in to join this conversation.
No reviewers
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
anuna/spindle-rust!26
Reference in a new issue
anuna/spindle-rust
No description provided.
Delete branch "feat/extension-interface"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?