Skip to content

Row-shape contract: shape='map' proves exactly-one-row-per-row at build time (TASK-58) - #44

Merged
claude-agent-ahrzb[bot] merged 1 commit into
masterfrom
task-58-shape-flag
Jul 28, 2026
Merged

Row-shape contract: shape='map' proves exactly-one-row-per-row at build time (TASK-58)#44
claude-agent-ahrzb[bot] merged 1 commit into
masterfrom
task-58-shape-flag

Conversation

@claude-agent-ahrzb

Copy link
Copy Markdown

The serving fence, ahead of stage B

DuckDBInferFn(..., shape=...) declares the row-count contract, checked statically at build:

shape contract rejects
"filter" (default) 0..1 out per in — byte-identical to today nothing new
"map" exactly 1, out[i] <-> in[i] WHERE, INNER JOIN (named), static-only constant queries
"many" 0..N — reserved for stage B everything (named reservation)

The proof is static (query shape), not a runtime row-count check — downstream code can rely on positional correspondence. When stage B lands, duplicate-key / cross / inequality / self-joins will build only under shape='many', so multiplicity can never sneak into a serving path by default.

Gate: cargo 163, pytest 613 + 13 xfail, corpus 529 unchanged. New fn.shape getter; matrix in tests/test_shape_contract.py; doc note in known-limitations §2.

🤖 Generated with Claude Code

… 'many' (TASK-58)

User-requested serving fence ahead of stage B: shape='map' statically
PROVES exactly one output row per input row (out[i] <-> in[i]) at build
time — rejects WHERE, INNER joins (key misses drop), and static-only
constant queries, each named; LEFT joins and scalar projections serve
(unique keys are already the map contract). shape='filter' (default) is
byte-identical to before; shape='many' is reserved and will be the ONLY
shape under which stage-B multiplicity constructs build. Introspectable
via fn.shape. Doc note in known-limitations §2.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude-agent-ahrzb
claude-agent-ahrzb Bot merged commit 6030a55 into master Jul 28, 2026
1 check passed
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