Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

Merge remote-tracking branch 'upstream/main' into storage-bypass-ratchet-7434

Steven Enamakel912251333d37
diff --cc .github/ci-paths-filter.yml
index 2d343b5d7a,ca6e46d3dd..0d7aa8def3
--- a/.github/ci-paths-filter.yml
+++ b/.github/ci-paths-filter.yml
@@@ -11,59 -11,59 +11,59 @@@
# The self-reference entries arm every area when any CI workflow, this file or
# the lane runner changes, so CI edits exercise the lanes they touch.
frontend:
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
-- - 'scripts/ci-cancel-aware.sh'
-- - 'package.json'
-- - 'pnpm-lock.yaml'
-- - 'app/package.json'
-- - 'app/index.html'
-- - 'app/public/**'
-- - 'app/src/**'
-- - 'app/scripts/**'
-- - 'app/test/vitest.config.ts'
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "scripts/ci-cancel-aware.sh"
++ - "package.json"
++ - "pnpm-lock.yaml"
++ - "app/package.json"
++ - "app/index.html"
++ - "app/public/**"
++ - "app/src/**"
++ - "app/scripts/**"
++ - "app/test/vitest.config.ts"
# The e2e/Playwright specs themselves: `typecheck:e2e` in the frontend
# job exists to check them, so a PR that touches only a spec has to
# match this filter or the job skips and the check reads as green.
-- - 'app/test/**'
-- - 'app/tsconfig*.json'
-- - 'app/vite.config.*'
-- - 'app/tailwind.config.*'
-- - 'app/postcss.config.*'
++ - "app/test/**"
++ - "app/tsconfig*.json"
++ - "app/vite.config.*"
++ - "app/tailwind.config.*"
++ - "app/postcss.config.*"
i18n:
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
-- - 'app/src/**'
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "app/src/**"
docs:
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
-- - 'app/src/App.tsx'
-- - 'scripts/generate-architecture-docs.mjs'
-- - 'scripts/__tests__/generate-architecture-docs.test.mjs'
- - 'gitbooks/developing/architecture/frontend.md'
- - 'gitbooks/developing/embed/**'
- - 'gitbooks/developing/embedding.md'
- - 'gitbooks/SUMMARY.md'
- - 'docs/gitbooks/en/developing/architecture/frontend.md'
-- - 'docs/gitbooks/en/developing/embed/**'
-- - 'docs/gitbooks/en/developing/embedding.md'
-- - 'docs/gitbooks/en/SUMMARY.md'
-- - 'crates/openhuman-embed/**'
-- - 'scripts/generate-embed-docs.mjs'
-- - 'scripts/run-embed-examples.mjs'
-- - 'scripts/__tests__/generate-embed-docs.test.mjs'
-- - 'scripts/__tests__/run-embed-examples.test.mjs'
-- - 'llms.txt'
-- - 'llms-full.txt'
-- - 'EMBED.md'
-- - 'package.json'
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "app/src/App.tsx"
++ - "scripts/generate-architecture-docs.mjs"
++ - "scripts/__tests__/generate-architecture-docs.test.mjs"
++ - "docs/gitbooks/en/developing/architecture/frontend.md"
++ - "docs/gitbooks/en/developing/embed/**"
++ - "docs/gitbooks/en/developing/embedding.md"
++ - "docs/gitbooks/en/SUMMARY.md"
++ - "crates/openhuman-embed/**"
++ - "scripts/generate-embed-docs.mjs"
++ - "scripts/run-embed-examples.mjs"
++ - "scripts/__tests__/generate-embed-docs.test.mjs"
++ - "scripts/__tests__/run-embed-examples.test.mjs"
++ - "llms.txt"
++ - "llms-full.txt"
++ - "EMBED.md"
++ - "package.json"
rust-core:
- - '.config/nextest.toml'
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
-- - 'scripts/ci/rust-coverage.sh'
- - 'scripts/ci/nextest-coverage.sh'
- - 'scripts/ci/nextest-report.mjs'
++ - ".config/nextest.toml"
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "scripts/ci/rust-coverage.sh"
++ - "scripts/ci/nextest-coverage.sh"
++ - "scripts/ci/nextest-report.mjs"
# The product feature set decides what the Rust lanes below
# actually compile (clippy's `--features`, the test suite's, and
# rust-coverage.sh's). Changing it changes the code under
@@@ -71,46 -71,48 +71,48 @@@
# this lane too — #5619 turned `hosting` on and, without this
# entry, resolved to `["rust-tauri"]` alone, skipping every lane
# that would have compiled the family it enabled.
-- - 'scripts/ci/product-features.*'
++ - "scripts/ci/product-features.*"
# The feature-gate smoke owns the dependency-floor ratchet. Its
# limits and measurement logic must arm that lane themselves.
-- - 'scripts/kernel-floor.limits'
-- - 'scripts/check-kernel-floor.sh'
-- - 'scripts/kernel-floor.sh'
-- - 'scripts/dep-sim.py'
++ - "scripts/kernel-floor.limits"
++ - "scripts/check-kernel-floor.sh"
++ - "scripts/kernel-floor.sh"
++ - "scripts/dep-sim.py"
# The coverage-presence gate and its allowlist decide whether this
# lane FAILS, so they arm it for the same reason.
-- - 'scripts/ci/assert-coverage-presence.sh'
-- - 'scripts/ci/coverage-presence-allowlist.txt'
-- - 'scripts/ci/check-openhuman-rust-layout.mjs'
-- - 'scripts/ci/check-crate-chain.mjs'
- - 'scripts/ci/check-storage-owner.mjs'
- - 'scripts/ci/check-storage-schema.mjs'
-- - 'scripts/ci/check-agent-runtime-boundary.mjs'
-- - 'scripts/ci/agent-runtime-boundary-baseline.json'
-- - 'scripts/ci/check-saas-ambient.mjs'
-- - 'scripts/ci/saas-ambient-baseline.json'
++ - "scripts/ci/assert-coverage-presence.sh"
++ - "scripts/ci/coverage-presence-allowlist.txt"
++ - "scripts/ci/check-openhuman-rust-layout.mjs"
++ - "scripts/ci/check-crate-chain.mjs"
++ - "scripts/ci/check-storage-owner.mjs"
++ - "scripts/ci/check-storage-schema.mjs"
++ - "scripts/ci/check-agent-runtime-boundary.mjs"
++ - "scripts/ci/agent-runtime-boundary-baseline.json"
++ - "scripts/ci/check-saas-ambient.mjs"
++ - "scripts/ci/saas-ambient-baseline.json"
# The ignored-test ratchet lives in rust-quality. Its checker and
# its baseline must arm that lane themselves, or a PR that raises
# the baseline skips the only gate that reads it.
-- - 'scripts/ci/check-ignored-tests.mjs'
-- - 'scripts/ci/ignored-test-baseline.json'
-- - 'scripts/ci/list-feature-gated-rust-tests.mjs'
-- - 'Cargo.toml'
-- - 'crates/openhuman-core/**'
-- - 'crates/openhuman-embed/**'
-- - 'crates/openhuman-tinyhumans/**'
-- - 'crates/openhuman-rpc/**'
-- - 'crates/openhuman-cli/**'
-- - 'crates/openhuman-tui/**'
-- - 'Cargo.lock'
-- - 'build.rs'
-- - '.cargo/config.toml'
-- - 'rust-toolchain.toml'
-- - 'src/**'
-- - 'tests/**'
-- - 'scripts/ci-cancel-aware.sh'
-- - 'scripts/check-linux-tls-dependencies.sh'
-- - 'scripts/test-rust-e2e.sh'
-- - 'scripts/test-rust-with-mock.sh'
++ - "scripts/ci/check-ignored-tests.mjs"
++ - "scripts/ci/ignored-test-baseline.json"
++ - "scripts/ci/list-feature-gated-rust-tests.mjs"
++ - "Cargo.toml"
++ - "crates/openhuman-core/**"
++ - "crates/openhuman-embed/**"
++ - "crates/openhuman-tinyhumans/**"
++ - "crates/openhuman-rpc/**"
++ - "crates/openhuman-cli/**"
++ - "crates/openhuman-tui/**"
++ - "Cargo.lock"
++ - "build.rs"
++ - ".cargo/config.toml"
++ - "rust-toolchain.toml"
++ - "src/**"
++ - "tests/**"
++ - "scripts/ci-cancel-aware.sh"
++ - "scripts/check-linux-tls-dependencies.sh"
++ - "scripts/test-rust-e2e.sh"
++ - "scripts/test-rust-with-mock.sh"
# Every vendored crate, not an enumeration. `[patch.crates-io]`
# force-resolves all ten submodules by path, so ANY pointer bump
# changes what this crate compiles against. The previous list
@@@ -119,150 -121,160 +121,164 @@@
# Enumerating here failed the same way the release Docker
# submodule list did three times before #5596 replaced it with
# `--init --recursive`. Do not go back to a list.
-- - '.gitmodules'
-- - 'vendor/**'
++ - ".gitmodules"
++ - "vendor/**"
rust-tauri:
- - '.config/nextest.toml'
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
- - 'scripts/ci/nextest-coverage.sh'
- - 'scripts/ci/nextest-report.mjs'
-- - 'Cargo.lock'
-- - '.cargo/config.toml'
-- - 'rust-toolchain.toml'
-- - 'crates/openhuman-app/**'
-- - 'scripts/ci-cancel-aware.sh'
++ - ".config/nextest.toml"
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "scripts/ci/nextest-coverage.sh"
++ - "scripts/ci/nextest-report.mjs"
++ - "Cargo.lock"
++ - ".cargo/config.toml"
++ - "rust-toolchain.toml"
++ - "crates/openhuman-app/**"
++ - "scripts/ci-cancel-aware.sh"
# The shell is a second Cargo world with its own duplicate
# `[patch.crates-io]` table pointing at the same submodules, so it
# is affected by a bump exactly as the core is. It named none.
-- - '.gitmodules'
-- - 'vendor/**'
++ - ".gitmodules"
++ - "vendor/**"
# Shared mock backend + script self-tests. The mock backend every
# E2E suite depends on had zero PR-lane coverage before this (its
# own socket-auth tests never ran in CI) — arm the scripts
# self-test job on any mock/script change.
scripts:
- - 'scripts/ci/rust-coverage.sh'
- - 'scripts/ci/fetch-submodule-tags.sh'
- - '.config/nextest.toml'
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
- - 'scripts/ci/nextest-coverage.sh'
- - 'scripts/ci/nextest-report.mjs'
-- - 'scripts/ci/check-module-boundaries.mjs'
-- - 'scripts/ci/module-boundaries.json'
- - 'scripts/ci/check-storage-bypass.mjs'
- - 'scripts/ci/storage-bypass-debt.mjs'
- - 'scripts/ci/storage-bypass*.json'
- - 'scripts/ci/storage-bypass*.md'
-- - 'scripts/ci/check-process-statics.mjs'
- - 'scripts/ci/check-ci-module-source.mjs'
-- - 'scripts/ci/check-crate-chain.mjs'
- - 'scripts/ci/check-storage-owner.mjs'
- - 'scripts/ci/check-storage-schema.mjs'
-- - 'scripts/ci/process-statics.json'
-- - 'scripts/mock-api/**'
-- - 'scripts/*.mjs'
-- - 'scripts/__tests__/**'
++ - "scripts/ci/rust-coverage.sh"
++ - "scripts/ci/fetch-submodule-tags.sh"
++ - ".config/nextest.toml"
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "scripts/ci/nextest-coverage.sh"
++ - "scripts/ci/nextest-report.mjs"
++ - "scripts/ci/check-module-boundaries.mjs"
++ - "scripts/ci/module-boundaries.json"
++ - "scripts/ci/check-storage-bypass.mjs"
++ - "scripts/ci/storage-bypass-debt.mjs"
++ - "scripts/ci/storage-bypass*.json"
++ - "scripts/ci/storage-bypass*.md"
++ - "scripts/ci/check-process-statics.mjs"
++ - "scripts/ci/check-ci-module-source.mjs"
++ - "scripts/ci/check-crate-chain.mjs"
++ - "scripts/ci/check-storage-owner.mjs"
++ - "scripts/ci/check-storage-schema.mjs"
++ - "scripts/ci/process-statics.json"
++ - "scripts/mock-api/**"
++ - "scripts/*.mjs"
++ - "scripts/__tests__/**"
# The inference capture proxy has node --test coverage in
# scripts/__tests__/ but lives under scripts/debug/.
-- - 'scripts/debug/*.mjs'
++ - "scripts/debug/*.mjs"
# The release-notes generator has node --test coverage in
# scripts/__tests__/ but lives one directory down, so the
# 'scripts/*.mjs' glob above never armed this lane for it — its
# tests could not have caught the v0.63.21 git ENOBUFS regression.
-- - 'scripts/release/*.mjs'
++ - "scripts/release/*.mjs"
# Bash helpers with node --test coverage in scripts/__tests__/.
-- - 'scripts/ci/assert-coverage-presence.sh'
-- - 'scripts/test-rust-e2e.sh'
++ - "scripts/ci/assert-coverage-presence.sh"
++ - "scripts/test-rust-e2e.sh"
# The web E2E build and session scripts, whose bundle guard and port
# guard are covered by scripts/__tests__/e2e-web-*.test.mjs. They match
# the frontend filter above, which runs no node --test suite, so without
# these a change to either script would skip the tests that pin it.
-- - 'app/scripts/e2e-ports.sh'
-- - 'app/scripts/e2e-web-build.sh'
-- - 'app/scripts/e2e-web-session.sh'
++ - "app/scripts/e2e-ports.sh"
++ - "app/scripts/e2e-web-build.sh"
++ - "app/scripts/e2e-web-session.sh"
# Shared logic behind the gate CLIs, and the module-pin gate's own
# files. Without these a change to the checking logic would skip
# the lane that tests it — the gate would stop watching itself.
-- - 'scripts/lib/**'
-- - 'scripts/ci/check-module-pins.mjs'
-- - 'scripts/ci/check-submodule-monotonic.mjs'
-- - 'scripts/ci/module-pin-exemptions.json'
++ - "scripts/lib/**"
++ - "scripts/ci/check-module-pins.mjs"
++ - "scripts/ci/check-submodule-monotonic.mjs"
++ - "scripts/ci/module-pin-exemptions.json"
# The ignored-test ratchet has node --test coverage in
# scripts/__tests__/ — editing the gate must run the tests that
# pin its clauses, or the counter's anchoring and its
# cfg_attr guard can be loosened with nothing watching.
-- - 'scripts/ci/check-ignored-tests.mjs'
++ - "scripts/ci/check-ignored-tests.mjs"
# The web E2E build/session contract has script-level regression
# tests; run them when either participant or Vite changes.
-- - 'app/scripts/e2e-web-build.sh'
-- - 'app/scripts/e2e-web-session.sh'
-- - 'app/vite.config.*'
++ - "app/scripts/e2e-web-build.sh"
++ - "app/scripts/e2e-web-session.sh"
++ - "app/vite.config.*"
# The storage-target parity test in self-hosted-lanes.test.mjs checks that
# every registered `tests/storage_*_e2e.rs` target is in the storage lane
# and the MongoDB workflow; adding a target must run it.
-- - 'tests/storage_*.rs'
-- - 'tests/cli_storage_url_e2e.rs'
-- - 'crates/openhuman-cli/Cargo.toml'
-- - '.github/workflows/storage-mongodb.yml'
++ - "tests/storage_*.rs"
++ - "tests/cli_storage_url_e2e.rs"
++ - "crates/openhuman-cli/Cargo.toml"
++ - ".github/workflows/storage-mongodb.yml"
# Test-wiring surface: a change here can orphan a test or add an
# untested controller domain → run the inventory guard.
inventory:
-- - '.github/workflows/**'
-- - 'package.json'
-- - 'crates/openhuman-core/src/core/all.rs'
-- - 'tests/**'
-- - 'scripts/**/*.test.mjs'
-- - 'scripts/tests/**'
-- - 'scripts/generate-test-inventory.mjs'
++ - ".github/workflows/**"
++ - "package.json"
++ - "crates/openhuman-core/src/core/all.rs"
++ - "tests/**"
++ - "scripts/**/*.test.mjs"
++ - "scripts/tests/**"
++ - "scripts/generate-test-inventory.mjs"
# The drift guard scans every workflow plus these two direct
# inputs, so changes to any of them must run it.
toolchain-image:
-- - '.github/workflows/**'
-- - '.github/Dockerfile'
-- - 'rust-toolchain.toml'
-- - 'scripts/ci/check-toolchain-image.mjs'
++ - ".github/workflows/**"
++ - ".github/Dockerfile"
++ - "rust-toolchain.toml"
++ - "scripts/ci/check-toolchain-image.mjs"
# Windows installer + its Pester unit test.
install_ps1:
-- - '.github/workflows/ci-*.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
-- - 'scripts/install.ps1'
-- - 'scripts/tests/OpenHumanWindowsInstall.Tests.ps1'
++ - ".github/workflows/ci-*.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "scripts/install.ps1"
++ - "scripts/tests/OpenHumanWindowsInstall.Tests.ps1"
# The storage ports and the domains that sit on them (storage-sqlite /
# storage-file lane in the lane plan; the MongoDB lane has its own workflow,
# storage-mongodb.yml, with the same paths). The vendor tree is covered whole,
# like `rust-core`: the ports and drivers are vendored, and a pointer bump
# anywhere can change what the driver features compile.
storage:
- - '.config/nextest.toml'
-- - '.github/workflows/ci-*.yml'
-- - '.github/workflows/storage-mongodb.yml'
-- - '.github/ci-paths-filter.yml'
-- - 'scripts/ci/self-hosted/**'
- - 'scripts/ci/nextest-coverage.sh'
- - 'scripts/ci/nextest-report.mjs'
-- - 'scripts/ci/checkout-submodules.sh'
-- - 'scripts/ci-cancel-aware.sh'
-- - 'build.rs'
-- - 'crates/openhuman-core/src/storage/**'
-- - 'crates/openhuman-core/src/cron/**'
-- - 'crates/openhuman-core/src/flows/**'
-- - 'crates/openhuman-core/src/security/approval/**'
-- - 'crates/openhuman-core/src/security/devices/**'
-- - 'crates/openhuman-core/src/security/secret_storage/**'
-- - 'crates/openhuman-core/src/security/credentials/**'
-- - 'crates/openhuman-core/src/desktop/notifications/**'
-- - 'crates/openhuman-core/src/integrations/task_sources/**'
-- - 'crates/openhuman-core/src/agent/orchestration/**'
-- - 'crates/openhuman-core/src/agent/session_store/**'
-- - 'crates/openhuman-core/src/profiles/**'
-- - 'crates/openhuman-core/src/integrations/composio/**'
-- - 'crates/openhuman-core/src/config/workspace/**'
-- - 'crates/openhuman-core/src/desktop/app_state/**'
-- - 'crates/openhuman-core/src/desktop/control/**'
-- - 'crates/openhuman-core/src/platform/cost/**'
-- - 'crates/openhuman-core/src/inference/tokenjuice/**'
-- - 'crates/openhuman-core/src/web3/wallet/**'
-- - 'crates/openhuman-core/src/config/schema/storage.rs'
-- - 'crates/openhuman-core/src/config/schema/load/source/**'
-- - 'crates/openhuman-rpc/src/session_store/**'
-- - 'Cargo.toml'
-- - 'Cargo.lock'
-- - 'crates/openhuman-*/Cargo.toml'
-- - 'tests/storage_*.rs'
-- - 'tests/cli_storage_url_e2e.rs'
-- - 'tests/support/storage_drivers.rs'
-- - '.cargo/config.toml'
-- - 'rust-toolchain.toml'
-- - '.gitmodules'
-- - 'vendor/**'
++ - ".config/nextest.toml"
++ - ".github/workflows/ci-*.yml"
++ - ".github/workflows/storage-mongodb.yml"
++ - ".github/ci-paths-filter.yml"
++ - "scripts/ci/self-hosted/**"
++ - "scripts/ci/nextest-coverage.sh"
++ - "scripts/ci/nextest-report.mjs"
++ - "scripts/ci/checkout-submodules.sh"
++ - "scripts/ci-cancel-aware.sh"
++ - "build.rs"
++ - "crates/openhuman-core/src/storage/**"
++ - "crates/openhuman-core/src/cron/**"
++ - "crates/openhuman-core/src/flows/**"
++ - "crates/openhuman-core/src/security/approval/**"
++ - "crates/openhuman-core/src/security/devices/**"
++ - "crates/openhuman-core/src/security/secret_storage/**"
++ - "crates/openhuman-core/src/security/credentials/**"
++ - "crates/openhuman-core/src/desktop/notifications/**"
++ - "crates/openhuman-core/src/integrations/task_sources/**"
++ - "crates/openhuman-core/src/agent/orchestration/**"
++ - "crates/openhuman-core/src/agent/session_store/**"
++ - "crates/openhuman-core/src/profiles/**"
++ - "crates/openhuman-core/src/integrations/composio/**"
++ - "crates/openhuman-core/src/config/workspace/**"
++ - "crates/openhuman-core/src/desktop/app_state/**"
++ - "crates/openhuman-core/src/desktop/control/**"
++ - "crates/openhuman-core/src/platform/cost/**"
++ - "crates/openhuman-core/src/inference/tokenjuice/**"
++ - "crates/openhuman-core/src/web3/wallet/**"
++ - "crates/openhuman-core/src/config/schema/storage.rs"
++ - "crates/openhuman-core/src/config/schema/load/source/**"
++ - "crates/openhuman-rpc/src/session_store/**"
++ - "Cargo.toml"
++ - "Cargo.lock"
++ - "crates/openhuman-*/Cargo.toml"
++ - "tests/storage_*.rs"
++ - "tests/cli_storage_url_e2e.rs"
++ - "tests/support/storage_drivers.rs"
++ - ".cargo/config.toml"
++ - "rust-toolchain.toml"
++ - ".gitmodules"
++ - "vendor/**"
diff --cc scripts/__tests__/self-hosted-lanes.test.mjs
index 55ce9243fc,c7e6d27684..6c228ee5f3
--- a/scripts/__tests__/self-hosted-lanes.test.mjs
+++ b/scripts/__tests__/self-hosted-lanes.test.mjs
@@@ -248,7 -254,7 +254,8 @@@ test("untouched areas leave only the al
"static:feature-forwarding",
"static:crate-chain",
"static:process-statics",
+ "static:module-source",
+ "static:storage-bypass",
"static:module-pins",
"static:submodule-monotonic",
]);
@@@ -286,7 -293,7 +294,8 @@@ test("the storage area arms only the st
"static:feature-forwarding",
"static:crate-chain",
"static:process-statics",
+ "static:module-source",
+ "static:storage-bypass",
"static:module-pins",
"static:submodule-monotonic",
],
@@@ -377,43 -395,127 +397,127 @@@ test("private lanes reuse checkout targ
);
});
- test("instrumented coverage uses sccache on ex63 and no wrapper on hosted", () => {
- for (const plan of plans()) {
- const ex63 = plan.profile === "ex63";
- const cov = plan.lanes.find((l) => l.name === "rust-cov");
- assert.equal(cov.env.RUSTC_WRAPPER, ex63 ? "sccache" : undefined);
- const tauriCov = plan.lanes
- .find((l) => l.name === "tauri")
- .checks.find((c) => c.name === "tauri-coverage");
- assert.equal(tauriCov.env.RUSTC_WRAPPER, ex63 ? "sccache" : undefined);
- // The linker flag always goes: llvm-cov sets RUSTFLAGS itself.
- assert.match(
- tauriCov.run,
- ex63 ? /^unset RUSTFLAGS &&/ : /^unset RUSTFLAGS RUSTC_WRAPPER &&/,
+ test("private gates-off, storage, and Tauri execute equivalent coverage suites with nextest", () => {
+ const plan = buildPlan({ profile: "ex63", areas: ALL, env: EX63_ENV });
+ for (const name of ["rust-gates-off", "storage-drivers", "tauri"]) {
+ for (const c of plan.lanes
+ .find((l) => l.name === name)
+ .checks.filter((c) => /cargo (test|llvm-cov)/.test(c.run))) {
+ assert.match(c.run, /cargo llvm-cov nextest/);
+ assert.match(c.run, /--no-tests=fail/);
+ // Pinned cargo-llvm-cov 0.9.1 rejects combining these two flags;
+ // --no-report already preserves previous instrumentation profiles.
+ assert.doesNotMatch(c.run, /--no-clean(?:\s|$)/);
+ assert.match(c.run, /--lcov --output-path ci-out\/lcov\//);
+ assert.match(c.run, /--no-report .*\|\| rc=\$\?; cargo llvm-cov report/);
+ assert.match(c.run, /exit "\$rc"$/);
+ }
+ }
+ const checks = Object.fromEntries(
+ plan.lanes.flatMap((l) => l.checks.map((c) => [c.name, c])),
+ );
+ assert.match(
+ checks["gate-contract-tests-features"].run,
+ /--features modules,mcp,e2e-test-support/,
+ );
+ assert.match(checks["gate-contract-tests-features"].run, /--test-threads=1/);
+ assert.match(checks["cron-module-tests"].run, /--test-threads=1/);
+ assert.equal(
+ checks["storage-e2e"].env.NEXTEST_EXPECTED_TARGETS,
+ "ci-out/nextest/storage-e2e-expected-targets.txt",
+ );
+ for (const target of [
+ ...checks["storage-e2e"].run.matchAll(/--test (\S+)/g),
+ ].map((match) => match[1])) {
+ assert.ok(
+ checks["storage-e2e"].run.includes(`'${target}'`),
+ `expected inventory includes ${target}`,
);
- assert.match(tauriCov.run, /--no-rustc-wrapper/);
}
+ assert.match(
+ checks["storage-lib-tests"].run,
+ /not test\(cron::bus_host::tests::\)/,
+ );
+ assert.equal(
+ checks["tauri-coverage"].env.CARGO_BUILD_TARGET_DIR,
+ "target/ci-private-coverage",
+ );
});
- test("sccache summary reports hit rate and the store in use", () => {
- assert.equal(sccacheSummary(null), null);
+ test("private auxiliary coverage reports after failed tests and preserves the failure", () => {
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), "lane-coverage-report-"));
+ const cargo = path.join(dir, "cargo");
+ const calls = path.join(dir, "calls");
+ fs.writeFileSync(
+ cargo,
+ '#!/bin/sh\necho "$*" >> "$CARGO_CALLS"\nif [ "$1" = metadata ]; then echo \"{\\\"packages\\\":[]}\"; fi\nif [ "$2" = nextest ]; then exit 17; fi\nexit 0\n',
+ { mode: 0o755 },
+ );
+ const plan = buildPlan({ profile: "ex63", areas: ALL, env: EX63_ENV });
+ const check = plan.lanes.find((l) => l.name === "storage-drivers").checks[0];
+ const result = spawnSync("bash", ["-o", "pipefail", "-c", check.run], {
+ cwd: repoRoot,
+ env: {
+ ...process.env,
+ PATH: `${dir}:${process.env.PATH}`,
+ CARGO_CALLS: calls,
+ NEXTEST_REPORT_DIR: path.join(dir, "reports"),
+ NEXTEST_EXPECTED_TARGETS: path.join(dir, "expected-targets"),
+ },
+ });
+ assert.equal(result.status, 17);
assert.equal(
- sccacheSummary({
- stats: {
- cache_hits: { counts: { Rust: 30 } },
- cache_misses: { counts: { Rust: 10 } },
+ fs
+ .readFileSync(path.join(dir, "expected-targets"), "utf8")
+ .trim()
+ .split("\n").length,
- 10,
++ 11,
+ );
+ const commands = fs.readFileSync(calls, "utf8").trim().split("\n");
+ assert.equal(commands.length, 3);
+ assert.match(commands[0], /^metadata /);
+ assert.match(commands[1], /^llvm-cov nextest /);
+ assert.match(commands[2], /^llvm-cov report /);
+ const tauri = plan.lanes.find((l) => l.name === "tauri");
+ assert.match(
+ tauri.checks.find((c) => c.name === "build-tauri").run,
+ /cargo build .*--bin OpenHuman/,
+ );
+ fs.rmSync(dir, { recursive: true, force: true });
+ });
+
+ test("private runner serializes independent lanes after failures even when parallelism is requested", async () => {
+ const out = fs.mkdtempSync(path.join(os.tmpdir(), "lanes-private-"));
+ fs.mkdirSync(path.join(out, "logs"));
+ const check = (name, run) => ({ name, run, when: true, needs: [] });
+ const plan = {
+ profile: "ex63",
+ lanes: [
+ {
+ name: "first",
+ checks: [
+ check("fails", "exit 1"),
+ check("continues", "echo continued"),
+ ],
},
- cache_location: "webdav, name: , prefix: /",
- }),
- "sccache (shared store): 30 Rust hits, 10 misses (75%).",
+ { name: "second", checks: [check("independent", "echo independent")] },
+ ],
+ };
+ const runner = new Runner(plan, { out, maxParallel: 8 });
+ assert.equal(runner.maxParallel, 1);
+ const lanes = await runner.run();
+ assert.equal(lanes[0].checks[0].status, "failure");
+ assert.equal(lanes[0].checks[1].status, "success");
+ assert.equal(lanes[1].checks[0].status, "success");
+ assert.ok(
+ Date.parse(lanes[1].checks[0].start) >= Date.parse(lanes[0].checks[1].end),
);
assert.equal(
- sccacheSummary({
- stats: { cache_hits: { counts: {} }, cache_misses: { counts: {} } },
- cache_location: 'Local disk: "/cache/sccache"',
- }),
- "sccache (slot disk): 0 Rust hits, 0 misses.",
+ new Runner({ ...plan, profile: "hosted" }, { out, maxParallel: 8 })
+ .maxParallel,
+ 8,
);
+ fs.rmSync(out, { recursive: true, force: true });
});
test("area flags are read strictly from CI_AREA_*", () => {
@@@ -698,6 -800,12 +802,15 @@@ test("module boundary policy and checke
"utf8",
);
const scripts = filters.split(/^scripts:\s*$/m)[1].split(/^\S[^\n]*:/m)[0];
+ for (const file of [
+ "scripts/ci/rust-coverage.sh",
+ "scripts/ci/fetch-submodule-tags.sh",
+ ]) {
- assert.ok(scripts.includes(`'${file}'`), `${file} must run its regressions`);
++ assert.ok(
++ scripts.includes(`'${file}'`),
++ `${file} must run its regressions`,
++ );
+ }
for (const file of [
"scripts/ci/check-module-boundaries.mjs",
"scripts/ci/module-boundaries.json",
@@@ -715,6 -823,12 +828,15 @@@ test("process-static policy and checke
"utf8",
);
const scripts = filters.split(/^scripts:\s*$/m)[1].split(/^\S[^\n]*:/m)[0];
+ for (const file of [
+ "scripts/ci/rust-coverage.sh",
+ "scripts/ci/fetch-submodule-tags.sh",
+ ]) {
- assert.ok(scripts.includes(`'${file}'`), `${file} must run its regressions`);
++ assert.ok(
++ scripts.includes(`'${file}'`),
++ `${file} must run its regressions`,
++ );
+ }
for (const file of [
"scripts/ci/check-process-statics.mjs",
"scripts/ci/check-crate-chain.mjs",
@@@ -744,39 -858,244 +866,284 @@@ test("process-static scan uses cancella
}
});
+ test("private frontend tools have an explicit 4 GiB Node heap while hosted keeps its default", () => {
+ for (const plan of plans()) {
+ const frontend = plan.lanes.find((lane) => lane.name === "frontend");
+ if (plan.profile === "ex63") {
+ assert.equal(frontend.env.NODE_OPTIONS, "--max-old-space-size=4096");
+ const probe = spawnSync(
+ process.execPath,
+ [
+ "-e",
+ "console.log(require('node:v8').getHeapStatistics().heap_size_limit)",
+ ],
+ {
+ env: { ...process.env, NODE_OPTIONS: frontend.env.NODE_OPTIONS },
+ encoding: "utf8",
+ },
+ );
+ assert.equal(probe.status, 0, probe.stderr);
+ const limit = Number(probe.stdout.trim());
+ assert.ok(
+ limit >= 4096 * 1024 * 1024 && limit < 4352 * 1024 * 1024,
+ `actual V8 heap limit ${limit}`,
+ );
+ } else {
+ assert.equal(frontend.env.NODE_OPTIONS, undefined);
+ }
+ }
+ });
+
+ test("private CI executes the coverage-disabled Composio stack regression once without instrumentation", () => {
+ for (const plan of plans()) {
+ const lint = plan.lanes.find((lane) => lane.name === "rust-lint");
+ const checks = lint.checks.filter(
+ (check) => check.name === "composio-stack-regression-uninstrumented",
+ );
+ if (plan.profile === "ex63") {
+ assert.equal(checks.length, 1);
+ assert.equal(checks[0].when, true);
+ assert.match(
+ checks[0].run,
+ /bash scripts\/ci\/nextest-coverage\.sh composio-stack-uninstrumented cargo nextest run --profile ci --no-tests=fail --no-fail-fast/,
+ );
+ assert.match(
+ checks[0].run,
+ /-p openhuman-cli --features "\$\(bash scripts\/ci\/product-features\.sh --core\)" --test composio_list_tools_stack_overflow_regression$/,
+ );
+ assert.doesNotMatch(checks[0].run, /llvm-cov|--no-default-features/);
+ assert.equal(lint.targetDir, "target/ci-private-build");
+ } else {
+ assert.equal(checks.length, 0);
+ }
+ }
+ const unrelated = buildPlan({ profile: "ex63", areas: NONE, env: EX63_ENV });
+ assert.ok(
+ unrelated.lanes
+ .flatMap((lane) => lane.checks)
+ .filter(
+ (check) => check.name === "composio-stack-regression-uninstrumented",
+ )
+ .every((check) => !check.when),
+ );
+ const source = fs.readFileSync(
+ path.join(
+ repoRoot,
+ "tests/composio_list_tools_stack_overflow_regression.rs",
+ ),
+ "utf8",
+ );
+ assert.match(source, /#!\[cfg\(not\(coverage\)\)\]/);
+ assert.doesNotMatch(source, /^\s*#\[ignore/m);
+ });
+
+ test("nextest validation helpers arm Rust validation and script regressions on their own", () => {
+ const filters = fs.readFileSync(
+ path.join(repoRoot, ".github/ci-paths-filter.yml"),
+ "utf8",
+ );
+ for (const area of ["rust-core", "rust-tauri", "storage", "scripts"]) {
+ const block = filters
+ .split(new RegExp(`^${area}:\\s*$`, "m"))[1]
+ .split(/^\S[^\n]*:/m)[0];
+ assert.ok(
+ block.includes("'scripts/ci/self-hosted/**'"),
+ `${area} covers guest verifier, linkage verifier and image pin changes`,
+ );
+ for (const file of [
+ ".config/nextest.toml",
+ "scripts/ci/nextest-coverage.sh",
+ "scripts/ci/nextest-report.mjs",
+ ]) {
+ assert.ok(block.includes(`'${file}'`), `${file} must arm ${area}`);
+ }
+ }
+ const scripts = filters.split(/^scripts:\s*$/m)[1].split(/^\S[^\n]*:/m)[0];
+ for (const file of [
+ "scripts/ci/rust-coverage.sh",
+ "scripts/ci/fetch-submodule-tags.sh",
+ ]) {
- assert.ok(scripts.includes(`'${file}'`), `${file} must run its regressions`);
++ assert.ok(
++ scripts.includes(`'${file}'`),
++ `${file} must run its regressions`,
++ );
+ }
+ assert.ok(
+ scripts.includes("'scripts/lib/**'"),
+ "module-pin-inventory.mjs is covered by the shared script library glob",
+ );
+ });
+
+ test("private coverage pools profiles for every Rust configuration without changing hosted or ordinary builds", () => {
+ for (const plan of plans()) {
+ const coverage = [];
+ for (const lane of plan.lanes)
+ for (const check of lane.checks) {
+ const env = { ...lane.env, ...check.env };
+ if (
+ check.name === "rust-core-coverage" ||
+ check.run.includes("cargo llvm-cov nextest")
+ ) {
+ coverage.push(check.name);
+ assert.equal(
+ env.LLVM_PROFILE_FILE_NAME,
+ plan.profile === "ex63" ? "openhuman-%8m.profraw" : undefined,
+ `${plan.profile}:${check.name}`,
+ );
+ } else if (
+ /cargo (?:build|clippy|check|test|nextest run)/.test(check.run)
+ ) {
+ assert.equal(
+ env.LLVM_PROFILE_FILE_NAME,
+ undefined,
+ `${plan.profile}:${check.name} is uninstrumented`,
+ );
+ }
+ }
+ if (plan.profile === "ex63") assert.equal(coverage.length, 8);
+ }
+ });
+
+ test("private release cleanup follows successful examples and names only the ordinary release profile", () => {
+ for (const plan of plans()) {
+ const lint = plan.lanes.find((lane) => lane.name === "rust-lint");
+ const cleanupIndex = lint.checks.findIndex(
+ (check) => check.name === "release-example-cleanup",
+ );
+ if (plan.profile === "hosted") {
+ assert.equal(cleanupIndex, -1);
+ continue;
+ }
+ const examplesIndex = lint.checks.findIndex(
+ (check) => check.name === "embed-offline-examples",
+ );
+ assert.equal(cleanupIndex, examplesIndex + 1);
+ const cleanup = lint.checks[cleanupIndex];
+ assert.equal(cleanup.when, true);
+ assert.deepEqual(cleanup.needs, ["embed-offline-examples"]);
+ assert.equal(
+ cleanup.run,
+ "bash scripts/ci-cancel-aware.sh cargo clean --profile release --target-dir target/ci-private-build",
+ );
+ assert.doesNotMatch(
+ cleanup.run,
+ /ci-private-coverage|tinymold|--profile dev|rm /,
+ );
+ }
+ });
+
+ test("failed offline examples block release cleanup while independent Rust validation continues", async () => {
+ const plan = buildPlan({ profile: "ex63", areas: ALL, env: EX63_ENV });
+ const lint = plan.lanes.find((lane) => lane.name === "rust-lint");
+ const cleanup = lint.checks.find(
+ (check) => check.name === "release-example-cleanup",
+ );
+ assert.ok(cleanup);
+ const out = fs.mkdtempSync(
+ path.join(os.tmpdir(), "release-cleanup-dependency-"),
+ );
+ try {
+ fs.mkdirSync(path.join(out, "logs"));
+ const checks = [
+ { name: "embed-offline-examples", when: true, needs: [], run: "exit 1" },
+ cleanup,
+ { name: "independent", when: true, needs: [], run: "echo continued" },
+ ];
+ const result = await new Runner(
+ { profile: "ex63", lanes: [{ name: "rust-lint", checks }] },
+ { out, maxParallel: 1 },
+ ).run();
+ assert.deepEqual(
+ result[0].checks.map((check) => check.status),
+ ["failure", "blocked", "success"],
+ );
+ } finally {
+ fs.rmSync(out, { recursive: true, force: true });
+ }
+ });
+
+ test("private ordinary Rust builds keep line tables while coverage and hosted profiles remain unchanged", () => {
+ for (const plan of plans()) {
+ for (const lane of plan.lanes.filter((lane) => lane.heavy != null)) {
+ const expected =
+ lane.name === "rust-cov"
+ ? "0"
+ : plan.profile === "ex63"
+ ? "line-tables-only"
+ : undefined;
+ assert.equal(
+ lane.env.CARGO_PROFILE_DEV_DEBUG,
+ expected,
+ `${plan.profile}:${lane.name}`,
+ );
+ assert.equal(
+ lane.env.CARGO_PROFILE_TEST_DEBUG,
+ undefined,
+ "test inherits the dev profile without a separate override",
+ );
+ assert.equal(
+ lane.env.CARGO_PROFILE_RELEASE_DEBUG,
+ undefined,
+ "release keeps the manifest profile",
+ );
+ for (const check of lane.checks) {
+ const env = { ...lane.env, ...check.env };
+ const coverage =
+ check.name === "rust-core-coverage" ||
+ check.run.includes("cargo llvm-cov nextest") ||
+ check.name === "tauri-coverage";
+ if (coverage)
+ assert.equal(
+ env.CARGO_PROFILE_DEV_DEBUG,
+ "0",
+ `${plan.profile}:${check.name} keeps coverage debug=0`,
+ );
+ if (plan.profile === "ex63" && lane.name === "rust-lint")
+ assert.equal(
+ env.CARGO_PROFILE_DEV_DEBUG,
+ "line-tables-only",
+ check.name,
+ );
+ assert.equal(env.CARGO_PROFILE_TEST_DEBUG, undefined);
+ assert.equal(env.CARGO_PROFILE_RELEASE_DEBUG, undefined);
+ }
+ }
+ }
+ });
++
+test("storage-bypass runs under cancellation supervision in both profiles", () => {
+ for (const profile of ["hosted", "ex63"]) {
+ const plan = buildPlan({
+ profile,
+ areas: NONE,
+ env: profile === "ex63" ? EX63_ENV : {},
+ });
+ const check = plan.lanes
+ .flatMap((lane) => lane.checks)
+ .find((check) => check.name === "storage-bypass");
+ assert.equal(check.when, true);
+ assert.equal(
+ check.run,
+ "bash scripts/ci-cancel-aware.sh node scripts/ci/check-storage-bypass.mjs",
+ );
+ }
+});
+
+test("storage checker and debt policy changes arm their own scripts lane", () => {
+ const filters = fs.readFileSync(
+ path.join(repoRoot, ".github/ci-paths-filter.yml"),
+ "utf8",
+ );
+ const scripts = filters.split(/^scripts:\s*$/m)[1].split(/^\S[^\n]*:/m)[0];
+ for (const pattern of [
+ "scripts/ci/check-storage-bypass.mjs",
+ "scripts/ci/check-crate-chain.mjs",
+ "scripts/ci/storage-bypass-debt.mjs",
+ "scripts/ci/storage-bypass*.json",
+ "scripts/ci/storage-bypass*.md",
+ ])
+ assert.ok(
+ scripts.includes(`'${pattern}'`),
+ `${pattern} must arm the scripts area`,
+ );
+});
diff --cc scripts/__tests__/storage-bypass-debt.test.mjs
index aeeee3ccdd,0000000000..dbd65e0dbc
mode 100644,000000..100644
--- a/scripts/__tests__/storage-bypass-debt.test.mjs
+++ b/scripts/__tests__/storage-bypass-debt.test.mjs
@@@ -1,306 -1,0 +1,319 @@@
+import assert from "node:assert/strict";
+import test from "node:test";
+import {
+ mkdtempSync,
+ rmSync,
+ mkdirSync,
+ writeFileSync,
+ symlinkSync,
+} from "node:fs";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
+import { fileURLToPath } from "node:url";
+import { execFileSync, spawnSync } from "node:child_process";
+import {
+ validateCoverageDebt,
+ validateAllowances,
+ historicalFindings,
+} from "../ci/storage-bypass-debt.mjs";
+import {
+ compare,
+ scan,
+ CURATED_VENDOR_ROOTS,
+ collectFindings,
+} from "../ci/check-storage-bypass.mjs";
+const row = {
+ rule: "json-write",
+ path: "crates/openhuman-embed/src/state.rs",
+ text: "tokio::fs::write(path, bytes);",
+ occurrence: 1,
+ classification: "unmigrated",
+ reason: "Existing native backend migration debt at this exact source site.",
+ issue: "https://github.com/tinyhumansai/openhuman/issues/7428",
+};
+const history = { baseline: [], extension: null, findings: [row] };
+test("initial extension admits only exact existing canonical coverage", () => {
+ assert.deepEqual(validateCoverageDebt([row], [], [row], history), []);
+ const added = { ...row, path: "crates/openhuman-embed/src/new.rs" };
+ assert.match(
+ validateCoverageDebt([added], [], [added], history).join("\n"),
+ /branch-added writer/,
+ );
+});
+test("moving or copying a recorded writer cannot reuse its identity", () => {
+ const moved = { ...row, path: "crates/openhuman-rpc/src/state.rs" };
+ assert.equal(compare([moved], [row]).added.length, 1);
+ const copied = { ...row, occurrence: 2 };
+ assert.equal(compare([row, copied], [row]).added.length, 1);
+});
+test("extension records may shrink but never grow after establishment", () => {
+ const old = { ...history, extension: [row] };
+ assert.deepEqual(validateCoverageDebt([], [], [], old), []);
+ const added = { ...row, text: "tokio::fs::write(other, bytes);" };
+ assert.match(
+ validateCoverageDebt([row, added], [], [row, added], old).join("\n"),
+ /Extension growth forbidden/,
+ );
+});
+test("removing a debt record does not grandfather a surviving writer", () => {
+ assert.equal(compare([row], []).added.length, 1);
+});
+test("original core debt cannot move into the extension or grow", () => {
+ const core = { ...row, path: "crates/openhuman-core/src/state.rs" };
+ assert.match(
+ validateCoverageDebt([core], [], [core], history).join("\n"),
+ /cannot conceal original core debt/,
+ );
+ assert.match(
+ validateCoverageDebt([core], [core], [], history).join("\n"),
+ /Core baseline growth forbidden/,
+ );
+});
+test("reasons, exact occurrence and issue links are mandatory", () => {
+ for (const bad of [
+ { reason: "" },
+ { issue: "" },
+ { classification: "approved" },
+ { occurrence: 2 },
+ ]) {
+ assert.ok(
+ validateCoverageDebt([row], [], [{ ...row, ...bad }], history).length,
+ );
+ }
+});
+test("an initial allowance cannot exempt a newly introduced branch writer", () => {
+ const record = { ...row, site: row.text };
+ assert.match(
+ validateAllowances([row], [record], {
+ rawFindings: [],
+ allowances: null,
+ }).join("\n"),
+ /branch-added writer/,
+ );
+ assert.deepEqual(
+ validateAllowances([row], [record], {
+ rawFindings: [row],
+ allowances: null,
+ }),
+ [],
+ );
+});
+test("later allowances cannot grow or excuse a copied site", () => {
+ const record = { ...row, site: row.text };
+ const copy = { ...record, path: "crates/openhuman-embed/src/copy.rs" };
+ assert.match(
+ validateAllowances([{ ...row, path: copy.path }], [copy], {
+ rawFindings: [row],
+ allowances: [record],
+ }).join("\n"),
+ /growth forbidden/,
+ );
+});
+test("curated vendor coverage excludes native drivers but not host adapter writes", () => {
+ assert.ok(
+ CURATED_VENDOR_ROOTS.every((p) => !p.includes("tinystoragedrivers")),
+ );
+ assert.ok(CURATED_VENDOR_ROOTS.some((p) => p.includes("tinymcp")));
+ assert.ok(CURATED_VENDOR_ROOTS.some((p) => p.includes("run_ledger")));
+ assert.equal(
+ scan(
+ "crates/openhuman-embed/src/adapter.rs",
+ "tokio::fs::write(path, bytes);",
+ ).length,
+ 1,
+ );
+});
+test("new serializer and helper rules ignore quoted and commented fixture text", () => {
+ assert.deepEqual(
+ scan(
+ "x.rs",
+ 'let fixture = "serde_json::to_writer(file, value);";\n/* fn write_atomic(path) {} */',
+ ),
+ [],
+ );
+});
+
+test("missing canonical base history fails closed", () => {
+ const root = mkdtempSync(join(tmpdir(), "storage-history-"));
+ try {
+ execFileSync("git", ["init"], { cwd: root, stdio: "ignore" });
+ assert.throws(() =>
+ historicalFindings(root, {
+ scan,
+ withoutAllowed: (_, x) => x,
+ isTestFile: () => false,
+ CURATED_VENDOR_ROOTS: [],
+ }),
+ );
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+test("quoted database opener examples do not count as host persistence", () => {
+ assert.deepEqual(
+ scan(
+ "crates/openhuman-embed/src/example.rs",
+ 'let example = r#"OtherStore::open(root.join("cache.db"))"#;',
+ ),
+ [],
+ );
+});
+
+test("duplicate original core identities cannot inflate the retained baseline", () => {
+ const core = { ...row, path: "crates/openhuman-core/src/state.rs" };
+ assert.match(
+ validateCoverageDebt([core], [core, core], [], {
+ baseline: [core],
+ extension: [],
+ findings: [core],
+ }).join("\n"),
+ /Duplicate core baseline record/,
+ );
+});
+
+test("real checkouts refuse missing curated vendor source instead of shrinking debt", async () => {
+ const root = mkdtempSync(join(tmpdir(), "storage-curated-source-"));
+ try {
+ execFileSync("git", ["init"], { cwd: root, stdio: "ignore" });
+ mkdirSync(join(root, "crates"));
+ await assert.rejects(collectFindings(root), /Missing curated source/);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test("present but empty curated vendor directories cannot appear as debt shrinkage", async () => {
+ const root = mkdtempSync(join(tmpdir(), "storage-empty-curated-"));
+ try {
+ execFileSync("git", ["init"], { cwd: root, stdio: "ignore" });
+ mkdirSync(join(root, "crates"));
+ for (const path of CURATED_VENDOR_ROOTS) {
+ if (path.endsWith(".rs")) {
+ mkdirSync(join(root, path, ".."), { recursive: true });
+ writeFileSync(join(root, path), "// no writer\n");
+ } else mkdirSync(join(root, path), { recursive: true });
+ }
+ await assert.rejects(collectFindings(root), /Empty curated source/);
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+});
+
+test("symlinked real checkouts still refuse missing curated source", async () => {
+ const fixture = mkdtempSync(join(tmpdir(), "storage-symlink-source-"));
+ const root = join(fixture, "checkout");
+ const linked = join(fixture, "linked");
+ try {
+ mkdirSync(root);
+ execFileSync("git", ["init"], { cwd: root, stdio: "ignore" });
+ mkdirSync(join(root, "crates"));
+ symlinkSync(root, linked, "junction");
+ await assert.rejects(collectFindings(linked), /Missing curated source/);
+ } finally {
+ rmSync(fixture, { recursive: true, force: true });
+ }
+});
+
+test("symlinked --root checkouts cannot bypass required canonical history", () => {
+ const fixture = mkdtempSync(join(tmpdir(), "storage-symlink-history-"));
+ const root = join(fixture, "checkout");
+ const linked = join(fixture, "linked");
+ try {
+ mkdirSync(root);
+ execFileSync("git", ["init"], { cwd: root, stdio: "ignore" });
+ mkdirSync(join(root, "crates"));
+ for (const path of CURATED_VENDOR_ROOTS) {
+ if (path.endsWith(".rs")) {
+ mkdirSync(join(root, path, ".."), { recursive: true });
+ writeFileSync(join(root, path), "// no writer\n");
+ } else {
+ mkdirSync(join(root, path), { recursive: true });
+ writeFileSync(join(root, path, "store.rs"), "// no writer\n");
+ }
+ }
+ mkdirSync(join(root, "scripts", "ci"), { recursive: true });
+ writeFileSync(
+ join(root, "scripts", "ci", "storage-bypass-baseline.json"),
+ "[]\n",
+ );
+ symlinkSync(root, linked, "junction");
+ const result = spawnSync(
+ process.execPath,
+ [
+ fileURLToPath(
+ new URL("../ci/check-storage-bypass.mjs", import.meta.url),
+ ),
+ "--root",
+ linked,
+ ],
+ { encoding: "utf8" },
+ );
+ assert.equal(result.status, 1, result.stdout + result.stderr);
+ assert.match(result.stderr, /merge-base|origin\/main|upstream\/main/);
+ } finally {
+ rmSync(fixture, { recursive: true, force: true });
+ }
+});
+
+test("new-based file stores are findings without matching memory stores", () => {
+ const findings = scan(
+ "crates/openhuman-core/src/catalog.rs",
+ [
+ "let cache = FileCatalogStore::new(dir);",
+ "let cache = tinyskills::FileCatalogStore::new(dir);",
+ "let memory = MemoryCatalogStore::new();",
+ ].join("\n"),
+ );
+ assert.deepEqual(
+ findings.map((f) => f.rule),
+ ["file-store-new", "file-store-new"],
+ );
+});
+
+for (const [name, source] of [
+ ["task stores", "vendor/tinyagents/crates/tinyagents-tasks/src/store.rs"],
+ [
+ "catalog store",
+ "vendor/tinyskills/crates/tinyskills/src/registry/store.rs",
+ ],
+]) {
+ test(`${name} owning writers are included in curated coverage`, async () => {
+ const root = mkdtempSync(join(tmpdir(), "storage-owner-coverage-"));
+ try {
+ mkdirSync(join(root, "crates"));
+ mkdirSync(join(root, source, ".."), { recursive: true });
+ writeFileSync(
+ join(root, source),
+ "pub fn persist() { std::fs::write(path, bytes); }\n",
+ );
+ const findings = await collectFindings(root);
+ assert.equal(findings.length, 1);
+ assert.equal(findings[0].path, source);
+ assert.equal(findings[0].rule, "json-write");
+ } finally {
+ rmSync(root, { recursive: true, force: true });
+ }
+ });
+}
+
+test("host calls to the JSONL task opener cannot hide their persistent path", () => {
+ const findings = scan(
+ "crates/openhuman-core/src/tasks.rs",
+ "let store = tinyagents::open_jsonl_task_store_or_memory(path, None);",
+ );
+ assert.equal(findings.length, 1);
+ assert.equal(findings[0].rule, "task-store-open");
+});
++
++test("current thread and turn-state host facades remain curated after storage migration", () => {
++ assert.ok(
++ CURATED_VENDOR_ROOTS.includes(
++ "vendor/tinyagents/crates/tinyagents-session/src/threads/mod.rs",
++ ),
++ );
++ assert.ok(
++ CURATED_VENDOR_ROOTS.includes(
++ "vendor/tinyagents/crates/tinyagents-session/src/turn_state/mirror",
++ ),
++ );
++});
diff --cc scripts/__tests__/storage-bypass.test.mjs
index 3f0de4e760,5cfca7632d..371efd5587
--- a/scripts/__tests__/storage-bypass.test.mjs
+++ b/scripts/__tests__/storage-bypass.test.mjs
@@@ -142,82 -142,7 +142,82 @@@ test("a new database open fails the che
);
});
+test("an embed Tokio file writer cannot bypass the host storage scan", () => {
+ const { status, out } = run(
+ {
+ "crates/openhuman-embed/src/preferences.rs":
+ "async fn save() { tokio::fs::write(path, bytes).await; }\n",
+ },
+ [],
+ );
+ assert.equal(status, 1);
+ assert.match(out, /New storage-bypass sites/);
+ assert.match(
+ out,
+ /json-write: crates\/openhuman-embed\/src\/preferences\.rs:1/,
+ );
+});
+
+test("every host crate rejects a new raw state writer", () => {
+ for (const name of [
+ "core",
+ "embed",
+ "tinyhumans",
+ "rpc",
+ "app",
+ "cli",
+ "tui",
+ ]) {
+ const rel = `crates/openhuman-${name}/src/new_state.rs`;
+ const result = run(
+ { [rel]: "async fn save() { tokio::fs::write(path, bytes).await; }\n" },
+ [],
+ );
+ assert.equal(result.status, 1, name);
+ assert.ok(result.out.includes(rel), name);
+ }
+});
+
+test("file mutations, temporary builders and serializers are findings", () => {
+ for (const source of [
+ "tokio::fs::rename(old, new);",
+ "std::fs::copy(old, new);",
+ "std::fs::hard_link(old, new);",
+ "tempfile::Builder::new();",
+ "serde_json::to_writer(file, value);",
+ "serde_json::to_writer_pretty(file, value);",
+ ])
+ assert.ok(scan("x.rs", source).length > 0, source);
+});
+
+test("known filesystem writer helpers are reviewed at their definition", () => {
+ for (const name of ["write_private", "create_private", "write_atomic"]) {
+ assert.ok(
+ scan("x.rs", `pub fn ${name}(path: &Path) { helper(path); }`).length > 0,
+ name,
+ );
+ }
+});
+
+test("vendored openers with database and stream path arguments are findings", () => {
+ for (const source of [
+ 'let store = OtherStore::open(root.join("cache.db"));',
+ 'let store = OtherStore::open(root.join("messages.jsonl"));',
+ ])
+ assert.ok(scan("x.rs", source).length > 0, source);
+});
+
+test("baseline regeneration cannot accept an additional core writer", () => {
+ const result = run(
+ { [`${SRC}/foo/store.rs`]: "std::fs::write(p, b);\n" },
+ [],
+ ["--write-baseline"],
+ );
+ assert.equal(result.status, 1);
+ assert.deepEqual(result.after, []);
+});
+
- test("the storage module, tests and allowlisted fallbacks are not flagged", () => {
+ test("the storage module, tests and allowlisted sites are not flagged", () => {
const { status } = run(
{
[`${SRC}/storage/driver.rs`]: "fn f() { let c = Connection::open(p); }\n",
diff --cc scripts/ci/check-storage-bypass.mjs
index be11db3a8a,7601065738..32a0db692a
--- a/scripts/ci/check-storage-bypass.mjs
+++ b/scripts/ci/check-storage-bypass.mjs
@@@ -45,44 -39,8 +46,44 @@@ const baselinePath = resolve
"scripts/ci/storage-bypass-baseline.json",
);
const writeBaseline = process.argv.includes("--write-baseline");
+/** Identify the actual checkout across symlinks and platform path spelling. */
+function sameCheckout(root) {
+ try {
+ const top = execFileSync("git", ["rev-parse", "--show-toplevel"], {
+ cwd: root,
+ encoding: "utf8",
+ stdio: ["ignore", "pipe", "pipe"],
+ }).trim();
+ return realpathSync(top) === realpathSync(root);
+ } catch {
+ return false;
+ }
+}
+const enforceHistory = rootFlag === -1 || sameCheckout(repoRoot);
+
+export const CURATED_VENDOR_ROOTS = [
+ "vendor/tinyagents/crates/tinyagents-tasks/src",
+ "vendor/tinyskills/crates/tinyskills/src/registry/store.rs",
+ "vendor/tinyagents/crates/tinyagents-session/src/run_ledger",
- "vendor/tinyagents/crates/tinyagents-session/src/threads/store",
++ "vendor/tinyagents/crates/tinyagents-session/src/threads/mod.rs",
+ "vendor/tinyagents/crates/tinyagents-session/src/transcript",
- "vendor/tinyagents/crates/tinyagents-session/src/turn_state/store.rs",
++ "vendor/tinyagents/crates/tinyagents-session/src/turn_state/mirror",
+ "vendor/tinymcp/crates/tinymcp/src/registry/store",
+ "vendor/tinymcp/crates/tinymcp/src/audit/store",
+ "vendor/tinymcp/crates/tinymcp/src/tinybus_module/service.rs",
+];
export const RULES = [
+ {
+ rule: "file-store-new",
+ pattern: /\b(?:[A-Za-z_][\w]*::)*File[A-Za-z_]*(?:Store|Ledger)::new\s*\(/,
+ hint: "a file-backed constructor needs captured native routing or an audited cache classification",
+ },
+ {
+ rule: "task-store-open",
+ pattern: /\bopen_jsonl_task_store_or_memory\s*\(/,
+ hint: "the JSONL task opener needs captured native routing; a fallback does not make its file portable",
+ },
{
rule: "sqlite-open",
pattern: /\bConnection::open(?:_with_flags)?\s*\(/,
diff --cc scripts/ci/storage-bypass-allow-reasons.json
index 94f78e3f36,0000000000..08ea361f25
mode 100644,000000..100644
--- a/scripts/ci/storage-bypass-allow-reasons.json
+++ b/scripts/ci/storage-bypass-allow-reasons.json
@@@ -1,121 -1,0 +1,121 @@@
+[
+ {
- "path": "crates/openhuman-core/src/security/approval/store.rs",
++ "path": "crates/openhuman-core/src/config/schema/profile_layout.rs",
++ "rule": "json-write",
++ "site": "std::fs::write(dir.join(PROFILE_LAYOUT_MARKER), \"2\\n\")",
++ "reason": "bootstrap marker that says which on-disk layout a profile directory is; it must be readable before any storage backend can be opened (it decides where the backend lives)",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
++ },
++ {
++ "path": "crates/openhuman-core/src/util/classic_transcript_fixture.rs",
++ "rule": "json-write",
++ "site": "std::fs::write(path, classic_jsonl(messages, meta)).expect(\"write the classic transcript\");",
++ "reason": "test-only fixture (compiled under cfg(test)) that writes a retired-layout `session_raw/*.jsonl` file for the importer and rewrite tests; no store reads it back",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
++ },
++ {
++ "path": "crates/openhuman-core/src/security/approval/store_import.rs",
+ "rule": "sqlite-open",
+ "site": "let conn = Connection::open(&db_path).with_context(|| {",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "reason": "the storage importer's read-only reader of a legacy database, opened on a scratch copy of it (never the real file) to bring older installs' rows into the backend",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
- "path": "crates/openhuman-core/src/security/devices/store.rs",
++ "path": "crates/openhuman-core/src/security/devices/store_import.rs",
+ "rule": "sqlite-open",
+ "site": "let conn = Connection::open(&db_path)",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "reason": "the storage importer's read-only reader of a legacy database, opened on a scratch copy of it (never the real file) to bring older installs' rows into the backend",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
- "path": "crates/openhuman-core/src/desktop/notifications/store.rs",
++ "path": "crates/openhuman-core/src/desktop/notifications/store_import.rs",
+ "rule": "sqlite-open",
+ "site": "let conn = Connection::open(&db_path).with_context(|| {",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "reason": "the storage importer's read-only reader of a legacy database, opened on a scratch copy of it (never the real file) to bring older installs' rows into the backend",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
- "path": "crates/openhuman-core/src/integrations/task_sources/store.rs",
++ "path": "crates/openhuman-core/src/integrations/task_sources/store_import.rs",
+ "rule": "sqlite-open",
+ "site": "let mut conn = Connection::open(&db_path)",
- "reason": "legacy fallback of a store that already runs on the storage port",
++ "reason": "the storage importer's read-only reader of a legacy database, opened on a scratch copy of it (never the real file) to bring older installs' rows into the backend",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7433"
+ },
+ {
- "path": "crates/openhuman-core/src/cron/policy.rs",
++ "path": "crates/openhuman-core/src/modules/storage_import_tinymcp.rs",
+ "rule": "sqlite-open",
- "site": "let conn = Connection::open(&path)",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "site": "Connection::open_with_flags(&copy, OpenFlags::SQLITE_OPEN_READ_WRITE)",
++ "reason": "the storage importer's read-only reader of a legacy database, opened on a scratch copy of it (never the real file) to bring older installs' rows into the backend",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
+ },
+ {
+ "path": "crates/openhuman-core/src/config/workspace/state.rs",
+ "rule": "sqlite-open",
+ "site": "let conn = Connection::open(db_path)?;",
+ "reason": "vault watcher state is absolute local paths and their mtimes: per-machine filesystem state that is meaningless on, and must not be shared through, another host's database",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
- {
- "path": "crates/openhuman-core/src/platform/cost/tracker.rs",
- "rule": "json-write",
- "site": "let mut file = OpenOptions::new()",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
- },
- {
- "path": "crates/openhuman-core/src/agent/orchestration/subagent_sessions/store.rs",
- "rule": "json-write",
- "site": "fs::write(&tmp_path, raw)",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "path": "crates/openhuman-core/src/integrations/composio/file_store.rs",
- "rule": "json-write",
- "site": "tokio::fs::write(&tmp, &bytes)",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7433"
- },
+ {
+ "path": "crates/openhuman-core/src/desktop/control/ops.rs",
+ "rule": "json-write",
+ "site": "let mut temporary = tempfile::NamedTempFile::new_in(parent)",
+ "reason": "this machine's own consent to drive its desktop: per-machine, and it must fail closed rather than follow a shared backend to another host",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "path": "crates/openhuman-core/src/desktop/app_state/ops/state_file.rs",
+ "rule": "json-write",
+ "site": "let mut temp_file = NamedTempFile::new_in(parent)",
+ "reason": "holds the local encryption key and keyring consent, which are needed before any storage backend is open (bootstrap state is never read from storage)",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "path": "crates/openhuman-core/src/web3/wallet/ops/state.rs",
+ "rule": "json-write",
+ "site": "let mut temp_file = NamedTempFile::new_in(parent)",
+ "reason": "paired with the OS keychain mnemonic (and holds it when there is no keychain): moves with the secrets work, not as a plain document",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
+ },
+ {
- "path": "crates/openhuman-core/src/inference/tokenjuice/savings.rs",
++ "path": "crates/openhuman-core/src/agent/harness/artifact_offload/mod.rs",
+ "rule": "json-write",
- "site": "if let Err(e) = std::fs::write(path, json) {",
- "reason": "one process-global savings counter snapshot, cheap to lose; not per-user data a scope would mean anything for",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
++ "site": "tokio::fs::write(&target, body)",
++ "reason": "a derived view of a blob-stored artifact, placed in the action dir so file_read can open the path a pointer hands back; the tenant's blob store stays the source of truth",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
- "path": "crates/openhuman-core/src/agent/artifacts/store.rs",
++ "path": "crates/openhuman-core/src/agent/harness/tool_result_artifacts/mod.rs",
+ "rule": "json-write",
- "site": "tokio::fs::write(&tmp_path, json).await.map_err(|e| {",
- "reason": "legacy fallback of a store that already runs on the storage port",
++ "site": "tokio::fs::write(&target, body).await?;",
++ "reason": "a derived view of a blob-stored tool-result artifact, written under the workspace's read-only artifacts root so file_read can open the key a pointer hands back; re-derived from the tenant's blob store on every read, which stays the source of truth",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
- "path": "crates/openhuman-core/src/agent/artifacts/store.rs",
++ "path": "crates/openhuman-core/src/modules/browser_task_report.rs",
+ "rule": "json-write",
- "site": "tokio::fs::write(&args_path, json)",
- "reason": "legacy fallback of a store that already runs on the storage port",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
++ "site": "let mut options = tokio::fs::OpenOptions::new();",
++ "reason": "opt-in debug trace (`[computer] trace`): the module's full task report, written as a file beside the module's own traces in the same trace directory so a person can open both; page text stays in a file only its owner can read and no store reads it back",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "path": "crates/openhuman-core/src/agent/artifacts/files.rs",
+ "rule": "json-write",
+ "site": "match tokio::fs::OpenOptions::new()",
+ "reason": "Historical local artifact content reservation; a native BlobStore now exists, so this is migration debt, not a missing blob capability.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
- "path": "crates/openhuman-core/src/modules/browser_profile.rs",
++ "path": "crates/openhuman-core/src/agent/artifacts/tiny_store.rs",
+ "rule": "json-write",
- "site": "lock.exists() && std::fs::OpenOptions::new().write(true).open(&lock).is_err()",
- "reason": "Checks whether the existing machine browser lock can be opened; no create, truncate or write call occurs. This permission probe is not an authoritative store.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "site": "tokio::fs::write(&dest, latest.body.as_bytes()).await?;",
++ "reason": "writes a text artifact's newest version into its file in the user-visible files folder; the deliverable is a user file on every backend, the versioned record itself goes through the artifact store",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
++ },
++ {
++ "path": "crates/openhuman-core/src/media/generation/artifact_tool.rs",
++ "rule": "json-write",
++ "site": "let mut file = tokio::fs::OpenOptions::new()",
++ "reason": "User-visible artifact content is retained as a local deliverable; versioned records and native blob storage are separate capabilities and this file does not establish shared storage authority.",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ }
+]
diff --cc scripts/ci/storage-bypass-extension.json
index d5c2ed8a3e,0000000000..bdf9293419
mode 100644,000000..100644
--- a/scripts/ci/storage-bypass-extension.json
+++ b/scripts/ci/storage-bypass-extension.json
@@@ -1,1092 -1,0 +1,672 @@@
+[
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-app/src/artifact_commands.rs",
- "line": 47,
++ "line": 41,
+ "text": "tokio::fs::copy(source, dest)",
+ "occurrence": 1,
+ "classification": "external-export",
+ "reason": "Explicit user-selected artifact export copies bytes to an external destination; native stored artifact content and export admission are separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-app/src/core_process.rs",
+ "line": 269,
+ "text": "let mut options = std::fs::OpenOptions::new();",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Debug-only owner-restricted per-launch RPC token file used by the local E2E host; not signed-in user state.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-app/src/gateway/store.rs",
+ "line": 155,
+ "text": "let mut options = std::fs::OpenOptions::new();",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Saved remote gateway endpoint and local SSH identity/bearer selection belong to the desktop host connection bootstrap; credentials must not become plain shared documents.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-app/src/gateway/store.rs",
+ "line": 165,
+ "text": "std::fs::rename(&temp_path, &path)?;",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Saved remote gateway endpoint and local SSH identity/bearer selection belong to the desktop host connection bootstrap; credentials must not become plain shared documents.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "sqlite-open",
+ "path": "crates/openhuman-app/src/imessage_scanner/chatdb.rs",
+ "line": 37,
+ "text": "Connection::open_with_flags(",
+ "occurrence": 1,
+ "classification": "read-only",
+ "reason": "Apple chat.db is explicitly opened SQLITE_OPEN_READ_ONLY; the external machine source is read, not an OpenHuman durable store.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-app/src/imessage_scanner/mod.rs",
+ "line": 272,
+ "text": "std::fs::write(path, rowid.to_string())",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "The last seen Apple chat.db ROWID cursor belongs to this machine source and cannot identify another host database.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-app/src/mcp_commands.rs",
+ "line": 238,
+ "text": "std::fs::write(&path, b\"{}\")",
+ "occurrence": 1,
+ "classification": "external-export",
+ "reason": "Explicitly creates an external installed MCP client configuration for the operating-system editor; not an OpenHuman authoritative store.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-app/src/window_state.rs",
+ "line": 144,
+ "text": "if let Err(err) = std::fs::write(&path, raw) {",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Window position and size reflect this machine display geometry, not cloud user state.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-cli/src/bin/fleet.rs",
+ "line": 522,
+ "text": "let mut file = std::fs::OpenOptions::new()",
+ "occurrence": 1,
+ "classification": "external-export",
+ "reason": "Explicit owner-only output of minted edge tokens to the requested fleet operator destination; not an internal user state store.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/agent/artifacts/migrate.rs",
- "line": 180,
++ "line": 183,
+ "text": "tokio::fs::copy(src, &partial)",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical artifact/attachment file publication or source-preserving import; native BlobStore availability does not authorize local historical source ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/agent/artifacts/migrate.rs",
- "line": 203,
++ "line": 206,
+ "text": "if let Err(e) = tokio::fs::rename(&partial, &target).await {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical artifact/attachment file publication or source-preserving import; native BlobStore availability does not authorize local historical source ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "file-mutation",
- "path": "crates/openhuman-core/src/agent/artifacts/store.rs",
- "line": 133,
- "text": "tokio::fs::rename(&tmp_path, &meta_path)",
++ "path": "crates/openhuman-core/src/agent/artifacts/tiny_store.rs",
++ "line": 146,
++ "text": "tokio::fs::copy(source, owned).await?",
+ "occurrence": 1,
- "classification": "classic",
- "reason": "Historical artifact/attachment file publication or source-preserving import; native BlobStore availability does not authorize local historical source ownership.",
++ "classification": "external-export",
++ "reason": "Materializes versioned artifact bytes in the user-visible artifact file; the versioned record and native blob storage remain separate from this local deliverable.",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
++ },
++ {
++ "rule": "file-mutation",
++ "path": "crates/openhuman-core/src/agent/artifacts/tiny_store.rs",
++ "line": 180,
++ "text": "tokio::fs::copy(&source, &dest).await?",
++ "occurrence": 1,
++ "classification": "external-export",
++ "reason": "Materializes versioned artifact bytes in the user-visible artifact file; the versioned record and native blob storage remain separate from this local deliverable.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/agent/attachments/legacy.rs",
+ "line": 156,
+ "text": "let linked = tokio::fs::hard_link(&temp, &path).await;",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical artifact/attachment file publication or source-preserving import; native BlobStore availability does not authorize local historical source ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/agent/attachments/provider_cache.rs",
- "line": 172,
++ "line": 173,
+ "text": "tokio::fs::rename(&temp, cache).await",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical artifact/attachment file publication or source-preserving import; native BlobStore availability does not authorize local historical source ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/agent/attachments/provider_source.rs",
+ "line": 245,
+ "text": "let linked = tokio::fs::hard_link(&temp, &path).await;",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical artifact/attachment file publication or source-preserving import; native BlobStore availability does not authorize local historical source ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
- {
- "rule": "task-store-open",
- "path": "crates/openhuman-core/src/agent/orchestration/running_subagents/task_ledger.rs",
- "line": 65,
- "text": "open_jsonl_task_store_or_memory(&task_store_path(workspace_dir))",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/agent/orchestration/subagent_sessions/store.rs",
- "line": 51,
- "text": "fs::rename(&tmp_path, path).map_err(|err| {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Historical subagent lifecycle/checkpoint file publication; scoped native orchestration stores must be selected separately.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/agent/session_store/agent_transcripts.rs",
- "line": 86,
- "text": "match std::fs::copy(legacy, own) {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Explicit legacy transcript adoption copies the source file without removing it; native resume is a distinct path.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/agent/subagent_host/lifecycle.rs",
- "line": 760,
- "text": "match std::fs::rename(&temporary, path) {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Historical subagent lifecycle/checkpoint file publication; scoped native orchestration stores must be selected separately.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/agent/subagent_host/lifecycle.rs",
- "line": 776,
- "text": "match std::fs::hard_link(&temporary, path) {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Historical subagent lifecycle/checkpoint file publication; scoped native orchestration stores must be selected separately.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-store-new",
- "path": "crates/openhuman-core/src/agent/tinyagents/reaper.rs",
- "line": 47,
- "text": "let store = FileStatusStore::new(open_session_stores(workspace).kv);",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic status sweep reads and persists cancellation through the concrete FileStore returned by the classic session opener; FileStatusStore::new is not a captured native KV adapter.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7423"
- },
- {
- "rule": "file-store-new",
- "path": "crates/openhuman-core/src/agent/tinyagents/replay/ops.rs",
- "line": 34,
- "text": "let store = FileStatusStore::new(open_session_stores(workspace).kv);",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Historical status reader wraps the concrete FileStore returned by the classic session opener; FileStatusStore::new is not a captured native KV adapter.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7423"
- },
- {
- "rule": "file-store-new",
- "path": "crates/openhuman-core/src/agent/tinyagents/replay/ops.rs",
- "line": 46,
- "text": "let store = FileStatusStore::new(open_session_stores(workspace).kv);",
- "occurrence": 2,
- "classification": "classic",
- "reason": "Historical status reader wraps the concrete FileStore returned by the classic session opener; FileStatusStore::new is not a captured native KV adapter.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7423"
- },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/config/schema/load/atomic_commit.rs",
+ "line": 44,
+ "text": "let replace = fs::rename(temp_path, config_path).await;",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic configuration atomic publication/backup/recovery helper; native document loading must avoid entering this filesystem path.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/config/schema/load/atomic_commit.rs",
+ "line": 57,
+ "text": "fs::rename(temp_path, config_path).await",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic configuration atomic publication/backup/recovery helper; native document loading must avoid entering this filesystem path.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/config/schema/load/atomic_commit.rs",
+ "line": 163,
+ "text": "if fs::copy(config_path, backup_path).await.is_err() {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic configuration atomic publication/backup/recovery helper; native document loading must avoid entering this filesystem path.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/config/schema/load/branches.rs",
- "line": 202,
++ "line": 203,
+ "text": "match fs::rename(&config_path, &corrupted_path).await {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic configuration atomic publication/backup/recovery helper; native document loading must avoid entering this filesystem path.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/config/schema/load/impl_load.rs",
+ "line": 107,
+ "text": "if let Err(rename_err) = std::fs::rename(config_path, &corrupted_path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic configuration atomic publication/backup/recovery helper; native document loading must avoid entering this filesystem path.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/config/schema/load_user_state.rs",
+ "line": 193,
+ "text": "if let Err(error) = std::fs::rename(&temp_path, &path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic configuration atomic publication/backup/recovery helper; native document loading must avoid entering this filesystem path.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/desktop/app_state/ops/state_file.rs",
+ "line": 55,
+ "text": "if let Err(rename_error) = fs::rename(path, &quarantine_path) {",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Local bootstrap state quarantine publication; user preferences and accessibility/key bootstrap require separate authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7428"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/desktop/control/ops.rs",
- "line": 151,
++ "line": 157,
+ "text": "serde_json::to_writer(&mut temporary, &LocalState { enabled: value })",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Serialization of this machine desktop-control consent into its local temporary file; consent must not follow another host backend.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/integrations/composio/file_store.rs",
- "line": 177,
- "text": "tokio::fs::rename(&tmp, path).await.map_err(|error| {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic integration cache atomic file replacement retained separately from captured native profile routing.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7433"
- },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/media/generation/artifact_tool.rs",
- "line": 203,
++ "line": 473,
+ "text": "if tokio::fs::rename(src, dest).await.is_err() {",
+ "occurrence": 1,
+ "classification": "scratch",
+ "reason": "Generated tool-output relocation between temporary native-tool paths before publication; authoritative artifact capture remains a separate host boundary.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/media/generation/artifact_tool.rs",
- "line": 204,
++ "line": 474,
+ "text": "tokio::fs::copy(src, dest).await.map_err(|e| {",
+ "occurrence": 1,
+ "classification": "scratch",
+ "reason": "Generated tool-output relocation between temporary native-tool paths before publication; authoritative artifact capture remains a separate host boundary.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/deletion.rs",
- "line": 73,
- "text": "if let Err(error) = std::fs::rename(&file, file.with_extension(\"json.corrupt\")) {",
- "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/deletion.rs",
++ "rule": "file-store-new",
++ "path": "crates/openhuman-core/src/memory/import.rs",
+ "line": 99,
- "text": "std::fs::rename(&temp, &file)",
++ "text": "FileCheckpointStore::new(workspace_dir).load()",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
++ "classification": "classic",
++ "reason": "Legacy memory import checkpoint adapter reads and saves resume, error and credit-pause bookkeeping through the existing host state store; this constructor is not proof of native migration authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
- "rule": "writer-helper",
- "path": "crates/openhuman-core/src/memory/files.rs",
- "line": 60,
- "text": "pub fn create_private(path: &Path) -> std::io::Result<File> {",
++ "rule": "file-store-new",
++ "path": "crates/openhuman-core/src/memory/import.rs",
++ "line": 122,
++ "text": "Arc::new(FileCheckpointStore::new(&config.workspace_dir)),",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
++ "classification": "classic",
++ "reason": "Legacy memory import checkpoint adapter reads and saves resume, error and credit-pause bookkeeping through the existing host state store; this constructor is not proof of native migration authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
- "rule": "writer-helper",
- "path": "crates/openhuman-core/src/memory/files.rs",
- "line": 84,
- "text": "pub fn write_private(path: &Path, bytes: &[u8]) -> std::io::Result<()> {",
++ "rule": "file-store-new",
++ "path": "crates/openhuman-core/src/memory/import.rs",
++ "line": 265,
++ "text": "let store = FileCheckpointStore::new(&config.workspace_dir);",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
++ "classification": "classic",
++ "reason": "Legacy memory import checkpoint adapter reads and saves resume, error and credit-pause bookkeeping through the existing host state store; this constructor is not proof of native migration authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/layout_migration/claim.rs",
- "line": 108,
- "text": "serde_json::to_writer(temp.as_file(), &marker).map_err(std::io::Error::other)?;",
++ "rule": "file-store-new",
++ "path": "crates/openhuman-core/src/memory/layout_migration/app_host.rs",
++ "line": 28,
++ "text": "let store = FileStateStore::new(&config.workspace_dir);",
+ "occurrence": 1,
+ "classification": "classic",
- "reason": "Legacy memory layout migration claim/state marker publication; historical source capture and native migration admission remain separate.",
++ "reason": "Legacy memory layout migration host retains its checkpoint and claim state through the existing file-state adapter; engine migration and checkpoint routing are separate obligations.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/memory/layout_migration/claim.rs",
+ "line": 111,
- "text": "std::fs::hard_link(temp.path(), &key.marker)",
++ "text": "serde_json::to_writer(temp.as_file(), &marker).map_err(std::io::Error::other)?;",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Legacy memory layout migration claim/state marker publication; historical source capture and native migration admission remain separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
+ "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/layout_migration/state.rs",
- "line": 131,
- "text": "std::fs::rename(&temp, &file)",
++ "path": "crates/openhuman-core/src/memory/layout_migration/claim.rs",
++ "line": 114,
++ "text": "std::fs::hard_link(temp.path(), &key.marker)",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Legacy memory layout migration claim/state marker publication; historical source capture and native migration admission remain separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/local_root.rs",
- "line": 169,
- "text": "serde_json::to_writer_pretty(temp.as_file(), record).map_err(std::io::Error::other)?;",
- "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/local_root.rs",
- "line": 171,
- "text": "match std::fs::hard_link(temp.path(), file) {",
- "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
- },
- {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/memory/tool_writes.rs",
- "line": 141,
- "text": "std::fs::rename(&temp, file)?;",
++ "rule": "file-store-new",
++ "path": "crates/openhuman-core/src/memory/layout_migration/test_host.rs",
++ "line": 50,
++ "text": "store: FileStateStore::new(&config.workspace_dir),",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical memory side-state filesystem publication/helper; native backend coverage and captured migration must be independently verified rather than inferred from owner-only permissions.",
++ "classification": "scratch",
++ "reason": "Test-only layout migration host, wired under cfg(test), instantiates the file-state fixture for migration controls; it is not a product storage route.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7427"
+ },
+ {
- "rule": "file-mutation",
- "path": "crates/openhuman-core/src/modules/browser_sites/store.rs",
- "line": 108,
- "text": "let _set_aside = tokio::fs::rename(&path, path.with_extension(\"json.corrupt\")).await;",
++ "rule": "writer-helper",
++ "path": "crates/openhuman-core/src/modules/browser_task_report.rs",
++ "line": 297,
++ "text": "async fn write_private(path: &Path, report: &TaskReport) -> std::io::Result<usize> {",
+ "occurrence": 1,
+ "classification": "unmigrated",
+ "reason": "Canonical browser site/report local publication helper; native scoped store selection requires its owning migration and trusted historical source admission.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
- "path": "crates/openhuman-core/src/modules/browser_sites/store.rs",
- "line": 185,
- "text": "tokio::fs::rename(&staged, path).await",
++ "path": "crates/openhuman-core/src/modules/storage_import_tinymcp.rs",
++ "line": 214,
++ "text": "std::fs::copy(path, &copy).with_context(|| format!(\"copy {}\", path.display()))?;",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical browser site/report local publication helper; native scoped store selection requires its owning migration and trusted historical source admission.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "classification": "classic",
++ "reason": "Source-preserving legacy MCP SQLite import copies the database and WAL companion into scratch storage before opening the copy; durable imported records are written through the module storage contract.",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
+ },
+ {
- "rule": "writer-helper",
- "path": "crates/openhuman-core/src/modules/browser_task_report.rs",
- "line": 297,
- "text": "async fn write_private(path: &Path, report: &TaskReport) -> std::io::Result<usize> {",
++ "rule": "file-mutation",
++ "path": "crates/openhuman-core/src/modules/storage_import_tinymcp.rs",
++ "line": 222,
++ "text": "std::fs::copy(&companion, PathBuf::from(target))",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical browser site/report local publication helper; native scoped store selection requires its owning migration and trusted historical source admission.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
++ "classification": "classic",
++ "reason": "Source-preserving legacy MCP SQLite import copies the database and WAL companion into scratch storage before opening the copy; durable imported records are written through the module storage contract.",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/platform/cost/tracker.rs",
- "line": 405,
++ "line": 402,
+ "text": "if let Err(error) = fs::rename(&legacy_path, &storage_path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical cost snapshot relocation/quarantine used by the classic/import path; native document accounting is a separate API.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/platform/cost/tracker.rs",
- "line": 411,
++ "line": 408,
+ "text": "fs::copy(&legacy_path, &storage_path).with_context(|| {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical cost snapshot relocation/quarantine used by the classic/import path; native document accounting is a separate API.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/platform/cost/tracker_documents.rs",
- "line": 186,
++ "line": 189,
+ "text": "match std::fs::rename(path, &target) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical cost snapshot relocation/quarantine used by the classic/import path; native document accounting is a separate API.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/platform/update/core.rs",
+ "line": 164,
+ "text": "std::fs::rename(tmp, dest).map_err(|e| {",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Downloaded executable update atomically replaces the local installed binary; deployment artifact is not tenant state.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/profiles/lifecycle.rs",
+ "line": 190,
+ "text": "std::fs::rename(&layout.dir, &dest)",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Desktop profile directory archive/rollback lifecycle operation; backend purge and ownership/drain authority are separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/profiles/lifecycle.rs",
+ "line": 198,
+ "text": "if let Err(e) = std::fs::rename(&dest, &layout.dir) {",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Desktop profile directory archive/rollback lifecycle operation; backend purge and ownership/drain authority are separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/audit.rs",
+ "line": 330,
+ "text": "let _ = std::fs::rename(&old_name, &new_name);",
+ "occurrence": 1,
+ "classification": "unmigrated",
+ "reason": "Canonical security audit file rotation; native scoped stream migration must retain captured producer authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/audit.rs",
+ "line": 334,
+ "text": "std::fs::rename(&self.log_path, &rotated)?;",
+ "occurrence": 1,
+ "classification": "unmigrated",
+ "reason": "Canonical security audit file rotation; native scoped stream migration must retain captured producer authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/credentials/http_creds.rs",
- "line": 422,
++ "line": 426,
+ "text": "if let Err(e) = fs::rename(&tmp_path, &self.path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical encrypted credential persistence/quarantine publication; native secret port and trusted source/key ownership are separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/credentials/profiles.rs",
- "line": 572,
++ "line": 577,
+ "text": "fs::rename(path, &candidate).with_context(|| {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical encrypted credential persistence/quarantine publication; native secret port and trusted source/key ownership are separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/credentials/profiles/persistence.rs",
+ "line": 277,
+ "text": "fs::rename(&tmp_path, &self.path).context(\"rename auth profile tmp -> store\")",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic encrypted credential profile fallback persists AuthProfilesData and token fields; native SecretStore routing requires trusted machine key and source admission, not directory rollback authority.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/secret_storage/encrypted_file_backend.rs",
- "line": 553,
++ "line": 580,
+ "text": "std::fs::rename(legacy_path, &archive_path)",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Historical encrypted credential persistence/quarantine publication; native secret port and trusted source/key ownership are separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "writer-helper",
+ "path": "crates/openhuman-core/src/security/secret_storage/file_store.rs",
- "line": 126,
++ "line": 201,
+ "text": "pub fn write_atomic(path: &Path, bytes: &[u8]) -> Result<(), SecretStorageError> {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Owner-only atomic encrypted-secret/bootstrap file helper; native SecretStore and machine master-key policy have separate admission.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/secret_storage/file_store.rs",
- "line": 241,
++ "line": 316,
+ "text": "std::fs::rename(source, destination)?;",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Owner-only atomic encrypted-secret/bootstrap file helper; native SecretStore and machine master-key policy have separate admission.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/secret_storage/file_store.rs",
- "line": 331,
++ "line": 406,
+ "text": "match std::fs::hard_link(path, &target) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Owner-only atomic encrypted-secret/bootstrap file helper; native SecretStore and machine master-key policy have separate admission.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/security/secret_storage/file_store.rs",
- "line": 358,
++ "line": 433,
+ "text": "return match std::fs::rename(path, &target) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Owner-only atomic encrypted-secret/bootstrap file helper; native SecretStore and machine master-key policy have separate admission.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7421"
+ },
- {
- "rule": "file-store-new",
- "path": "crates/openhuman-core/src/skills/catalog/registry.rs",
- "line": 118,
- "text": "builder.store(FileCatalogStore::new(dir.clone())).build()",
- "occurrence": 1,
- "classification": "scratch",
- "reason": "Refetchable skill catalog metadata cache uses FileCatalogStore and capability-directory temporary-file publication; SaaS cache routing and desktop cache selection remain separate work.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7429"
- },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/threads/welcome_migration.rs",
- "line": 306,
++ "line": 310,
+ "text": "fs::rename(path, destination).map_err(|e| {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Explicit legacy welcome-thread file relocation; native thread metadata/streams do not grant historical import ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/threads/welcome_migration.rs",
- "line": 362,
++ "line": 366,
+ "text": "if let Err(err) = fs::rename(&old_path, &new_path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Explicit legacy welcome-thread file relocation; native thread metadata/streams do not grant historical import ownership.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
+ },
- {
- "rule": "writer-helper",
- "path": "crates/openhuman-core/src/tinymemes/host.rs",
- "line": 263,
- "text": "pub(crate) fn write_atomic(path: &Path, contents: &str) -> std::io::Result<()> {",
- "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical local TinyMemes index/remix marker write helper; owning compiled module native CAS/read work is separate and not assumed available here.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
- },
+ {
+ "rule": "file-mutation",
- "path": "crates/openhuman-core/src/tinymemes/host.rs",
- "line": 268,
- "text": "std::fs::rename(&tmp, path).inspect_err(|_| {",
++ "path": "crates/openhuman-core/src/tinymemes/docs.rs",
++ "line": 81,
++ "text": "match std::fs::rename(&path, &migrated) {",
+ "occurrence": 1,
- "classification": "unmigrated",
- "reason": "Canonical local TinyMemes index/remix marker write helper; owning compiled module native CAS/read work is separate and not assumed available here.",
++ "classification": "classic",
++ "reason": "Retires the legacy JSON document by renaming it only after the native document-port write succeeds; the native document remains authoritative after adoption.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7431"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-core/src/web3/wallet/ops/state.rs",
+ "line": 156,
+ "text": "if let Err(rename_error) = fs::rename(path, &quarantine_path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic wallet state quarantine coupled to local keychain secrets; not eligible for plain-document relocation.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-embed/src/harness/skills.rs",
+ "line": 162,
+ "text": "std::fs::copy(entry.path(), &target).map_err(|source| HarnessError::Workspace {",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Library AgentSpec skill provisioning copies caller-supplied bundles into the agent directory because discovery rejects symlinks.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7429"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-embed/src/harness/workspace.rs",
- "line": 119,
++ "line": 174,
+ "text": "let temp = tempfile::Builder::new()",
+ "occurrence": 1,
+ "classification": "scratch",
+ "reason": "Library harness temporary workspace builder allocates a requested scratch directory; not durable user state.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7434"
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-embed/src/profiles.rs",
+ "line": 420,
+ "text": "let mut options = std::fs::OpenOptions::new();",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Fresh owner-only service token written before any served gateway; installation/connection bootstrap is deliberately local.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "crates/openhuman-embed/src/profiles.rs",
+ "line": 436,
+ "text": "std::fs::rename(&temp_path, path)",
+ "occurrence": 1,
+ "classification": "machine",
+ "reason": "Fresh owner-only service token written before any served gateway; installation/connection bootstrap is deliberately local.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7432"
+ },
+ {
+ "rule": "json-write",
- "path": "crates/openhuman-tui/src/app/artifacts.rs",
- "line": 79,
- "text": "match std::fs::write(&path, state.export_markdown()) {",
++ "path": "crates/openhuman-tinyhumans/src/integrations/file_storage/tools/download.rs",
++ "line": 89,
++ "text": "if let Err(e) = tokio::fs::write(&path, &body).await {",
+ "occurrence": 1,
+ "classification": "external-export",
- "reason": "Explicit transcript Markdown export to the operator-selected path; the authoritative conversation journal is not replaced by this export.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
- },
- {
- "rule": "sqlite-open",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/run_ledger/drivers/import.rs",
- "line": 104,
- "text": "let connection = Connection::open_with_flags(",
- "occurrence": 1,
- "classification": "read-only",
- "reason": "Read-only SQLite source opened by the explicit run-ledger import; not a native database writer.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7423"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/threads/store/index.rs",
- "line": 124,
- "text": "File::create(&threads_file)",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic conversation file index or message journal implementation; native conversation readers and append capability are separate owning APIs.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/threads/store/mod.rs",
- "line": 312,
- "text": "let mut file = OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic conversation file index or message journal implementation; native conversation readers and append capability are separate owning APIs.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/threads/store/mod.rs",
- "line": 365,
- "text": "let mut temp = File::create(&tmp_path)",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic conversation file index or message journal implementation; native conversation readers and append capability are separate owning APIs.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/threads/store/mod.rs",
- "line": 381,
- "text": "if let Err(error) = fs::rename(&tmp_path, path) {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic conversation file index or message journal implementation; native conversation readers and append capability are separate owning APIs.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/adoption.rs",
- "line": 319,
- "text": "match std::fs::OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/history.rs",
- "line": 1211,
- "text": "OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
++ "reason": "Downloads remote file bytes into the acting directory as a user-visible deliverable; local exported bytes do not replace the authoritative remote file record.",
++ "issue": "https://github.com/tinyhumansai/openhuman/issues/7425"
+ },
+ {
+ "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/import/ops.rs",
- "line": 68,
- "text": "fs::File::create(&staged)",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Explicit legacy transcript import stages and publishes files; native session ports do not authorize implicit historical import.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/import/ops.rs",
- "line": 81,
- "text": "fs::rename(&destination, &backup).with_context(|| {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Explicit legacy transcript import stages and publishes files; native session ports do not authorize implicit historical import.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/import/ops.rs",
- "line": 88,
- "text": "if let Err(error) = fs::rename(&staged, &destination) {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Explicit legacy transcript import stages and publishes files; native session ports do not authorize implicit historical import.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/import/ops.rs",
- "line": 90,
- "text": "let _ = fs::rename(&backup, &destination);",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Explicit legacy transcript import stages and publishes files; native session ports do not authorize implicit historical import.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-store-new",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/import/ops.rs",
- "line": 111,
- "text": "kv: FileStore::new(root.join(KV_SUBDIR)),",
++ "path": "crates/openhuman-tui/src/app/artifacts.rs",
++ "line": 79,
++ "text": "match std::fs::write(&path, state.export_markdown()) {",
+ "occurrence": 1,
- "classification": "classic",
- "reason": "Legacy transcript importer and live dual-write explicitly construct the file KV destination under tinyagents_store; source-preserving import is distinct from native session routing.",
++ "classification": "external-export",
++ "reason": "Explicit transcript Markdown export to the operator-selected path; the authoritative conversation journal is not replaced by this export.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7424"
+ },
- {
- "rule": "sqlite-open",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/import/ops.rs",
- "line": 512,
- "text": "let conn = match rusqlite::Connection::open_with_flags(",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Explicit legacy transcript import stages and publishes files; native session ports do not authorize implicit historical import.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/migration.rs",
- "line": 281,
- "text": "fs::hard_link(source, destination)?;",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/migration.rs",
- "line": 312,
- "text": "fs::write(marker_path, body)",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
+ {
+ "rule": "json-write",
+ "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/writer.rs",
- "line": 455,
++ "line": 441,
+ "text": "let mut file = fs::OpenOptions::new()",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/writer.rs",
- "line": 478,
++ "line": 464,
+ "text": "fs::rename(&tmp_path, path).with_context(|| {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
+ },
+ {
+ "rule": "file-mutation",
+ "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/writer.rs",
- "line": 516,
++ "line": 503,
+ "text": "let published = match fs::hard_link(&tmp_path, path) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
+ },
+ {
+ "rule": "json-write",
+ "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/writer.rs",
- "line": 534,
++ "line": 522,
+ "text": "let mut file = fs::OpenOptions::new()",
+ "occurrence": 2,
+ "classification": "classic",
+ "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
+ },
+ {
+ "rule": "json-write",
+ "path": "vendor/tinyagents/crates/tinyagents-session/src/transcript/writer.rs",
- "line": 598,
++ "line": 586,
+ "text": "if let Err(err) = fs::write(&md_path, md.as_bytes()) {",
+ "occurrence": 1,
+ "classification": "classic",
+ "reason": "Classic transcript generation/adoption/migration publication; scoped native session stores are a distinct implementation and historical source admission remains separate.",
+ "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/turn_state/store.rs",
- "line": 560,
- "text": "let mut tmp = NamedTempFile::new_in(&dir)",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic turn-state temporary-file publication retained separately from the native typed-state port.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-session/src/turn_state/store.rs",
- "line": 626,
- "text": "fs::rename(&temp_path, path).map_err(|error| {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic turn-state temporary-file publication retained separately from the native typed-state port.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-tasks/src/completions/store.rs",
- "line": 153,
- "text": "std::fs::OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-tasks/src/completions/store.rs",
- "line": 206,
- "text": "let file = std::fs::OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-tasks/src/completions/store.rs",
- "line": 275,
- "text": "let mut out = std::fs::OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinyagents/crates/tinyagents-tasks/src/completions/store.rs",
- "line": 291,
- "text": "std::fs::rename(&tmp, &self.path).map_err(|e| store_err(\"swap compacted log\", e))?;",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyagents/crates/tinyagents-tasks/src/store.rs",
- "line": 373,
- "text": "let file = std::fs::OpenOptions::new()",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "task-store-open",
- "path": "vendor/tinyagents/crates/tinyagents-tasks/src/store_registry.rs",
- "line": 157,
- "text": "pub fn open_jsonl_task_store_or_memory(path: &Path) -> Arc<dyn TaskStore> {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Classic detached-task or completion JSONL opener, append, torn-tail repair, or compaction publication; native task routing does not remove the owning library local fallback.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7426"
- },
- {
- "rule": "sqlite-open",
- "path": "vendor/tinymcp/crates/tinymcp/src/audit/store/types.rs",
- "line": 52,
- "text": "let connection = Connection::open(path).map_err(|source| {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Owning MCP local registry/audit store implementation used by the module local opener; native captured callback storage is distinct and does not remove this local mode.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinymcp/crates/tinymcp/src/registry/store/types.rs",
- "line": 39,
- "text": "let mut options = std::fs::OpenOptions::new();",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Owning MCP local registry/audit store implementation used by the module local opener; native captured callback storage is distinct and does not remove this local mode.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
- },
- {
- "rule": "file-mutation",
- "path": "vendor/tinymcp/crates/tinymcp/src/registry/store/types.rs",
- "line": 62,
- "text": "match std::fs::hard_link(&temp_path, &key_path) {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Owning MCP local registry/audit store implementation used by the module local opener; native captured callback storage is distinct and does not remove this local mode.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinymcp/crates/tinymcp/src/registry/store/types.rs",
- "line": 82,
- "text": "let mut options = std::fs::OpenOptions::new();",
- "occurrence": 2,
- "classification": "classic",
- "reason": "Owning MCP local registry/audit store implementation used by the module local opener; native captured callback storage is distinct and does not remove this local mode.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
- },
- {
- "rule": "sqlite-open",
- "path": "vendor/tinymcp/crates/tinymcp/src/registry/store/types.rs",
- "line": 198,
- "text": "let connection = Connection::open(path).map_err(|source| {",
- "occurrence": 1,
- "classification": "classic",
- "reason": "Owning MCP local registry/audit store implementation used by the module local opener; native captured callback storage is distinct and does not remove this local mode.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7430"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyskills/crates/tinyskills/src/registry/store.rs",
- "line": 261,
- "text": "let mut options = OpenOptions::new();",
- "occurrence": 1,
- "classification": "read-only",
- "reason": "Catalog reader opens an existing capability-directory file with read(true) and no write/create flag; this exact occurrence is not the catalog publisher.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7429"
- },
- {
- "rule": "json-write",
- "path": "vendor/tinyskills/crates/tinyskills/src/registry/store.rs",
- "line": 339,
- "text": "let mut options = OpenOptions::new();",
- "occurrence": 2,
- "classification": "scratch",
- "reason": "Refetchable skill catalog metadata cache uses FileCatalogStore and capability-directory temporary-file publication; SaaS cache routing and desktop cache selection remain separate work.",
- "issue": "https://github.com/tinyhumansai/openhuman/issues/7429"
+ }
+]
diff --cc scripts/ci/storage-bypass.md
index 2bf8efcad2,0000000000..bfb69a9b56
mode 100644,000000..100644
--- a/scripts/ci/storage-bypass.md
+++ b/scripts/ci/storage-bypass.md
@@@ -1,79 -1,0 +1,77 @@@
+# Storage bypass coverage and retained debt
+
+The cancellation-supervised checks lane scans every immediate `crates/*/src`
- host directory. The original core document/storage implementation exclusion and
- sibling test exclusions remain. It also scans explicitly curated classic
- TinyAgents session/task/completion stores, TinySkills catalog storage, and the TinyMCP registry/audit stores actually opened
- by host composition. Native storage driver implementations are not bypasses;
++host directory. The core storage implementation and sibling test exclusions
++remain. Curated sources also cover TinyAgents session/task/completion owners,
++TinySkills catalog storage, and TinyMCP registry/audit stores opened by host
++composition. Native storage backend implementations are outside this scan;
+their host adapters remain scanned.
+
- Rules cover database opens, filesystem writes/creation, rename/copy/hard-link
- publication, tempfile builders, JSON writer destinations, the known filesystem
- helper definitions `write_private`, `create_private`, and `write_atomic`, and
- store open calls with a nearby `.db` or `.jsonl` literal argument, file-backed `File*Store::new` / `File*Ledger::new` constructors, and the JSONL task opener. Tokio calls
- are included: the original `fs::write` pattern already recognized their `fs::`
- suffix. The missing embed detection was a directory coverage bug.
++Rules detect database opens, file mutations, tempfile builders, JSON writers,
++known filesystem writer helpers, store openers with a nearby `.db` or `.jsonl`
++literal, file-backed `File*Store::new` / `File*Ledger::new` constructors, and the
++JSONL task opener. Tokio calls are included. The former embed gap was caused by
++scanning only the core directory.
+
- ## Two exact debt inventories
++## Exact inventories
+
- `storage-bypass-baseline.json` retains the original **68** core rule identities.
- This change does not increase or replace that baseline. Regeneration requires an
- existing baseline and refuses new findings; it can only remove fixed sites.
- The merge-base check also prevents editing the manifest to accept new debt.
++`storage-bypass-baseline.json` retains **57** original core rule identities,
++byte-for-byte identical to canonical main. This PR does not increase or replace
++that baseline. Regeneration requires an existing baseline, refuses new findings,
++and can only remove fixed sites. Canonical merge-base validation also rejects
++baseline growth.
+
- `storage-bypass-extension.json` contains **109** reviewed identities for coverage
- that this change introduces. Each identifies its exact rule, path, source line,
- and occurrence, with a destination classification, reason, and owning issue.
- These are sites, not 109 independent stores. The initial extension must match
- source already present at the canonical merge base, including its recorded
- vendor gitlinks. A branch-added or moved writer cannot enter this inventory.
- Once the extension exists in the base, its identities can only shrink. Removing
- an entry while its writer survives fails the ordinary added-finding check.
++`storage-bypass-extension.json` establishes **67** reviewed identities for the
++broader coverage. Each records its rule, path, source line, occurrence,
++classification, reason, and owning issue. These are identities, not independent
++stores or completed migrations. The initial extension must already exist at the
++canonical merge base and its recorded vendor gitlinks. A writer added, moved,
++or copied by the PR cannot enter the inventory. Once established in canonical
++main, this manifest can only shrink.
+
- `storage-bypass-allow-reasons.json` audits the original **16** pinned exclusions
- and one existing browser lock permission probe. The old claim that the port has
- no blob store is removed: local artifact reservation is historical migration
- debt, not an absent native BlobStore capability. Initial audited exclusions must
- also exist at the canonical merge base; later exclusions cannot grow. An exact
- site allowance never covers a second occurrence or another call in the file.
++The merge with current main removes 53 retired extension identities and reviews
++11 existing canonical identities: artifact file materialization, legacy memory
++import/layout checkpoints, a test-only migration fixture, source-preserving MCP
++import copies, legacy tinymemes document retirement, and downloaded file bytes.
++The thread facade and turn-state mirror replace their removed classic store
++paths in the curated source list, preserving coverage of the current owners.
+
- The browser lock probe opens an existing file without create, truncate or a
- write call. The separate Apple chat.db record explicitly uses
- `SQLITE_OPEN_READ_ONLY`. Neither classification establishes storage authority.
- Other records distinguish classic compatibility/import paths, machine bootstrap,
- scratch, explicit external exports, and genuine unmigrated state. A classification
- is review evidence, not a claim that its issue or native host routing is complete.
++`storage-bypass-allow-reasons.json` audits **17** current canonical exclusions.
++Retired file-store fallbacks are not restored. Exclusions cover read-only legacy
++imports over scratch copies, machine/bootstrap state, user-visible artifact
++files and derived views, and an exact test-only classic transcript fixture.
++Artifact files do not imply that native BlobStore support is absent. Initial
++exclusions must exist in canonical source; later exclusions cannot grow. An
++allowance never covers a second occurrence or another call in the same file.
+
- ## Bounds and verification
++Classifications are review evidence. They do not establish tenant authority,
++cloud isolation, migration completion, or an export's admission policy.
+
- This is a source guard, not Rust name resolution or whole-program dataflow.
- It does not expand macros or resolve renamed imports, follow arbitrary writer
- helpers, or infer a destination behind a variable. Opener literal matching spans
- the current and following source line; curated owner store definitions cover
- known indirect host opens. New rules mask Rust comments and quoted fixtures;
- original core rule identities retain their existing lexical behavior.
++## Bounds and validation
+
- Real CI uses the canonical merge base and fails if the base, original baseline,
- or recorded vendor source is unavailable. Current curated vendor files must also be readable, and curated directories must contain Rust source; absent or empty checkouts cannot count as debt removal. `--root` also checks history when it names a real Git checkout; it supports isolated source
- fixtures without Git; those tests independently exercise the manifest comparison policy.
- Do not use a synthetic fixture result as proof of actual host storage isolation.
++This is a source guard, not Rust name resolution or callgraph/dataflow analysis.
++It does not expand macros, resolve arbitrary import aliases, or infer a writer's
++destination from a variable. Literal opener matching spans the current and next
++source line. New rules mask Rust comments and quoted fixtures; original core
++identities retain their existing lexical behavior.
+
- The embed Tokio writer and five additional coverage/regeneration cases genuinely
- failed against the original scanner (0 passed, 6 failed), then passed unchanged.
- A separate missing-baseline regeneration case also genuinely failed before its
- fix. Current focused scanner/debt/lane controls cover exact identity moves and
- copies, initial branch writes, later manifest growth, surviving unrecorded writes,
- missing history, absent/empty curated source, duplicate core records, comments/fixtures, original core debt, and both CI profiles. The review controls reproduced duplicate-baseline and missing-source failures (0 passed, 2 failed), empty-source failure (0 passed, 1 failed), and missing scripts path-filter coverage (0 passed, 1 failed) before their fixes. The initial focused suite had 60 passing controls. A subsequent review reproduced two real symlink-root bypasses (0 passed, 2 failed): missing curated source was ignored, and `--root` skipped required canonical history. Shared canonical-path checkout detection fixes both; the expanded suite has 62 passing controls. Checker, debt helper, and policy-only JSON/Markdown changes arm the scripts self-test lane.
++Real checkouts require canonical history, the original baseline, and recorded
++vendor sources. Missing/empty curated roots, invalid/duplicate records, and stale
++allowances fail closed. `--root` enforces history for real checkouts, including
++symlink spellings; isolated fixtures exercise source and debt policy separately.
++A fixture pass is not proof of host storage isolation.
+
- Run:
++The focused scanner/debt/lane suite has 78 passing controls. It covers initial
++branch writers, copied/moved identities, later growth, missing history and
++baselines, absent/empty curated roots, symlink spellings, comments/fixtures,
++current owner paths, and cancellation supervision in both CI profiles. Policy
++JSON/Markdown, scanner, debt-helper, and shared comment-masker changes arm the
++scripts regression lane.
+
+```sh
+node --test scripts/__tests__/storage-bypass*.test.mjs scripts/__tests__/self-hosted-lanes.test.mjs
+bash scripts/ci-cancel-aware.sh node scripts/ci/check-storage-bypass.mjs
+```
+
- This guard does not implement backend migration, desktop import authority, or
- Memory/SQLite/MongoDB runtime composition. Those belong to the linked owner
- issues and their authentic native integration proofs.
-
- The latest review added task/completion and catalog owner coverage. Three curated/constructor regressions and one host task-opener regression failed before their fixes. The expanded focused suite passed 70 controls. The additional 14 canonical sites include a read-only catalog opener, refetchable catalog cache publication, classic task/completion logs, and classic file-backed status/import stores. No site is classified as migrated solely because another native implementation exists. Changes to the shared Rust comment masker also arm the scripts lane.
++Backend migration, desktop import authority, and native runtime composition
++remain the responsibilities of their linked owner issues and integration tests.