Summary
Configuration.md documents inline comments as supported:
# Full line comment
allow git status # Inline comment
But the parser never strips inline # comments — they become part of the pattern/value, silently breaking the directive. Full-line comments work; mid-line ones don't.
Blast radius (every directive type)
| Line |
Parsed result |
allow git status # x |
pattern = git status # x → never matches git status |
deny rm -rf "trash" # x |
pattern corrupted and message lost (None) |
allow-redirect /tmp/** # x |
pattern = /tmp/** # x |
deny-mcp mcp__*__delete_* "m" # x |
pattern + message both broken |
alias mygit git # x |
alias silently dropped |
set log-full # x |
setting silently skipped |
set log ~/audit.log # x |
log path = …/audit.log # x |
End-to-end proof (no handler involved):
parse_config("allow zzz foo") # zzz foo -> allow
parse_config("allow zzz foo # comment") # zzz foo -> ask (rule dead)
Root cause
parse_config (src/dippy/core/config.py:250-257) skips full-line comments via line.startswith("#"), but rest (everything after the directive) flows into the pattern untouched — no inline-comment stripping anywhere.
Fix constraint
# can legitimately appear in quoted content (deny git commit -m "#wip") or paths, so a fix must strip only an unquoted, whitespace-preceded # (shell-style), not a naive split("#"). Either fix the parser to do that, or correct Configuration.md if literal # support is intentional.
Surfaced by
#125 — an annotated example config whose inline-commented rules are all silently dead.
Summary
Configuration.mddocuments inline comments as supported:But the parser never strips inline
#comments — they become part of the pattern/value, silently breaking the directive. Full-line comments work; mid-line ones don't.Blast radius (every directive type)
allow git status # xgit status # x→ never matchesgit statusdeny rm -rf "trash" # xNone)allow-redirect /tmp/** # x/tmp/** # xdeny-mcp mcp__*__delete_* "m" # xalias mygit git # xset log-full # xset log ~/audit.log # x…/audit.log # xEnd-to-end proof (no handler involved):
Root cause
parse_config(src/dippy/core/config.py:250-257) skips full-line comments vialine.startswith("#"), butrest(everything after the directive) flows into the pattern untouched — no inline-comment stripping anywhere.Fix constraint
#can legitimately appear in quoted content (deny git commit -m "#wip") or paths, so a fix must strip only an unquoted, whitespace-preceded#(shell-style), not a naivesplit("#"). Either fix the parser to do that, or correctConfiguration.mdif literal#support is intentional.Surfaced by
#125 — an annotated example config whose inline-commented rules are all silently dead.