Snapshot Format
Knob-definition files, snapshots and patches all share one JSON schema,
schema_version: 1, parsed strictly by detent/json_schema.hh and
detent/json_patch.hh in the detent::detent target.
Live Snapshot
Section titled “Live Snapshot”{ "schema_version": 1, "version": 42, "published_at": "2026-10-09T09:16:59Z", "knobs": { "checkout:killswitch_new_path": { "default": 0 }, "search:max_results": { "default": 25 }, "payments:new_processor": { "default": 0, "overrides": { "employees": 1, "beta": { "rollout_pct": 50 } }, "rollout_pct": 10, "rollout_value": 1 } }}| Field | Required | Meaning |
|---|---|---|
schema_version | yes | Exactly 1 |
version | yes | Positive 64-bit integer |
published_at | no | RFC 3339 UTC timestamp, informational |
knobs | yes | Object mapping knob names to definitions |
Knob-Definition File
Section titled “Knob-Definition File”A knob-definition file has the same shape without version and
published_at; including either field is a schema error. parse_defaults
reads it, and the test writer’s GenerationWriter::publish_json publishes one
as a real generation (see Testing).
{ "schema_version": 1, "knobs": { "checkout:killswitch_new_path": { "default": 0 } }}A patch uses the snapshot shape with two differences:
- It contains only the knobs that changed.
- A knob mapped to
nullis deleted from the live snapshot.
{ "schema_version": 1, "version": 43, "knobs": { "search:max_results": { "default": 50 }, "checkout:old_flag": null }}This follows JSON Merge Patch (RFC 7396) at knob granularity: each knob is replaced or deleted as a unit.
Strictness
Section titled “Strictness”The parser rejects the whole document, never part of it, when it finds:
- Invalid JSON or invalid UTF-8.
- A missing required field, or a field of the wrong JSON type.
- Any unknown field, at the top level or inside a definition.
- A duplicate key: top-level field, knob name or group name.
- An invalid knob name or group name.
- A value that is not a JSON integer, such as
trueor1.0, or one outside the signed 64-bit range. rollout_pctoutside0–100, or a group override that is neither an integer nor{"rollout_pct": N}.- A
rollout_valuewithout a percentage, or a percentage without arollout_value. - More knobs than the caller’s
max_knobs(default 100,000). - A document larger than 16 MiB, or nested too deeply.
The parser returns an UpdateError naming the category; nothing is
published.
Wire Formats Beyond JSON
Section titled “Wire Formats Beyond JSON”The durable authority and managed agents use a narrow, versioned MessagePack schema for snapshots, exact-base deltas and progress records, inside bounded raw or zstd frames. It carries the same definitions plus per-namespace and per-key revisions. It’s an internal protocol between Detent components, not a publishing format; publishers speak JSON. See Delivery and Local Images.