{
    "rules": [
        {
            "id": "Requirement 1.1.1",
            "machine_id": "requirement_1_1_1",
            "content": "The `API`, and any state it maintains SHOULD exist as a global singleton, even in cases wherein multiple versions of the `API` are present at runtime.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 1.1.2.1",
            "machine_id": "requirement_1_1_2_1",
            "content": "The `API` MUST define a `provider mutator`, a function to set the default `provider`, which accepts an API-conformant `provider` implementation.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.2.2",
            "machine_id": "requirement_1_1_2_2",
            "content": "The `provider mutator` function MUST invoke the `initialize` function on the newly registered provider before using it to resolve flag values.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.2.3",
            "machine_id": "requirement_1_1_2_3",
            "content": "The `provider mutator` function MUST invoke the `shutdown` function on the previously registered provider once it's no longer being used to resolve flag values.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.2.4",
            "machine_id": "requirement_1_1_2_4",
            "content": "The `API` SHOULD provide functions to set a provider and wait for the `initialize` function to complete or abnormally terminate.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 1.1.3",
            "machine_id": "requirement_1_1_3",
            "content": "The `API` MUST provide a function to bind a given `provider` to one or more clients using a `domain`. If the domain already has a bound provider, it is overwritten with the new mapping.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.4",
            "machine_id": "requirement_1_1_4",
            "content": "The `API` MUST provide a function to add `hooks` which accepts one or more API-conformant `hooks`, and appends them to the collection of any previously added hooks. When new hooks are added, previously added hooks are not removed.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.5",
            "machine_id": "requirement_1_1_5",
            "content": "The `API` MUST provide a function for retrieving the metadata field of the configured `provider`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.6",
            "machine_id": "requirement_1_1_6",
            "content": "The `API` MUST provide a function for creating a `client` which accepts the following options:  - domain (optional): A logical string identifier for binding clients to provider.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.1.7",
            "machine_id": "requirement_1_1_7",
            "content": "The client creation function MUST NOT throw, or otherwise abnormally terminate.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 1.2.1",
            "machine_id": "requirement_1_2_1",
            "content": "The client MUST provide a method to add `hooks` which accepts one or more API-conformant `hooks`, and appends them to the collection of any previously added hooks. When new hooks are added, previously added hooks are not removed.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.2.2",
            "machine_id": "requirement_1_2_2",
            "content": "The client interface MUST define a `metadata` member or accessor, containing an immutable `domain` field or accessor of type string, which corresponds to the `domain` value supplied during client creation.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 1.3.1",
            "machine_id": "condition_1_3_1",
            "content": "The implementation uses the dynamic-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.3.1.1",
                    "machine_id": "conditional_requirement_1_3_1_1",
                    "content": "The `client` MUST provide methods for typed flag evaluation, including boolean, numeric, string, and structure, with parameters `flag key` (string, required), `default value` (boolean | number | string | structure, required), `evaluation context` (optional), and `evaluation options` (optional), which returns the flag value.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 1.3.2",
            "machine_id": "condition_1_3_2",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.3.2.1",
                    "machine_id": "conditional_requirement_1_3_2_1",
                    "content": "The `client` MUST provide methods for typed flag evaluation, including boolean, numeric, string, and structure, with parameters `flag key` (string, required), `default value` (boolean | number | string | structure, required), and `evaluation options` (optional), which returns the flag value.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 1.3.3",
            "machine_id": "condition_1_3_3",
            "content": "The implementation language differentiates between floating-point numbers and integers.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.3.3.1",
                    "machine_id": "conditional_requirement_1_3_3_1",
                    "content": "The client SHOULD provide functions for floating-point numbers and integers, consistent with language idioms.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 1.3.4",
            "machine_id": "requirement_1_3_4",
            "content": "The `client` SHOULD guarantee the returned value of any typed flag evaluation method is of the expected type. If the value returned by the underlying provider implementation does not match the expected type, it's to be considered abnormal execution, and the supplied `default value` should be returned.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Condition 1.4.1",
            "machine_id": "condition_1_4_1",
            "content": "The implementation uses the dynamic-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.4.1.1",
                    "machine_id": "conditional_requirement_1_4_1_1",
                    "content": "The `client` MUST provide methods for detailed flag value evaluation with parameters `flag key` (string, required), `default value` (boolean | number | string | structure, required), `evaluation context` (optional), and `evaluation options` (optional), which returns an `evaluation details` structure.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 1.4.2",
            "machine_id": "condition_1_4_2",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.4.2.1",
                    "machine_id": "conditional_requirement_1_4_2_1",
                    "content": "The `client` MUST provide methods for detailed flag value evaluation with parameters `flag key` (string, required), `default value` (boolean | number | string | structure, required), and `evaluation options` (optional), which returns an `evaluation details` structure.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 1.4.3",
            "machine_id": "requirement_1_4_3",
            "content": "The `evaluation details` structure's `value` field MUST contain the evaluated flag value.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 1.4.4",
            "machine_id": "condition_1_4_4",
            "content": "The language supports generics (or an equivalent feature).",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.4.4.1",
                    "machine_id": "conditional_requirement_1_4_4_1",
                    "content": "The `evaluation details` structure SHOULD accept a generic argument (or use an equivalent language feature) which indicates the type of the wrapped `value` field.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 1.4.5",
            "machine_id": "requirement_1_4_5",
            "content": "The `evaluation details` structure's `flag key` field MUST contain the `flag key` argument passed to the detailed flag evaluation method.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.4.6",
            "machine_id": "requirement_1_4_6",
            "content": "In cases of normal execution, the `evaluation details` structure's `variant` field MUST contain the value of the `variant` field in the `flag resolution` structure returned by the configured `provider`, if the field is set.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.4.7",
            "machine_id": "requirement_1_4_7",
            "content": "In cases of normal execution, the `evaluation details` structure's `reason` field MUST contain the value of the `reason` field in the `flag resolution` structure returned by the configured `provider`, if the field is set.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.4.8",
            "machine_id": "requirement_1_4_8",
            "content": "In cases of abnormal execution, the `evaluation details` structure's `error code` field MUST contain an `error code`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.4.9",
            "machine_id": "requirement_1_4_9",
            "content": "In cases of abnormal execution (network failure, unhandled error, etc) the `reason` field in the `evaluation details` SHOULD indicate an error.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 1.4.10",
            "machine_id": "requirement_1_4_10",
            "content": "Methods, functions, or operations on the client MUST NOT throw exceptions, or otherwise abnormally terminate. Flag evaluation calls must always return the `default value` in the event of abnormal execution. Exceptions include functions or methods for the purposes for configuration or setup.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 1.4.11",
            "machine_id": "requirement_1_4_11",
            "content": "In the case of abnormal execution, the client SHOULD log an informative error message.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 1.4.12",
            "machine_id": "requirement_1_4_12",
            "content": "The `client` SHOULD provide asynchronous or non-blocking mechanisms for flag evaluation.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 1.4.13",
            "machine_id": "requirement_1_4_13",
            "content": "In cases of abnormal execution, the `evaluation details` structure's `error message` field MAY contain a string containing additional details about the nature of the error.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Requirement 1.4.14",
            "machine_id": "requirement_1_4_14",
            "content": "If the `flag metadata` field in the `flag resolution` structure returned by the configured `provider` is set, the `evaluation details` structure's `flag metadata` field MUST contain that value. Otherwise, it MUST contain an empty record.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 1.4.15",
            "machine_id": "condition_1_4_15",
            "content": "The implementation language supports a mechanism for marking data as immutable.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.4.14.1",
                    "machine_id": "conditional_requirement_1_4_14_1",
                    "content": "Condition: `Flag metadata` MUST be immutable.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 1.5.1",
            "machine_id": "requirement_1_5_1",
            "content": "The `evaluation options` structure's `hooks` field denotes an ordered collection of hooks that the client MUST execute for the respective flag evaluation, in addition to those already configured.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.6.1",
            "machine_id": "requirement_1_6_1",
            "content": "The API MUST define a mechanism to propagate a shutdown request to active providers.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.7.1",
            "machine_id": "requirement_1_7_1",
            "content": "The `client` MUST define a `provider status` accessor which indicates the readiness of the associated provider, with possible values `NOT_READY`, `READY`, `STALE`, `ERROR`, or `FATAL`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 1.7.2",
            "machine_id": "condition_1_7_2",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 1.7.2.1",
                    "machine_id": "conditional_requirement_1_7_2_1",
                    "content": "In addition to `NOT_READY`, `READY`, `STALE`, or `ERROR`, the  `provider status` accessor must support possible value `RECONCILING`.",
                    "RFC 2119 keyword": null,
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 1.7.3",
            "machine_id": "requirement_1_7_3",
            "content": "The client's `provider status` accessor MUST indicate `READY` if the `initialize` function of the associated provider terminates normally.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.7.4",
            "machine_id": "requirement_1_7_4",
            "content": "The client's `provider status` accessor MUST indicate `ERROR` if the `initialize` function of the associated provider terminates abnormally.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.7.5",
            "machine_id": "requirement_1_7_5",
            "content": "The client's `provider status` accessor MUST indicate `FATAL` if the `initialize` function of the associated provider terminates abnormally and indicates `error code` `PROVIDER_FATAL`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.7.6",
            "machine_id": "requirement_1_7_6",
            "content": "The client MUST default, run error hooks, and indicate an error if flag resolution is attempted while the provider is in `NOT_READY`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.7.7",
            "machine_id": "requirement_1_7_7",
            "content": "The client MUST default, run error hooks, and indicate an error if flag resolution is attempted while the provider is in `FATAL`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 1.7.8",
            "machine_id": "requirement_1_7_8",
            "content": "Implementations SHOULD propagate the `error code` returned from any provider lifecycle methods.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 2.1.1",
            "machine_id": "requirement_2_1_1",
            "content": "The provider interface MUST define a `metadata` member or accessor, containing a `name` field or accessor of type string, which identifies the provider implementation.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 2.2.1",
            "machine_id": "requirement_2_2_1",
            "content": "The `feature provider` interface MUST define methods to resolve flag values, with parameters `flag key` (string, required), `default value` (boolean | number | string | structure, required) and `evaluation context` (optional), which returns a `resolution details` structure.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 2.2.2",
            "machine_id": "condition_2_2_2",
            "content": "The implementing language type system differentiates between strings, numbers, booleans and structures.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 2.2.2.1",
                    "machine_id": "conditional_requirement_2_2_2_1",
                    "content": "The `feature provider` interface MUST define methods for typed flag resolution, including boolean, numeric, string, and structure.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 2.2.3",
            "machine_id": "requirement_2_2_3",
            "content": "In cases of normal execution, the `provider` MUST populate the `resolution details` structure's `value` field with the resolved flag value.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 2.2.4",
            "machine_id": "requirement_2_2_4",
            "content": "In cases of normal execution, the `provider` SHOULD populate the `resolution details` structure's `variant` field with a string identifier corresponding to the returned flag value.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 2.2.5",
            "machine_id": "requirement_2_2_5",
            "content": "The `provider` SHOULD populate the `resolution details` structure's `reason` field with `\"STATIC\"`, `\"DEFAULT\",` `\"TARGETING_MATCH\"`, `\"SPLIT\"`, `\"CACHED\"`, `\"DISABLED\"`, `\"UNKNOWN\"`, `\"STALE\"`, `\"ERROR\"` or some other string indicating the semantic reason for the returned flag value.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 2.2.6",
            "machine_id": "requirement_2_2_6",
            "content": "In cases of normal execution, the `provider` MUST NOT populate the `resolution details` structure's `error code` field, or otherwise must populate it with a null or falsy value.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 2.2.7",
            "machine_id": "requirement_2_2_7",
            "content": "In cases of abnormal execution, the `provider` MUST indicate an error using the idioms of the implementation language, with an associated `error code` and optional associated `error message`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 2.2.8",
            "machine_id": "condition_2_2_8",
            "content": "The implementation language supports generics (or an equivalent feature).",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 2.2.8.1",
                    "machine_id": "conditional_requirement_2_2_8_1",
                    "content": "The `resolution details` structure SHOULD accept a generic argument (or use an equivalent language feature) which indicates the type of the wrapped `value` field.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                },
                {
                    "id": "Requirement 2.2.9",
                    "machine_id": "requirement_2_2_9",
                    "content": "The `provider` SHOULD populate the `resolution details` structure's `flag metadata` field.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                },
                {
                    "id": "Requirement 2.2.10",
                    "machine_id": "requirement_2_2_10",
                    "content": "`flag metadata` MUST be a structure supporting the definition of arbitrary properties, with keys of type `string`, and values of type `boolean | string | number`.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 2.3.1",
            "machine_id": "requirement_2_3_1",
            "content": "The provider interface MUST define a `provider hook` mechanism which can be optionally implemented in order to add `hook` instances to the evaluation life-cycle.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 2.3.2",
            "machine_id": "requirement_2_3_2",
            "content": "In cases of normal execution, the `provider` MUST NOT populate the `resolution details` structure's `error message` field, or otherwise must populate it with a null or falsy value.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 2.3.3",
            "machine_id": "requirement_2_3_3",
            "content": "In cases of abnormal execution, the `resolution details` structure's `error message` field MAY contain a string containing additional detail about the nature of the error.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Requirement 2.4.1",
            "machine_id": "requirement_2_4_1",
            "content": "The `provider` MAY define an initialization function which accepts the global `evaluation context` as an argument and performs initialization logic relevant to the provider.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Condition 2.4.2",
            "machine_id": "condition_2_4_2",
            "content": "The provider defines an `initialize` function.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 2.4.2.1",
                    "machine_id": "conditional_requirement_2_4_2_1",
                    "content": "If the provider's `initialize` function fails to render the provider ready to evaluate flags, it SHOULD abnormally terminate.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 2.5.1",
            "machine_id": "requirement_2_5_1",
            "content": "The provider MAY define a mechanism to gracefully shutdown and dispose of resources.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Requirement 2.5.2",
            "machine_id": "requirement_2_5_2",
            "content": "After a provider's shutdown function has terminated successfully, the provider's state MUST revert to its uninitialized state.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 2.6.1",
            "machine_id": "requirement_2_6_1",
            "content": "The provider MAY define an `on context changed` function, which takes an argument for the previous context and the newly set context, in order to respond to an evaluation context change.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Requirement 3.1.1",
            "machine_id": "requirement_3_1_1",
            "content": "The `evaluation context` structure MUST define an optional `targeting key` field of type string, identifying the subject of the flag evaluation.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 3.1.2",
            "machine_id": "requirement_3_1_2",
            "content": "The evaluation context MUST support the inclusion of custom fields, having keys of type `string`, and values of type `boolean | string | number | datetime | structure`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 3.1.3",
            "machine_id": "requirement_3_1_3",
            "content": "The evaluation context MUST support fetching the custom fields by key and also fetching all key value pairs.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 3.1.4",
            "machine_id": "requirement_3_1_4",
            "content": "The evaluation context fields MUST have an unique key.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 3.2.1",
            "machine_id": "condition_3_2_1",
            "content": "The implementation uses the dynamic-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 3.2.1.1",
                    "machine_id": "conditional_requirement_3_2_1_1",
                    "content": "The API, Client and invocation MUST have a method for supplying `evaluation context`.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 3.2.2",
            "machine_id": "condition_3_2_2",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 3.2.2.1",
                    "machine_id": "conditional_requirement_3_2_2_1",
                    "content": "The API MUST have a method for setting the global `evaluation context`.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 3.2.2.2",
                    "machine_id": "conditional_requirement_3_2_2_2",
                    "content": "The Client and invocation MUST NOT have a method for supplying `evaluation context`.",
                    "RFC 2119 keyword": "MUST NOT",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 3.2.2.3",
                    "machine_id": "conditional_requirement_3_2_2_3",
                    "content": "The API MUST have a method for setting `evaluation context` for a `domain`.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 3.2.2.4",
                    "machine_id": "conditional_requirement_3_2_2_4",
                    "content": "The API MUST have a mechanism to manage `evaluation context` for an associated `domain`.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 3.2.3",
            "machine_id": "requirement_3_2_3",
            "content": "Evaluation context MUST be merged in the order: API (global; lowest precedence) - transaction - client - invocation - before hooks (highest precedence), with duplicate values being overwritten.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 3.2.4",
            "machine_id": "condition_3_2_4",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 3.2.4.1",
                    "machine_id": "conditional_requirement_3_2_4_1",
                    "content": "When the global `evaluation context` is set, the `on context changed` function MUST run.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 3.2.4.2",
                    "machine_id": "conditional_requirement_3_2_4_2",
                    "content": "When the `evaluation context` for a specific provider is set, the `on context changed` function MUST only run on the associated provider.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 3.3.1",
            "machine_id": "condition_3_3_1",
            "content": "The implementation uses the dynamic-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 3.3.1.1",
                    "machine_id": "conditional_requirement_3_3_1_1",
                    "content": "The API SHOULD have a method for setting a `transaction context propagator`.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 3.3.1.2",
            "machine_id": "condition_3_3_1_2",
            "content": "The SDK implements context propagation.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 3.3.1.2.1",
                    "machine_id": "conditional_requirement_3_3_1_2_1",
                    "content": "The API MUST have a method for setting the `evaluation context` of the `transaction context propagator` for the current transaction.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 3.3.1.2.2",
                    "machine_id": "conditional_requirement_3_3_1_2_2",
                    "content": "A `transaction context propagator` MUST have a method for setting the `evaluation context` of the current transaction.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 3.3.1.2.3",
                    "machine_id": "conditional_requirement_3_3_1_2_3",
                    "content": "A `transaction context propagator` MUST have a method for getting the `evaluation context` of the current transaction.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 3.3.2",
            "machine_id": "condition_3_3_2",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 3.3.2.1",
                    "machine_id": "conditional_requirement_3_3_2_1",
                    "content": "The API MUST NOT have a method for setting a `transaction context propagator`.",
                    "RFC 2119 keyword": "MUST NOT",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 4.1.1",
            "machine_id": "requirement_4_1_1",
            "content": "Hook context MUST provide: the `flag key`, `flag value type`, `evaluation context`, and the `default value`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.1.2",
            "machine_id": "requirement_4_1_2",
            "content": "The `hook context` SHOULD provide: access to the `client metadata` and the `provider metadata` fields.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 4.1.3",
            "machine_id": "requirement_4_1_3",
            "content": "The `flag key`, `flag type`, and `default value` properties MUST be immutable. If the language does not support immutability, the hook MUST NOT modify these properties.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 4.1.4",
            "machine_id": "condition_4_1_4",
            "content": "The implementation uses the dynamic-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 4.1.4.1",
                    "machine_id": "conditional_requirement_4_1_4_1",
                    "content": "The evaluation context MUST be mutable only within the `before` hook.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 4.2.1",
            "machine_id": "requirement_4_2_1",
            "content": "`hook hints` MUST be a structure supports definition of arbitrary properties, with keys of type `string`, and values of type `boolean | string | number | datetime | structure`..",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 4.2.2",
            "machine_id": "condition_4_2_2",
            "content": "The implementation language supports a mechanism for marking data as immutable.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 4.2.2.1",
                    "machine_id": "conditional_requirement_4_2_2_1",
                    "content": "Condition: `Hook hints` MUST be immutable.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 4.2.2.2",
                    "machine_id": "conditional_requirement_4_2_2_2",
                    "content": "Condition: The client `metadata` field in the `hook context` MUST be immutable.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 4.2.2.3",
                    "machine_id": "conditional_requirement_4_2_2_3",
                    "content": "Condition: The provider `metadata` field in the `hook context` MUST be immutable.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 4.3.1",
            "machine_id": "requirement_4_3_1",
            "content": "Hooks MUST specify at least one stage.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 4.3.2",
            "machine_id": "condition_4_3_2",
            "content": "The implementation uses the dynamic-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 4.3.2.1",
                    "machine_id": "conditional_requirement_4_3_2_1",
                    "content": "The `before` stage MUST run before flag resolution occurs. It accepts a `hook context` (required) and `hook hints` (optional) as parameters and returns either an `evaluation context` or nothing.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Condition 4.3.3",
            "machine_id": "condition_4_3_3",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 4.3.3.1",
                    "machine_id": "conditional_requirement_4_3_3_1",
                    "content": "The `before` stage MUST run before flag resolution occurs. It accepts a `hook context` (required) and `hook hints` (optional) as parameters. It has no return value.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 4.3.4",
            "machine_id": "requirement_4_3_4",
            "content": "Any `evaluation context` returned from a `before` hook MUST be passed to subsequent `before` hooks (via `HookContext`).",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.3.5",
            "machine_id": "requirement_4_3_5",
            "content": "When `before` hooks have finished executing, any resulting `evaluation context` MUST be merged with the existing `evaluation context`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.3.6",
            "machine_id": "requirement_4_3_6",
            "content": "The `after` stage MUST run after flag resolution occurs. It accepts a `hook context` (required), `flag evaluation details` (required) and `hook hints` (optional). It has no return value.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.3.7",
            "machine_id": "requirement_4_3_7",
            "content": "The `error` hook MUST run when errors are encountered in the `before` stage, the `after` stage or during flag resolution. It accepts `hook context` (required), `exception` representing what went wrong (required), and `hook hints` (optional). It has no return value.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.3.8",
            "machine_id": "requirement_4_3_8",
            "content": "The `finally` hook MUST run after the `before`, `after`, and `error` stages. It accepts a `hook context` (required) and `hook hints` (optional). There is no return value.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 4.3.9",
            "machine_id": "condition_4_3_9",
            "content": "`finally` is a reserved word in the language.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 4.3.9.1",
                    "machine_id": "conditional_requirement_4_3_9_1",
                    "content": "Instead of `finally`, `finallyAfter` SHOULD be used.",
                    "RFC 2119 keyword": "SHOULD",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 4.4.1",
            "machine_id": "requirement_4_4_1",
            "content": "The API, Client, Provider, and invocation MUST have a method for registering hooks.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.4.2",
            "machine_id": "requirement_4_4_2",
            "content": "Hooks MUST be evaluated in the following order:  - before: API, Client, Invocation, Provider - after: Provider, Invocation, Client, API - error (if applicable): Provider, Invocation, Client, API - finally: Provider, Invocation, Client, API",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.4.3",
            "machine_id": "requirement_4_4_3",
            "content": "If a `finally` hook abnormally terminates, evaluation MUST proceed, including the execution of any remaining `finally` hooks.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.4.4",
            "machine_id": "requirement_4_4_4",
            "content": "If an `error` hook abnormally terminates, evaluation MUST proceed, including the execution of any remaining `error` hooks.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.4.5",
            "machine_id": "requirement_4_4_5",
            "content": "If an error occurs in the `before` or `after` hooks, the `error` hooks MUST be invoked.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.4.6",
            "machine_id": "requirement_4_4_6",
            "content": "If an error occurs during the evaluation of `before` or `after` hooks, any remaining hooks in the `before` or `after` stages MUST NOT be invoked.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 4.4.7",
            "machine_id": "requirement_4_4_7",
            "content": "If an error occurs in the `before` hooks, the default value MUST be returned.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.5.1",
            "machine_id": "requirement_4_5_1",
            "content": "`Flag evaluation options` MAY contain `hook hints`, a map of data to be provided to hook invocations.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Requirement 4.5.2",
            "machine_id": "requirement_4_5_2",
            "content": "`hook hints` MUST be passed to each hook.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 4.5.3",
            "machine_id": "requirement_4_5_3",
            "content": "The hook MUST NOT alter the `hook hints` structure.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 5.1.1",
            "machine_id": "requirement_5_1_1",
            "content": "The `provider` MAY define a mechanism for signaling the occurrence of one of a set of events, including `PROVIDER_READY`, `PROVIDER_ERROR`, `PROVIDER_CONFIGURATION_CHANGED` and `PROVIDER_STALE`, with a `provider event details` payload.",
            "RFC 2119 keyword": "MAY",
            "children": []
        },
        {
            "id": "Requirement 5.1.2",
            "machine_id": "requirement_5_1_2",
            "content": "When a `provider` signals the occurrence of a particular `event`, the associated `client` and `API` event handlers MUST run.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.1.3",
            "machine_id": "requirement_5_1_3",
            "content": "When a `provider` signals the occurrence of a particular `event`, event handlers on clients which are not associated with that provider MUST NOT run.",
            "RFC 2119 keyword": "MUST NOT",
            "children": []
        },
        {
            "id": "Requirement 5.1.4",
            "machine_id": "requirement_5_1_4",
            "content": "`PROVIDER_ERROR` events SHOULD populate the `provider event details`'s `error message` field.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 5.1.5",
            "machine_id": "requirement_5_1_5",
            "content": "`PROVIDER_ERROR` events SHOULD populate the `provider event details`'s `error code` field.",
            "RFC 2119 keyword": "SHOULD",
            "children": []
        },
        {
            "id": "Requirement 5.2.1",
            "machine_id": "requirement_5_2_1",
            "content": "The `client` MUST provide a function for associating `handler functions` with a particular `provider event type`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.2.2",
            "machine_id": "requirement_5_2_2",
            "content": "The `API` MUST provide a function for associating `handler functions` with a particular `provider event type`.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.2.3",
            "machine_id": "requirement_5_2_3",
            "content": "The `event details` MUST contain the `provider name` associated with the event.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.2.4",
            "machine_id": "requirement_5_2_4",
            "content": "The `handler function` MUST accept a `event details` parameter.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.2.5",
            "machine_id": "requirement_5_2_5",
            "content": "If a `handler function` terminates abnormally, other `handler functions` MUST run.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.2.6",
            "machine_id": "requirement_5_2_6",
            "content": "Event handlers MUST persist across `provider` changes.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.2.7",
            "machine_id": "requirement_5_2_7",
            "content": "The `API` and `client` MUST provide a function allowing the removal of event handlers.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.3.1",
            "machine_id": "requirement_5_3_1",
            "content": "If the provider's `initialize` function terminates normally, `PROVIDER_READY` handlers MUST run.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.3.2",
            "machine_id": "requirement_5_3_2",
            "content": "If the provider's `initialize` function terminates abnormally, `PROVIDER_ERROR` handlers MUST run.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Requirement 5.3.3",
            "machine_id": "requirement_5_3_3",
            "content": "Handlers attached after the provider is already in the associated state, MUST run immediately.",
            "RFC 2119 keyword": "MUST",
            "children": []
        },
        {
            "id": "Condition 5.3.4",
            "machine_id": "condition_5_3_4",
            "content": "The implementation uses the static-context paradigm.",
            "RFC 2119 keyword": null,
            "children": [
                {
                    "id": "Conditional Requirement 5.3.4.1",
                    "machine_id": "conditional_requirement_5_3_4_1",
                    "content": "While the provider's `on context changed` function is executing, associated `RECONCILING` handlers MUST run.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 5.3.4.2",
                    "machine_id": "conditional_requirement_5_3_4_2",
                    "content": "If the provider's `on context changed` function terminates normally, and no other invocations have yet to terminate, associated `PROVIDER_CONTEXT_CHANGED` handlers MUST run.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                },
                {
                    "id": "Conditional Requirement 5.3.4.3",
                    "machine_id": "conditional_requirement_5_3_4_3",
                    "content": "If the provider's `on context changed` function terminates abnormally, and no other invocations have yet to terminate, associated `PROVIDER_ERROR` handlers MUST run.",
                    "RFC 2119 keyword": "MUST",
                    "children": []
                }
            ]
        },
        {
            "id": "Requirement 5.3.5",
            "machine_id": "requirement_5_3_5",
            "content": "If the provider emits an event, the value of the client's `provider status` MUST be updated accordingly.",
            "RFC 2119 keyword": "MUST",
            "children": []
        }
    ]
}