Expand description
keel doctor --effective-policy — show the composed policy the core is
given (the defaults/E005 CCR: front ends and CLI compose
defaults < packs < user before keel_configure; the core layers no
pack underneath, contracts/core-ffi.h).
effective_policy is the Rust twin of Python’s
keel._defaults.apply_pack_defaults and Node’s
defaults.mjs::applyPackDefaults: merge granularity is per KEY of
defaults.outbound / defaults.llm (a higher layer replaces a key it sets
wholesale, fills in the rest), and target tables pass through untouched —
the engine resolves target → defaults precedence per key at execute time.
The three implementations must agree byte-for-byte; the cross-language
parity test in tests/cli.rs runs all three over the same fixture.
The Level 0 layer is the frozen smart-defaults pack itself,
contracts/defaults.toml, embedded with include_str! so the binary and
the contract can never drift (“this document ships compiled into the
binary”). The printed policy is the PRE-resolution merge — cache = { mode = "dev" } stays symbolic (the front ends resolve it against KEEL_ENV at
run time), keeping the --json twin byte-deterministic.
Functions§
- effective_
policy - Compose the effective policy:
defaults < packs < user, per-key wholesale on thedefaults.outbound/defaults.llmtables, target tables untouched. Returns a NEW value; the input is never borrowed mutably. Idempotent on the embedded Level 0 policy. Byte-identical (as sorted JSON) to Pythonapply_pack_defaultsand NodeapplyPackDefaultsover the same inputs. - llm_
pack_ fragment - The generic
[defaults.llm]pack fragment — what the provider packs and the AI-SDK middleware contribute (Pythonprovider_defaults(), NodellmPack.defaults()). Folding it is the identity over the embedded defaults, by construction. - run
- Run
keel doctor --effective-policyforproject.