Hacker
Ubedullah Allah Dino
@ubed786
Projects
REFEREE — Experiment Reliability Auditor for Flagsmith
Flagsmith Experimentation HackathonNov 2026
REFEREE is a command-line agent that answers one question before anyone trusts an A/B test: does the code actually measure the experiment configured in Flagsmith? The problem: Flagsmith computes experiment results from the events an app sends, but it never sees the code. A one-character bug silently corrupts the result, and nothing on the dashboard shows it. Example: the code calls trackEvent('Order_Completed'), but the metric counts 'order_completed'. Other bugs of this kind: a mistyped flag key, a variation value the code never checks, identify() called after the flag is read, or events lost because they were not flushed before exit. The team then ships a "winner" chosen from broken data. Who uses it: developers and reviewers who add or change experiment code, as a check before they trust the results or merge. How it works: 1. The developer captures the experiment from Flagsmith with the official CLI. REFEREE prints the exact read-only GET commands, and the developer runs them with their own login. 2. REFEREE validates the experiment, flag, variations, metrics and warehouse status against Flagsmith's OpenAPI schema. It then audits the JS/TS codebase and cites the file and line for every finding. 3. It gives a conservative verdict: INVALID if anything fails, otherwise KEEP RUNNING. An ambiguous call is reported as UNKNOWN, not guessed. REFEREE never picks a winner; that stays in Flagsmith. 4. Where a fix is provably safe, REFEREE shows the exact diff and applies it only after a human types y. It then backs up the file, rescans to prove the fix and writes a Markdown report. `referee undo` restores the file byte for byte. Evidence: 931 tests passed and 0 failed, CI green on every commit, 13/13 seeded defects caught on a synthetic benchmark with 0 false alarms, and a read-only snapshot of a real Flagsmith experiment audited end to end. Honest scope: deterministic rules by design (no LLM); JS/TS only; tested on Windows with Python 3.14; demo and benchmark data are synthetic; not yet production-ready.