feat(migrate-statsig): Statsig→Confidence migration — Phase 2: code transformation#25
Open
fabriziodemaria wants to merge 1 commit into
Open
feat(migrate-statsig): Statsig→Confidence migration — Phase 2: code transformation#25fabriziodemaria wants to merge 1 commit into
fabriziodemaria wants to merge 1 commit into
Conversation
9b3f59d to
7853f4d
Compare
7853f4d to
5d2c309
Compare
Adds the `plan code` workflow to the migrate-statsig skill: transforming Statsig SDK usage (checkGate/getConfig/getExperiment/getLayer, React hooks, *Sync/*Async/legacy spellings) into the Confidence OpenFeature SDK, one flag = one PR. Registers it in CLAUDE.md / README.md / the command. The skill encodes findings validated against the real Confidence local-resolve providers (spotify/confidence-resolver) and three real statsig-io/samples demos (node-express, pythontodo, a Spring app) — including one full demo round-trip (migrate → create flags via MCP → resolve live): - Set the Phase 1 ENTITY FIELD in the eval context (not just targetingKey), else everything resolves to DEFAULT. - Python has a local-resolve provider now (in-process, not remote). - Sync/async shape follows the TARGET SDK (JS await; Java/Go/Python sync; drop Statsig *Async Future/.get()). - Object reads: floats in Python, dev.openfeature.sdk.Value in Java. - CommonJS apps must convert to ESM (provider is ESM-only). - log_event/logEvent is BLOCKED (no Confidence event-logging API). - private_attributes change privacy when moved into the (logged) context. - Materialized segments / sticky assignments need a provider materialization store, or they silently resolve to DEFAULT. Example apps used for validation are kept out of the PR to stay focused on the skill. Co-authored-by: Cursor <cursoragent@cursor.com>
eb5858b to
d81257c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 2 of the Statsig→Confidence migration. Phase 1 (#23) is merged, rebased on
main.Scope: the skill only — adds the
plan codeworkflow tomigrate-statsig. The example apps used to validate it are intentionally not committed to keep this PR focused; the findings they produced are baked intoSKILL.md.Summary
Adds Phase 2 — code transformation (
/confidence:migrate-statsig plan code): transform Statsig SDK usage into the Confidence OpenFeature SDK, one flag = one PR. Registers it inCLAUDE.md/README.md/ the command. Targets the Confidence local-resolve providers from spotify/confidence-resolver (JS, Java, Python, Go, Rust) plus the React local-resolve hooks.How these migrations were tested
The skill's mappings were driven and checked against the real Confidence providers + three real
statsig-io/samplesapps (not toy fixtures):sample-feature-gate→true,warning-banner→{title:"Big Sale", dismissible:false}for a US user)statsig-node(CommonJS)node --check+tscagainst the real@spotify-confidence/...+@openfeature/server-sdk*Async)mvn compile(BUILD SUCCESS) against the realcom.spotify.confidence:openfeature-provider-localSo: every migration was compiled/typechecked against the real Confidence packages, and one (Python) was run end-to-end against a live Confidence project. Per-language reference fixtures (JS/Java/Python compiled; Go/Rust doc-verified) were also used during development.
Findings encoded in the skill
user_id) in the eval context, not justtargetingKey— else every flag resolves toDEFAULT(caught by the live resolve).confidence-openfeature-provider, alpha) → Python migrates in-process, not remote.await); Java/Go/Python synchronous → drop Statsig*AsyncFuture/.get().dev.openfeature.sdk.Value(Java →asStructure().asObjectMap()).log_event/logEventis BLOCKED — no Confidence event-logging API; leave existing analytics in place.private_attributesare unlogged in Statsig but logged in Confidence → surface before moving into the context.DEFAULT.*Sync/*Async/legacy spellings andgetLayer→ experiment-flag mapping handled.