Skip to content

feat(repository): derive dependency scopes from queries - #857

Merged
patroza merged 4 commits into
t3code/sa-401-query-owned-live-invalidationfrom
t3code/sa-401-repository-owned-read-scopes
Aug 6, 2026
Merged

feat(repository): derive dependency scopes from queries#857
patroza merged 4 commits into
t3code/sa-401-query-owned-live-invalidationfrom
t3code/sa-401-repository-owned-read-scopes

Conversation

@omegent-app

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

Copy link
Copy Markdown
Contributor

Why

Live repository queries already retain typed predicates in an intermediate representation. Callers should not repeat repository names, paths, or manual read scopes when model metadata can identify affected relationships.

What

Adds repositoryDependency(schema), an encoded-side schema annotation. Repository construction derives nested dependency paths from the schema AST once. The same metadata extracts aliases from writes and recognizes matching query predicates; primary IDs remain automatic. Previous and next aliases are recorded for updates and removals.

How

The query IR is inspected before it reaches Cosmos, SQL, or memory adapters. eq and in predicates over annotated fields produce scoped reads, including nested whereSome paths such as parts.-1.id. Unsupported predicates and queries containing or conservatively retain repository-wide dependencies. Existing dependencyIds and explicit withReadScope remain backwards compatible.

Remarks

Stacked on #856. Scanner consumer and linked-mode validation: macs-holding/scanner#2198. Includes a patch changeset for effect-app; package checks, lint, and all tests pass locally.

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@omegent-app
omegent-app Bot marked this pull request as ready for review August 6, 2026 15:42
@pkg-pr-new

pkg-pr-new Bot commented Aug 6, 2026

Copy link
Copy Markdown

Open in StackBlitz

@effect-app/cli

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

effect-app

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

@effect-app/eslint-codegen-model

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

@effect-app/eslint-shared-config

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

@effect-app/infra

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

@effect-app/vue

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

@effect-app/vue-components

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

commit: 86510d8

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@omegent-app omegent-app Bot changed the title feat(repository): own dependency read scopes feat(repository): derive dependency scopes from queries Aug 6, 2026
omegent-app Bot and others added 2 commits August 6, 2026 18:12
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
@patroza
patroza merged commit e9b1f45 into t3code/sa-401-query-owned-live-invalidation Aug 6, 2026
1 check passed
@patroza
patroza deleted the t3code/sa-401-repository-owned-read-scopes branch August 6, 2026 18:25
patroza added a commit that referenced this pull request Aug 6, 2026
* feat(vue): add query-owned live invalidation

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>

* feat(repository): derive dependency scopes from queries (#857)

* feat(repository): own dependency read scopes

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>

* feat(repository): derive dependency scopes from queries

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>

* refactor(repository): derive dependencies from schema annotations

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>

* refactor(repository): remove manual read scope API

Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>

---------

Co-authored-by: omegent-app[bot] <306514130+omegent-app[bot]@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>

---------

Co-authored-by: omegent-app[bot] <306514130+omegent-app[bot]@users.noreply.github.com>
Co-authored-by: Patrick Roza <42661+patroza@users.noreply.github.com>
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