The small adventure
Forms evolve. A field team might collect one season with version 1.0 and add a
new question for version 1.1. Formulus already carries a schemaVersion through
its form and observation APIs, but forms loaded from bundle storage are
currently assigned the hard-coded version 1.0.
Help Formulus read the version written by the form author, while keeping old
forms working. Tiny change, important provenance.
Where to start
formulus/src/services/FormService.ts
formulus/src/services/__tests__/FormService.test.ts
formulus/src/components/common/FormCard.tsx
formulus/src/webview/FormulusMessageHandlers.ts
formulus/AGENTS.md
Look at the FormSpec type and follow where schemaVersion is displayed and
passed across the WebView bridge before changing the loader.
Expected behavior
- If the root of
schema.json contains a non-empty string
schemaVersion, use it as the FormSpec.schemaVersion.
- Otherwise, if it contains a non-empty string
version, use that value.
- If neither is present, preserve the current fallback of
1.0 so existing
bundles continue to load.
- Values that are missing, blank, or not strings should use the fallback.
If the repository's current form specification says something different when
you begin, stop and ask before changing the precedence. The public form contract
wins over this draft.
What to change
- Replace the hard-coded assignment in
FormService with the behavior above.
- Add tests for
schemaVersion, version, precedence when both exist, and the
fallback for absent or invalid values.
- Remove the nearby
TODO once the behavior is covered.
- Keep the change local to loading form metadata; do not redesign the form
bundle format.
Done when
Verify it
From formulus/:
pnpm run lint
pnpm run format:check
pnpm run test --ci --watchAll=false
What you will meet along the way
This issue follows a form from its bundle files into Formulus and toward the
WebView bridge. That is one of ODE's central routes: portable JSON form
definitions become offline observations with enough metadata to make sense
later.
AI tools are welcome, not required
An assistant can help locate every schemaVersion reference or draft table
tests. Please inspect those references yourself and mention in the PR where the
value goes after FormService. Understanding the data's journey matters more
than producing the four-line fix quickly.
The small adventure
Forms evolve. A field team might collect one season with version 1.0 and add a
new question for version 1.1. Formulus already carries a
schemaVersionthroughits form and observation APIs, but forms loaded from bundle storage are
currently assigned the hard-coded version
1.0.Help Formulus read the version written by the form author, while keeping old
forms working. Tiny change, important provenance.
Where to start
formulus/src/services/FormService.tsformulus/src/services/__tests__/FormService.test.tsformulus/src/components/common/FormCard.tsxformulus/src/webview/FormulusMessageHandlers.tsformulus/AGENTS.mdLook at the
FormSpectype and follow whereschemaVersionis displayed andpassed across the WebView bridge before changing the loader.
Expected behavior
schema.jsoncontains a non-empty stringschemaVersion, use it as theFormSpec.schemaVersion.version, use that value.1.0so existingbundles continue to load.
If the repository's current form specification says something different when
you begin, stop and ask before changing the precedence. The public form contract
wins over this draft.
What to change
FormServicewith the behavior above.schemaVersion,version, precedence when both exist, and thefallback for absent or invalid values.
TODOonce the behavior is covered.bundle format.
Done when
1.0.Verify it
From
formulus/:pnpm run lint pnpm run format:check pnpm run test --ci --watchAll=falseWhat you will meet along the way
This issue follows a form from its bundle files into Formulus and toward the
WebView bridge. That is one of ODE's central routes: portable JSON form
definitions become offline observations with enough metadata to make sense
later.
AI tools are welcome, not required
An assistant can help locate every
schemaVersionreference or draft tabletests. Please inspect those references yourself and mention in the PR where the
value goes after
FormService. Understanding the data's journey matters morethan producing the four-line fix quickly.