Skip to content

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

chore(ci): add storage bypass check script and baseline

Steven Enamakel346e04cf64ea
diff --git a/scripts/ci/check-storage-bypass.mjs b/scripts/ci/check-storage-bypass.mjs
new file mode 100755
index 0000000000..dba01b9f63
--- /dev/null
+++ b/scripts/ci/check-storage-bypass.mjs
@@ -0,0 +1,198 @@
+#!/usr/bin/env node
+// Storage-bypass ratchet.
+//
+// Persistent state goes through the storage port (`crates/openhuman-core/src/
+// storage/`, `tinystoragedrivers`), so one backend setting moves all of it:
+// SQLite files, a file tree, or a shared MongoDB, with every record under the
+// acting agent's scope. Code that opens its own database or writes its own
+// file store behind the port makes state a cloud deployment cannot share or
+// isolate. Each existing site is baselined exactly; a new one fails CI, and a
+// fixed one must be removed from the baseline.
+//
+// Rules (non-test Rust under crates/openhuman-core/src, outside storage/):
+// sqlite-open rusqlite `Connection::open(` - use the document port
+// json-write fs::write / File::create / OpenOptions::new() - a raw file
+// store; use the document, stream or secret port
+//
+// A file may keep a rule when it is the legacy fallback of a store that already
+// runs on the port (it serves the host that configured no backend), or when its
+// state is per-machine and must not be shared. Both are listed in ALLOW with the
+// reason; the reason is the review.
+//
+// node scripts/ci/check-storage-bypass.mjs
+// node scripts/ci/check-storage-bypass.mjs --write-baseline
+// node scripts/ci/check-storage-bypass.mjs --root <dir> (tests)
+
+import { mkdir, readFile, readdir, writeFile } from "node:fs/promises";
+import { dirname, relative, resolve, sep } from "node:path";
+import { fileURLToPath } from "node:url";
+
+const rootFlag = process.argv.indexOf("--root");
+const repoRoot =
+ rootFlag === -1
+ ? resolve(dirname(fileURLToPath(import.meta.url)), "../..")
+ : resolve(process.argv[rootFlag + 1]);
+const scanRoot = resolve(repoRoot, "crates/openhuman-core/src");
+const baselinePath = resolve(repoRoot, "scripts/ci/storage-bypass-baseline.json");
+const writeBaseline = process.argv.includes("--write-baseline");
+
+export const RULES = [
+ {
+ rule: "sqlite-open",
+ pattern: /\bConnection::open(?:_with_flags)?\s*\(/,
+ hint: "persist through the storage port (crate::storage::documents::Repo)",
+ },
+ {
+ rule: "json-write",
+ pattern: /\b(?:fs::write|File::create|OpenOptions::new)\s*\(/,
+ hint: "persist through the storage port, or allowlist it with a reason in ALLOW",
+ },
+];
+
+const SRC = "crates/openhuman-core/src/";
+const FALLBACK = "legacy fallback of a store that already runs on the storage port";
+
+/** path -> { rules, reason }: sites a rule does not apply to. */
+export const ALLOW = new Map([
+ [`${SRC}security/approval/store.rs`, { rules: ["sqlite-open"], reason: FALLBACK }],
+ [`${SRC}security/devices/store.rs`, { rules: ["sqlite-open"], reason: FALLBACK }],
+ [`${SRC}desktop/notifications/store.rs`, { rules: ["sqlite-open"], reason: FALLBACK }],
+ [`${SRC}integrations/task_sources/store.rs`, { rules: ["sqlite-open"], reason: FALLBACK }],
+ [`${SRC}cron/policy.rs`, { rules: ["sqlite-open"], reason: FALLBACK }],
+ [
+ `${SRC}config/workspace/state.rs`,
+ {
+ rules: ["sqlite-open"],
+ 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",
+ },
+ ],
+ [`${SRC}platform/cost/tracker.rs`, { rules: ["json-write"], reason: FALLBACK }],
+]);
+
+/** Whether `rule` is allowed in `rel`. */
+export function allowed(rel, rule) {
+ return ALLOW.get(rel)?.rules.includes(rule) ?? false;
+}
+
+function isTestFile(rel) {
+ return (
+ rel.startsWith("crates/openhuman-core/src/storage/") ||
+ rel.endsWith("_tests.rs") ||
+ rel.includes(`${sep}test_support${sep}`) ||
+ rel.includes("/test_support/")
+ );
+}
+
+/** Code part of a line: drops `//` comments outside string literals. */
+export function codeOf(line) {
+ let quoted = false;
+ let escaped = false;
+ for (let i = 0; i < line.length; i += 1) {
+ const c = line[i];
+ if (c === '"' && !escaped) quoted = !quoted;
+ if (!quoted && c === "/" && line[i + 1] === "/") return line.slice(0, i);
+ escaped = c === "\\" && !escaped;
+ }
+ return line;
+}
+
+/** Findings in one file's source. */
+export function scan(rel, source) {
+ const found = [];
+ const occurrences = new Map();
+ for (const [index, raw] of source.split(/\r?\n/).entries()) {
+ const code = codeOf(raw);
+ if (!code.trim()) continue;
+ for (const { rule, pattern } of RULES) {
+ if (!pattern.test(code)) continue;
+ const text = raw.trim();
+ const key = `${rule}\0${text}`;
+ const occurrence = (occurrences.get(key) ?? 0) + 1;
+ occurrences.set(key, occurrence);
+ found.push({ rule, path: rel, line: index + 1, text, occurrence });
+ }
+ }
+ return found;
+}
+
+const identity = ({ rule, path, text, occurrence }) =>
+ `${rule}\0${path}\0${text}\0${occurrence}`;
+
+/** `added` must fail; `stale` must be removed from the baseline. */
+export function compare(findings, baseline) {
+ const expected = new Set(baseline.map(identity));
+ const actual = new Set(findings.map(identity));
+ return {
+ added: findings.filter((f) => !expected.has(identity(f))),
+ stale: baseline.filter((b) => !actual.has(identity(b))),
+ };
+}
+
+async function rustFiles(dir) {
+ const out = [];
+ let entries;
+ try {
+ entries = await readdir(dir, { withFileTypes: true });
+ } catch {
+ return out;
+ }
+ for (const entry of entries) {
+ const path = resolve(dir, entry.name);
+ if (entry.isDirectory()) out.push(...(await rustFiles(path)));
+ else if (entry.name.endsWith(".rs")) out.push(path);
+ }
+ return out.sort();
+}
+
+async function main() {
+ const findings = [];
+ for (const path of await rustFiles(scanRoot)) {
+ const rel = relative(repoRoot, path).split(sep).join("/");
+ if (isTestFile(rel)) continue;
+ const found = scan(rel, await readFile(path, "utf8"));
+ findings.push(...found.filter((f) => !allowed(rel, f.rule)));
+ }
+
+ if (writeBaseline) {
+ await mkdir(dirname(baselinePath), { recursive: true });
+ await writeFile(baselinePath, `${JSON.stringify(findings, null, 2)}\n`);
+ console.log(
+ `Wrote ${findings.length} baselined storage-bypass sites to ${relative(repoRoot, baselinePath)}.`,
+ );
+ return 0;
+ }
+
+ let baseline;
+ try {
+ baseline = JSON.parse(await readFile(baselinePath, "utf8"));
+ } catch (error) {
+ console.error(`Unable to read ${relative(repoRoot, baselinePath)}: ${error.message}`);
+ return 1;
+ }
+
+ const { added, stale } = compare(findings, baseline);
+ if (added.length === 0 && stale.length === 0) {
+ console.log(
+ `Storage-bypass ratchet holds (${findings.length} baselined sites; it only goes down).`,
+ );
+ return 0;
+ }
+ if (added.length) {
+ console.error(`New storage-bypass sites (${added.length}):`);
+ for (const f of added) {
+ const hint = RULES.find((r) => r.rule === f.rule)?.hint ?? "";
+ console.error(` ${f.rule}: ${f.path}:${f.line}: ${f.text}\n -> ${hint}`);
+ }
+ }
+ if (stale.length) {
+ console.error(`\nFixed sites still in the baseline (${stale.length}); remove them:`);
+ for (const f of stale) console.error(` ${f.rule}: ${f.path}: ${f.text} [${f.occurrence}]`);
+ console.error("\nTighten the baseline with --write-baseline once nothing new was added.");
+ }
+ return 1;
+}
+
+if (fileURLToPath(import.meta.url) === resolve(process.argv[1] ?? "")) {
+ process.exit(await main());
+}
diff --git a/scripts/ci/storage-bypass-baseline.json b/scripts/ci/storage-bypass-baseline.json
new file mode 100644
index 0000000000..f9559ed6a4
--- /dev/null
+++ b/scripts/ci/storage-bypass-baseline.json
@@ -0,0 +1,590 @@
+[
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/artifacts/files.rs",
+ "line": 141,
+ "text": "match tokio::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/artifacts/store.rs",
+ "line": 122,
+ "text": "tokio::fs::write(&tmp_path, json).await.map_err(|e| {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/artifacts/store.rs",
+ "line": 295,
+ "text": "tokio::fs::write(&args_path, json)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/attachments/legacy.rs",
+ "line": 143,
+ "text": "let mut file = tokio::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/attachments/mod.rs",
+ "line": 288,
+ "text": "let mut file = tokio::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/attachments/provider_cache.rs",
+ "line": 163,
+ "text": "let mut file = tokio::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/attachments/provider_open.rs",
+ "line": 20,
+ "text": "let filesystem_root = std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/attachments/provider_source.rs",
+ "line": 232,
+ "text": "let mut file = tokio::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/debug/dump_writer.rs",
+ "line": 48,
+ "text": "std::fs::write(&prompt_path, &dumped.text)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/debug/dump_writer.rs",
+ "line": 50,
+ "text": "std::fs::write(&meta_path, render_meta(dumped))",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/debug/dump_writer.rs",
+ "line": 56,
+ "text": "std::fs::write(",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/debug/dump_writer.rs",
+ "line": 69,
+ "text": "std::fs::write(&wire_path, super::wire::render(dumped))",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/debug/dump_writer.rs",
+ "line": 86,
+ "text": "std::fs::write(&summary_path, &summary)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/orchestration/subagent_sessions/store.rs",
+ "line": 43,
+ "text": "fs::write(&tmp_path, raw)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/progress_tracing/export.rs",
+ "line": 33,
+ "text": "let opened = std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/prompts/agents_md.rs",
+ "line": 198,
+ "text": "std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/prompts/render_helpers/workspace_files.rs",
+ "line": 91,
+ "text": "if let Err(e) = std::fs::write(&path, default_content) {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/prompts/render_helpers/workspace_files.rs",
+ "line": 101,
+ "text": "let _ = std::fs::write(&hash_path, &current_hash);",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/subagent_host/lifecycle.rs",
+ "line": 668,
+ "text": "let file = OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/subagent_host/lifecycle.rs",
+ "line": 758,
+ "text": "std::fs::write(&temporary, bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/subagent_host/lifecycle.rs",
+ "line": 774,
+ "text": "std::fs::write(&temporary, bytes)",
+ "occurrence": 2
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/agent/subagent_host/ops/pause_checkpoint.rs",
+ "line": 82,
+ "text": "if let Err(e) = std::fs::write(&checkpoint_path, json) {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/common.rs",
+ "line": 70,
+ "text": "std::fs::write(tmp.path().join(\"SOUL.md\"), \"# Soul\\nBe helpful.\").unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/common.rs",
+ "line": 71,
+ "text": "std::fs::write(",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 89,
+ "text": "std::fs::write(tmp.path().join(\"SOUL.md\"), \"# Soul\").unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 90,
+ "text": "std::fs::write(tmp.path().join(\"IDENTITY.md\"), \"# Identity\").unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 91,
+ "text": "std::fs::write(tmp.path().join(\"PROFILE.md\"), \"# User Profile\").unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 92,
+ "text": "std::fs::write(tmp.path().join(\"MEMORY.md\"), \"# Memory\\nLearned bits.\").unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 106,
+ "text": "std::fs::write(",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 176,
+ "text": "std::fs::write(ws.path().join(\"SOUL.md\"), &big_content).unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/channels/tests/prompt.rs",
+ "line": 193,
+ "text": "std::fs::write(ws.path().join(\"PROFILE.md\"), \"\").unwrap();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/migrations/phase_out_profile_md.rs",
+ "line": 192,
+ "text": "match fs::write(&md_path, cleaned.as_bytes()) {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/ops/ui.rs",
+ "line": 321,
+ "text": "std::fs::write(&flag_path, \"\")",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/schema/load/atomic_commit.rs",
+ "line": 166,
+ "text": "} else if fs::write(backup_path, as_upgraded).await.is_err() {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/schema/load/impl_load.rs",
+ "line": 505,
+ "text": "let mut temp_file = OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/schema/load_user_state.rs",
+ "line": 175,
+ "text": "let mut temp_file = std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/workspace/ops.rs",
+ "line": 40,
+ "text": "std::fs::write(&path, contents)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/workspace/rpc.rs",
+ "line": 154,
+ "text": "std::fs::write(&path, contents).map_err(|e| {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/config/workspace/rpc.rs",
+ "line": 190,
+ "text": "std::fs::write(&path, default_contents).map_err(|e| {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/core/auth.rs",
+ "line": 231,
+ "text": "let mut file = std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/core/auth.rs",
+ "line": 242,
+ "text": "std::fs::write(path, token)?;",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/flows/tinyflows/caps/code.rs",
+ "line": 111,
+ "text": "tokio::fs::write(&script_path, script_body)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/flows/tinyflows/caps/code.rs",
+ "line": 114,
+ "text": "tokio::fs::write(&input_path, input_json)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/inference/host_runtime/ops/runtime_ops.rs",
+ "line": 162,
+ "text": "tokio::fs::write(&file_path, audio_bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/inference/tokenjuice/savings.rs",
+ "line": 162,
+ "text": "if let Err(e) = std::fs::write(path, json) {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/integrations/composio/file_store.rs",
+ "line": 85,
+ "text": "tokio::fs::write(&tmp, &bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/integrations/file_storage/tools/download.rs",
+ "line": 84,
+ "text": "if let Err(e) = tokio::fs::write(&path, &body).await {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/memory/files.rs",
+ "line": 61,
+ "text": "let mut options = std::fs::OpenOptions::new();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/modules/browser_sites/store.rs",
+ "line": 174,
+ "text": "let mut options = tokio::fs::OpenOptions::new();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/modules/browser_task_report.rs",
+ "line": 304,
+ "text": "let mut options = tokio::fs::OpenOptions::new();",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/doctor/core/workspace_checks.rs",
+ "line": 30,
+ "text": "match std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/service/daemon_host.rs",
+ "line": 43,
+ "text": "tokio::fs::write(path, bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/service/linux.rs",
+ "line": 37,
+ "text": "fs::write(&file, unit)?;",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/service/macos.rs",
+ "line": 81,
+ "text": "fs::write(&file, plist)?;",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/service/mock.rs",
+ "line": 163,
+ "text": "std::fs::write(path, bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/service/windows.rs",
+ "line": 40,
+ "text": "fs::write(&wrapper, cmd)?;",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/update/core.rs",
+ "line": 192,
+ "text": "let mut out = std::fs::File::create(&tmp_path)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/update/core.rs",
+ "line": 219,
+ "text": "let mut out = std::fs::File::create(&tmp_path)",
+ "occurrence": 2
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/platform/update/core.rs",
+ "line": 504,
+ "text": "let mut file = std::fs::File::create(&tmp_path)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/runtime/python_server/kompress.rs",
+ "line": 150,
+ "text": "tokio::fs::write(",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/audit.rs",
+ "line": 284,
+ "text": "let mut file = OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/credentials/http_creds.rs",
+ "line": 420,
+ "text": "fs::write(&tmp_path, &json)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/credentials/profiles.rs",
+ "line": 284,
+ "text": "let mut file = OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/credentials/profiles.rs",
+ "line": 297,
+ "text": "fs::write(path, bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/credentials/profiles/lock.rs",
+ "line": 84,
+ "text": "OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/keyring/encrypted_store.rs",
+ "line": 316,
+ "text": "let open_result = fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/keyring/encrypted_store.rs",
+ "line": 348,
+ "text": "let open_result = fs::OpenOptions::new()",
+ "occurrence": 2
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/keyring/file_store.rs",
+ "line": 79,
+ "text": "let file = OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/keyring/file_store.rs",
+ "line": 168,
+ "text": "match OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/pairing.rs",
+ "line": 118,
+ "text": "let mut file = std::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/security/pairing.rs",
+ "line": 129,
+ "text": "std::fs::write(path, token)?;",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/skills/ops_create.rs",
+ "line": 247,
+ "text": "std::fs::write(&workflow_toml_path, workflow_toml)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/skills/ops_discover/api.rs",
+ "line": 47,
+ "text": "std::fs::write(&readme_path, content)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/skills/run_log.rs",
+ "line": 112,
+ "text": "let mut f = tokio::fs::OpenOptions::new()",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/skills/webhooks/router.rs",
+ "line": 537,
+ "text": "if let Err(e) = std::fs::write(&path, json) {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/threads/welcome_migration.rs",
+ "line": 298,
+ "text": "fs::write(path, rewritten).map_err(|e| {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/threads/welcome_migration.rs",
+ "line": 389,
+ "text": "fs::write(marker, b\"done\\n\").map_err(|e| {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/tinymemes/host.rs",
+ "line": 267,
+ "text": "std::fs::write(&tmp, contents)?;",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/tools/impl/document/mod.rs",
+ "line": 264,
+ "text": "if let Err(err) = tokio::fs::write(&output_path, &bytes).await {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/tools/impl/presentation/mod.rs",
+ "line": 328,
+ "text": "if let Err(err) = tokio::fs::write(&output_path, &bytes).await {",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/user_agents/host.rs",
+ "line": 126,
+ "text": "std::fs::write(&layout.meta_path, raw)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/voice/audio_toolkit/ops.rs",
+ "line": 62,
+ "text": "tokio::fs::write(&resolved, &bytes)",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/voice/audio_toolkit/ops.rs",
+ "line": 408,
+ "text": "tokio::fs::write(&resolved_path, email.formatted())",
+ "occurrence": 1
+ },
+ {
+ "rule": "json-write",
+ "path": "crates/openhuman-core/src/voice/ops.rs",
+ "line": 176,
+ "text": "tokio::fs::write(&file_path, audio_bytes)",
+ "occurrence": 1
+ }
+]