Skip to content

storage(#7642): CI gate for storage-backend deps outside tinystoragedrivers - #7700

Merged
senamakel merged 6 commits into
tinyhumansai:mainfrom
senamakel:storage-7642-host-1
Oct 13, 2026
Merged

senamakel merged 6 commits into
tinyhumansai:mainfrom
senamakel:storage-7642-host-1

Conversation

@senamakel

@senamakel senamakel commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Adds scripts/ci/check-storage-owner.mjs, wired into pnpm rust:layout (and pnpm storage:owner).
  • It reads cargo metadata for the root workspace and crates/openhuman-app, and fails when a first-party crate (path or git source) outside tinystoragedrivers* depends on rusqlite, libsqlite3-sys, mongodb, object_store, sqlx, redb, sled or rocksdb, or is named *-sqlite / *-mongodb / *-file. crates.io crates are ignored.
  • Allowlist, each with a reason: tinychannels (iMessage chat.db reader), openhuman-app (imessage scanner), tinymemory-integrations (legacy-import).
  • Self-test: scripts/__tests__/check-storage-owner.test.mjs (8 tests, pass).

Problem

Part of #7522: nothing stopped a storage backend dependency from creeping back in outside tinystoragedrivers.

Solution

Declared dependencies (any kind, optional included) of every first-party package in the resolved metadata are checked, so vendored crates are covered. No temporary allowlist entries were needed: the #7640 and #7641 offenders are already gone on upstream/main, so there is nothing to remove later.

Verification on this branch (cargo tree -i, depth 1):

root workspace:  rusqlite v0.40.2 <- tinymemory-integrations, tinystoragedrivers-sqlite
openhuman-app:   rusqlite v0.40.2 <- openhuman-app, tinymemory-integrations, tinystoragedrivers-sqlite
mongodb, object_store: not in either graph ("did not match any packages")

node scripts/ci/check-storage-owner.mjs exits 0; check-openhuman-rust-layout.mjs and check-crate-chain.mjs pass. No Rust changed, so no cargo builds were run.

Submission Checklist

  • Tests added or updated (clean, each forbidden dep, owner exemption, crate names, registry ignored, allowlist, CLI exit codes 0/1/2)
  • Diff coverage: N/A (scripts only)
  • Coverage matrix: N/A (CI tooling)
  • No new external network dependencies introduced: yes, none
  • Manual smoke checklist: N/A

Impact

CI only. crates/openhuman-app/Cargo.lock is left as upstream (cargo metadata locally wants a tinychannels-bus lock bump; unrelated).

Related

Closes #7642

Summary by CodeRabbit

  • Chores
    • Added an automated check to help ensure storage-related dependencies are used only by designated components.
    • The check now runs as part of the Rust layout validation and can also be run separately.
    • Added coverage for valid and invalid dependency metadata, check reports, and command-line outcomes.

senamakel and others added 6 commits October 13, 2026 14:36
Advance the vendored tinywallet submodule to a newer commit.

Auto-committed-on: dragonfly
Update the vendored tinywallet submodule to the latest upstream commit.

Auto-committed-on: dragonfly
The storage-owner check now runs as part of the rust:layout and storage:bypass
scripts so ownership violations are caught in the existing CI paths. The script
itself was reworked to deduplicate violations, print the report, and exit with a
proper status code, and cargo metadata no longer passes --no-deps so dependency
packages are included in the analysis.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

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 ✅ Completed 2026-10-13T11:57:26.356938Z 9ebaa5d 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 13, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

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

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9ce719e9-a5b4-4b54-be12-b45cbe69e5b5
📥 Commits

Reviewing files that changed from the base of the PR and between 7ebbd24 and 9ebaa5d.

📒 Files selected for processing (3)
  • package.json
  • scripts/__tests__/check-storage-owner.test.mjs
  • scripts/ci/check-storage-owner.mjs
 _______________________________________________________________________________________________________________
< Make quality a requirements issue. Involve your users in determining the project's real quality requirements. >
 ---------------------------------------------------------------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
  • 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 5c2233c into tinyhumansai:main Oct 13, 2026
12 of 21 checks passed

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ebaa5d08f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread package.json
"rust:module-boundaries": "node scripts/ci/check-module-boundaries.mjs",
"rust:module-boundaries:complete": "node scripts/ci/check-module-boundaries.mjs --require-complete",
"rust:layout": "node scripts/ci/check-openhuman-rust-layout.mjs && node scripts/ci/check-crate-chain.mjs && node scripts/ci/check-storage-bypass.mjs",
"rust:layout": "node scripts/ci/check-openhuman-rust-layout.mjs && node scripts/ci/check-crate-chain.mjs && node scripts/ci/check-storage-bypass.mjs && node scripts/ci/check-storage-owner.mjs",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Wire the owner check into the actual CI plan

Checked .github/workflows/ci-lanes.yml and scripts/ci/self-hosted/lanes-plan.mjs: PR CI executes check-openhuman-rust-layout.mjs directly at lines 189–192 and check-crate-chain.mjs at 231–233, and no workflow invokes pnpm rust:layout. Consequently manifest/dependency PRs never run this owner checker on repository metadata (the scripts lane only runs its fixture-based unit test), so the advertised gate cannot enforce the storage-driver ownership invariant; add it to the lane plan and arm it in .github/ci-paths-filter.yml.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

if (FORBIDDEN_CRATE_NAME.test(pkg.name)) {
out.push({ package: pkg.name, kind: 'crate-name', detail: `crate name matches ${FORBIDDEN_CRATE_NAME}` });
}
if (Object.hasOwn(allowlist, pkg.name)) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope reader exemptions to their justified dependency

If tinychannels, openhuman-app, or tinymemory-integrations later adds any other forbidden dependency (for example mongodb or object_store), this package-level continue skips the whole dependency loop, even though the recorded exception reasons only justify their read-only SQLite use. Such a real backend would pass the new gate; encode exemptions as package/dependency pairs and continue checking all other dependencies.

AGENTS.md reference: AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

Comment thread package.json
"dep:audit": "bash scripts/dep-audit/run.sh",
"agent:runtime-boundary": "node scripts/ci/check-agent-runtime-boundary.mjs",
"storage:bypass": "node scripts/ci/check-storage-bypass.mjs",
"storage:owner": "node scripts/ci/check-storage-owner.mjs",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Update the command documentation with the owner gate

This adds a public storage:owner command and expands pnpm rust:layout, but scripts/ci/README.md has no entry for check-storage-owner.mjs and its local-running section still says only the layout and crate-chain checks run through that command; scripts/README.md likewise omits the new entry point. Update those command indexes with this contract change so contributors can discover and diagnose the new Cargo-metadata gate.

AGENTS.md reference: AGENTS.md:L773-L773

Useful? React with 👍 / 👎.

@tinysweeper

tinysweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Adds a new CI gate that fails when a first-party package outside tinystoragedrivers* declares a forbidden storage-backend dependency or is named *-sqlite/*-mongodb/*-file. Across the critique, security, tests, commits, and description lanes no findings were reported, and the change is described as sound and safe to merge; note that the code index is behind this pull request (indexed at 7f4e63a), so retrieved context may be out of date, and one file (scripts/ci/check-storage-owner.mjs) could not be reviewed in the critique lane.

State: Incomplete
Priority: none
Reviewed head: 9ebaa5d08fba
Updated: 2026-10-13T18:10:22Z

Review snapshot

Change surface Files Review signal Count
Production 1 Active findings 0
Tests 1 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 1 Pending checks/questions 1

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

What changed

The pull request adds scripts/ci/check-storage-owner.mjs, a storage-owner CI gate that reads cargo metadata for the root workspace and crates/openhuman-app and fails when a first-party package outside tinystoragedrivers* declares a backend dependency or is named *-sqlite/*-mongodb/*-file. It wires the gate into the rust:layout script and adds a storage:owner script in package.json, and ships a colocated node:test self-test in scripts/__tests__/check-storage-owner.test.mjs that exercises the parsing, the allowlist, the report formatter and the CLI exit codes (0/1/2). No Rust changed.

Features

  • Added — Storage-owner CI gate: Introduces a new check that fails when a first-party package outside tinystoragedrivers* declares a forbidden storage-backend dependency or is named *-sqlite/*-mongodb/*-file, with read-only external-database readers permitted via an allowlist that requires a reason. (scripts/ci/check-storage-owner.mjs)
  • Added — storage:owner script and rust:layout wiring: Makes the new gate runnable directly and as part of the rust:layout aggregate check, so storage-backend ownership violations are caught in the existing layout CI path. (package.json)

Tests

  • self-test — A colocated node:test suite exercises the parsing, the allowlist, the report formatter and the CLI exit codes (0/1/2) against a hand-built cargo metadata shape; the test corpus matches what the code consumes and the CLI paths are exercised end to end.: The tests lane reported no defect worth reporting and described the change as sound and safe to merge. It notes the test corpus is written against a hand-built metadata shape rather than real cargo output. (scripts/__tests__/check-storage-owner.test.mjs, scripts/ci/check-storage-owner.mjs)

Findings

No active actionable findings.

Could not review: scripts/ci/check-storage-owner.mjs

Before merge

  • Complete the critique review for scripts/ci/check-storage-owner.mjs.
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: incomplete; unanswered: scripts/ci/check-storage-owner.mjs
  • Lane summary: Reviewed 2 files; 0 findings. 1 file could not be reviewed: scripts/ci/check-storage-owner.mjs. _The code index is behind this pull request (indexed at `7f4e63ae7c89`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The security lane reviewed all three files and reported zero findings.
  • Lane summary: Reviewed 3 files; 0 findings. _The code index is behind this pull request (indexed at `7f4e63ae7c89`), so retrieved context may be out of date._

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The tests lane found no defect worth reporting, stating the self-test corpus matches what the code consumes and the CLI paths are exercised end to end, making the change sound and safe to merge.
  • Lane summary: Adds a new CI gate (scripts/ci/check-storage-owner.mjs) that reads `cargo metadata` for the root workspace and crates/openhuman-app and fails when a first-party package outside tinystoragedrivers* declares a backend dependency or is named *-sqlite/*-mongodb/*-file, wires it into `rust:layout`, and ships a colocated node:test self-test that exercises the parsing, the allowlist, the report formatter and the CLI exit codes (0/1/2). The test corpus is written against a hand-built metadata shape, but it does match what the code consumes and the CLI paths are exercised end to end, so the change looks sound and safe to merge; I found no defect worth reporting. _The code index is behind this pull request (indexed at `7f4e63ae7c89`), so retrieved context may be out of date._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Positive: The commits lane reported nothing sensitive found in what this pull request commits.
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Positive: The description lane reported the description matches the diff accurately, including the claim that no Rust changed, with no defect found.
  • Lane summary: Adds a new storage-owner CI gate (`scripts/ci/check-storage-owner.mjs`), wires it into `pnpm rust:layout`, and ships an 8-case self-test; the description matches the diff accurately, including the claim that no Rust changed. No defect found. _The code index is behind this pull request (indexed at `7f4e63ae7c89`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, deepseek-v4.1-flash
  • Spend: $0.002989
  • Tokens: 407894 input · 37068 output · 98560 cached · 324 embedding
Head State Pass summary
9ebaa5d08fba incomplete 0 active finding(s), 0 resolved finding(s) (at 2026-10-13T18:10:22Z)

tinysweeper 0.1.2

@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 found nothing blocking, but could not review everything, so this is not an approval: scripts/ci/check-storage-owner.mjs.

             $0.0030 · 407,894 in / 37,068 out · 98,560 cached (24%) · ladder/vectors-oai3, deepseek-v4.1-flash · 324 embedded
critique:    $0.0023 · 170,970 in / 32,847 out · 54,400 cached (32%) · deepseek-v4.1-flash
security:    $0.0005 · 139,594 in / 1,728 out  · 28,928 cached (21%) · deepseek-v4.1-flash
tests:       $0.0001 · 59,849 in  / 893 out    · 7,808 cached (13%)  · deepseek-v4.1-flash
description: $0.0001 · 32,374 in  / 651 out    · 7,424 cached (23%)  · deepseek-v4.1-flash

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage 8/8: CI gate — no storage-backend deps or *-sqlite/*-mongodb/*-file crates outside tinystoragedrivers

1 participant