Skip to content

feat(storage): migrate TinyArtifacts to TSD v2 - #9

Merged
senamakel merged 6 commits into
mainfrom
epic-8131-tinyartifacts-upstream
Oct 22, 2026
Merged

senamakel merged 6 commits into
mainfrom
epic-8131-tinyartifacts-upstream

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

Complete TinyArtifacts' migration to TinyStorageDrivers v2 and consume the canonical upstream TSD 2.1.0 revision. The artifact document store and blob adapter use host-bound ports; backend engine implementations remain feature-gated in TinyStorageDrivers. This branch also retains the legacy artifact import path and its real previous-release fixture.

The branch includes the current TinyArtifacts main history and pins tinystoragedrivers-types, api, and testkit to canonical revision 05eaada962decbab33bafa4763d2bd1a67f6b456.

Verification

  • cargo check --manifest-path Cargo.toml -p tiny-artifacts --all-features --offline
  • cargo test --manifest-path Cargo.toml --workspace --all-features --offline
  • cargo clippy --manifest-path Cargo.toml --workspace --all-targets --all-features --offline -- -D warnings
  • cargo fmt --manifest-path Cargo.toml --all -- --check
  • cargo deny --manifest-path Cargo.toml check sources
  • .github/scripts/check-storage-engines.sh
  • .github/scripts/check-file-coverage.sh (all executable source files meet the 90% line threshold)

Part of tinyhumansai/openhuman#8131.

@tinysweeper

tinysweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Verdict: Incomplete · Priority: none
Coverage: Reviewed 6 of 24 files; not reviewed: Cargo.lock, crates/tiny-arti…, and 1 additional unreviewed files; not reviewed (large PR): .github/scripts/…, .github/workflow…, and 13 additional unreviewed files.
Pull request purpose (title): feat(storage): migra…

Diagnostics and supporting details

Full summary

Pull request purpose (title): feat(storage): migrate TinyArtifacts to TSD v2. Tiny Sweeper completed its review; deterministic results follow.

Unreviewed paths

  • .github/scripts/check-storage-engines.sh
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • Cargo.lock
  • crates/tiny-artifacts/src/file_store.rs
  • crates/tiny-artifacts/src/file_store_tests.rs
  • crates/tiny-artifacts/src/fs_store.rs
  • crates/tiny-artifacts/src/service.rs
  • crates/tiny-artifacts/src/storage.rs
  • crates/tiny-artifacts/src/storage_tests.rs
  • crates/tiny-artifacts/src/store.rs
  • crates/tiny-artifacts/tests/diff.rs
  • crates/tiny-artifacts/tests/fixtures/README.md
  • crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs
  • crates/tiny-artifacts/tests/fixtures/previous-release-1.json
  • crates/tiny-artifacts/tests/fs_store.rs
  • crates/tiny-artifacts/tests/service.rs
  • crates/tiny-artifacts/tests/shared_files.rs

Partial review reasons

  • critique: .github/scripts/check-storage-engines.sh — not selected by the large-review budget
  • security: .github/scripts/check-storage-engines.sh — not selected by the large-review budget
  • critique: .github/workflows/ci.yml — not selected by the large-review budget
  • critique: CHANGELOG.md — not selected by the large-review budget
  • critique: crates/tiny-artifacts/src/file_store.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/src/file_store.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/src/file_store_tests.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/src/file_store_tests.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/src/service.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/src/service.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/src/storage.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/src/storage.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/src/storage_tests.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/src/storage_tests.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/src/store.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/src/store.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/tests/diff.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/tests/diff.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/tests/fixtures/README.md — not selected by the large-review budget
  • critique: crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/tests/fixtures/previous-release-1.json — not selected by the large-review budget
  • security: crates/tiny-artifacts/tests/fixtures/previous-release-1.json — not selected by the large-review budget
  • critique: crates/tiny-artifacts/tests/service.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/tests/service.rs — not selected by the large-review budget
  • critique: crates/tiny-artifacts/tests/shared_files.rs — not selected by the large-review budget
  • security: crates/tiny-artifacts/tests/shared_files.rs — not selected by the large-review budget

Review snapshot

Change surface Files Review signal Count
Production 7 Active findings 0
Tests 9 Noted findings 0
Documentation 3 Resolved findings 0
Configuration 4 Pending checks/questions 42

Completeness: Incomplete
Test assessment: Test coverage is assessed from changed tests and lane evidence; execution is not claimed without trusted check data.

What changed

Record persistence moved to `DocumentArtifactStore`, which opens over an already-bound `Storage`, ensures `artifacts.records` and `artifacts.migrations`, and writes a schema-version checkpoint via `put_with` with an `Absent`-or-`Version` precondition, tolerating a conflict when the latest checkpoint already shows completion. Legacy records are imported through `import_legacy_record_json`, which validates the id, writes with `Precondition::Absent`, and accepts a conflict only when the existing document's schema, absence of expiry, and body all match. File bytes are adapted through `BlobFileStore` over the host blob handle; `FsArtifactStore`, `FsFileStore`, `Artifacts::with_version_files`, and `import_legacy_file` are deleted, `validate_id` relocates to `store.rs`, `storage_schema` is replaced by `collections()`, and the public re-exports, README example, CHANGELOG, and CI workflow are updated to match. A new engine guard script runs in CI to keep storage engine crates out of library dependency trees.

Features

  • Added — DocumentArtifactStore over host-bound document port: Artifact records are persisted as documents in a host-provided storage scope, and `open` ensures the crate's collections and applies its schema checkpoint before returning a usable store, so the library no longer owns host paths or persistence engines. (crates/tiny-artifacts/src/document_store.rs, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/lib.rs pub mod tools;)
  • Added — Legacy record import from serialized bytes: Hosts can hand each previous-release record's JSON bytes to `import_legacy_record_json`; ids are validated, an exact replay is treated as a no-op returning false, and an id already holding different content, a foreign schema, or an expiry is rejected as a conflict rather than overwriting. (crates/tiny-artifacts/src/document_store.rs, crates/tiny-artifacts/src/store.rs pub trait ArtifactStore: Send + Sync {)
  • Modified — BlobFileStore rebound to Storage and legacy/filesystem import removed: `BlobFileStore::new` now takes the host-bound `Storage` bundle instead of a scoped handle, and `import_legacy_file` is removed so that locating source files and copying legacy bytes are host responsibilities. (crates/tiny-artifacts/src/file_store.rs fn validate_prefix(prefix: &str) -> Result<()> {, crates/tiny-artifacts/src/file_store.rs pub trait FileStore: Send + Sync {, crates/tiny-artifacts/src/file_store.rs impl FileStore for BlobFileStore {)
  • Removed — Filesystem stores dropped: `FsArtifactStore` and `FsFileStore`, plus `Artifacts::with_version_files`, are deleted from the library, so hosts must supply a document store and file store explicitly; this is a breaking public API change noted in the CHANGELOG. (crates/tiny-artifacts/src/fs_store.rs, crates/tiny-artifacts/src/file_store.rs, crates/tiny-artifacts/src/service.rs impl Artifacts {)
  • Internal refactor — validate_id moved to store.rs and storage declarations reshaped: Id validation is now a shared crate-internal helper used by the store and service paths, and `storage_schema` is replaced by `collections()` returning the two crate-owned document collections for host setup. (crates/tiny-artifacts/src/store.rs pub trait ArtifactStore: Send + Sync {, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/service.rs impl Artifacts {)
  • Added — Storage engine dependency guard in CI: The workspace fails CI if any library target's normal or build dependency tree contains a storage engine crate, with a built-in self-test pinning the allowed-versus-forbidden classification before the real scan runs. (.github/scripts/check-storage-engines.sh, .github/workflows/ci.yml jobs:)
  • Modified — Dependency pins and documentation updated: The crate now depends on `tinystoragedrivers-types`, `api`, and `testkit` at the canonical revision instead of `tinystoragedrivers-core`, and README/CHANGELOG were rewritten around the new ports and import path. (Cargo.toml uuid = { version = "1", features = ["v4"] }, crates/tiny-artifacts/Cargo.toml uuid.workspace = true, README.md All creation and change goes through one service, `Artifacts`:, README.md The service enforces the rules, whoever is calling:, README.md artifacts)

Tests

  • unit — Document store open/round-trip behavior: the migration marker records the schema version, upserts carry the schema, listing is newest-first, get/delete round-trip, and a reopened store still reads records.: Added inside the crate's test module with the testkit in-memory backend; exercises the checkpoint and record paths directly. (crates/tiny-artifacts/src/document_store_tests.rs)
  • unit — Legacy import idempotency, conflict handling, schema/expiry preconditions, corrupt-record listing versus get errors, and propagation of injected backend, conflict, ensure, and metadata failures.: Added using the testkit FaultPlan to drive retry/conflict and failure branches rather than asserting against mocks. (crates/tiny-artifacts/src/document_store_tests.rs)
  • unit — Blob adapter reads metadata across instances, deletes only the requested prefix without touching a sibling key, and rejects invalid keys and noncanonical or traversal prefixes.: Retained and reworked assertions for the blob file store now that the filesystem store is gone. (crates/tiny-artifacts/src/file_store_tests.rs, crates/tiny-artifacts/src/file_store.rs)
  • unit — `collections()` exposes exactly the artifact-owned document collections `artifacts.records` and `artifacts.migrations`.: Adjusted storage test replacing the former owner/blob-prefix schema assertions. (crates/tiny-artifacts/src/storage_tests.rs, crates/tiny-artifacts/src/storage.rs)
  • integration — Separate services over the same scoped backend read, share, and delete the same file versions, with the prefix listing empty after delete.: Reworked to use the testkit memory backend under a named scope; test-source change only. (crates/tiny-artifacts/tests/shared_files.rs async fn separate_services_read_share_and_delete_shared_file_versions() {, crates/tiny-artifacts/tests/shared_files.rs use tiny_artifacts::{)
  • fixture — A real serialized previous-release `ArtifactRecord` produced by the prior `FsArtifactStore::upsert`, plus a checked-in generator and README describing how to regenerate it and its expected SHA-256.: Provides the input exercised by the legacy import tests; the fixture-deriving generator references the removed `FsArtifactStore` from the archived revision, not the current source. (crates/tiny-artifacts/tests/fixtures/previous-release-1.json, crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs, crates/tiny-artifacts/tests/fixtures/README.md)
  • unit — Diff test assertion tightened to compare line count to zero instead of an empty-vector check.: Cosmetic assertion change with equivalent behavior. (crates/tiny-artifacts/tests/diff.rs fn writing_into_an_empty_version_is_total_churn_and_no_change_is_none() {)

Findings

No active actionable findings.

Before merge

  • Complete the critique review for .github/workflows/ci.yml, crates/tiny-artifacts/src/file_store.rs, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/service.rs, crates/tiny-artifacts/src/file_store_tests.rs, .github/scripts/check-storage-engines.sh, crates/tiny-artifacts/tests/service.rs, crates/tiny-artifacts/tests/fixtures/README.md, crates/tiny-artifacts/tests/shared_files.rs, crates/tiny-artifacts/src/store.rs, crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs, crates/tiny-artifacts/src/storage_tests.rs, CHANGELOG.md, crates/tiny-artifacts/tests/diff.rs, crates/tiny-artifacts/tests/fixtures/previous-release-1.json.
  • Complete the security review for crates/tiny-artifacts/src/file_store.rs, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/service.rs, crates/tiny-artifacts/src/file_store_tests.rs, .github/scripts/check-storage-engines.sh, crates/tiny-artifacts/tests/service.rs, crates/tiny-artifacts/tests/shared_files.rs, crates/tiny-artifacts/src/store.rs, crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs, crates/tiny-artifacts/src/storage_tests.rs, crates/tiny-artifacts/tests/diff.rs, crates/tiny-artifacts/tests/fixtures/previous-release-1.json.
  • Review uncovered paths: .github/scripts/check-storage-engines.sh, .github/workflows/ci.yml, CHANGELOG.md, crates/tiny-artifacts/src/file_store.rs, crates/tiny-artifacts/src/file_store_tests.rs, crates/tiny-artifacts/src/service.rs, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/storage_tests.rs, crates/tiny-artifacts/src/store.rs, crates/tiny-artifacts/tests/diff.rs, crates/tiny-artifacts/tests/fixtures/README.md, crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs, crates/tiny-artifacts/tests/fixtures/previous-release-1.json, crates/tiny-artifacts/tests/service.rs, crates/tiny-artifacts/tests/shared_files.rs.
Agent review details

critique

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered files: .github/workflows/ci.yml, crates/tiny-artifacts/src/file_store.rs, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/service.rs, crates/tiny-artifacts/src/file_store_tests.rs, .github/scripts/check-storage-engines.sh, crates/tiny-artifacts/tests/service.rs, crates/tiny-artifacts/tests/fixtures/README.md, crates/tiny-artifacts/tests/shared_files.rs, crates/tiny-artifacts/src/store.rs, crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs, crates/tiny-artifacts/src/storage_tests.rs, CHANGELOG.md, crates/tiny-artifacts/tests/diff.rs, crates/tiny-artifacts/tests/fixtures/previous-release-1.json
  • Lane summary: Reviewed 6 of 21 files — 15 not reviewed. Reviewed 6 files; 2 findings. 15 files were omitted: not selected by the large-review budget.

security

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered files: crates/tiny-artifacts/src/file_store.rs, crates/tiny-artifacts/src/storage.rs, crates/tiny-artifacts/src/service.rs, crates/tiny-artifacts/src/file_store_tests.rs, .github/scripts/check-storage-engines.sh, crates/tiny-artifacts/tests/service.rs, crates/tiny-artifacts/tests/shared_files.rs, crates/tiny-artifacts/src/store.rs, crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs, crates/tiny-artifacts/src/storage_tests.rs, crates/tiny-artifacts/tests/diff.rs, crates/tiny-artifacts/tests/fixtures/previous-release-1.json
  • Lane summary: Reviewed 6 of 18 files — 12 not reviewed. Reviewed 6 files; 0 findings. 12 files were omitted: not selected by the large-review budget. 3 files were not security-reviewed: CHANGELOG.md (prose or tabular data), README.md (prose or tabular data), crates/tiny-artifacts/tests/fixtures/README.md (prose or tabular data).

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Tests lane answered with no findings and noted that document-store tests pin migration checkpoints, precondition conflicts, corrupt records, invalid ids, scope isolation, expiry rejection, and injected backend faults rather than asserting on mocks.
  • Positive: Tests lane noted blob/file store tests retain traversal, canonical-segment, and prefix-boundary assertions including sibling-key preservation on prefix delete.
  • Lane summary: This change replaces the crate's filesystem-backed stores (FsArtifactStore, FsFileStore) with host-bound storage ports (DocumentArtifactStore over DocumentStore, BlobFileStore over BlobStore), moves validate_id into store.rs, and drops import_legacy_file in favour of import_legacy_record_json. The new document store's tests are substantive: they exercise migration checkpoints, precondition conflicts, corrupt records, invalid ids, scope isolation, expiry rejection, and injected backend failures via the testkit FaultPlan, so the retry/conflict branches in migrate and import_legacy_record_json are pinned rather than asserted on mocks. The blob/file store tests retain the traversal, canonical-segment and prefix-boundary assertions, including that delete_prefix does not touch a sibling key. I found no defect that fails or misbehaves for a reachable input, and no violation of the repository's stated coding rules; the only changes I could not verify from here are inside the tinystoragedrivers crates, which are outside this repository. _The code index is behind this pull request (indexed at `e051287af4ab`), so retrieved context may be out of date._

commits

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: Commits lane answered with no findings, reporting no sensitive content in committed files.
  • Lane summary: No sensitive content in committed files. _The code index is behind this pull request (indexed at `e051287af4ab`), so retrieved context may be out of date._

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The change migrates TinyArtifacts off its filesystem stores to host-bound TSD v2 document/blob ports, rewires lib, service, README, CHANGELOG and CI, and adds a storage-engine guard script; the new account store, import path, migration checkpointing and tests look consistent with the code that remains, and I found no defect I can anchor to a concrete reachable input. I did not verify the pin thoroughness of every TSD-derived dependency in the new graph, but nothing in this diff is wrong on that account. _The code index is behind this pull request (indexed at `e051287af4ab`), so retrieved context may be out of date._
Evidence and run details
  • Models: deepseek-v4.1-flash, ladder/vectors-oai3
  • Spend: $0.004349
  • Tokens: 757257 input · 12427 output · 79488 cached · 769 embedding
  • Updated: 2026-10-22T11:53:59Z
Head State Pass summary
f322ccbbe450 incomplete 0 active finding(s), 0 resolved finding(s) (at 2026-10-22T11:53:59Z)

tinysweeper 0.1.2

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-22T11:53:23.298371Z f322ccb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5b674e5e-28fe-4e38-8f56-95d8ad062bcc
📥 Commits

Reviewing files that changed from the base of the PR and between 21d0c50 and f322ccb.

⛔ Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 23
  • .github/scripts/check-storage-engines.sh
  • .github/workflows/ci.yml
  • CHANGELOG.md
  • Cargo.toml
  • README.md
  • crates/tiny-artifacts/Cargo.toml
  • crates/tiny-artifacts/src/document_store.rs
  • crates/tiny-artifacts/src/document_store_tests.rs
  • crates/tiny-artifacts/src/file_store.rs
  • crates/tiny-artifacts/src/file_store_tests.rs
  • crates/tiny-artifacts/src/fs_store.rs
  • crates/tiny-artifacts/src/lib.rs
  • crates/tiny-artifacts/src/service.rs
  • crates/tiny-artifacts/src/storage.rs
  • crates/tiny-artifacts/src/storage_tests.rs
  • crates/tiny-artifacts/src/store.rs
  • crates/tiny-artifacts/tests/diff.rs
  • crates/tiny-artifacts/tests/fixtures/README.md
  • crates/tiny-artifacts/tests/fixtures/generate_legacy_artifact.rs
  • crates/tiny-artifacts/tests/fixtures/previous-release-1.json
  • crates/tiny-artifacts/tests/fs_store.rs
  • crates/tiny-artifacts/tests/service.rs
  • crates/tiny-artifacts/tests/shared_files.rs
+--------------------------------------------------+
| Veni, Vidi, Validavi. I came, I saw, I reviewed. |
+--------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@senamakel
senamakel merged commit e4aecbe into main Oct 22, 2026
14 of 15 checks passed

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper could not complete coverage (15 unanswered item(s)), so this is not an approval.

Diagnostics

Total spend: $0.0043

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant