Repository navigation
[AGE-2882] Add artifact metadata tables - #1435
Open
rutvij-menavlikar wants to merge 13 commits into
Open
rutvij-menavlikar wants to merge 13 commits into
rutvij-menavlikar wants to merge 13 commits into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
3 of 5 tasks
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
rutvij-menavlikar
marked this pull request as ready for review
November 19, 2026 14:46
rutvij-menavlikar
requested review from
chiragjn,
debajyoti-truefoundry,
heerambavi1998 and
thesujai
as code owners
November 19, 2026 14:46
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9e9efaa. Configure here.
Co-authored-by: Cursor <cursoragent@cursor.com>
rutvij-menavlikar
force-pushed
the
rutvij/age-2882_1
branch
from
November 19, 2026 15:56
9e9efaa to
b3e76a2
Compare
3 tasks done
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This branch has not been 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
Adds Postgres + SQLite migrations for the artifact metadata tables from the Artifacts design. File bytes live in S3; these tables hold metadata only. Store, upload, list, and serving paths come in later PRs.
Linear: AGE-2882
Schema
Postgres types; SQLite stores
jsonbas BLOB, timestamps as ISO text,bigintas INTEGER.Changes
artifact: ULIDid,UNIQUE (tenant_id, slug),title,latest_version(0 until the first version),created_by_subject,created_by_session_id(no FK; outlives the session). Indexes(tenant_id, created_by_subject->>'subject_id', updated_at DESC, id)(SQLite:json_extract(created_by_subject, '$.subject_id')) and(tenant_id, created_by_session_id).artifact_version: immutable rows with PK(artifact_id, version),storage_prefix,total_bytes,created_at. Cascades fromartifact. Written once after files are uploaded, so there is no status or per-file table; file listings come from the object store.How was this tested?
jest.store.sqlite.config.cjs) and on a throwaway database on the devtest RDS, PG 17.11 (jest.store.postgres.config.cjs).tsc --noEmit, eslint, prettier on changed files.Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locallypackages/trueforge-sdk,python/trueforge_sdk,.github/fern/openapi/openapi.json,docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge.env.exampleupdated if configuration or behavior changedNote
Low Risk
Additive schema-only migrations with no runtime or security logic changes; standard lock_timeout and rollback
downpaths.Overview
Introduces artifact metadata storage in Postgres and SQLite via paired Kysely migrations, plus a patch changeset for
@truefoundry/trueforge. File content stays in object storage; these tables only track identity, versioning, and pointers.The
artifacttable holds per-tenant slugs, titles,latest_version, creator subject/session (session id is not an FK so rows persist after the session), and indexes for listing by creator and filtering by session.artifact_versionstores immutable version rows withstorage_prefixandtotal_bytes, keyed by(artifact_id, version)with cascade delete fromartifact.Reviewed by Cursor Bugbot for commit 3307efc. Bugbot is set up for automated code reviews on this repo. Configure here.