The context exists somewhere — a postmortem doc, a Slack thread, someone's memory. It's just never at the moment a new engineer opens a PR touching that file.
Decision Guardian reads a markdown file of decisions tied to file patterns and posts the relevant context as a PR comment when those files change. Works as a GitHub Action or CLI (npx decision-guardian check, non-zero exit on critical matches).
The part I found interesting to build: simple file matching created too much noise, so I added content-aware rules. A config file only triggers if you change the specific keys that matter.
An alert only fires when both files in a coupled pair change in the same PR. Regex matching on diffs with ReDoS protection and 5s timeout.
{ "match_mode": "all", "conditions": [ { "type": "file", "pattern": "src/analytics/events.ts" }, { "type": "file", "pattern": "src/analytics/schema.ts" } ] }
That rule fires only when both files are in the same PR diff — the case where a field rename needs to be consistent across both.
Tech: TypeScript, Trie for O(1) pattern lookup, safe-regex for ReDoS prevention. CLI is platform-agnostic — GitLab CI, Jenkins, any pre-push hook.
GitHub: https://github.com/DecispherHQ/decision-guardian (MIT)
Known gaps: PR commenting is GitHub-only for now. GitLab native support is the most requested thing and the ISCMProvider interface is already stubbed for it.
Happy to discuss the matching engine or the decision format tradeoffs.