Skip to content

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

docs: add README files for file_storage and web_chat modules

Steven Enamakel80424126d6f1
diff --git a/crates/openhuman-core/src/integrations/file_storage/README.md b/crates/openhuman-core/src/integrations/file_storage/README.md
index a64b7eae82..f0252927e1 100644
--- a/crates/openhuman-core/src/integrations/file_storage/README.md
+++ b/crates/openhuman-core/src/integrations/file_storage/README.md
@@ -17,7 +17,8 @@ and TTL enforcement.
plan / up to 1 year on paid plans. Billing goes through the standard
integration billing flow (S3 rates plus margin), charged upfront for the
whole TTL on upload and as egress on download/link generation.
-- Block all six tools when autonomy is read-only (`SecurityPolicy::can_act`).
+- Block the five mutating/transfer tools (everything except `storage_list_files`)
+ when autonomy is read-only (`SecurityPolicy::can_act`).
## Key Files
@@ -26,8 +27,8 @@ and TTL enforcement.
| `mod.rs` | Export-only module root; re-exports `build_file_storage_tools` and the six `Storage*Tool` structs. |
| `types.rs` | Serde types for backend responses (`UploadResponse`, `ListFilesResponse`, `FileMeta`, `LinkResponse`, `DeleteResponse`). |
| `tools.rs` | Module doc listing the backend endpoints and billing model; wires in `tools_part_01.rs` / `tools_part_02.rs` via `include!`. |
-| `tools_part_01.rs` | Shared helpers (path resolution/validation, filename/mime handling) plus `StorageUploadFileTool`, `StorageDownloadFileTool`, `StorageListFilesTool`. |
-| `tools_part_02.rs` | `StorageGetLinkTool`, `StorageSetVisibilityTool`, `StorageDeleteFileTool`, and the `build_file_storage_tools` builder. |
+| `tools_part_01.rs` | Shared helpers (`resolve_upload_path`, `validate_file_id`, `validate_visibility`, `sanitize_filename`, `action_dir_for_context`, `readonly_autonomy_block`) plus `StorageUploadFileTool`, `StorageDownloadFileTool`, `StorageListFilesTool`, and the `StorageGetLinkTool` struct. |
+| `tools_part_02.rs` | The `Tool` impl for `StorageGetLinkTool`, `StorageSetVisibilityTool`, `StorageDeleteFileTool`, and the `build_file_storage_tools` builder. |
| `tools_tests.rs` | Tool metadata/schema tests and path-resolution/sanitization unit tests. |
## Agent Tools
@@ -81,9 +82,11 @@ Called from `crates/openhuman-core/src/tools/ops.rs` (around line 905):
tools.extend(crate::integrations::file_storage::build_file_storage_tools(...));
```
-The tool structs themselves are re-exported through
-`crates/openhuman-core/src/integrations/mod.rs` and
-`crates/openhuman-core/src/tools/mod.rs` (`pub use crate::integrations::tools::*;`).
+The tool structs are exported only from this module
+(`crate::integrations::file_storage::Storage*Tool`); unlike the sibling
+`integrations/tools.rs` family they are not re-exported through
+`crates/openhuman-core/src/tools/mod.rs`, because nothing constructs them
+outside `build_file_storage_tools`.
## Dependencies
@@ -99,6 +102,9 @@ The tool structs themselves are re-exported through
## Tests
`tools_tests.rs` covers tool name/permission/category/schema metadata for all
-six tools plus unit tests for `resolve_upload_path` and `sanitize_filename`
-(traversal and symlink-escape rejection, filename sanitization).
+six tools, argument validation that fails before any network call, unit tests
+for `resolve_upload_path` (traversal escape, directory rejection) and
+`sanitize_filename`, the read-only autonomy block for the five guarded tools,
+and end-to-end flows for each tool against a `wiremock` backend (multipart
+upload, 302-to-presigned download, link, visibility, delete, envelope errors).
</content>
diff --git a/crates/openhuman-core/src/util/mod.rs b/crates/openhuman-core/src/util/mod.rs
index 3531d98c79..dc353ea0a6 100644
--- a/crates/openhuman-core/src/util/mod.rs
+++ b/crates/openhuman-core/src/util/mod.rs
@@ -1,19 +1,22 @@
//! Utility functions for `OpenHuman`.
//!
-//! Kernel family — always compiled, never gated. These are dependency-free
-//! helpers reused across domains; nothing here may reach into a domain.
+//! Kernel family — always compiled, never gated. Self-contained helpers
+//! reused across domains; nothing here may reach into a domain (no `use
+//! crate::` anywhere in this directory).
//!
//! - [`text`] — UTF-8-safe truncation, char-boundary rounding, provenance tags
//! - [`retry`] — retry-with-backoff + transient-filesystem-error classification
//! - [`sanitize`] — LLM-facing text sanitization (control-char stripping,
//! instruction-fence removal, UTF-8-safe byte caps)
//! - [`bm25`] — BM25 ranking over short documents (tool + skill search)
-//! - [`tls`] — TLS client/connector construction
+//! - [`tls`] — platform-conditional `reqwest::ClientBuilder` factory
//! - [`types`] — shared utility types
//!
-//! Everything is re-exported at the module root, so
-//! `crate::util::<fn>` paths (including the `truncate_with_ellipsis`
-//! doctest) resolve without naming the submodule.
+//! `retry`, `text`, and `types` items are re-exported at the module root, so
+//! `crate::util::<fn>` (and `openhuman_core::util::<fn>` from outside, the
+//! path the `truncate_with_ellipsis` doctest uses) resolves without naming the
+//! submodule. `bm25`, `redact`, `sanitize`, and `tls` are reached through
+//! their submodule path.
//!
//! See [`README.md`](README.md) for a per-file breakdown.
diff --git a/crates/openhuman-core/src/web_chat/README.md b/crates/openhuman-core/src/web_chat/README.md
index 702718d97e..f7eb8eb436 100644
--- a/crates/openhuman-core/src/web_chat/README.md
+++ b/crates/openhuman-core/src/web_chat/README.md
@@ -64,7 +64,7 @@ surfaces.
`invalidate_thread_sessions`, plus `in_flight_entries_for_test` (exported
unconditionally; `test_support/introspect.rs` uses it). The turn's
in-flight/session state lives here (`THREAD_SESSIONS`,
- `THREAD_BUDGET_SIGNALS`, `IN_FLIGHT`, parallel map).
+ `THREAD_BUDGET_SIGNALS`, `IN_FLIGHT`, `PARALLEL_IN_FLIGHT`).
- `ChatRequestMetadata` (`types.rs`) — per-request metadata passed by every
caller of `start_chat`/`spawn_progress_bridge`.
- Schemas (`schemas.rs`): `all_web_channel_controller_schemas`,