Greenlight — Devpost Submission
Project Overview
| Field | Value |
|---|---|
| Project Name | Greenlight |
| Tagline | YouTube tells you that your video was demonetized. Greenlight tells you which six seconds, cites the clause, and fixes them. |
| GitHub Repository | https://github.com/edish-github/Greenlight |
| Built With | TypeScript, Next.js 15, Node.js, FFmpeg, Groq Whisper, Google Gemini, Anthropic Claude, Zod, Zustand, Tailwind CSS, Vitest, Docker |
| Category Tags | Creator Tools, Media & Video, Developer Tools, Policy & Compliance, Machine Learning |
Executive Summary
| Phase | Description |
|---|---|
| The Problem | Video creators spend 40 hours editing, upload to YouTube, and receive a yellow dollar icon (Limited Ads). YouTube's Checks provide a coarse video-level verdict with zero timestamps and zero remediation. |
| The Blindspot | The single most repeated rule ("never swear in the first 7 seconds") was deleted by YouTube in July 2025. Standard frontier models still flag it because of stale pre-training weights. |
| The Architecture | Policy-as-Data: Machine-readable YAML rule packs, local high-recall detectors, and an allowlist Gate where the model acts strictly as an adjudicator and cannot hallucinate rules. |
| The Closed Loop | One-click audio remediation compiling approved spans into a single-pass FFmpeg filter complex (bleeps/mutes), preserving 4K video without re-encoding, and re-scanning to green. |

Inspiration: The $10,000 Yellow Dollar Problem
Every video creator with a sizable audience has experienced the frustration of an upload suddenly receiving YouTube's yellow dollar icon (Limited or no ads).
The feedback loop today leaves creators with three poor options:
- Publish anyway and absorb a 50% to 80% revenue penalty.
- Request a manual human review and lose the critical first 24-to-48-hour traffic window where the vast majority of video monetization occurs.
- Blindly guess which segment triggered the flag, re-edit, re-render, and re-upload.
The Folklore Trap: Why Prompt Engineering Fails Creators
During policy research for this project, we identified an architectural failure in how conventional AI systems approach compliance:
- YouTube's official Ad Guideline Update Log records that the famous rule prohibiting stronger profanity in the first 7 seconds was officially removed in July 2025. Under current guidelines, stronger profanity in the opening seconds can remain eligible for full ad revenue.
- However, creator blogs, video tutorials, and every frontier large language model (GPT-4, Claude, Gemini) continue to enforce this deleted rule because it was dominant during their pre-training window.
A standard "AI demonetization checker" built by simply sending transcripts to an LLM prompt will confidently flag compliant videos against rules that no longer exist.
Greenlight was designed to make that failure mode structurally impossible.
What It Does
Greenlight is a pre-publish policy linter and audio remediation engine for video creators.
00:00.9 strong profanity -> DETECTED, then CLEARED (no clause matched, ad-eligible)
00:04.8 repeated profanity -> AFG-LANG-002 limited ads effective 2025-07 -> bleep
00:12.5 sensitive events -> AFG-SENS-001 no ads effective 2025-07 -> manual review
title profanity -> AFG-PKG-001 no ads effective 2025-07 -> suggested edit
1. Millisecond-Precision Risk Timeline
The creator uploads a finished MP4 and enters the intended publishing title. Greenlight extracts 16kHz mono audio, transcribes it with word-level millisecond offsets via Groq Whisper, and plots color-coded risk bands across the timeline. Clicking any band seeks the video player to that exact millisecond.
2. Live Policy Citations with Effective Dates
Every finding includes the official YouTube advertiser-friendly clause ID (such as AFG-LANG-002), its effective date, an honest status indicator denoting whether the text is a verbatim quote or a summary paraphrase, and a direct link to the Google Help Center.
3. Transparent Cleared Spans
A tool that flags every potential term produces unmanageable false alarms. At 00:00.9 in our sample, an isolated strong word is detected and cleared by the Gate because current YouTube guidelines allow single strong words in video bodies. Greenlight displays what it reviewed and cleared on screen.
4. Single-Pass FFmpeg Audio Remediation
When the creator approves remediation, Greenlight compiles all selected fixes into a single FFmpeg filter graph. It generates an inline 1000Hz sine oscillator, ducks the original audio, and merges them using amix. Using stream copy on video (-c:v copy), the repair executes in ~3 seconds without re-encoding the video stream.
5. Automated Green Re-Scan Verification
The repaired MP4 is immediately run back through the identical detection and Gate pipeline under a new SHA-256 hash. The interface displays a before-and-after timeline comparison proving the findings have been resolved.
6. YouTube Studio Self-Certification Sheet
Translates scan findings directly into YouTube's 6 upload self-certification categories (Inappropriate Language, Adult Content, Violence, Shocking Content, Harmful Acts, Sensitive Events) with clickable timestamp proof for each declaration.


How We Built It: Architecture
The foundation of the system is: Policy is data, not model memory.

The Nine-Plane Pipeline
- Input Surfaces: Accepts rendered MP4, MOV, or MKV files alongside planned titles and thumbnails. Includes pre-computed judge-mode samples that resolve in under 250ms with zero network requests.
- Ingest Plane: Deterministic hashing (SHA-256), stream inspection via ffprobe, and 16kHz mono WAV extraction.
- Evidence Plane: Word-level timestamps via Groq Whisper Large v3 (with an automatic fallback ladder to OpenAI and local models).
- Candidate Generators: Local, deterministic pattern engines (lexicon matching, sliding-window density analysis, topic focus tracking, packaging checks). Sub-100ms execution, high recall, deliberately low precision.
- Policy Plane: Machine-readable YAML packs (youtube-afg-2026.09.yaml). Contains 12 active clauses, deprecated rule records, and the runtime allowlist.
- The Gate: Three-stage validation. An LLM adjudicates candidate spans against active clause text only. Output is validated against a strict Zod contract, verified against the clause allowlist, and bounded by video duration. Unrecognized or fabricated rules are rejected and logged to drops.jsonl.
- Scoring Engine: A pure aggregation function calculating overall status (Green, Amber, Red), confidence levels, driving clauses, and estimated revenue impact ranges.
- Remediation Engine: Compiles approved fixes into a single-pass FFmpeg filter string, outputting fixed.mp4 without video quality degradation.
- Output Surfaces: Next.js 15 dashboard, interactive millisecond timeline, YouTube Studio self-certification sheet, and the /compare side-by-side verification route.

Scan Sequence Lifecycle
The end-to-end scan lifecycle executes in approximately 16 to 18 seconds on a cold 3-minute video:

The Remediation State Machine
The finding lifecycle tracks candidates from initial detection through verification, remediation, and re-scan:

The Five Architectural Invariants
| Invariant | Guarantee | Enforced By |
|---|---|---|
| I1: Policy as Data | Policy exists exclusively in versioned YAML data, never in prompts or model weights. | src/policy/packs/*.yaml, tests/policy.test.ts |
| I2: Allowlist Gate | No finding can be emitted without an allowlisted clause ID from the loaded pack. | src/policy/loader.ts, tests/gate.test.ts |
| I3: Bounded LLM Role | Deterministic detectors propose candidate spans; the model only adjudicates against supplied clause text. | src/pipeline/detect/, tests/detect.test.ts |
| I4: Determinism | Identical media bytes + identical pack version = identical scan ID and repeatable findings. | src/lib/hash.ts, tests/verdict.test.ts |
| I5: Degraded States | Every external dependency has a labelled degraded banner; no unhandled crashes or blank spinners. | src/pipeline/transcribe/, components/DegradedBanner.tsx |
Evaluation Benchmark & Verification
Pack: [email protected] | Fixture: clip-01 (Hand-labelled ground truth)
| Category | Recall | Precision | True Positives | False Negatives | False Positives |
|---|---|---|---|---|---|
| Inappropriate Language | 1.00 | 1.00 | 1 | 0 | 0 |
| Packaging (Title/Thumb) | 1.00 | 1.00 | 1 | 0 | 0 |
| Sensitive Events | 1.00 | 1.00 | 1 | 0 | 0 |
| Overall (Adjudicated) | 1.00 | 1.00 | 3 | 0 | 0 |
Strict Negative Span Scoring
A compliance checker that flags all spoken content achieves 100% recall but zero utility. The evaluation suite (evals/run.ts) explicitly scores labelled negative spans — compliant words that must not fire (e.g. the isolated profanity at 00:00.9).
- Positive spans receive 2000ms overlap slack.
- Negative spans receive 0ms slack. Any finding landing on a negative span triggers a non-zero exit code.
Intellectual Honesty Scope: These measurements evaluate detection recall against hand-labelled ground truth spans, not prediction accuracy against YouTube's private internal decisions. YouTube's monetization determinations remain private to the channel owner; no external tool can honestly claim to measure YouTube's internal algorithms directly.
Key Technical Challenges & Solutions
1. Preventing "False Green" Re-Scans
- The Issue: In early testing, if a re-scan ran without an audio transcript or without the Gate, zero findings were detected. The diff engine initially interpreted zero findings as "all issues resolved" and rendered a green timeline. A false green is dangerous because it falsely assures a creator that a video is safe.
- The Solution: In src/pipeline/remediate/diff.ts, findings are only marked resolved if the re-scan completed with an active transcript and Gate adjudication. If any subsystem is degraded, findings are marked unverified with an explicit warning banner.
2. Single-Pass FFmpeg Audio Synthesis
- The Issue: Re-rendering an entire 4K 60fps video to bleep two seconds of audio takes 15 minutes and degrades picture quality through lossy compression.
- The Solution: In src/pipeline/remediate/filters.ts, we implemented a pure-string FFmpeg filter_complex generator. It generates an inline 1000Hz sine oscillator, ducks the target audio window, blends them with amix, and pairs this with -c:v copy. The video stream is preserved bit-for-bit, rendering in ~3 seconds.
3. Defeating LLM Hallucinations (Adversarial Regression Test)
- The Issue: Proving that an LLM cannot hallucinate removed guidelines like the first-7-seconds rule.
- The Solution: In tests/no-seven-second-rule.test.ts, we created an adversarial model stub that deliberately attempts to cite AFG-LANG-DEP-7SEC on every candidate. The test verifies that the Gate drops 100% of these attempts and produces an unaffected green verdict.
Unit Economics
Estimated per 3-minute video cold scan:
| Pipeline Stage | Processing Time | Compute / Provider | Cost | API Calls |
|---|---|---|---|---|
| Demux & Audio Extraction | ~3s | Local FFmpeg | $0.00 | 0 |
| Word-Level Transcription | ~5s | Groq Whisper Large v3 | ~$0.001 | 1 |
| Candidate Generation | <0.1s | Local TypeScript Regex | $0.00 | 0 |
| Policy Adjudication | ~5s | Gemini 2.5 Flash / Claude 3.5 | ~$0.02 | 1-3 |
| FFmpeg Remediation | ~3s | Local FFmpeg Stream Copy | $0.00 | 0 |
| Total Cold Scan | ~16s | ~$0.021 | 2-4 |
Pre-computed sample scans in Judge Mode resolve from local cache in under 250ms with $0.00 API spend.
What We Learned
- Constraining Models Beats Prompting Models: The most valuable architectural mechanism in an LLM application is defining what the model is physically prevented from emitting. Using a strict allowlist derived from versioned data makes entire classes of hallucinations impossible rather than just unlikely.
- Honesty as an Architectural Feature: Building disclaimers, paraphrase badges, and unverified states directly into data schemas ensures that transparency survives refactoring and runtime execution.
- The Power of the Closed Loop: Providing diagnosis without remediation leaves half the user's problem unsolved. Pairing policy analysis with deterministic FFmpeg audio repair transforms the application from an informational report into an actionable workflow tool.
What's Next for Greenlight
- Multi-Platform Policy Packs: Expand Policy-as-Data to TikTok Creator Rewards, Twitch Brand Safety, and Meta Monetization via modular YAML packs.
- NLE Timeline Integration: Direct plugin for Adobe Premiere Pro and DaVinci Resolve that imports policy findings directly as markers on the editor's sequence.
- Local Watch-Folder Daemon: A background folder-watcher that automatically scans exports the moment a rendering job finishes.
- Platform Policy Registry: A versioned changelog tracking platform guideline modifications over time with automated regression tests.
Verification & Quickstart
# Clone the repository
git clone https://github.com/edish-github/Greenlight.git
cd Greenlight
# Install dependencies and run tests (93 tests passing)
npm install
npm test
# Start the local development server
npm run dev
Open http://localhost:3000 and click the Placeholder walkthrough card to explore the full interactive report in under 250ms with zero API keys required.

Log in or sign up for Devpost to join the conversation.