13 lines
424 B
XML
13 lines
424 B
XML
# InvariantRequiresAxiom: nodes with invariant=true must have level='Axiom.
|
|
# Apply as a post-schema constraint on individual Node records.
|
|
std.contract.custom (
|
|
fun label =>
|
|
fun value =>
|
|
if value.invariant && value.level != 'Axiom then
|
|
'Error {
|
|
message = "Node '%{value.id}': invariant=true requires level='Axiom (got '%{std.string.from value.level})"
|
|
}
|
|
else
|
|
'Ok value
|
|
)
|