Skip to content

Conversation

@seefeldb
Copy link
Contributor

@seefeldb seefeldb commented Jul 16, 2025

Summary by cubic

Removed all direct reads and writes to the internal DocImpl object; all cell and document access now goes through transaction-based APIs.

  • Refactors
    • Updated core runner modules to use transaction methods instead of direct doc access.
    • Replaced legacy cell link methods with new link abstractions.
    • Adjusted tests and utility functions to align with the new transaction-based approach.

@seefeldb seefeldb requested review from Copilot and ellyxir July 16, 2025 23:30
@linear
Copy link

linear bot commented Jul 16, 2025

@seefeldb seefeldb changed the title Removed all direct reads or writes to DocImpl, now everything goes via transactions chore(runner): removed all direct reads or writes to DocImpl, now everything goes via transactions Jul 16, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes all direct reads and writes to DocImpl, routing everything through transactions instead. This is a significant refactoring that affects the core data access layer of the system.

Key changes:

  • Replaces legacy getAsLegacyCellLink() calls with modern getAsLink() and getAsWriteRedirectLink() methods
  • Updates all cell operations to use transaction-based reads and writes instead of direct document access
  • Refactors storage interfaces to use activity logs instead of legacy transaction logs

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/ui/src/v1/components/common-plaid-link.ts Updates method calls from legacy cell link format to modern format
packages/runner/test/*.test.ts Extensive test updates to use new cell link and transaction APIs
packages/runner/src/storage/transaction-shim.ts Major refactoring of storage transaction implementation and logging
packages/runner/src/storage/interface.ts Updates interface definitions for transaction methods
packages/runner/src/*.ts Core runtime files updated to use transaction-based operations

Copy link

Copilot AI Jul 16, 2025

Choose a reason for hiding this comment

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

The function name changed from isLegacyCellLink to isAnyCellLink but the test description still refers to 'legacy cell link'. Consider updating the test description to match the new function name.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

cubic found 2 issues across 30 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.

@seefeldb seefeldb force-pushed the berni/ct-486-remove-remaining-direct-uses-of-doc branch from 17124f0 to f2f0418 Compare July 16, 2025 23:46
Copy link
Contributor

@ellyxir ellyxir Jul 17, 2025

Choose a reason for hiding this comment

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

suggest we create a unit test to show ignorereadforscheduling is respected (i can do this later)

Copy link
Contributor

Choose a reason for hiding this comment

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

this pattern is repeated a few times and also in query-result-proxy.ts, runner.ts. perhaps option for refactoring into a function that also takes in the failure option (runtime.edit() or undefined for example). but not a big deal.

Copy link
Contributor

Choose a reason for hiding this comment

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

suggest calling this readOnlyReason if we think we'll ever use it to show the reason, otherwise turn to boolean

seefeldb and others added 16 commits July 18, 2025 14:42
- Refactored core runner modules to eliminate direct references to the `doc` object.
- Updated builder, builtins, cell, data-updating, doc-map, link-utils, query-result-proxy, recipe-binding, runner, runtime, scheduler, sigil-types, storage, storage/transaction-shim, and uri-utils to use new abstractions or access patterns.
- Adjusted related tests to align with the new approach and ensure coverage.
- updated read APIs to pass metadata along
- use it to ignore certain reads in scheduler
- Move createSigilLink function from cell.ts to link-utils.ts as createSigilLinkFromParsedLink
- Add support for base cell/link parameter to enable relative references
- Add sanitizeSchemaForLinks function to remove asCell/asStream flags from schemas
- Update all callers to use new function signature with options object
- Add comprehensive tests for schema sanitization
@seefeldb seefeldb force-pushed the berni/ct-486-remove-remaining-direct-uses-of-doc branch from 54433d0 to a0cd848 Compare July 18, 2025 19:46
@seefeldb seefeldb merged commit 6c16c0f into main Jul 18, 2025
2 checks passed
@seefeldb seefeldb deleted the berni/ct-486-remove-remaining-direct-uses-of-doc branch July 18, 2025 20:15
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.

3 participants