Skip to content

fix: clear every tuple on a deleted agent instance - #73

Open
vitramir wants to merge 1 commit into
mainfrom
t6/instance-tuple-cleanup
Open

fix: clear every tuple on a deleted agent instance#73
vitramir wants to merge 1 commit into
mainfrom
t6/instance-tuple-cleanup

Conversation

@vitramir

@vitramir vitramir commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

removeAgentInstanceAuthorization deleted only the three tuples creation wrote. can_write_inbox is granted after creation — to identities and groups allowed to write that inbox — so those grants outlived the instance they named. authz.md:185 requires every tuple on the object to go.

The tuples on agent_instance:<id> are now read back and deleted as a set.

One exception is handled by hand: organization membership names the instance as the user rather than the object, so a read scoped to the object never returns it. My first attempt missed that and the existing test caught it. Thread participations also name the instance as the user, but those belong to the threads and are removed with them.

Deleting an instance removed only the three tuples creation wrote, so
can_write_inbox grants -- which are written afterwards, by whoever is
allowed to write that inbox -- outlived the instance they named.

The tuples on the instance are read back and deleted as a set. The one
exception is organization membership, which names the instance as the
user rather than the object and so is never returned by that read; it is
still deleted by hand. Thread participations name it as the user too, but
those belong to the threads and go with them.
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