Skip to content

[AGE-2882] Add artifact DB stores - #1442

Open
rutvij-menavlikar wants to merge 21 commits into
rutvij/age-2882_1from
rutvij/age-2882_2
Open

rutvij-menavlikar wants to merge 21 commits into
rutvij/age-2882_1from
rutvij/age-2882_2

Conversation

@rutvij-menavlikar

@rutvij-menavlikar rutvij-menavlikar commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #1435. Adds IArtifactStore with Postgres and SQLite implementations. Not wired into main.ts yet; the list/get APIs PR does that.

Linear: AGE-2882

Changes

  • src/db/artifactStore.ts: records, inputs, ArtifactSlugConflictError, IArtifactStore.
  • createArtifact / getArtifact (by tenant + slug).
  • listArtifacts: creator-scoped, most recently updated first, offset page tokens; served by artifact_list_idx from [AGE-2882] Add artifact metadata tables #1435.
  • createVersion: allocates the next version as pending. Storage keys include the version number, so file rows are written at commit.
  • commitVersion: records uploaded files, flips pending → committed, advances latest_version monotonically, in one transaction.
  • failVersion: flips pending → failed.
  • getVersion: version + files; checks the artifact is in the tenant first.
  • Kysely table types for both dialects. Changeset .changeset/artifact-store-tables.md is shared with [AGE-2882] Add artifact metadata tables #1435.

How was this tested?

  • Shared contract suite (tests/db/artifactStoreContractSuite.ts), 5 tests: SQLite and Postgres (local container) pass.
  • tsc --noEmit (src + tests/db), eslint, prettier on changed files.

Checklist

Made with Cursor


Note

Medium Risk
New persistence layer with tenant scoping and version concurrency, but not yet wired to APIs or main—schema/migration alignment with the stacked tables PR matters.

Reviewed by Cursor Bugbot for commit 8ef1a83. Bugbot is set up for automated code reviews on this repo. Configure here.

@datadog-official

datadog-official Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Code Quality  Code Vulnerabilities  IaC  Library Vulnerabilities  Secrets

🎉 All green!

🛠️ No new code quality issues
🛡️ No new code vulnerabilities
📚 No new vulnerable libraries detected
🧱 No new Infrastructure as Code (IaC) issues
🔑 No new secrets detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 8ef1a83 | Docs | Give us feedback!

updated_at: string;
}

export interface ArtifactFileRecord {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parent Interface - FileStore ( S3 vs local ) + DbStore ( postgres, sqlite)

list files for a version etc,

@rutvij-menavlikar
rutvij-menavlikar force-pushed the rutvij/age-2882_2 branch 4 times, most recently from 6186486 to 8de239e Compare November 20, 2026 12:05
rutvij-menavlikar and others added 13 commits November 20, 2026 17:39
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>
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>
Co-authored-by: Cursor <cursoragent@cursor.com>
rutvij-menavlikar and others added 3 commits November 20, 2026 18:03
…sion from latest_version

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
rutvij-menavlikar and others added 5 commits November 20, 2026 20:08
…act, MAX_TITLE_LENGTH

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…raint

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@veria-ai

veria-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

PR overview

No security issues were found in this pull request.

Reviews

This branch has not been deployed

No deployments
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.

2 participants