Conformance suite

Every quillflow runtime (TypeScript today, .NET next) must pass these files. The browser and the server re-validate the same form, so they must agree exactly.

File What it pins
formulas.json Formula evaluation: { formula, ast, expect } with shared vars and today. Evaluate ast only; formula is for humans. expect: null means blank (also the result of an error).
forms/*.json Whole-form behaviour: a canonical definition, mocked dataSources responses, and cases.

Running a form case

  1. Load definition. If expect.definitionError is set (e.g. "cycle"), loading must fail with that error.
  2. Use today (default 2026-03-15) and language (default: the form's default language).
  3. Answer data-source requests from dataSources: the entry whose id matches and whose params are deep-equal. No match means the request fails.
  4. Apply values (flat paths → values, all at once) or data (a nested submission; unknown keys ignored).
  5. Wait until no data-source requests are pending, then compare:
    • valid: the form has no errors;
    • pages: page name → visible;
    • dataSources: id → idle | loading | ready | error;
    • fields: path → a subset of visible, required, readonly, value, label, hint, choices, plus errors (list of codes) and messages (list of rendered messages). note is a comment;
    • submission: deep-equal to the submitted data.

Editing

The JSON is generated. Edit the YAML under src/ and run npm run conformance:build. forms/cycle.json is written by hand, because the compiler refuses to produce a cyclic form. CI runs npm run conformance:check to catch stale JSON.