Repository navigation
feat: Add the override store, overlay, and data system wiring - #451
Merged
Merged
Conversation
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
September 25, 2026 22:51
0f89736 to
4810ac9
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
September 25, 2026 22:51
e2df553 to
e4d05bb
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
September 28, 2026 20:36
4810ac9 to
20eea70
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
September 28, 2026 20:36
e4d05bb to
09915cc
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
October 1, 2026 23:43
20eea70 to
8072ee4
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
October 1, 2026 23:43
09915cc to
4f4c242
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
October 3, 2026 00:46
8072ee4 to
ed8fccf
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
October 3, 2026 00:46
4f4c242 to
54278dc
Compare
Member
Author
|
bugbot review |
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
October 3, 2026 01:54
54278dc to
0dee958
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
October 8, 2026 16:54
bb04f10 to
6ad2419
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
October 8, 2026 16:54
0dee958 to
18341e8
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
October 13, 2026 22:12
6ad2419 to
7579ddb
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
October 13, 2026 22:12
18341e8 to
45c6daa
Compare
Member
Author
|
bugbot review |
Member
Author
|
bugbot review |
2 similar comments
Member
Author
|
bugbot review |
Member
Author
|
bugbot review |
Member
Author
|
bugbot review |
Member
Author
|
bugbot review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 0a4c8b7. Configure here.
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
November 3, 2026 23:58
7579ddb to
fae4a5c
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
November 3, 2026 23:58
0a4c8b7 to
827c4e2
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
November 4, 2026 19:20
fae4a5c to
16d5b70
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
November 4, 2026 19:48
40612a6 to
8023cbc
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
November 4, 2026 19:48
16d5b70 to
156dc66
Compare
Flag overrides, as defined by the OVERRIDE specification, need three pieces below the store: a marker on the flag and segment model that says a definition came from the override store, evaluator marking that follows every definition an evaluation reads, and an indicator on the evaluation reason that reports the marking to callers. The model classes carry the marker as an attribute that is never serialized. `as_override` returns a marked shallow copy and leaves the original unchanged. Only the SDK components that manage override entries set it. The evaluator marks an evaluation as override-affected when the evaluated flag, a prerequisite flag at any depth, or a segment read during clause matching carries the marker. A segment counts when it is read, so a segment that does not match, or that is read through a negated clause, still marks the evaluation. The marking propagates upward only: a prerequisite's own record reflects the definitions its own subtree read, and a plain prerequisite inside a marked evaluation is not marked. An error result is marked when a marked definition was read before the failure, including when the failure was raised while a prerequisite was being evaluated. An evaluation that reads no marked definition keeps the shared precomputed detail instances. `EvaluationReason#override_affected` carries the indicator. It is written to JSON as `overrideAffected` only when true, so the wire format of ordinary evaluations is unchanged. `with_override_affected` follows the `with_big_segments_status` precedent and returns the same instance when nothing changes. Flag overrides are currently experimental and subject to change.
kinyoklion
force-pushed
the
rlamb/overrides-ruby-model-evaluator
branch
from
November 4, 2026 20:47
156dc66 to
d677d6c
Compare
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
November 4, 2026 20:47
8023cbc to
65c2ed1
Compare
keelerm84
approved these changes
Nov 5, 2026
Ruby 3.1 through 3.3 report file modification times in whole seconds on Windows, so a truncation 20 ms after another one does not look like a new write. The reloader specs that need a rewrite to look new now stamp the file's modification time themselves. The listen gem polls on Windows CI and compares the lstat of a symbolic link, so it cannot see a link replaced within the second of its creation. The watcher spec that replaces a link waits for the next second first on a platform with whole-second file times.
Adds the override layer that the OVERRIDE specification describes: a runtime-mutable collection of flag and segment definitions that takes precedence over LaunchDarkly data at the store read boundary. - `LaunchDarkly::Interfaces::Overrides::OverrideSource` and `OverrideSink` define how a source supplies complete snapshots to the SDK. - `Impl::Overrides::Layer` holds marked entries in an immutable hash that is swapped on update, so the layer holds exactly one snapshot at any instant. - `Impl::Overrides::Overlay` sits at the store read boundary. A read for a key returns the override entry when one exists and the LaunchDarkly entry otherwise. An enumeration is the union with the override entry winning. Initialization status is the base store's alone. - `Impl::Overrides::Sink` applies snapshots and notifies flag change listeners of every flag whose merged-view evaluation may have changed, including flags that depend on an overridden prerequisite or segment. - `DataSystem::ConfigBuilder#overrides` accepts one override source builder. The FDv2 data system builds it at construction, so an invalid configuration raises from `LDClient.new`, starts it before its run loop so the initial load is in effect before the constructor returns, serves reads through the overlay, and stops it when the client closes. Offline clients build no source. - The client consults the override store before the not-initialized short-circuit: an overridden flag is served before LaunchDarkly data arrives, and a flag that is not overridden still returns the client-not-ready default. `all_flags_state` reads through the overlay and, before initialization, returns only the overridden flags. A wrong-type migration result keeps the marking of the evaluation it replaces. - `FileData.make_flag_with_value` gains an off form, which the override source uses so that a value-only override reports the OFF reason kind. The file data sources keep their existing form. The OVERRIDE specification's test vectors run as a spec through the full client stack. The per-evaluation summary marker in the vectors is asserted once the event processor carries it. Flag overrides are currently experimental and subject to change.
… changes The override layer keeps a dependency graph of its entries in each snapshot. The store expands every changed LaunchDarkly item through both its own graph and the layer's, to a fixpoint, so a change to a prerequisite flag or a segment that an override entry references notifies that entry's flag as well. This matches how dependent flags behave for LaunchDarkly data. The store's own dependency graph now keys items by string, the form in which the data model names prerequisites and segments. Changes keyed by symbol, which is what the change set carries, previously reached no dependents at all.
…e source from blocking the client Before initialization, all_flags_state returns a state of overrides alone only when the store is not initialized and the override store holds flags, and it reads those flags from the override store itself. An evaluation does the same for the flag it evaluates. Before, a configured source was enough: an empty override store over a store that held LaunchDarkly data without an init marker produced a valid state of that data, and an evaluation served it. The overlay no longer returns the override entries alone when the base store fails to list its items, so a client whose store fails reports an invalid state and logs the failure, as it does without a source. An exception from the source's start no longer prevents the client from starting: it is logged, the source is stopped, a snapshot it supplied is removed, and the client runs without overrides. Stopping the data system closes the sink before it stops the source, so a snapshot supplied during shutdown is ignored. In offline mode the SDK logs that the configured source is not started.
A source logs and retries a failed load, and raises a configuration error from its builder's build. If start raises anyway, the SDK logs it, stops the source, removes its snapshot, and the client runs without overrides.
When the evaluator raises for a flag that came from the override store, variation_detail and all_flags_state now report the EXCEPTION error reason with override_affected set, from the flag's own marker, as the events already do. all_flags_state also no longer raises NoMethodError when an evaluation raises: the failed flag has no evaluation state, so it reports no prerequisites. That crash predates overrides; it made the exception path of all_flags_state unreachable.
The FeatureStore interface documents its entities as hashes, and a custom store can return a plain hash. The evaluator raises on one, and the rescue then called override? on the hash, so variation_detail and all_flags_state raised NoMethodError instead of returning the EXCEPTION result they returned before overrides. A helper now reads the marker only from an object that has it. A spec also shows that a flag whose evaluation raises after a flag with prerequisites reports no prerequisites: block locals start fresh on each iteration.
…he store fails Overrides only add to the all flags state. When the store cannot list its flags, the state without overrides is invalid and empty, so with overrides it now holds the override store's flags and stays invalid, and the failure is logged as before. A client-side SDK bootstrapped from the state uses its flags whatever $valid says, so the overridden values still reach it.
…ields and unimplemented source methods, and skip the fan-out loop without overrides The sink now rejects a deleted entry before it replaces the layer; an override defines a flag or segment, and a deleted one shadowed the LaunchDarkly item with one that could not be evaluated. Building the dependency graph for change notifications no longer raises for an entry whose dependency fields cannot be read, as the layer's own graph already did, so the other entries are still notified. A source that does not implement start or stop, whose interface defaults raise NotImplementedError, no longer stops the client from starting or from stopping the rest of the data system. The store's dependency fan-out calls its own tracker once when no external graph is set, as before external graphs existed, so users without overrides keep the previous cost. The overrides example uses the data_system_config option and builds the configuration.
kinyoklion
force-pushed
the
rlamb/overrides-ruby-store-overlay
branch
from
November 6, 2026 23:47
a9befc7 to
1005ed0
Compare
Base automatically changed from
rlamb/overrides-ruby-model-evaluator
to
feat/overrides
November 6, 2026 23:53
kinyoklion
marked this pull request as ready for review
November 6, 2026 23:53
kinyoklion
added a commit
that referenced
this pull request
Nov 7, 2026
…ide-affected evaluations (#452) <!-- TERMAG_PR_BODY_BEGIN --> ## Summary This PR is stacked on #451 because it uses the override store and the marking that PR wires into the client. This change carries the override-affected marking from evaluation into analytics events, as the OVERRIDE specification requires. Event handling keys on the marking scalar that the client hands to the event processor, not on the evaluation reason. `EvalEvent` and `record_eval_event` gain an `override_affected` flag. The client sets it from the evaluation result for the evaluated flag, from each prerequisite record's own marking for prerequisite evaluations, and from the flag's own marker when an evaluation raises. An unknown flag is never marked. The event dispatcher produces no individual feature event and no debug event for a marked evaluation, whatever the flag's configuration requests. Marked evaluations appear in summary events only. The summarizer keys counters by version, variation, and the marker, so override-affected and other evaluations of the same flag, variation, and version accumulate into separate counters. The summary event writes `overrideAffected: true` on the marked counters only, following the existing `unknown` marker. Event ingestion must accept that property on summary counters before release. `all_flags_state` presents an override-affected flag with `trackEvents` false, `trackReason` false, and no `debugEventsUntilDate`, so a consumer bootstrapped from the state sends no individual events for it. The flag, its value, its version, and its reason stay in the state. When an evaluation raises, there is no evaluation result, so the flag's own override marker decides, as it does for the reason and for the event of a single evaluation. The specification vectors now also check the summary marker the client hands to the event processor for each evaluation. Verification: processor specs (no feature event, no debug event, marked counter, counter split, unmarked counters unchanged, marked prerequisite record), summarizer spec (split by marker), client specs (record arguments for direct, segment, prerequisite, unknown, and error cases; all-flags tracking fields including experiment tracking and details-only-for-tracked), and end-to-end payload specs through the real event processor (index plus marked summary only for an overridden flag, individual events for an unaffected prerequisite inside a marked evaluation, ordinary events when nothing is overridden). Full suite and RuboCop are clean. Each new spec was checked against a deliberate defect in the code it covers. The existing FDv1 and FDv2 file data sources keep their current behavior. This series does not change them; the override feature is additive. [SDK-3249](https://launchdarkly.atlassian.net/browse/SDK-3249) [SDK-3249]: https://launchdarkly.atlassian.net/browse/SDK-3249?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Analytics now threads an **`override_affected`** marker from evaluations into `EvalEvent` / `record_eval_event`. The client sets it from the evaluation result (and per-prerequisite marking for prereq records; flag-store marker on errors). > > **Event pipeline:** Override-affected evals still hit summary counters and index events, but **no feature or debug events** are emitted even when tracking or debug mode is on. The summarizer buckets counts by version, variation, and the marker; summary payloads add **`overrideAffected: true`** only on marked counters. > > **`all_flags_state`:** For override-affected flags, **`trackEvents`**, **`trackReason`**, and **`debugEventsUntilDate`** are cleared so bootstrapped clients do not send individual events; values/reasons stay present. > > Specs cover processor, summarizer, client wiring, OVERRIDE vectors (`summaryOverrideAffected`), and end-to-end payloads, plus **`RecordingEventProcessor`** for tests. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit e2e01d8. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- TERMAG_PR_BODY_END --> <!-- termag: box=i-0575d1c54853058d7 project=projects --> <sub>Opened from termag</sub>
kinyoklion
added a commit
that referenced
this pull request
Nov 12, 2026
<!-- TERMAG_PR_BODY_BEGIN --> BEGIN_COMMIT_OVERRIDE feat: Add experimental support for flag overrides, read from local JSON or YAML files or supplied by a custom override source feat: Mark evaluations that a flag override affected with `override_affected` in the evaluation reason, and count them under separate summary counters END_COMMIT_OVERRIDE Every change in this PR was already reviewed and merged through its own PR against `feat/overrides`: #449, #450, #451, #452, #453, #454, #484, #493. This PR merges the branch into `main` and adds nothing of its own. Flag overrides let an operator force flags and segments to known definitions on a running client, whether or not the client can reach LaunchDarkly, and remove the override when the incident is over. They are an option of the FDv2 data system (`LaunchDarkly::DataSystem::ConfigBuilder#overrides`), with a file-based source in `LaunchDarkly::Integrations::FileData.override_source`, and are experimental. `main` has one commit that `feat/overrides` does not (#490), and the two merge without conflicts. CI on `feat/overrides` @ 156611b is green on every job, Windows included. <!-- TERMAG_PR_BODY_END --> <!-- termag: box=i-0575d1c54853058d7 project=ruby-server-sdk --> <sub>Opened from termag</sub> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Adds **experimental flag overrides** so operators can force known flag/segment definitions at evaluation time without replacing LaunchDarkly streaming or polling. > > **Configuration & data path.** FDv2 gains an optional override source via `DataSystemConfig` / `ConfigBuilder#overrides`. When set, the client builds an override layer, overlays it on the feature store for reads, and wires the layer’s dependency graph into the main store so prerequisite/segment changes still fan out to affected flags. Contract tests advertise `flag-overrides` and can wire file paths through `LaunchDarkly::Integrations::FileData.override_source`. > > **File-based source.** New `FileData` plumbing (parse/merge, poller, reloader with in-place rewrite handling, optional `listen`-based watcher) backs `FileData.override_source` with polling or watching, duplicate-key policy, and resilient reload/retry. The `listen` gem is added for contract tests’ watching mode. > > **Evaluation & analytics.** Flag/segment models carry an internal override marker. The evaluator propagates **override-affected** marking through prerequisites and segment matches; `EvaluationReason` exposes `overrideAffected` in JSON when true. Override-affected evaluations are excluded from individual and debug events but get **separate summary counters** keyed by the marker. > > **Client behavior.** Before initialization (or when the store is unavailable), evaluations and `all_flags_state` can serve override entries only, with one-time warnings. Docs/examples shift to `data_system_config: ... .build` instead of passing raw builders. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 156611b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
keelerm84
added a commit
that referenced
this pull request
Dec 3, 2026
<!-- TERMAG_PR_BODY_BEGIN --> BEGIN_COMMIT_OVERRIDE feat: Add experimental support for flag overrides, read from local JSON or YAML files or supplied by a custom override source feat: Mark evaluations that a flag override affected with `override_affected` in the evaluation reason, and count them under separate summary counters END_COMMIT_OVERRIDE Every change in this PR was already reviewed and merged through its own PR against `feat/overrides`: #449, #450, #451, #452, #453, #454, #484, #493. This PR merges the branch into `main` and adds nothing of its own. Flag overrides let an operator force flags and segments to known definitions on a running client, whether or not the client can reach LaunchDarkly, and remove the override when the incident is over. They are an option of the FDv2 data system (`LaunchDarkly::DataSystem::ConfigBuilder#overrides`), with a file-based source in `LaunchDarkly::Integrations::FileData.override_source`, and are experimental. `main` has one commit that `feat/overrides` does not (#490), and the two merge without conflicts. CI on `feat/overrides` @ 156611b is green on every job, Windows included. <!-- TERMAG_PR_BODY_END --> <!-- termag: box=i-0575d1c54853058d7 project=ruby-server-sdk --> <sub>Opened from termag</sub> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Adds **experimental flag overrides**: optional per-key flag/segment definitions that win over LaunchDarkly data at evaluation time, configured via `LaunchDarkly::DataSystem::ConfigBuilder#overrides` and intended for incident response. > > The FDv2 data system wires an **override layer + overlay** on the feature store, starts/stops an `OverrideSource`, and exposes `override_items` so evaluations and `all_flags_state` can still serve override-only data before LaunchDarkly init. A new **file-based source** (`LaunchDarkly::Integrations::FileData.override_source`) loads JSON/YAML from local paths with merge/reload logic, polling or `listen`-based watching, and contract-test harness support (`flag-overrides` capability). Dependency tracking links LaunchDarkly store changes to override dependents for flag-change notifications. > > Evaluations that read override data are marked with **`override_affected`** on `EvaluationReason` (including transitive prereq/segment reads). Those evaluations **skip individual and debug analytics events** and appear only in **summary counters** tagged with `overrideAffected`. Docs/examples now call `.build` on data-system presets. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4cb8af9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> (cherry picked from commit 9e2452c) Ported to v9: the FDv2 file data source and its spec are the renamed file_data_source files, the FDv1 data system and file data source are gone, data kinds live in Interfaces::DataStore, Config takes data_system:, and the specs use the v9 MockFeatureStore and InMemoryFeatureStore. --------- Co-authored-by: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Co-authored-by: Jason Bailey <jbailey@launchdarkly.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: joker23 <2494686+joker23@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
This PR is stacked on #450 because it uses the override marker, the evaluator marking, and the reason indicator that PR adds.
This change adds the override layer that the OVERRIDE specification describes: a runtime-mutable collection of flag and segment definitions that takes precedence over LaunchDarkly data at the store read boundary, populated by an override source through a sink. With no override source configured the SDK behaves exactly as before. The file-based source, the events changes, and the contract test service follow in later PRs.
LaunchDarkly::Interfaces::Overrides::OverrideSourceandOverrideSinkdefine how a source supplies complete snapshots to the SDK. The sink accepts data model objects or hashes in the flag and segment data model. The SDK marks the entries itself.Impl::Overrides::Layerholds marked entries in an immutable hash that is swapped on update, so the layer holds exactly one snapshot at any instant and reads are lock-free.Impl::Overrides::Overlaysits at the store read boundary: a read for a key returns the override entry when one exists and the LaunchDarkly entry otherwise, an enumeration is the union with the override entry winning, and initialization status is the base store's alone.Impl::Overrides::Sinkapplies snapshots and notifies flag change listeners of every flag whose merged-view evaluation may have changed, including flags that depend on an overridden prerequisite or segment. It computes dependency edges over both the old and the new merged view, as the Go reference does.DataSystem::ConfigBuilder#overridesaccepts one override source builder, the samebuild(sdk_key, config)protocol as the data source builders. The FDv2 data system builds the source at construction, so an invalid configuration raises fromLDClient.newlike other invalid component configuration. It starts the source before its run loop, so the initial load is in effect before the constructor returns. An exception from the source'sstartdoes not prevent the client from starting: the SDK logs it, stops the source, removes any snapshot the source supplied, and the client runs without overrides (the SDK's own file source does not raise fromstart; a custom source could). It serves reads through the overlay. When the client closes, the sink stops accepting snapshots before the source is stopped, and an exception fromstopis logged. An offline client builds no source and logs a warning that the configured source is not started.The client consults the override store before the not-initialized short-circuit. An overridden flag is served before LaunchDarkly data arrives, read from the override store itself, and a flag that is not overridden still returns the client-not-ready default, even when a store without an init marker holds LaunchDarkly data for it.
all_flags_statereads through the overlay. Before initialization, when the store is not initialized and the override store holds flags, it returns a state of those flags alone, read from the override store, with a once-per-client warning; with no override flags the state is invalid, as it is without a source. Without a source this state is empty, because the SDK reports no flags before the store is initialized, so the override flags only add to what it reports; overrides never remove a flag from the state. A failure of the base store to list its flags propagates through the overlay, andall_flags_statelogs it as without a source. Without a source the state is then invalid and empty; with override flags it holds those flags and stays invalid, so the overrides only add to it. A client-side SDK bootstrapped from the state uses its flags whatever$validsays (js-client-sdk 3.x and the 4.x browser SDK only log a warning), so the overridden values still reach it. A wrong-type migration result keeps the marking of the evaluation it replaces. When the evaluator raises for a flag that came from the override store,variation_detailandall_flags_statereport theEXCEPTIONerror reason withoverride_affectedset, from the flag's own marker. This also fixes a pre-existing crash:all_flags_stateraisedNoMethodErrorwhen an evaluation raised, because the failed flag has no evaluation state; it now reports that flag with no prerequisites. The marker is read only from the SDK's model objects: a custom store can return a flag as a plain hash, as theFeatureStoreinterface documents, and such a flag never came from the override store, so its failed evaluation still returns the unmarkedEXCEPTIONresult instead of raising.A value-only override expands, through the file loading code from #449, into a flag that is on and serves its single value by fallthrough, which reports the FALLTHROUGH reason kind as the specification describes.
The OVERRIDE specification's test vectors (
spec/fixtures/override-vectors/vectors.json) run as a spec through the full client stack, checking value, variation index, and reason under the vectors' comparison rules. The vectors' per-evaluation summary marker is asserted once the event processor carries the marking, in the events PR.LaunchDarkly changes reach override dependents.
Layerkeeps a dependency graph of its entries in each snapshot, andStoreexpands every changed LaunchDarkly item through both its own graph and the layer's, to a fixpoint. A change to a prerequisite flag or a segment that an override entry references therefore notifies that entry's flag, the same way dependent flags are notified for LaunchDarkly data, and a chain may cross between LaunchDarkly data and overrides any number of times.The FDv2 store's defect that seeded its dependency fan-out with symbol keys, while
Impl::DependencyTrackerindexes dependents under string keys, is fixed onmainby #470, which the stack's base now includes. The fan-out helper here also compares keys as strings, which the fixpoint needs in any case, and the store spec keeps the #470 specs beside this PR's specs for the override layer.Verification: specs for the layer (marking, replacement, snapshot atomicity under concurrent writers), the overlay (precedence, union, deleted base items, base failure, initialization), the sink (added, removed, changed, and unchanged entries, dependency fan-out through prerequisites and nested segments, both merged views, no-listener path, base failure, serialized updates), the FDv2 wiring (construction, start order, overlay reads, stop, offline, availability unaffected), the client (not-ready gate, all-flags state, change notifications through the flag tracker, migration marker, lifecycle), and the specification vectors. Full suite and RuboCop are clean, and the full suite passes on JRuby 9.4 (the specs wait on queues without
Queue#pop's timeout, which Ruby 3.1 and JRuby 9.4 lack). Each new spec was checked against a deliberate defect in the code it covers.The existing FDv1 and FDv2 file data sources keep their current behavior. This series does not change them; the override feature is additive.
SDK-3249
Note
Overview
feat: Add the override store, overlay, and data system wiring
Adds experimental, runtime flag/segment overrides:
DataSystem::ConfigBuilder#overridesaccepts anOverrideSourcebuilder, FDv2 buildsLayer+Overlay+Sink, wiresStoreto cross-graph dependency notifications, and extends evaluator/reason plumbing so prerequisites, segments, and client APIs respect override markers while still documenting that the surface is experimental.Highlights
Impl::Overrides::{Layer,Overlay,Sink}) plusInterfaces::Overridescontracts mark model objects, merge overrides ahead of LD data, and fan-out flag-change listeners using merged dependency graphs.EvaluationReason, evaluator state, prerequisite records, migrations, andLDClientpaths (variation_detail,all_flags_state) now propagateoverrideAffected, handle uninitialized stores by consulting pure override snapshots, and keep JSON compatibility by emitting the bit only when true.start/stop), exposesoverride_items, and coordinates withStorevia external dependency graphs; specs/vectors cover layer semantics, notifier behavior, client flows, and file-data reloader timing fixes on coarse clocks.Reviewed by Cursor Bugbot for commit 1005ed0. Bugbot is set up for automated code reviews on this repo. Configure here.
The all-flags report keeps an override-affected flag's
trackEvents,trackReason, anddebugEventsUntilDatein this PR; #452 turns them off (OVERRIDE Requirement 1.4.1.1) together with the rest of the event policy for override-affected evaluations.Opened from termag