Skip to content

fix(example): declare make_series count/step constraints#1

Merged
rustyconover merged 1 commit into
mainfrom
fix/make-series-arg-constraints
Jul 7, 2026
Merged

fix(example): declare make_series count/step constraints#1
rustyconover merged 1 commit into
mainfrom
fix/make-series-arg-constraints

Conversation

@rustyconover

Copy link
Copy Markdown
Contributor

Problem

main CI is red: the HTTP integration suite fails at
catalog/function_arguments_constraints.test:72Expected 2 rows, but got 0 rows.

That test asserts a cross-SDK contract: make_series must surface its
count and step argument ranges via vgi_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 argConstraints on the two relevant make_series overloads in
examples/table.ts (the per-argument constraint framework already shipped in
e94f289):

  • count{ ge: 0 }[0, +inf)
  • integer step{ ge: 1 }[1, +inf)

The float step overload and all other args stay unconstrained (NULL), so the
DISTINCT ... WHERE arg_range IS NOT NULL query yields exactly the two expected
rows. argConstraints also enforces the ranges at bind, satisfying the test's
later statement error for make_series(-1).

Verification

  • Introspected the compiled example worker: count → [0, +inf), integer
    step → [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 vgi
extension; CI uses the community extension that produced the original assertion.)

🤖 Generated with Claude Code

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>
@rustyconover rustyconover merged commit 9aa9d37 into main Jul 7, 2026
2 checks passed
@rustyconover rustyconover deleted the fix/make-series-arg-constraints branch July 7, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant