Back to browse
GitHub Repository

Shift from passive documentation to active enforcement.

57 starsTypeScript

Decision Guardian – Enforce ADRs on PRs

by iamalizaidi·Feb 12, 2026·4 points·8 comments

AI Analysis

●●●BangerSolve My ProblemBig BrainNiche Gem

CODEOWNERS for architectural decisions—surfaces why code exists before breaking it.

Strengths
  • Solves real problem (institutional amnesia on decisions) with a friction-free integration point (PRs)
  • Smart implementation: prefix trie for O(log n) matching instead of brute-force, AST parsing with remark
  • Explicit privacy guarantees (no external calls, no data leaves GitHub) reduce friction for adoption
Weaknesses
  • GitHub-only; no broader VCS support limits addressable market significantly
  • Requires manual markdown file maintenance; scaling to large decision sets may become unwieldy
Target Audience

Engineering teams and technical leads managing architectural decisions across projects

Similar To

CODEOWNERS (GitHub native, but for file ownership not decisions) · Documenting ADRs + manual enforcement (no automation) · Slack thread-based decision logging (unstructured, context-loss at scale)

Post Description

Hi HN, I built this to solve a problem I kept running into on my team.

The problem: A senior engineer made a deliberate choice—Postgres over MongoDB for billing because we needed ACID compliance. They documented the reasoning in a Slack thread. 8 months later they left. A new developer opened a PR to migrate to MongoDB. No one remembered why Postgres was chosen. We spent 3 months re-evaluating a decision that had already been carefully made.

What this does: Decision Guardian is a GitHub Action that lets you write architectural decision records in markdown, tied to file paths. When a PR modifies those files, it automatically posts a comment with the relevant context—what was decided, why, what alternatives were rejected.

Think of it as CODEOWNERS for the "why" instead of the "who."

Technical details:

1) Written in TypeScript, runs as a GitHub Action 2) AST-based markdown parsing with remark 3) Prefix trie for O(log n) file-to-decision matching instead of brute-force O(N×M) 4) Supports glob patterns, regex content matching (with ReDoS protection via VM sandbox + timeout), and boolean logic for complex rules 5) Handles PRs with 3000+ files using streaming mode 6) Idempotent comments—updates existing ones instead of spamming, with self-healing duplicate cleanup 7) 5-layer progressive truncation to always fit within GitHub's comment size limit 8) No external network calls, no data leaves your GitHub runner

What I'd love feedback on:

1) Is the decision file format (structured markdown) the right choice, or would YAML/TOML be better? 2) Any thoughts on content-based matching (detecting patterns in diffs, not just filenames)? 3) Would integration with existing ADR tools (like adr-tools) be useful?

Code: https://github.com/DecispherHQ/decision-guardian

Happy to answer any questions about the implementation.

Similar Projects