Skip to content

Evidence and reproduction ​

Shows that each runtime fact is true of the Smart Forms version it describes. A fact is either reproduced by a test that runs the published npm package, or backed by a source-only permalink into the Smart Forms source at that version's release commit.

Reproduction tests run the exact package versions the plugin has verified, installed as dev dependencies. Each test builds a small synthetic form, runs Smart Forms on it, and asserts what Smart Forms does. A reproduced fact names its test by file and full title, and a unit test fails if that test does not exist.

ComponentHarnessHow it runsFacts
populate 4.7.1populate.ts@aehrc/sdc-populate in plain Node, with a fetch callback that answers by URL, as the Smart Forms app's doesAll reproduced
template-extract 1.0.15extract.tsThe CommonJS build of @aehrc/sdc-template-extract, because its ESM build fails to import in NodeAll reproduced
renderer 1.4.0None yetThe renderer needs a browser environment, planned as the optional P9All source-only

The populate tests cover languages, prerequisites, names, embeddings, sourceQueries, variable storage and evaluation order; the template-extract tests cover contexts and template selection. Run them with npm test -- packages/plugin-smart-forms/test/reproduction.

Source permalinks point at the release commit of a version, not at a later checkout: f846e2d8 for renderer 1.4.0 and populate 4.7.1, and 0fca4c36 for template-extract 1.0.15. A cited file is checked to be the same at the release as in the code that was researched. A rule's message claims only what source-only evidence shows.

Verifying a new Smart Forms version ​

  1. Pin the new package version in the plugin's dev dependencies. For populate, also update the fhirclient override in the root package.json, which names the populate version.
  2. Run the reproduction tests against it, and add tests for any behaviour that changed.
  3. Add the version to the end of its list in compat.verified in src/index.ts, and record its facts in src/facts/, with their evidence. A fact whose upstream issue is fixed in the new version is left out for it.
  4. Where behaviour changed, update the rules, and run npm run corpus -- --smart-forms to see how the findings change.

Schema ​

Code ​

Where the facts come from and decisions S4, S10 and S11 in the design plan record how evidence works and why.