Repository navigation
[AGE-2882] Add artifact DB stores - #1439
Merged
Merged
Conversation
rutvij-menavlikar
force-pushed
the
rutvij/age-2882_2
branch
from
November 19, 2026 13:27
7e6b2e8 to
5958f97
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
rutvij-menavlikar
force-pushed
the
rutvij/age-2882_2
branch
from
November 19, 2026 13:31
5958f97 to
814a4a2
Compare
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>
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
Co-authored-by: Cursor <cursoragent@cursor.com>
3 tasks done
Co-authored-by: Cursor <cursoragent@cursor.com>
[AGE-2886] Add listArtifacts to artifact stores
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9853c78. Configure here.
| "@truefoundry/trueforge": patch | ||
| --- | ||
|
|
||
| Add artifact listing to the artifact stores. |
There was a problem hiding this comment.
PR adds two changeset files
Low Severity
This PR adds artifact-apis.md and also edits artifact-store-tables.md. Only one changeset file is allowed per PR; extra files and edits to a parent stacked changeset should be folded into a single patch file for this change.
Additional Locations (1)
Triggered by learned rule: Prereleases use rc tags only
Reviewed by Cursor Bugbot for commit 9853c78. Configure here.
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
Stacked on #1435. Adds
IArtifactStorewith Postgres and SQLite implementations — only the operations the push/pull flow needs once the object store lands. Not wired intomain.tsyet; that comes with the first consumer.Linear: AGE-2882
Changes
src/db/artifactStore.ts: records, inputs,ArtifactSlugConflictError,IArtifactStore.createArtifact/getArtifact(by tenant + slug).createVersion: allocates the next version aspending. Storage keys include the version number, so file rows are written at commit.commitVersion: records uploaded files, flipspending→committed, advanceslatest_versionmonotonically — one transaction.failVersion: flipspending→failed.getVersion: version + files (each withcreated_at); checks the artifact is in the tenant first (for pull/serve).commitVersionsetsartifact_file.created_atat commit; callers don't pass it.How was this tested?
tests/db/artifactStoreContractSuite.ts), 4 tests: SQLite pass; Postgres pass against a throwaway DB on the devtest RDS (PG 17.11).tsc --noEmit(src + tests/db), 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
Medium Risk
New schema and transactional versioning semantics affect future push/pull flows, but behavior is isolated behind
IArtifactStoreand covered by contract tests; no runtime wiring in this PR.Overview
Introduces
IArtifactStoreand dual Postgres/SQLite implementations for artifact metadata and versioned file manifests (bytes still assumed in object storage). Callers can create/get artifacts by tenant + slug, list a subject’s artifacts with token pagination, and run a pending → committed/failed version lifecycle: allocate version numbers, commit file rows and bumplatest_versionmonotonically (Postgres serializes concurrent version writes with row locks), or fail pending versions and fetch a version with its files—all scoped by tenant.Migrations and Kysely types add
artifact,artifact_version, andartifact_filetables;artifact_list_idxnow includescreated_by_subjectsubject_idto match listing queries. A shared contract test suite exercises both backends. Stores are not wired into the app entrypoint yet.Reviewed by Cursor Bugbot for commit 9853c78. Bugbot is set up for automated code reviews on this repo. Configure here.