{
"primitive": "config",
"scenarios": [
{
"name": "set_then_get_roundtrips",
"steps": [
{ "op": "config.set", "args": { "key": "greeting", "value": "hello" } },
{ "op": "config.get", "args": { "key": "greeting" }, "expect": { "value": "hello" } },
{ "op": "config.get", "args": { "key": "missing" }, "expect": { "value": null } }
]
},
{
"name": "flag_default_then_on_off",
"steps": [
{ "op": "config.flag", "args": { "key": "f", "default": false }, "expect": { "value": false } },
{ "op": "config.set_flag_on", "args": { "key": "f" } },
{ "op": "config.flag", "args": { "key": "f", "default": false }, "expect": { "value": true } },
{ "op": "config.set_flag_off", "args": { "key": "f" } },
{ "op": "config.flag", "args": { "key": "f", "default": true }, "expect": { "value": false } }
]
},
{
"name": "delete_raw_and_flags_revert",
"steps": [
{ "op": "config.set", "args": { "key": "temp", "value": "stored" } },
{ "op": "config.delete", "args": { "key": "temp" }, "expect": { "value": true } },
{ "op": "config.get", "args": { "key": "temp" }, "expect": { "value": null } },
{ "op": "config.delete", "args": { "key": "temp" }, "expect": { "value": false } },
{ "op": "config.set_flag_on", "args": { "key": "gone" } },
{ "op": "config.flag", "args": { "key": "gone", "default": false }, "expect": { "value": true } },
{ "op": "config.delete_flag", "args": { "key": "gone" }, "expect": { "value": true } },
{ "op": "config.flag", "args": { "key": "gone", "default": false }, "expect": { "value": false } },
{ "op": "config.delete_flag", "args": { "key": "gone" }, "expect": { "value": false } },
{ "op": "config.set_flag_allow_list", "args": { "key": "allow", "entries": ["u1"] } },
{ "op": "config.flag", "args": { "key": "allow", "default": false, "targeting_key": "u1" }, "expect": { "value": true } },
{ "op": "config.flag", "args": { "key": "allow", "default": false, "targeting_key": "u2" }, "expect": { "value": false } },
{ "op": "config.set_flag_percent", "args": { "key": "pct0", "percent": 0 } },
{ "op": "config.flag", "args": { "key": "pct0", "default": false, "targeting_key": "u" }, "expect": { "value": false } },
{ "op": "config.set_flag_percent", "args": { "key": "pct100", "percent": 100 } },
{ "op": "config.flag", "args": { "key": "pct100", "default": false, "targeting_key": "u" }, "expect": { "value": true } }
]
},
{
"name": "namespace_isolation",
"note": "Config keys are scoped by Forge namespace. A value set under one namespace must not be visible under another.",
"steps": [
{ "op": "config.set", "args": { "key": "shared", "value": "from-a" }, "namespace": "app-a" },
{ "op": "config.get", "args": { "key": "shared" }, "namespace": "app-b", "expect": { "value": null } },
{ "op": "config.get", "args": { "key": "shared" }, "namespace": "app-a", "expect": { "value": "from-a" } }
]
},
{
"name": "typed_flag_values_and_details",
"steps": [
{ "op": "config.set_flag_value", "args": { "key": "bool", "value": true, "variant": "bool-v1" } },
{ "op": "config.flag_details", "args": { "key": "bool", "default": false }, "expect": { "shape": { "value_json": "true", "value_type": "boolean", "variant": "bool-v1", "reason": "static", "error_code": null } } },
{ "op": "config.set_flag_value", "args": { "key": "string", "value": "blue", "variant": "string-v1" } },
{ "op": "config.flag_details", "args": { "key": "string", "default": "red" }, "expect": { "shape": { "value_json": "\"blue\"", "value_type": "string", "variant": "string-v1" } } },
{ "op": "config.set_flag_value", "args": { "key": "integer", "value": 7, "variant": "integer-v1" } },
{ "op": "config.flag_details", "args": { "key": "integer", "default": 0 }, "expect": { "shape": { "value_json": "7", "value_type": "integer", "variant": "integer-v1" } } },
{ "op": "config.set_flag_value", "args": { "key": "float", "value": 1.5, "variant": "float-v1" } },
{ "op": "config.flag_details", "args": { "key": "float", "default": 0.0 }, "expect": { "shape": { "value_json": "1.5", "value_type": "float", "variant": "float-v1" } } },
{ "op": "config.set_flag_value", "args": { "key": "object", "value": { "palette": "dark" }, "variant": "object-v1" } },
{ "op": "config.flag_details", "args": { "key": "object", "default": {} }, "expect": { "shape": { "value_json": "{\"palette\":\"dark\"}", "value_type": "object", "variant": "object-v1" } } },
{ "op": "config.set_flag_percent", "args": { "key": "rollout", "percent": 44 } },
{ "op": "config.flag_details", "args": { "key": "rollout", "default": false, "targeting_key": "user-42" }, "expect": { "shape": { "value_json": "true", "value_type": "boolean", "variant": "on", "reason": "percent_in" } } },
{ "op": "config.flag_details", "args": { "key": "missing", "default": ["fallback"] }, "expect": { "shape": { "value_json": "[\"fallback\"]", "value_type": "array", "variant": null, "reason": "default_missing", "error_code": null } } }
]
}
]
}