FS FormScript

Duplication

One rule, web and API

The same eligibility rule means something different on web, mobile, and the API. That disagreement is a compliance incident.

what this buys you

  • Same values on both sides
  • Same validity verdict
  • Same error codes
  • Same output document
Language specification 1.0 · level 3 of 5

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.

forms
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.

Boundary. Rules that are not part of the form — authorization, fraud, inventory — stay on the server.