Hacker
Sarang R
@s1056sar
Projects
FlagSpec
Flagsmith Experimentation HackathonNov 2026
Feature-flag experiments fail silently. If a developer calls `hasFeature()` instead of `get_experiment_flag()`, uses a different user/session identifier between exposure and conversion `track_event()`, mistypes a metric event's casing, or exits a short-lived worker before the SDK flushes its buffer, Flagsmith raises zero exceptions—it simply records 0 exposures, orphaned conversions, or skewed results. We built FlagSpec + Placebo, a standalone developer-tooling and chaos-verification suite around unmodified Self-Hosted Flagsmith so every static lint rule comes with a live statistical proof receipt: 1. FlagSpec (`flagspec lint`) — Tree-sitter AST & Dataflow Linter (Python & TypeScript): Unlike regex preflight scripts, FlagSpec parses real ASTs to catch 5 documented Flagsmith failure modes (`FS001`–`FS005`) at PR time: unkeyed active multivariate variations, missing or mismatched identifiers across exposure and conversion calls in the same scope, non-experiment flag reads on active experiment flags, case-sensitive metric event mismatches, and process exits before SDK event flushing. Ships as both a CLI and a 60-second GitHub Composite Action (`action.yml`) with inline PR annotations. 2. Placebo (`flagspec prove` & `flagspec canary`) — Jepsen-Style Chaos & Proof Engine:** Replays the exact linted defect (plus chaos faults: `crash_on_b`, `identity_churn_bot_skew`, `unflushed_exit`, and `aa_baseline`) through the real Flagsmith Python SDK against a live Self-Hosted Flagsmith stack with a known planted ground truth (`0%` A/A or `+20%` planted lift). Evaluates independent Event Conservation % (`sent vs stored`), Independent χ² Sample Ratio Mismatch (SRM)** (even when Flagsmith's `srm_p_value` returns `None`), and Verdict Integrity. `flagspec canary` runs a continuous 0%-lift synthetic A/A probe to alert if a live experimentation pipeline starts dropping or skewing events. 3. Control Room UI (`flagspec ui`) — Zero-Build FastAPI Dashboard (`localhost:8501`): Visualizes AST findings, side-by-side Broken vs. Fixed event-conservation Proof Receipts, and live Jepsen chaos/canary oracles alongside Self-Hosted Flagsmith (`localhost:8000`). Who uses it: Any engineering team running Self-Hosted Flagsmith Experimentation who wants CI guardrails on every PR and empirical proof that their experimentation pipeline isn't silently lying.