From 81a9cdbadf8c9d940d4fe9a2a0de607dee1f5f1a Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Thu, 4 Jun 2026 16:16:45 +0900 Subject: feat(config): add subdirectory LSP config watchers and fix permission ordering - Add watchDirConfig() for per-directory config watching - Register watchers for subdirectories with their own dispatch.toml - Fix permission ordering: move "*" wildcard to front so findLast reaches specific rules first (was silently breaking all specific bash permission rules) - Add comprehensive tests for watcher functionality - Update mocks in test files --- dispatch.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'dispatch.toml') diff --git a/dispatch.toml b/dispatch.toml index 9477842..6964993 100644 --- a/dispatch.toml +++ b/dispatch.toml @@ -48,11 +48,18 @@ base_url = "https://opencode.ai/zen/go/v1" [permissions] read = "allow" +# NOTE on ordering: rules are flattened in file order and the LAST matching +# rule wins (see evaluate()'s findLast). So a broad fallback like "*" must be +# placed FIRST and the more-specific overrides AFTER it — otherwise a trailing +# "*" would shadow every specific rule above it. (Global+local merge preserves +# this: global patterns are emitted before local ones so local overrides win.) + [permissions.edit] "*" = "ask" "src/**" = "allow" [permissions.bash] +"*" = "ask" "npm test" = "allow" "npm run *" = "allow" "git status" = "allow" @@ -63,7 +70,6 @@ read = "allow" "git commit *" = "allow" "git push *" = "allow" "ls *" = "allow" -"*" = "ask" [permissions.external_directory] "~/*" = "ask" -- cgit v1.2.3