Skip to content

fix(validate): count operators need condition and count on every target (3.5.1) - #36

Merged
agreenspan merged 1 commit into
mainfrom
fix/3.5.1-count-condition
Oct 8, 2026
Merged

agreenspan merged 1 commit into
mainfrom
fix/3.5.1-count-condition

Conversation

@agreenspan

Copy link
Copy Markdown
Contributor

Follow-up to #35, folded into the unreleased 3.5.1 entry (no version change).

validateRule required a count operator's condition (and count) only for the check target. toPrisma's count step throws without either, and toSql refuses the operator. So { field: 'posts', arrayOperator: 'atLeast', count: 2 } validated for toPrisma, and a lens source holding it passed validateNarrowing while toSourceQueries refused it. Both are now required on every target (missing_condition / missing_count).

Tests (written first, failing before the fix):

  • validateRule for check, toPrisma and toSql refuses a missing condition and a missing count.
  • validateNarrowing and toSourceQueries agree for both sources.

The stale validateRule.test.ts case "allows missing count for toPrisma" now asserts the refusal.

Full bun run check: 2670 pass / 0 fail.

🤖 Generated with Claude Code

…rget (3.5.1)

validateRule required them only for `check`; toPrisma's count step (and toSql, which refuses
the operator) reject a count operator without them, so validateNarrowing passed a source that
toSourceQueries refused. Folded into the unreleased 3.5.1 entry.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@agreenspan
agreenspan merged commit 562258d into main Oct 8, 2026
1 check passed
@agreenspan
agreenspan deleted the fix/3.5.1-count-condition branch October 8, 2026 15:25
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