You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Policies are JSON-only today. Support YAML as a first-class policy format: the same schema (YAML is
a superset, so every existing policy has a 1:1 YAML twin), plus YAML custom tags — the ! prefix —
as declarative transformation functions inline in the policy:
Tags are data, not code: a fixed whitelist of transformation tags (e.g. !length, !json_decode, !lower) parsed with a safe YAML loader — an unknown tag is a validation error,
never an arbitrary constructor. This keeps the format Builder-friendly.
The tags are surface syntax over the same transformation pipeline planned for condition.transform — one implementation, two spellings. A minimal function set can ship with
the format; the fuller coercion layer (dates, CIDR, sizes) extends it later.
Each transformation step wraps errors per value (a failed decode is a provider error on that
resource, not a crashed run).
tirith lint / tirith fmt (feat(cli): tirith lint and tirith fmt #366) must accept and format YAML policies; validation and the
interactive builder round-trip both formats.
Acceptance. A .yaml policy evaluates identically to its JSON twin; ! tags apply the shared
transformations with per-value error handling; an unknown tag fails validation with a clear
message; tirith lint/fmt handle YAML; docs show a side-by-side JSON/YAML example.
Policies are JSON-only today. Support YAML as a first-class policy format: the same schema (YAML is
a superset, so every existing policy has a 1:1 YAML twin), plus YAML custom tags — the
!prefix —as declarative transformation functions inline in the policy:
Design constraints
!length,!json_decode,!lower) parsed with a safe YAML loader — an unknown tag is a validation error,never an arbitrary constructor. This keeps the format Builder-friendly.
condition.transform— one implementation, two spellings. A minimal function set can ship withthe format; the fuller coercion layer (dates, CIDR, sizes) extends it later.
resource, not a crashed run).
tirith lint/tirith fmt(feat(cli):tirith lintandtirith fmt#366) must accept and format YAML policies; validation and theinteractive builder round-trip both formats.
Acceptance. A
.yamlpolicy evaluates identically to its JSON twin;!tags apply the sharedtransformations with per-value error handling; an unknown tag fails validation with a clear
message;
tirith lint/fmthandle YAML; docs show a side-by-side JSON/YAML example.