{"record":{"id":"87a792b7bae4f523","repo":"zeroclaw-labs/zeroclaw","slug":"event-kind-is-invalid-expected-created-modif","errorCode":null,"errorMessage":"event '{kind}' is invalid; expected created, modified, deleted, or renamed","messagePattern":"event '(.+?)' is invalid; expected created, modified, deleted, or renamed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":16438,"sourceCode":"    pub fn validate(&self) -> anyhow::Result<()> {\n        if self.paths.is_empty() {\n            anyhow::bail!(\"at least one path must be configured\");\n        }\n        for path in &self.paths {\n            let trimmed = path.trim_end_matches('/');\n            let normalized = if trimmed.is_empty() { \"/\" } else { trimmed };\n            if !self.allow_broad_roots && FILESYSTEM_BROAD_ROOTS.contains(&normalized) {\n                anyhow::bail!(\n                    \"path '{path}' is a broad system root; set allow_broad_roots = true to watch it\"\n                );\n            }\n        }\n        for kind in &self.events {\n            if !matches!(\n                kind.as_str(),\n                \"created\" | \"modified\" | \"deleted\" | \"renamed\"\n            ) {\n                anyhow::bail!(\n                    \"event '{kind}' is invalid; expected created, modified, deleted, or renamed\"\n                );\n            }\n        }\n        Ok(())\n    }\n}\n\nimpl ChannelConfig for FilesystemConfig {\n    fn name() -> &'static str {\n        \"Filesystem\"\n    }\n    fn desc() -> &'static str {\n        \"Filesystem SOP Listener\"\n    }\n}\n\nfn default_filesystem_events() -> Vec<String> {","sourceCodeStart":16420,"sourceCodeEnd":16456,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L16420-L16456","documentation":"The filesystem listener only emits four event kinds — `created`, `modified`, `deleted`, `renamed` — and `validate` checks each `events` entry against exactly those strings. Anything else (including near-synonyms like `create` or `write`) is rejected so the watcher's event mapping never receives an unknown kind.","triggerScenarios":"`events = [\"create\", \"write\"]` (inotify-style names); `events = [\"Created\"]` (wrong case); a typo like `modifed`; entries appended from a documentation example for a different watcher library.","commonSituations":"Porting config from inotifywait/fsnotify vocabulary where `create`/`write` are the norm; assuming past-tense vs present-tense does not matter; hand-typing the list instead of copying the default.","solutions":["Use only `created`, `modified`, `deleted`, `renamed` (all four are the default when `events` is omitted).","Copy the default list and delete the kinds you do not want.","Check for case differences and typos in each entry."],"exampleFix":"# before\nevents = [\"create\", \"write\", \"delete\"]\n\n# after\nevents = [\"created\", \"modified\", \"deleted\"]","handlingStrategy":"type-guard","validationCode":"const FS_EVENTS: [&str; 4] = [\"created\", \"modified\", \"deleted\", \"renamed\"];\nanyhow::ensure!(\n    cfg.events.iter().all(|k| FS_EVENTS.contains(&k.as_str())),\n    \"invalid filesystem event kind\"\n);","typeGuard":"fn is_valid_fs_event(kind: &str) -> bool {\n    matches!(kind, \"created\" | \"modified\" | \"deleted\" | \"renamed\")\n}","tryCatchPattern":null,"preventionTips":["Use the past-tense names; inotify's create/write do not exist here.","Omit `events` entirely to get all four kinds by default.","Validate against the four-value set wherever the list is generated."],"tags":["filesystem","config","events","invalid-value","zeroclaw"],"backgroundTag":"invalid-enum-value","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}