Skip to content

docs: feature-flag plugin design & phased build plan#1009

Open
lane711 wants to merge 1 commit into
mainfrom
lane711/feature-flag-plugin-plan
Open

docs: feature-flag plugin design & phased build plan#1009
lane711 wants to merge 1 commit into
mainfrom
lane711/feature-flag-plugin-plan

Conversation

@lane711

@lane711 lane711 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a research-backed design doc for a SonicJS feature-flag plugin — LaunchDarkly / Unleash / Flagsmith / GrowthBook / Statsig parity, built entirely on the document model (no new feature tables).

docs/ai/plans/feature-flag-plugin-plan.md

Why

Proposal to make SonicJS usable as a feature-flag / progressive-delivery platform, serving both internal feature gating (FlagService.isEnabled) and external apps (SDK keys, /flags API, OpenFeature provider).

Highlights

  • Document-model native: flags/segments/projects/envs/SDK-keys/audit/experiments all as system document types. Versioning → change history/rollback; draft-vs-published → staged changes; facets → segments; hooks → webhooks + cache bust; cron → scheduled rollouts.
  • Deterministic eval engine: off → prerequisites → individual targets → rules (first-match) → fallthrough, returning {value, variant, reason} mapped to OpenFeature vocabulary.
  • MurmurHash3-32 bucketing for sticky, monotonic % rollouts (bucketBy + per-flag salt).
  • Edge delivery: D1 source of truth behind 3-tier CacheService (memory→KV→D1) + versioned polling. SSE streaming documented as optional stretch.
  • 7 phases (0→6): MVP boundary at Phase 2; terminal "highly complex" A/B experimentation engine (CUPED, sequential testing, holdouts, mutual-exclusion layers) at Phase 6.

Scope

Docs only — no code, no schema, no migrations. This is the design/roadmap for review before implementation.

🤖 Generated with Claude Code

Research-backed design doc for a SonicJS feature-flag plugin (LaunchDarkly /
Unleash / Flagsmith / GrowthBook / Statsig parity), built on the document model.
7 phases (0-6): MVP at Phase 2, terminal "highly complex" A/B experimentation
engine at Phase 6. Dual consumer (internal gating + external service), full
multi-project/env, MurmurHash3-32 bucketing, OpenFeature provider, D1 + 3-tier
cache edge delivery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant