Skip to content

feat(platform): add the metamask-extension overlay for feature-flags - #157

Draft
MajorLift wants to merge 8 commits into
feat/MCWP-827_feature-flagsfrom
jongsun/add/feature-flags-extension-overlay
Draft

feat(platform): add the metamask-extension overlay for feature-flags#157
MajorLift wants to merge 8 commits into
feat/MCWP-827_feature-flagsfrom
jongsun/add/feature-flags-extension-overlay

Conversation

@MajorLift

Copy link
Copy Markdown
Contributor

Motivation

The feature-flags skill in #147 ships with a mobile overlay only, so an agent working in metamask-extension gets the shared skill and no client specifics.

Writing that overlay by transposing mobile's API would have produced something mostly right and wrong where it matters. The extension's helper is a direct port of mobile's, and shared/lib/remote-feature-flag-utils.ts:7 says so in its own header, so the exported names do match. Three things do not.

The version basis inverts mobile's warning. Mobile's overlay says the comparison is against the native binary version, not package.json. The extension resolves APP_VERSION from packageJson.version. Same symbol, opposite source, and the mobile sentence is actively misleading in this repo.

Two modules export the same three names with different semantics. shared/lib/remote-feature-flag-utils.ts and shared/lib/feature-flags/version-gating.ts both export hasMinimumRequiredVersion, validatedVersionGatedFeatureFlag and VersionGatedFeatureFlag. The second types minimumVersion as string | null and does not unwrap progressive-rollout wrappers. An import of either name compiles against either module, which is the trap a reader of the mobile overlay walks into.

getBooleanFeatureFlag is the house entry point, not mobile's. Counting invocations outside tests and outside the defining modules: 17 against 6. It takes the fallback as a required second argument rather than a trailing ?? localFlag.

Overview

Adds domains/platform/skills/feature-flags/repos/metamask-extension.md. Based on #147's branch, so it should merge after it.

Sections: the canonical API and the two-module collision, requirements, adding a flag, testing, what the extension does not have, and what it has that mobile does not.

Five things the mobile overlay covers have no extension counterpart and are named as absent rather than invented: the native binary version, multi-version { versions: {...} } flags, a central FeatureFlagNames registry, OVERRIDE_REMOTE_FEATURE_FLAGS, and a useRemoteFeatureFlag hook. Each was established with a positive control on the same search shape.

Showcase

No trial run. The evidence is that every symbol and path named was read from the repository, with the file it came from recorded.

Two things a reviewer should settle rather than inherit:

  • Which of the two same-named modules is canonical is not written down anywhere. No ADR, no lint rule. The overlay recommends remote-feature-flag-utils on importer count (13 production files against 4), recency and wrapper support, and says explicitly that this is a preference rather than repo policy.
  • Whether getBooleanFeatureFlag's dominance is a decision or accretion is likewise unrecorded.

Separate defect, found on the way and not fixed here: domains/testing/skills/ab-testing/repos/metamask-extension.md:78 on main tells readers to use FixtureBuilder.withRemoteFeatureFlags(...). That method does not exist. The string appears twice in metamask-extension, both inside doc comments in test/e2e/feature-flags/feature-flag-registry.ts. The real method is withRemoteFeatureFlagController, at test/e2e/fixtures/fixture-builder-v2.ts:428. This overlay names the real one.

NicolasMassart and others added 8 commits September 3, 2026 18:26
- Introduced a new `analytics` skill that provides a repo-agnostic base and integrates a MetaMask Mobile overlay for the canonical tracking API. This skill is marked as `mandatory: true`, ensuring it installs even when the `coding` domain is filtered out.
- Updated documentation in `README.md` to clarify the behavior of `mandatory: true` in relation to domain filtering.
…cking

- Revised the event tracking workflow to clarify the registration process in the catalog, emphasizing the reuse of existing catalog names only for identical interactions.
- Enhanced UI testing instructions to specify wrapping `useAnalytics` with the test factory and asserting builder calls in non-React tests.
- Updated documentation to reflect these changes and improve clarity on testing practices.
…API documentation

- Updated the documentation to specify the two emission paths for analytics: the `analytics` helper and `AnalyticsController:trackEvent` via `initMessenger`.
- Enhanced clarity on the roles of different components in the analytics system, including the distinction between non-React and UI helpers.
- Revised the requirements section to reflect the updated paths and usage guidelines for analytics tracking.
…platform domain

- Added the `analytics` skill to the CHANGELOG, highlighting its repo-agnostic base and MetaMask Mobile overlay.
- Updated the README to include the new `platform` domain, clarifying its purpose for product analytics and platform skills.
- Adjusted the `analytics` skill's domain from `coding` to `platform` to better reflect its functionality.
Co-authored-by: Cursor <cursoragent@cursor.com>
The extension's helper is a direct port of mobile's and its header says so,
so the exported names match. Three things do not, and they are what the
overlay is for.

The version basis inverts mobile's warning: mobile compares against the
native binary version, the extension against `packageJson.version`.

Two modules export `hasMinimumRequiredVersion`,
`validatedVersionGatedFeatureFlag` and `VersionGatedFeatureFlag` with
different semantics. Only one unwraps progressive-rollout wrappers, and an
import of either name compiles against either module.

`getBooleanFeatureFlag` is the house entry point rather than mobile's, at 17
production call sites against 6, and it takes the fallback as a required
argument instead of a trailing `??`.
@NicolasMassart
NicolasMassart force-pushed the feat/MCWP-827_feature-flags branch 3 times, most recently from 19e7f71 to 3b3f0c0 Compare September 11, 2026 11:53
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.

2 participants