{"record":{"id":"7e8825442c02a327","repo":"tinyhumansai/openhuman","slug":"the-module-host-policy-was-never-published-so-mod","errorCode":null,"errorMessage":"the module host policy was never published, so module '{MODULE_ID}' cannot be loaded; call modules::memory::set_modules_policy during boot","messagePattern":"the module host policy was never published, so module '(.+?)' cannot be loaded; call modules::memory::set_modules_policy during boot","errorType":"exception","errorClass":"MemoryError","httpStatus":null,"severity":"error","filePath":"src/openhuman/modules/memory.rs","lineNumber":228,"sourceCode":"                    .await\n                    .map_err(|error| from_bus(&error))\n            })\n            .await\n            .cloned()\n    }\n\n    /// Ensure the module is serving, and hand back a proxy for its object.\n    ///\n    /// `operation` identifies the forwarded call (e.g. `\"store\"`, `\"recall\"`)\n    /// for the diagnostic below. Never `namespace`, `key`, `content`, or any\n    /// record value — those are user memory content, not correlation fields.\n    async fn proxy(&self, operation: &str) -> Result<tinybus::Proxy, MemoryError> {\n        log::debug!(\n            \"[modules:memory] driver_id={} operation={operation} resolving module proxy\",\n            self.driver_id,\n        );\n        let config = self.config.as_ref().or_else(|| policy()).ok_or_else(|| {\n            MemoryError::Other(anyhow::anyhow!(\n                \"the module host policy was never published, so module '{MODULE_ID}' \\\n                 cannot be loaded; call modules::memory::set_modules_policy during boot\"\n            ))\n        })?;\n        let runtime = host::runtime().await.map_err(|error| {\n            MemoryError::Other(anyhow::anyhow!(\"the module bus is not running: {error}\"))\n        })?;\n        super::memory_host::install(runtime.connection(), Arc::clone(config))\n            .await\n            .map_err(|error| {\n                MemoryError::Other(anyhow::anyhow!(\n                    \"the memory module host callbacks are unavailable: {error}\"\n                ))\n            })?;\n        // TinyMemory resolves its embedding provider while the native library\n        // is admitted. Host callbacks must therefore exist before loading,\n        // including in tests and explicit-path overrides where no boot policy\n        // was available when the shared module runtime first started.","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/modules/memory.rs#L210-L246","documentation":"The memory module driver attempted to obtain a bus proxy before the host published its module-host policy, meaning `modules::memory::set_modules_policy` was never called during boot. This is an initialization-order bug in the embedding host: the driver is being reached (e.g. a memory RPC arrived) without the boot sequence having installed the policy that governs module admission. The message names the missing call explicitly because the fix belongs in the host's boot code, not at this call site.","triggerScenarios":"Thrown at src/openhuman/modules/memory.rs:228 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the boot path calls `modules::memory::set_modules_policy` before any memory RPC can be served","Check that early-boot code did not swallow an error that skips the policy publication step","For embedders using `CoreBuilder`, confirm the module host setup step is not skipped by a slim `DomainSet`/`ServiceSet` preset"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}