Skip to content

Add flagd / OpenFeature flag provider - #7

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
cursor/flags-flagd-adapter-0d80
Aug 15, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
cursor/flags-flagd-adapter-0d80

Conversation

@FlyOverCoderKY

@FlyOverCoderKY FlyOverCoderKY commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Phase 3 already shipped the LaunchDarkly, AWS AppConfig, and Cloudflare Flagship adapters. Nathan authorized the remaining vendor adapters to be built now. This PR lands the last one — @pegma/flags-flagd — and no others. Phase 3 vendor adapters are complete.

Behavior

createFlagdFlagProvider takes a host-injected flagd / OpenFeature reader. The adapter translates an already-evaluated OpenFeature detail into a FlagResolution and does not import the OpenFeature SDK or a flagd provider, own a client singleton, or evaluate targeting rules / percentage rollouts.

Documented OpenFeature reason kinds only:

  • TARGETING_MATCH, SPLIT, DEFAULT, STATIC, and CACHED → TARGETING_MATCH
  • STALE → STALE_CACHE (so the flags client records the stale reason and emits fallback telemetry)
  • DISABLED → DISABLED
  • missing reader result, or FLAG_NOT_FOUND → DEFAULT_FALLBACK
  • other ERROR codes and unknown reasons (including UNKNOWN) propagate so the flags client can record ERROR

Optional flagdEvaluationContext builds the documented OpenFeature context (targetingKey plus JSON-compatible attributes). Hosts that need a different context shape map EvaluationContext themselves inside the reader.

Tests

  • Unit tests for reason translation, injected key mapping, unknown reasons, reader errors, and no OpenFeature / flagd SDK / Date.now() on the production path
  • Phase 1 conformance suite against a memory reader, plus a client-level STALE → STALE_CACHE fallback-log case
  • Release inventory includes the new public package

Docs

Plan status is Phase 3 vendor adapters in-tree, unpublished. MIT © RetireGolden, LLC.

Do not publish or tag from this PR.

Open in Web Open in Cursor 

Land the last Phase 3 vendor adapter as a thin FlagProvider that
translates injected OpenFeature evaluation details. Targeting and
percentage rollouts stay in flagd.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 512f03b2e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/flags-flagd/src/index.ts Resolved
OpenFeature STALE is a stale provider result, not a fresh targeting
match. Return STALE_CACHE so the client emits fallback telemetry.

Co-authored-by: Fly Over Coder <FlyOverCoder@gmail.com>
@FlyOverCoderKY
FlyOverCoderKY merged commit 096f8f4 into main Aug 15, 2026
5 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the cursor/flags-flagd-adapter-0d80 branch August 15, 2026 21:56
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