Skip to Content
The formatPolicies

Policies

A Policy decides who handles a case, by walking an ordered ladder of rules: the first rule whose condition holds and that produces someone wins. Anyone can read it and predict the answer.

policies/<slug>/POLICY.md, with its rules under rules/.

Fields

Besides the common fields:

FieldRequiredNotes
typeYesPolicy. No kind.
require_catch_allYestrue if the policy must end in a rule that catches every case.

The body is the policy’s description. A policy writes no links.

policies/aprobacion-de-compras/POLICY.md
--- type: Policy title: Aprobación de órdenes de compra name: aprobacion-de-compras require_catch_all: true created_at: 2026-10-15T15:47:35.165Z updated_at: 2026-10-16T12:01:34.655Z --- Quién aprueba una orden de compra según su franja de monto (`amount_band`: alta ≥ 20.000.000 ARS, media ≥ 5.000.000, baja el resto) y, en proveedores nuevos, siempre dirección.

Rules

Each rule is a Rule in rules/<nn>-<slug>.md, in the order the ladder is walked (position, from 0).

FieldRequiredNotes
typeYesRule.
positionYesIts step in the ladder.
titleYesWhat the rule says, in a line.
whenNoThe condition. Without it, the rule catches everything that reaches it.
thenYesWho handles the case.
policies/aprobacion-de-compras/rules/001-proveedor-nuevo-direccion.md
--- type: Rule position: 0 then: label: Martín method: fixed target: direccion/socio-comercial title: "Proveedor nuevo: dirección" when: op: equals path: supplier_new value: true created_at: 2026-10-15T15:47:35.165Z updated_at: 2026-10-16T12:01:34.655Z ---

Conditions

when reads the case being evaluated by path (supplier_new, amount_band, project.team):

opHolds when
existspath has a value.
equalspath equals value.
inpath is one of values.
allevery one of conditions holds.
anyat least one of conditions holds.
notcondition does not hold.

A value can be a literal or { from: "a.b.c" }, read from the case.

Outcomes

then.method says how the target is chosen:

methodChooses
fixedtarget, always. label is the name to show for it.
weightedone of candidates, at random by weight.
round_robinthe next of candidates in turn, optionally per partitionBy.
weighted_rotationthe next of candidates in a rotation that respects their weights, optionally per partitionBy.

candidates is a list of targets, or of { target, weight }; filter is a condition run on each candidate. A rule whose condition holds but whose outcome yields no one does not catch the case: the ladder moves on.