Skip to content

fix(daemon): replace synced store with synced export tables under peer formulaand retain sent formulas#3176

Draft
kumavis wants to merge 4 commits intollmfrom
cursor/ocapn-export-table-4c06
Draft

fix(daemon): replace synced store with synced export tables under peer formulaand retain sent formulas#3176
kumavis wants to merge 4 commits intollmfrom
cursor/ocapn-export-table-4c06

Conversation

@kumavis
Copy link
Copy Markdown
Member

@kumavis kumavis commented Apr 13, 2026

Refs: (no linked issue)

Description

This PR changes cross-peer retention bookkeeping so it is attached to each
peer formula and no longer modeled as user-visible inventory data.

The goal is to retain formulas for objects exported to a peer (including when
that object is not saved in the local pet store), while keeping retention rows
out of normal user-facing name APIs.

What changed

  • Peer formulas can now record their synced-store dependency via an optional
    syncedStore field.
  • Invitation setup records the synced-store on the peer formula and stores
    bootstrap handles under hidden internal names (@peer-handle,
    @self-handle).
  • Mail send/reply/sendValue paths now call a host hook
    (trackSentIdentifiers) so locally sourced identifiers sent to a peer are
    retained in that peer's synced store.
  • Hidden export-retention rows use objective, deterministic names derived from
    the exported identifier (@export-...) instead of subjective counters.
  • synced-pet-store supports internal (non-pet) names for writes/removals, but
    list() remains user-facing and returns only pet names.
  • Synced-store controller user APIs filter internal names, while GC seeding uses
    full synced-store state (including hidden rows).

Files touched

  • packages/daemon/src/daemon.js
  • packages/daemon/src/host.js
  • packages/daemon/src/mail.js
  • packages/daemon/src/store-controller.js
  • packages/daemon/src/synced-pet-store.js
  • packages/daemon/src/types.d.ts
  • packages/daemon/test/synced-pet-store.test.js
  • packages/daemon/test/synced-pet-store-integration.test.js

Testing

Executed:

  • npx corepack yarn workspace @endo/daemon ava test/synced-pet-store.test.js test/synced-pet-store-integration.test.js --timeout=120s

Added/updated coverage for:

  • grantee writes to hidden internal synced-store entries
  • hidden entries excluded from list()
  • send path retention rows being created and synchronized as hidden entries

Compatibility notes

  • SyncedPetStore.list() intentionally exposes only regular pet names.
  • Internal retention/bootstrap rows remain replicated and GC-relevant, but are
    not surfaced in user inventory listings.
  • Type signatures for synced-store write/remove accept Name so internal rows
    can be represented explicitly.
Open in Web Open in Cursor 

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 13, 2026

⚠️ No Changeset found

Latest commit: a4b588c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

cursoragent and others added 3 commits April 13, 2026 08:38
Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: kumavis <kumavis@users.noreply.github.com>
@kumavis kumavis changed the title fix(daemon): hide synced export tables and retain sent formulas fix(daemon): replace synced store with synced export tables under peer formulaand retain sent formulas Apr 13, 2026
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.

2 participants