Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved prerequisite-handling defects drop feature metadata and assigned values, mishandle obfuscated lookups, and cause inconsistent exposure recording, targeting context, and cache behavior.
6 open issues
Scope silent-root prerequisite cache entries to the configuration · New Forward the root evaluation context to prerequisite callbacks · New Finalize selected prerequisite decisions after the root succeeds · New Use obfuscated keys to reconstruct prerequisite assignments · New Include the assigned value in prerequisite evaluation details · New Preserve feature metadata when reconstructing prerequisite evaluations · New
What changed in this PR
Adds dependent-flag support to precomputed assignments, extending the prerequisite provenance work in #437 into browser evaluation, exposure reporting, and RUM enrichment.
Changes:
- Adds dependency records, error results, validation, and capability negotiation for precomputed assignments.
- Reports ordered prerequisite evaluations while limiting exposures and RUM enrichment to selected dependencies.
- Adds browser corpus and dependency tests, and preserves Node prerequisite telemetry when later hooks fail.
| File | Description |
|---|---|
packages/node-server/test/dependent-flags.spec.ts |
Tests telemetry preservation after hook failures. |
packages/node-server/src/provider.ts |
Separates dependency telemetry retention from exposure rollback. |
packages/node-server/rules-based.d.ts |
Updates precomputed assignment declarations. |
packages/node-server/index.d.ts |
Updates telemetry sidecar declarations. |
packages/core/test/evaluation/precomputed-dependencies.spec.ts |
Tests dependency reconstruction and validation. |
packages/core/src/evaluation/precomputed-evaluation.ts |
Attaches dependency records to evaluation results. |
packages/core/src/evaluation/precomputed-dependencies.ts |
Reconstructs and stores prerequisite details. |
packages/core/src/evaluation/index.ts |
Exports dependency helpers. |
packages/core/src/configuration/wire.test.ts |
Adapts assertions to the assignment union. |
packages/core/src/configuration/wire-validation.ts |
Validates error assignments and dependency records. |
packages/core/src/configuration/flag-key-obfuscation.ts |
Advertises dependent-flag capability. |
packages/core/src/configuration/configuration.ts |
Defines dependency and error assignment types. |
packages/core/README.md |
Documents precomputed dependency semantics. |
packages/browser/test/transport/fetchConfiguration.spec.ts |
Updates capability-header expectations. |
packages/browser/test/openfeature/rumIntegration.spec.ts |
Tests selected-dependency RUM enrichment. |
packages/browser/test/openfeature/provider.spec.ts |
Updates provider capability expectations. |
packages/browser/test/openfeature/precomputed-corpus.spec.ts |
Adds a browser runner for Web-enabled shared fixtures. |
packages/browser/test/openfeature/obfuscation.spec.ts |
Updates capability expectations for obfuscated responses. |
packages/browser/test/openfeature/flagEvaluations.spec.ts |
Tests prerequisite telemetry ordering. |
packages/browser/test/openfeature/exposures.spec.ts |
Tests selected-dependency exposure emission. |
packages/browser/test/openfeature/exposure-hook.spec.ts |
Tests dependency callbacks and shared exposure decisions. |
packages/browser/src/openfeature/rumIntegration.ts |
Enriches RUM with selected prerequisites. |
packages/browser/src/openfeature/flagEvaluations.ts |
Records prerequisite evaluations before the root. |
packages/browser/src/openfeature/exposures.ts |
Prepares and emits dependency exposures. |
packages/browser/src/openfeature/exposure-hook.ts |
Delivers selected dependencies to customer callbacks. |
packages/browser/src/openfeature/core-provider-metadata.ts |
Preserves dependency associations when copying metadata. |
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Error handling can lose prerequisite evaluations, suppress the root callback when context access fails, and skip remaining prerequisite and root records when RUM recording throws.
3 open issues
6 resolved since last review
Preserve feature metadata when reconstructing prerequisite evaluations Include the assigned value in prerequisite evaluation details Use obfuscated keys to reconstruct prerequisite assignments Finalize selected prerequisite decisions after the root succeeds Forward the root evaluation context to prerequisite callbacks Scope silent-root prerequisite cache entries to the configuration
Review effort: Balanced
OpenFeature Browser Provider Bundle SizesMeasured from the Vite production output after installing packed Both scenarios initialize an OpenFeature provider, evaluate a boolean flag, change context, and evaluate again. Telemetry is disabled for DatadogProvider; no tracking hooks are registered for DatadogCoreProvider. DatadogProvider fetches precomputed assignments for each context; DatadogCoreProvider receives rules from fetchRulesConfiguration once and evaluates locally. Sizes include OpenFeature and the same small scenario harness. Configuration responses are supplied by Playwright and are not bundled. These are complete scenario JS sizes, not configuration payload sizes or isolated provider/Protobuf costs; the difference between rows is not a decoder-only delta.
Dependency checks passed: no Protobuf markers in default/precomputed scenarios; markers present in rules-based scenarios. OpenFeature Browser Tracking Hook Bundle SizesSynthetic entrypoints import and call tracking hook factories from the packed
OpenFeature Node Server Bundle SizesIndependent Webpack production builds of the installed core and Node SDK tarballs, targeting Node 18 with ESM (
Adding SSR helpers to the provider adds 83.1 KiB raw / 23.6 KiB gzip in this build. This includes fetching, parsing, and serialization, not just the decoder. SSR helpers fetch rules for the browser, not for configuring that provider (which uses its existing JSON API). Adding precomputation to the provider adds 3.2 KiB raw / 1.0 KiB gzip in this build. Both precompute scenarios import precomputeConfiguration from /rules-based and receive already-parsed rules from the test harness; they do not fetch, parse, or serialize configuration. These are bundler sizes, not npm install sizes, unbundled Node require/import costs, payload sizes, or latency. Gzip compares compressed artifacts. Deltas compare scenarios in this build, not changes against the base branch. The browser scenarios include OpenFeature and a different harness, so their sizes are not directly comparable. Dependency checks passed: no Protobuf runtime or generated schema modules in the provider-only or either precompute bundle; present in both SSR bundles (checked using Webpack module statistics). This report shows current PR artifact sizes only; it does not compare against the base branch. |
There was a problem hiding this comment.
🔵 Needs a closer look
Human assessment is needed because an unreadable context getter can silently skip all prerequisite exposure callbacks even when the root tracking context resolves successfully.
No open issues 🎉
3 resolved since last review
Review effort: Balanced
|
Fresh Copilot review reports no open issues. On the remaining “closer look” note: the custom exposure hook resolves the tracking context once, catches an unreadable caller context, and still iterates every prerequisite plus the root callback with an undefined cloned context. The lifecycle regression suite covers that path, the independent local review found no material issue, and the full browser suite passes (625 tests). |
|
🤖 Comment from Claude working with Aaron Silverman: [P2] Dependency depth limit (core evaluator on All evaluators in this stack accept 0–255 today. In libdatadog (DataDog/libdatadog#2748), a 255-edge chain overflows 128 KiB and 256 KiB thread stacks in a release build, and Rust aborts the process on a stack overflow. I suggested lowering the maximum there to 32. All evaluators should keep the same range, so that one configuration behaves the same in every SDK. Suggested change in |
Normalize root dependency failures while preserving prerequisite details, tolerate future dependency fields, and default malformed evaluator options safely. Environment: Datadog workspace Co-Authored-By: Codex GPT-5 <noreply@localhost>
36398b6 to
e078194
Compare
Reject bigint depth overrides on JSON configurations while preserving protobuf bigint support, and strengthen depth-boundary and dependency telemetry coverage. Environment: Datadog workspace Co-Authored-By: Codex GPT-5 <noreply@localhost>
| source.evaluatorParams = fromJson(FlagsConfigurationSchema, { | ||
| evaluatorParams: { maxDependencyDepth: failure === 'depth limit' ? 0 : 256 }, | ||
| }).evaluatorParams | ||
| ['missing parent', 'GENERAL', 'FLAG_NOT_FOUND', undefined], |
There was a problem hiding this comment.
🤖 Comment from Claude working with Aaron Silverman:
[P2] Follow-up to our root error code comment: evaluate() now returns GENERAL for the root, but the precompute path still reports the prerequisite's code for the same root. This table now encodes that split.
precompute-configuration.ts:95-98pusheserror.errorCode, which is the prerequisite's code. For a missing parent,onEvaluationErrorgetsFLAG_NOT_FOUND, and for an invalid parentPARSE_ERROR, whileevaluate()returnsGENERALfor the same root. A precomputed producer that writes the root's error from this callback gets the prerequisite's code.- Our earlier comment also asked for
GENERALon failed ancestors. The intermediate prerequisite still copies the leaf's code:packages/core/test/evaluation/dependent-flags.spec.ts:670expectsFLAG_NOT_FOUNDforprerequisitewhen onlymissingis absent.
Suggested change (tested: with it, precompute-configuration.test.ts and dependent-flags.spec.ts pass, 122 tests, and tsc --noEmit passes):
// precompute-configuration.ts
errorCode: error instanceof DependencyGraphError ? error.rootErrorCode : ('GENERAL' as ErrorCode),// this table
['missing parent', 'GENERAL', 'GENERAL', undefined],
['invalid parent', 'GENERAL', 'GENERAL', 'PARSE_ERROR'],| } | ||
|
|
||
| function logInvalidEvaluatorParams(logger: Logger, rootFlagKey: string): void { | ||
| logger.error('invalid evaluatorParams; using default maxDependencyDepth', { |
There was a problem hiding this comment.
🤖 Comment from Claude working with Aaron Silverman:
[P3] With invalid evaluatorParams, this logs at error level on every root evaluation that reaches a dependency.
getMaxDependencyDepthruns once when a root evaluation first reaches a dependency (lines 380 and 473), and each invalid case calls this function.- On
main, an invalid depth made the dependent evaluation fail withPARSE_ERROR. Now evaluation continues with the default depth of 10, and the log is the only signal of the invalid parameters. It repeats on each evaluation that reaches a dependency. A probe withmaxDependencyDepth: 256and 1,000 evaluations of one root gave 1,000logger.errorcalls.
Suggested change: log once per configuration object. Tested: the same probe logs once, precompute-configuration.test.ts and dependent-flags.spec.ts pass (122 tests), and tsc --noEmit passes.
const reportedInvalidEvaluatorParams = new WeakSet<object>()
function logInvalidEvaluatorParams(logger: Logger, config: object, rootFlagKey: string): void {
if (reportedInvalidEvaluatorParams.has(config)) return
reportedInvalidEvaluatorParams.add(config)
logger.error('invalid evaluatorParams; using default maxDependencyDepth', {
flagKey: rootFlagKey,
defaultMaxDependencyDepth: DEFAULT_MAX_DEPENDENCY_DEPTH,
})
}Then pass config at the four call sites in getMaxDependencyDepth.

Summary
Applies the evaluator findings synthesized from Aaron’s dependent-flags reviews across SDK implementations.
GENERALon the requested/root flagevaluatorParamsblocks and invalid or wrongly typedmaxDependencyDepthvalues by logging an error and using the hard-coded depth of 10flagEvaluationobjects while continuing to require a non-emptykey0through255depth overridesScope
This PR changes evaluator parsing and failure semantics only. It does not implement precomputed payload generation, the new precomputed error wire shape, or obfuscated-key encryption. Existing precomputation regression tests are updated only because they exercise the shared evaluator and must distinguish root errors from prerequisite diagnostics.
Validation
git diff --check