Skip to content

feat(artifacts): list only your own artifacts, and share a personal one with the org - #32

Merged
fforres merged 1 commit into
skywardfrom
feat/share-artifacts-with-org
Oct 20, 2026
Merged

fforres merged 1 commit into
skywardfrom
feat/share-artifacts-with-org

Conversation

@fforres

@fforres fforres commented Oct 20, 2026

Copy link
Copy Markdown

Since #31, new artifacts are created at the org tier, so every member's artifact list shows every other member's artifacts. This keeps #31's access model and scopes the list.

List. The gallery and the MCP artifacts.list tool now return only the caller's own artifacts:

An executor with no subject still lists every org artifact. Opening, editing and deleting by id are unchanged: any member can open an org artifact from its link.

Share. Artifacts saved before #31 are personal, and another member opening their link gets a 404. POST /artifacts/:artifactId/share moves one of the caller's personal artifacts to the org tier in place and records the caller as its creator. Another member's artifact, an unknown id and an already shared artifact all return 404. The detail page shows Share (with a confirmation) on a personal artifact and Copy link on a shared one.

Migration. Adds nullable artifact.created_by: cloud migration 0023, and the D1 runtime schema upgrade is covered by a new d1.test.ts case.

Tests

  • packages/core/sdk/src/artifacts.test.ts: own list vs another member's list, legacy rows with no creator, share by owner, share by another member, share of an already shared artifact, and an overwrite by another member keeping the creator. Mutation-checked: removing the list filter, not recording the creator, or dropping the owner = 'user' guard on share each fail tests.
  • packages/core/api/src/artifacts/artifacts-share.test.ts: 200 with owner: "org", and 404 for an unknown id.
  • apps/host-cloudflare/src/db/d1.test.ts: the column is added to a database that predates it.

The UI change was typechecked and linted but not exercised in a browser.

Known gap, not addressed here. The settled-render image preview (setPreview) holds whatever data its capturer saw. On an org artifact any member can write it, and since #31 it's shown to every member. The UI doesn't call it today.

…ne with the org

Org-tier artifacts stay openable, editable and deletable by every member
through their link, but the artifact list (the gallery and the MCP list
tool) now shows only the caller's own: their personal artifacts, org
artifacts they created, and org artifacts with no recorded creator.

A new nullable `created_by` column records the creating subject on save.
Overwrites, renames and preview updates leave it alone.

POST /artifacts/:artifactId/share moves one of the caller's personal
artifacts to the org tier and records them as its creator. Another
member's artifact, an unknown id and an already shared artifact all
return 404. The detail page shows Share for a personal artifact and
Copy link for a shared one.

Includes the cloud migration for the new column and a D1 upgrade test.
@fforres
fforres added this pull request to stack #34 October 20, 2026 21:10
@fforres
fforres merged commit 2c24bdf into skyward Oct 20, 2026
4 of 40 checks passed
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