fix(example): declare make_series count/step constraints#1
Merged
Conversation
The make_series `count` const arg declares ge=0 → [0, +inf) and the integer `step` overload declares ge=1 → [1, +inf), matching the Python, Go, and Rust example workers. Surfaces via vgi_function_arguments() for agent discovery and enforces the ranges at table bind. Fixes catalog/function_arguments_constraints.test:72, which asserted the cross-SDK contract that make_series exposes count/step ranges (expected 2 rows, was getting 0 because the TS example declared no arg constraints). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
mainCI is red: the HTTP integration suite fails atcatalog/function_arguments_constraints.test:72— Expected 2 rows, but got 0 rows.That test asserts a cross-SDK contract:
make_seriesmust surface itscountandstepargument ranges viavgi_function_arguments(). The Python,Go, and Rust example workers all declare these (
feat(example): declare make_series count/step constraints); the TypeScript example worker never did,so the discovery query returned 0 rows.
Fix
Declare
argConstraintson the two relevantmake_seriesoverloads inexamples/table.ts(the per-argument constraint framework already shipped ine94f289):count→{ ge: 0 }→[0, +inf)step→{ ge: 1 }→[1, +inf)The float
stepoverload and all other args stay unconstrained (NULL), so theDISTINCT ... WHERE arg_range IS NOT NULLquery yields exactly the two expectedrows.
argConstraintsalso enforces the ranges at bind, satisfying the test'slater
statement errorformake_series(-1).Verification
count → [0, +inf), integerstep → [1, +inf), everything else NULL — matching the expected output byte-for-byte.bun test— 195 pass / 0 fail.bun run build:types(tsc) — clean.(Local C++ integration run skips this test due to a version-skewed local
vgiextension; CI uses the community extension that produced the original assertion.)
🤖 Generated with Claude Code