Promise. One document is the rule. Conforming runtimes return the same values, the same validity, the same error codes, and the same output.
Today. Node and the browser share this TypeScript engine — so you stop authoring the form rules twice. You still execute them on both sides (the browser for feedback; the server because the browser can be skipped). A second independent runtime (level 4) is not claimed yet.
One schema, two runtimes
The browser and the server read the same file. There is no second DTO to keep quietly in step.
One error dictionary
E-VAL-01 means the same thing in the console, in the API response and in the support ticket.
One place to change it
When the rule changes, the diff is one file — and the reviewer sees the rule, not a spread of conditionals.
form loan version = "1.0" {
field annual_income {
type = number
validate { min = 0 }
}
group guarantor {
field guarantor_name {
type = string
when = annual_income > 10000
required = true
}
}
output {
annual_income: number
guarantor.guarantor_name: string
}
}
When income is 8 000, guarantor_name is omitted from the output. When income is 25 000, it is required. Both sides must agree.