Skip to content

fix(lens): 3.5.1 review fixes - #35

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

agreenspan merged 1 commit into
mainfrom
fix/3.5.1-review

Conversation

@agreenspan

Copy link
Copy Markdown
Contributor

Fixes from the adversarial review of 3.5.0 (TDD; tests in test/review.351.test.ts).

  1. toLensSelect + bridged sources: it skipped every column a bridged source reads, so materializeSources over its rows + far side threw UsageError: lacks 'age' for any: [age > 35, crm:Profile.tier = gold] with age hidden. It now selects the source's local reads (a read across the bridge → that bridge's local on key) as fetch-only columns; a viewer's projectRows drops them (tested).
  2. README "Sources across a bridge" snippet: prisma[query.model].findMany(query.prisma) is rejected by Prisma and ignored steps. Both source-query snippets now destructure and run steps through executePrismaPlan; a test runs that shape against the rails harness (plain, bridged, count step, column ref). This surfaced that SourcePrismaQuery.steps was dropped for a column-reference where (unresolved __field), now fixed: steps is present whenever the where needs executePrismaPlan.
  3. label/groupBy across a to-many relation (local or bridged): validation refused it but toSourceQueries/materializeSources ran. toOnePathError is now the single check used by validation and the source plans (inspect mode included); test asserts validateNarrowing ok ⇔ no posture refuses.
  4. JSON re-check: selects the Json column whole (meta: true), so SQL no longer refuses a local JSON read; the SQL refusal message names the real reason. Count operators across a bridge now say "aren't supported across a bridge".
  5. orderRecords README row notes JS code-unit order vs database collation.

CHANGELOG 3.5.1, version bump. No release/tag (train publishes).

🤖 Generated with Claude Code

…fused at runtime, JSON re-check selects

- toLensSelect selects a bridged source's local reads (and each bridge's local on key) as
  fetch-only columns, so materializeSources over its rows + the far side answers it.
- A label/groupBy across a to-many relation is refused by toSourceQueries and
  materializeSources too: one shared toOnePathError check, so validateNarrowing is ok
  exactly when no posture refuses.
- A re-check reading into a Json column selects the column whole; SQL refusal messages name
  the real reason. SourcePrismaQuery.steps is present for a column reference too.
- Count operators across a bridge say so.
- README snippets destructure query.prisma and run steps through executePrismaPlan (tested
  against the rails harness); orderRecords notes JS code-unit string order.

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