Repository navigation
feat(mothership): erase private memory when a member leaves or an organization is deleted - #9503
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Contributor
[Medium impact] The PR appears safe to merge after the companion worker changes are deployed, as noted in the PR description. SummaryQueues private memory cleanup in the same transaction as member removal, external collaborator removal, organization transfer, or organization deletion.
|
…anization is deleted Account deletion already queues the worker's memory cleanup. Removing a member, removing an external collaborator from an organization's workspaces, moving a member to another organization and deleting an organization now queue it too, in the same transaction, with the worker's new organization_member and organization targets.
waleedlatif1
force-pushed
the
feat/memory-offboarding-erasure
branch
from
October 31, 2026 06:47
e53a76c to
5446713
Compare
Collaborator
Author
… database The unit tests only checked mocked outbox calls. The integration test runs member removal, external removal and organization cleanup against Postgres: each committed change queues its erasure, a rolled-back one queues nothing.
Collaborator
Author
Collaborator
Author
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Mothership's private memory (the memory sidecar, live only in hosted dev) is now erased when its owner is offboarded (Mothership D106, simstudioai/mothership#878). Account deletion already queues the worker's memory cleanup. This PR also queues it, in the same transaction as the change it follows, when:
removeUserFromOrganization): targetorganization_memberremoveExternalUserFromOrganizationWorkspaces): targetorganization_member, since their workspace chats used that organization's memoryorganization_memberfor the source organizationenqueueOrganizationResourceCleanup, called by the admin delete): targetorganizationlib/mothership/generated/memory-notes-access.tsis regenerated from the worker contract (bun run contracts:sync).Companion: simstudioai/mothership#878
Product update (if relevant)
None visible. Private memory is limited to effective super-users with the benchmark deployment opt-in, and only hosted dev runs the memory sidecar. On staging and production the worker answers these cleanup events without erasing anything.
Type of Change
Testing
lib/mothership/memories/offboarding.integration.tsruns against real Postgres (bun run test:integration lib/mothership/memories/offboarding.integration.ts, passing locally). A removal whose actor lacks authority rolls back and queues nothing. A committed member removal and an external-collaborator removal each queueorganization_memberfor that user.enqueueOrganizationResourceCleanupin a rolled-back transaction queues nothing, and in a committed one queuesorganization.membership.tsandresource-cleanup.tsreverted tostaging(expected 2 queued erasures, received none).Checklist