oz-policy-builder
CLI

synthesize

Run the decision tree on a Recording, emit a PolicySpec.

oz-policy-cli synthesize <RECORDING_FILE> [OPTIONS]

Reads a Recording JSON document from disk, runs the decision tree, and emits the resulting PolicySpec JSON to stdout. Pure in-process, no network calls. The schema is oz-policy-builder/v1.

Flags

FlagTypeDefaultDescription
RECORDING_FILEPathBuf (positional)requiredPath to a Recording JSON document.
--modeauto | compose-only | codegen-onlyautoSynthesis mode. auto permits both Track A composition and Track B generated slots. compose-only requires every constraint to fit an existing OZ primitive. codegen-only forces every constraint into a Generated slot.
--tightnessexact | small-margin | looseexactNumeric tightness applied to observed i128 constraints.
--lifetimeu32Lifetime in ledgers emitted as PolicySpec.lifetime_ledgers and (when applicable) SpendingLimit.period_ledgers.
--delegated-signerString (StrKey C-address)Contract address that takes over auth. When provided, the synthesizer emits exactly one Delegated signer instead of the per-recording observed signers.
--rule-nameStringruleHuman-readable name for the emitted ContextRuleSpec. Must be 20 UTF-8 bytes or fewer.

See Synthesis modes for what mode and tightness actually do.

Example

oz-policy-cli synthesize recording.json \
  --mode auto \
  --tightness exact \
  --lifetime 432000 \
  --rule-name "blend-claim" \
  > spec.json

Errors

Exit codeVariant
13E_SYNTH_NOT_EXPRESSIBLE (the decision tree cannot represent the recording within the framework's hard limits)

On this page