AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
Dual-Gate Impact Analysis & Regression Guard for AI-Assisted Development (The Bánh Mì Sandwich Pattern)
Translation pending
Developer toolsPythonGitHub @okrathOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
🥖 Dual-Gate Impact Analysis & Regression Guard for AI-Assisted Development
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
Dual-Gate Impact Analysis & Regression Guard for AI-Assisted Development
Enforcing the Sandwich Pattern with scope control, deterministic diff auditing, project invariants, and LLM gatekeeping.
guard wraps coding workflows in an automated safety harness that verifies changes before and after execution. It runs two gates around each task: a pre-task scope check and a post-task verification gate combining deterministic diff checks, static rules, project invariants, and an LLM review.
Install the guard CLI globally on any platform:Read the full README ↗guard)guard wraps coding workflows in an automated safety harness that verifies changes before and after execution. It runs two gates around each task: a pre-task scope check and a post-task verification gate combining deterministic diff checks, static rules, project invariants, and an LLM review.
Live Documentation: https://okrath.github.io/banh-mi-guard/
Install the guard CLI globally on any platform:
# Recommended: Isolated global installation with pipx
pipx install banh-mi-guard
# Or with standard pip across all platforms:
pip install banh-mi-guard
For environment $PATH configuration, installation from GitHub main, and optional Alibaba OCR CLI setup, see CLI Reference: Installation & Environment Setup.
Integrate guard into your workflow in four simple steps:
# 1. PRE-TASK: Declare scope and capture baseline before editing code
guard pre "Implement mobile responsive navigation drawer" --scope src/components/nav
# 2. EDIT: Modify code using your AI agent (Claude Code, Cursor, Codex, etc.) or editor
# 3. POST-TASK: Verify diffs, static security rules, build health, and LLM approval
guard post
# 4. COMMIT: Commit approved changes (approvals are HMAC-signed; unapproved commits or unsigned older sessions are blocked)
git commit -m "feat: add responsive navigation drawer"
To run deep repository inspection with Alibaba OCR, use guard post --full. For a large or security-sensitive change, the post report asks you (through your agent) whether you want a deeper review by a panel of three reviewers, a full OCR review, or both.
Every modification is verified before and after execution across three layers:
DEAD-REF), evaluates static rules (SEC-001 to SEC-008), and detects code hygiene issues.APPROVED or REVISE verdict. Most of its findings are advisory review comments; the hard blocking comes from the deterministic checks of pillars 1 and 2 (see Scoring and the final verdict). Approved sessions receive a cryptographic HMAC signature required by Git commit hooks.For architectural diagrams, taxonomy, and security specifications, see Architecture Specification.
guard pre, guard post, guard run): Enforces the Sandwich Pattern. guard pre sets scope and invariant baselines; guard post audits diffs, executes test suites, and requests gate approval; guard run wraps external commands in both gates atomically. See CLI Reference: Pre & Post.guard invariants): Enforces domain and team behavioral invariants without token costs using regex checks across local (.guard/invariants.json) and shared (guard.invariants.json) files. See CLI Reference: Invariants.guard install, guard hook, guard agent, guard uninstall): Configures Git hooks (core.hooksPath) and injects directives into global agent instruction files (CLAUDE.md, AGENT.md). Agent hook adapters intercept edit tools to block out-of-scope or unauthorized modifications. See CLI Reference: Installation & Hooks.guard config, guard setup): Interactive wizards for configuring LLM credentials (APIs or local agent CLIs like claude, codex, omp), syncing settings to Alibaba OCR, and choosing commit message policies. See CLI Reference: Configuration.guard review, guard finding, guard accept, guard reset): Runs on-demand LLM diff reviews, tracks deferred or rejected findings, provides an interactive decision screen when review budgets are exhausted, and archives sessions. See CLI Reference: Review & Accept.guard post (reviewer panel, finding validation, test evidence, threat frame), what they cost, and the Not reviewed / limits section of the report. Developer-only measurement tool: Benchmark.Run the integration and unit test suite locally:
pytest
guard doctor, guard update, guard untracked): Performs environment diagnostics, upgrades guard (directly from GitHub) or Alibaba OCR (under a 3-day supply-chain quarantine cooling period covering OCR only), and tracks untracked directory exclusions. See CLI Reference: Doctor & Update.guard watch, guard worker-verify): guard watch follows the workers of one Orca run (or explicit worktrees) by heartbeat and Git activity, nudges stalled workers and reports when one is done or needs a human; guard worker-verify audits one worker's delivery before you accept it (scope, weakened or skipped tests, CI edits, report and evidence freshness, acceptance rerun). See CLI Reference: Worker Supervision.