Skip to content

fix(query): keep tight ProjectableGuard on project() + dual-tag/optional harden - #850

Merged
patroza merged 2 commits into
mainfrom
fix/restore-tight-project-guard
Aug 4, 2026
Merged

fix(query): keep tight ProjectableGuard on project() + dual-tag/optional harden#850
patroza merged 2 commits into
mainfrom
fix/restore-tight-project-guard

Conversation

@omegent-app

@omegent-app omegent-app Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Why

Scanner Overview.List SchemaErrors require tag-aware projections. Softening project() to a key-only guard papers over illegal multi-tag DTOs. Keep the tight guard and fix the real dual-tag / optionalKey type holes.

What

  • Restore/keep ProjectableGuard on project() (same as projectComputed)
  • Single-literal tags: KeysOfUnion of matched domain members (dual packing/closed shapes)
  • Multi-tag / bare string tags: still key intersection (batchId on initial still fails)
  • Optional keys: key-presence only (UnprojectableKeys) so optionalKey does not false-negative
  • Tests for dual same-tag + activeRequest cancel regression

How

See ProjectableFromDomain / ProjectableGuard in packages/effect-app/src/Model/query/dsl.ts.

Remarks

Scanner branch chore/effect-app-beta-306 validates against this under pnpm embedded:effect:link.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@pkg-pr-new

pkg-pr-new Bot commented Aug 4, 2026

Copy link
Copy Markdown

Open in StackBlitz

@effect-app/cli

npm i https://pkg.pr.new/effect-app/libs/@effect-app/cli@850

effect-app

npm i https://pkg.pr.new/effect-app/libs/effect-app@850

@effect-app/eslint-codegen-model

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-codegen-model@850

@effect-app/eslint-shared-config

npm i https://pkg.pr.new/effect-app/libs/@effect-app/eslint-shared-config@850

@effect-app/infra

npm i https://pkg.pr.new/effect-app/libs/@effect-app/infra@850

@effect-app/vue

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue@850

@effect-app/vue-components

npm i https://pkg.pr.new/effect-app/libs/@effect-app/vue-components@850

commit: e50c93e

omegent-app Bot and others added 2 commits August 4, 2026 11:23
Revert the loose ProjectableKeyGuard paper-over. project() and projectComputed
both require domain-owned keys (tag-aware). Call sites that project view DTOs
must derive from domain tagged members instead.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Keep tag-aware ProjectableGuard on project() and projectComputed. Fix dual
same-tag domain variants (KeysOfUnion for single literal tags) and optionalKey
false negatives (key-presence check). Multi-tag flat DTOs still fail when they
claim state-only fields.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@patroza
patroza marked this pull request as ready for review August 4, 2026 11:24
@omegent-app
omegent-app Bot force-pushed the fix/restore-tight-project-guard branch from 5864aae to e50c93e Compare August 4, 2026 11:26
@patroza
patroza merged commit ad0ede6 into main Aug 4, 2026
6 checks passed
@patroza
patroza deleted the fix/restore-tight-project-guard branch August 4, 2026 11:28
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