Skip to content

Simplify query policies, fetch commits, and graph lifetimes - #150

Merged
KidkArolis merged 2 commits into
masterfrom
codex/simplify-query-runtime
Sep 30, 2026
Merged

KidkArolis merged 2 commits into
masterfrom
codex/simplify-query-runtime

Conversation

@KidkArolis

@KidkArolis KidkArolis commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Query ownership and event rules were re-derived across fetch commits, row snapshots, and realtime replay. Graph freshness adoption and prefetch expiry were also split between Figbird and relational refs.

This compiles response rebasing, row ownership, and event policies once per query, including the store and inspector's remaining realtime checks. The rules stay in private storage so state subscribers retain the original maintenance shape. Fetch commits separate planning from cache application at the existing atomic boundary; the planner decides which pending mutations participate in a query and which lanes need settlement deferral. Mutation acknowledgements still precede planning, and notifications still follow the cache commit.

Each relational query has one lifetime manager for reader/preparation/prefetch leases, Suspense adoption, and prefetch expiry. The lifetime owns the root Suspense entry and observes actual graph starts. Legacy hooks and their contracts are retained.

Validation:

  • npm run tsc, npm run lint, npm run ava, and npm run test pass; all 440 tests pass.
  • Committed tests cover prefetch expiry, replacement, timer cancellation, and disposal, plus the 1,024-combination comparison against the original policy rules.
  • Regression coverage verifies the subscriber-visible maintenance shape and snapshot fetches during pending optimistic writes. The original state snapshots are restored.
  • npm run package:check verifies ESM, CommonJS, declarations, type-only exports, legacy hooks, and private exports.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Approved; Cursor Bugbot completed with no findings, and no Security Agent check was present. No reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver - Risk Based

@KidkArolis
KidkArolis merged commit 763f1a8 into master Sep 30, 2026
5 checks passed
@KidkArolis
KidkArolis deleted the codex/simplify-query-runtime branch September 30, 2026 12:06
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