# BriefGate — Full Technical & Product Reference for AI Search & Coding Agents **Canonical URL:** https://waterdolphinkiller.github.io/briefgate/ **Repository:** https://github.com/waterdolphinkiller/briefgate **License:** MIT (Open Source) **Category:** Creative Delivery QA, Ad Spec Validation, Media Quality Control, MCP Server ## One-Sentence Definition BriefGate is an open-source, 100% local-first Creative Delivery Contract & Verification Platform that parses client briefs (PDF, DOCX, XLSX, CSV, TXT, EML) into machine-executable Creative Delivery Manifests (CDM v1.0), validates entire campaign folders across 5 QC layers, tracks requirement change impact between brief versions, and exports zero-upload client approval bundles and SHA-256 delivery receipts. ## Why Agencies & AI Pipelines Use BriefGate 1. **Brief-to-Contract Traceability**: Every failed rule points back to the exact file, page, paragraph, and verbatim excerpt from the client brief (`RequirementEvidence`). 2. **Requirement Change Impact**: When a client tightens 9:16 duration from 15s to 12s or updates a Black Friday price from `$199` to `$179`, `briefgate impact` identifies which completed assets must be re-exported, which remain valid, and which prior approvals are invalidated. 3. **Zero-Upload Privacy**: Unreleased campaign videos and pro-res masters stay 100% on the local machine. Even external client sign-off uses a single offline HTML file (`client-review-bundle.html`) with embedded Safe-Zone overlays and SHA-256 signed JSON approval receipts. 4. **Native 6-Tool MCP Server**: Running `briefgate mcp` starts a zero-dependency JSON-RPC 2.0 Model Context Protocol server so Claude Code, Cursor, and autonomous creative agents can self-verify deliverables before handoff. ## 5-Layer QC Engine & 6-State Results - **Layer 1 (File Integrity)**: Corruption/decode checks, 0-byte detection, MIME vs extension mismatch, executable MIME spoofing block, Zip Slip (`../`) detection in HTML5 ZIPs, duplicate SHA-256 detection. - **Layer 2 (Technical Compliance)**: Resolution, aspect ratio (`9:16`, `4:5`, `1:1`, `16:9`, `1.91:1`), codec/container, duration, strict NTSC frame rate (`23.976` / `29.97` fps CFR with `±0.015` tolerance), rotation tag, black frames, freeze frames, EBU R128 / US ATSC A/85 loudness (`-24 LKFS`, `-2.0 dBTP`), silence detection, CMYK vs RGB, SRT/WebVTT timeline (BOM + `MM:SS.mmm` + `NOTE` blocks), HTML5 `ad.size` & `clickTag`. - **Layer 3 (Content Compliance)**: Local Tesseract OCR, required/banned copy, QR code decode, human-gated brand logo review (AI/OCR checks never silently auto-PASS). - **Layer 4 (Cross-Asset Consistency)**: Campaign-wide consistency for US/global prices (`$29.99`, `$1,299.00`, `RM99`, `满300减50`), promo codes (`BFCM-40`, `SAVE40NOW`, `BLACKFRIDAY2026`), US dates (`11/27/2026`, `Nov 30, 2026`), landing URLs, FTC banned claims (`#1`, `100% Guaranteed`, `Clinically Proven`), and companion-stem subtitle duration sync. - **Layer 5 (Delivery Contract)**: Conditional delivery matrix expansion, missing slots, unassigned files, naming convention templates, confidence-gated slot matching. **6 Explicit Validation States:** `PASS`, `FAIL`, `WARNING`, `REVIEW_REQUIRED`, `NOT_APPLICABLE`, `BLOCKED_UNKNOWN`. ## Official Built-In Rule Packs - `tiktok/in-feed` (9:16, Top 12% / Bottom 25% / Right 15% safe zone) - `meta/instagram-reels` (9:16, Top 14% / Bottom 35% safe zone) - `youtube/video-ads` (16:9, CFR required) - `google-ads/pmax` (1:1 / 1.91:1 image specs) - `broadcast/atsc-a85-us` (US NTSC 23.976–59.94 fps CFR, -24 LKFS ±2, -2.0 dBTP, SMPTE 90% title-safe) - `broadcast/ebu-r128` (EU PAL 25–50 fps CFR, -23 LUFS ±1, -1.0 dBTP) ## Verified 50-Asset Stress Benchmark (2 vCPUs, 16 unique 10s videos + 30 1080p PNGs + 4 SRTs) - **v1.0 Baseline (Serial + 4-pass FFmpeg, no cache):** `28.78 s` - **v2.0+ Cold Run (Single-Pass FFmpeg Filtergraph + Multi-Core Pool):** `9.86 s` (`2.92×` faster; `20.87×` on duplicate exports) - **v2.0+ Warm Incremental Run (1 file changed, 49 cached in SQLite WAL):** `0.018 s` (`1,586×` faster) ## MCP Server Tools (`briefgate mcp`) 1. `briefgate_parse_brief` 2. `briefgate_validate_manifest` 3. `briefgate_run_qc` 4. `briefgate_analyze_impact` 5. `briefgate_remediate_assets` 6. `briefgate_export_review_bundle`