Skip to content

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

docs(memory): local-module testing lever and the host cache reset\n

Shanu952b08e196ad
diff --git a/.claude/memory.md b/.claude/memory.md
index b13d462683..00b1a9b1a9 100644
--- a/.claude/memory.md
+++ b/.claude/memory.md
@@ -260,6 +260,8 @@ Quick reference for anyone starting with Claude on this project. Updated by the
- **Garbage-file corruption fixtures self-heal** — tinycortex's cold-open path (`connection.rs`) auto-quarantines a file that fails to open, so a garbage `chunks.db` makes `store()` succeed, not fail. Test the classification arm directly (`escalate_or_count`) instead of the full stack.
- **Module-side degraded statics never reach the host** — the pinned TinyMemory cdylib has its own `tree::health` statics; host visibility comes only from `MemoryEvent` (host arms in `memory/host.rs` + `modules/memory_host.rs` → `user_error` web channel). A new variant is release-gated (tinymemory release + registry re-pin) before the product sees it.
- **Module source-registry path (the #5820 "no memory source registered" strand)** — the module must read the host's `<root>/config.toml` (beside `workspace/`), not `workspace_dir/config.toml`; the host sends `config_path` in the module config JSON (`modules/ops.rs`) and tinymemory ≥ v1.13.1 honours it with a sibling-file fallback. Test a module fix before its release with `OPENHUMAN_MODULE_PATH=<dir holding libtinymemory_module.dylib>` (build in `vendor/tinymemory/crates/tinymemory-module` with `cargo build --release`; it is its own cargo workspace).
+- **Testing a local TinyMemory module build** — use `TINYMEMORY_TEST_MODULE=<path/to/libtinymemory_module.dylib>` (the loader's dev override; CI uses it too), never `OPENHUMAN_MODULE_PATH`: that search path hands the module an empty config, it refuses setup (`workspace_dir must be set`) and tinybus reports it as an "unrecoverable fault" with the reason dropped. In the app log, module output is prefixed `tinybus_module <target> message=`; host output is not.
+- **Module quarantine vs host cache** — the host's own engine copy caches its chunk-store handle; when the module quarantines `chunks.db`, `RuntimeCallbacks::publish_event` must reset it (`memory/host_impls.rs::reset_in_process_chunk_store`) or in-process reads stay `malformed` until restart.
- **Worktree submodules can be half-initialised** — a timed-out `git submodule update --init --recursive` leaves `vendor/<x>/` holding only a `.git` file while `git submodule status` shows a clean SHA. Detect with `ls vendor/<x>/Cargo.toml`; fix with `git submodule update --force --recursive <path>`. tinymemory has its own nested `vendor/tinycortex` that must be initialised from inside `vendor/tinymemory`.
- **Never trust `cmd | tail` / `cmd | grep` exit codes in background checks** — the pipeline reports the filter's status, so a failed `cargo check` (disk full, missing submodule) read as green twice this session. Use `${PIPESTATUS[0]}` or grep for `Finished`.
- **Re-pinning the TinyMemory module moves five things in one commit** — gitlink → release tag commit, `modules/registry.rs` (version, release_url, 11 digests from the release's `checksum.toml`), the four workflow `memory_version`/`memory_sha256` pairs (ubuntu-22.04-x86_64 row), and `ARTIFACT_CAPABILITIES_PIN` in `modules/memory.rs` after diffing the capability surface between tags. Guards: `modules/memory_tests.rs` (workflow digests, capability pin). Run `cargo test --lib -- modules::memory modules::registry`. The version bump also dirties BOTH `Cargo.lock`s (root + `app/src-tauri`) and CI is `--locked`: `cargo metadata --locked --manifest-path <each>` then commit both.