Skip to content

feat(mount): mint creator grants inside @corbits/artifacts - #38

Open
TheGreatAxios wants to merge 2 commits into
mainfrom
cl-9480-mint-creator-grants-inside-corbitsartifacts-instead-of-via
Open

TheGreatAxios wants to merge 2 commits into
mainfrom
cl-9480-mint-creator-grants-inside-corbitsartifacts-instead-of-via

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

Creator write and archive grants are now minted by the package instead of by each host's onArtifactCreated hook.

What changed

  • POST /artifacts and POST /artifacts/upload (once per file) insert creator-origin, allow grants on artifact:<id> for the creating principal via @intx/db's grant table, in the same transaction as the artifact. Inserts use onConflictDoNothing.
  • onArtifactCreated is still called for other side effects.
  • Reference host drops its grantOwnership hook; README and AGENTS.md updated.
  • Added an upload-path e2e test: grants exist, and the creator can then revise and archive.

Testing

bun run check and bun run test:coverage (Postgres, ALLOW_DESTRUCTIVE_ARTIFACT_TESTS=1): 305 pass, 0 fail.

Closes CL-9480

Insert creator-origin grants on artifact:<id> in the creating transaction for both POST /artifacts and POST /artifacts/upload. onArtifactCreated still runs for other side effects.
The mount imports generateId from it at runtime, so a consumer must
resolve it rather than rely on a hoisted transitive copy.
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