Skip to content

feat(wes): add the I/O Schema form (proposal) - #613

Merged
uniqueg merged 26 commits into
feat/io-schemafrom
feat/io-form-proposal
Dec 4, 2026
Merged

uniqueg merged 26 commits into
feat/io-schemafrom
feat/io-form-proposal

Conversation

@uniqueg

@uniqueg uniqueg commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Part of #444

This merges into the integration branch feat/io-schema, a branch off dev that won't be released, so that the full I/O Schema integration can run in ELIXIR On-Cloud. It was built before the open design questions of #444 are answered, and they stay listed below: they still steer the work, and anything @anuragxxd decides differently gets changed or rolled back on feat/io-schema. The split into reviewable PRs (see Q7) applies to the later step from feat/io-schema into dev, which needs his review.

What it does

ecc-client-ga4gh-wes-io-form renders the input form of a workflow from its GA4GH IO Schema (profile 0.3.0, pinned at ga4gh-io-schema 2c3dc49). It validates the values in the browser and emits ecc-io-form-changed with {values, valid, errors}. The structure is schema → field descriptors → controls, so the rendering layer can be swapped.

All planned steps are on the branch:

  • S1 Offline check of IO schemas against the profile's meta-schema (bundled; nothing is fetched), plus a compiled validator of the input values. Errors carry JSON Pointers. It sits behind an IoSchemaValidator interface, with @hyperjump/json-schema as the default. scripts/sync-io-schema.mjs copies the profile, its conformance suite and its examples from a checkout at the pin.
  • S2 File reference value checks by the profile's rules: scheme allow-list, path rules, percent-encoded ... The output URI checks moved here from run-output.
  • S3 Renderer for the profile's Markdown subset (markdown-it, html: false, own link and image rules). It is behind setDescriptionFormat() and plain text is the default (Q4).
  • S4 The form element: controls by type, format and enum (text, number, checkbox, select, date, time, date-time, groups for objects, JSON for the rest), defaults prefilled, unset inputs left out, errors at their input. It comes with a docs page, a docs-app demo with the profile's example workflows, and a changeset.
  • S5 Widget hints (x-ga4gh-ui-widget): textarea, slider, multi-select, typeahead, color, tags, radio (as a dropdown) and switch (as a checkbox), each with the profile's fit rules and a fallback to the type's control.
  • S6 File reference fields (x-ga4gh-file, also as a union branch): a text field for a URI or relative path, with the allowed schemes shown. Refused values make the form invalid, and refused defaults aren't prefilled. The checks follow the schema, not the controls, so union branches the form doesn't show, tags, tuples, maps, contains, dependentSchemas and then/else are checked too; in a union, a string that a branch without a file reference takes (by type, const, enum, pattern) isn't checked as a file reference.
  • S7 x-ga4gh-error-message (outermost wins, once per location), and hidden inputs (x-ga4gh-hidden) under "Advanced", except those that must be set or fail.
  • S8 List editor for arrays (add and remove within minItems/maxItems) and a branch chooser for anyOf/oneOf.
  • S9 allOf branches with properties shown as sections (nf-core parameter groups); the demo includes nf-core fetchngs.
  • Public helpers in @elixir-cloud/wes/utils: checkIoSchema, setIoSchemaValidator, checkFileValue, setDescriptionFormat.

Open questions for @anuragxxd (with the default this branch uses)

  1. Library: the branch uses its own renderer on @elixir-cloud/design. The alternatives were JSON Forms core with Lit renderers, RJSF in a React island, jsfe, or remote's headless library.
  2. Validator: the branch uses @hyperjump/json-schema (no 'unsafe-eval' needed in the host page's CSP, about 90 KiB) rather than Ajv 2020 (about 44 KiB, but it needs 'unsafe-eval'). Swapping is one setIoSchemaValidator() call. Do you know whether Krini or the docs app set a CSP?
  3. Place and name: the branch puts ecc-client-ga4gh-wes-io-form in @elixir-cloud/wes. The alternative is a shared @elixir-cloud/io-schema package that also holds the checks and the Markdown renderer.
  4. Markdown: plain text is the default; the markdown-it renderer is built but switched off (setDescriptionFormat('markdown')). Your answer only flips that switch. markdown-it is in the bundle either way.
  5. Missing primitives: the branch renders radio as a dropdown and switch as a checkbox, which the profile allows. The alternative is adding a radio group, switch and tag input to @elixir-cloud/design first.
  6. Event payload: the branch emits {values, valid, errors} (errors as JSON Pointer + message) rather than only {values, valid}.
  7. Split: for the step from feat/io-schema into dev, the work would be split into 9 PRs, one per step S1–S9, or fewer, bigger ones if you prefer.
  8. Tests: the branch keeps WTR + @open-wc/testing, as in feat(wes): show one output by its viewer hint #609, while test: set up unit, integration and e2e tests #484 is open.
  9. Lit: the branch stays on Lit 2.8 and would move with the rest of the packages if they go to Lit 3.

Notes for review

  • Test runner config (shared by all packages): nodeResolve.browser: true, plus a small shim that serves hyperjump's CommonJS dependencies (content-type, idn-hostname, punycode) with their named exports. The other packages' suites pass with it locally.
  • hyperjump settings are global to the page: retrieval over HTTP(S) is off and format assertion is on. This is documented on the I/O Schemas page.
  • Bundle size: hyperjump and markdown-it are new dependencies of @elixir-cloud/wes.
  • Limits: the field walk stops at cyclic references and at 1000 fields, and inputs with more than 1000 properties or lists with more than 1000 items are edited as JSON; references inside embedded $id resources aren't followed for fields. The file value walk follows references by JSON Pointer, $anchor and $id (also inside embedded resources), is linear in the schema size per value, has a node budget and refuses values nested more than 64 levels deep (fail closed). It walks both then and else, whatever if says.
  • Names with #: hyperjump decodes URI fragments with decodeURI, which keeps %23, so pointers to names with # found nothing. The registered copy of a schema gives such subschemas of the root resource a generated $anchor (ecc-location-N) and points local $refs at it; error locations stay JSON Pointers and the document stays unchanged. Inside embedded $id resources such names still can't be used.
  • Pre-commit hook: commits were made with HUSKY=0, because the hook's docs build needs Google Fonts, which the agent sandbox blocks by default. I ran lint and the docs build by hand instead, and both passed.

How it was verified

  • WES package: 896 tests pass in Chromium and in Firefox (web-test-runner). This covers the profile's conformance suite (all valid cases accepted, all invalid ones rejected), its example schemas, the file reference vectors, the Markdown security cases, the field descriptors and the form element (widgets, files, error messages, hidden inputs, lists, unions, sections). Every fix of the review threads starts with a test that failed before it. WebKit can't launch on the agent host, so it runs in CI only.
  • npm run build of the WES package, lint and the docs build pass (the docs build needs Google Fonts).
  • The TES, TRS, cloud-registry and service-registry test suites pass with the changed shared config. ecc-utils-design has one Chromium failure: a code-editor test loads an Ace worker from a CDN. It fails the same way on dev's config.
  • Reviews (adversarial and quality) on S1–S3, S4 and S5–S9, plus a second adversarial round on the S5–S9 fixes. Fixed: an embedded $id that collides with the profile (high); exponential field expansion through references (high); file checks that depended on the union branch shown (high); unchecked file references in tags, tuples and maps; nested allOf sections beyond the field cap; state of later list items after a removal; repeated field walks with long lists; an emptied required list being dropped; accessible names of controls and buttons; from the second round, file checks refusing presets and free text next to a file branch, an exponential walk through branching references, refused list defaults removed at shifted indexes, unwalked applicators (then/else, dependentSchemas, unevaluated*, contains), and deep values skipped instead of refused.
  • Sourcery's 20 threads: 18 fixed (names with #, references in annotation schemas, file checks behind any reference and nested branch constraints, $ref siblings, allOf required, union defaults, numeric list items, field limits, null inputs, emptied list items, __proto__ inputs, file text, slider bounds, validator rejections, the stale-schema test, docs), 2 declined (below). The element is also defined only once, so hosts that load the React wrapper first don't fail.
  • Adversarial review of these fixes, two rounds. Fixed from the first: annotation schemas inside embedded resources refused (high, a regression of the fixes), annotation schemas under names with #, file checks failing open behind references the resolver missed, slider edge cases, a stack overflow on left-recursive union defaults, and __proto__ group defaults. Fixed from the second (last) round: exponential union defaults on recursive trees (high), file checks behind a $dynamicRef to another dynamic target (now every schema with its anchor name is walked), sliders looping on huge bounds, and references to the meta-schemas refusing values. Documented: names with # inside an embedded $id resource still can't be addressed (hyperjump).
  • CI: all checks pass at 2b9ca89 (Lint, Test on Node 22 and 24, Codecov patch and project, Sourcery, Read the Docs preview: https://cloud-components--613.org.readthedocs.build/en/613/).

Declined review findings

  • Sourcery: make the file checks follow only the applicable branches and track evaluated properties (medium). The walk is fail-closed: it may refuse what validation accepts, never less; branch-level results come with validateAt in feat(wes): build run requests from I/O Schemas (proposal) #614.
  • Sourcery: time-limit schema patterns (medium). They run in every JSON Schema validator; a worker-based validator can be plugged in through setIoSchemaValidator.
  • Sourcery: notify mounted components when setDescriptionFormat changes (medium). Documented as a setting to call before the components render, pending Q4.
  • When an anyOf/oneOf branch reaches its keyword through $ref, its own failure is shown next to the summary message (low). hyperjump's BASIC output has no keyword path through $ref to filter by; it's cosmetic.
  • Load markdown-it lazily (medium, quality). Deferred until Q4 is answered: if Markdown stays off, the renderer can go; if it's on, it's needed anyway.
  • Split io-form.ts (about 1100 lines) into modules, de-duplicate the isObject and scheme helpers, move IoFormChange next to the event, and add a --check mode to the sync script (low, quality). They'll be done when the work is split into PRs for dev.
  • Native accessible names inside the design package's select and checkbox (quality): the form sets aria-label on them; the gap is in @elixir-cloud/design, out of scope here.
  • Time-only values (format: time) are converted with the browser's current UTC offset, so across a DST change the offset can differ from the day the workflow runs (low). A time without a date has no better offset.

🤖 Generated with Claude Code

Summary by Sourcery

Add a GA4GH IO Schema-driven workflow input form with browser validation and an event carrying input values and errors.

New Features:

  • Add the ecc-client-ga4gh-wes-io-form component to render and validate workflow inputs from GA4GH IO Schema Profile 0.3.0, with typed controls, schema-driven widgets, defaults, lists, unions, sections, hidden inputs, and file references.
  • Emit ecc-io-form-changed with current values, validity, and JSON Pointer-based errors, and expose schema, file-value, and description-format helpers through @elixir-cloud/wes/utils.
  • Add a WES documentation page and interactive examples demonstrating the new form.

Bug Fixes:

  • Apply the shared file-reference URI checks to run outputs and reject values that violate the IO Schema profile's output URI rules.

Enhancements:

  • Add an optional, opt-in Markdown renderer for IO Schema descriptions in both the input form and run-output component; plain text remains the default.

Build:

  • Add Hyperjump JSON Schema and markdown-it dependencies to the WES package, plus Rollup CommonJS, JSON, and dev-server support needed for browser tests.

Documentation:

  • Document the supported IO Schema profile, offline schema and value validation, file-reference rules, description rendering, and the new form's API and usage.

Tests:

  • Add profile conformance, file-value, Markdown security, validator, field descriptor, and form interaction tests; include the new form in WES theming coverage.

Chores:

  • Bundle the pinned profile meta-schema, vocabularies, conformance cases, file-value vectors, and examples, with a script to synchronize them from the profile repository.

uniqueg and others added 5 commits December 3, 2026 07:20
Bundle the GA4GH IO Schema Profile 0.3.0 (meta-schema and vocabularies,
pinned at ga4gh-io-schema 2c3dc49, the pin of #609) and check IO schemas
offline: $schema names the profile, the meta-schema passes with format
assertion, and every $ref resolves within the document. A valid schema
comes with a validator of its input values, whose errors carry JSON
Pointers, the failed keyword and a message.

The validator is @hyperjump/json-schema (no 'unsafe-eval' needed),
behind the internal IoSchemaValidator interface, so that the component
owner can swap it (open question 2 of #444).

scripts/sync-io-schema.mjs copies the profile, its conformance suite,
file-value vectors and example schemas from a checkout at the pin. The
tests run the whole conformance suite and the examples offline.

The test runner now takes the browser builds of dependencies and serves
the CommonJS dependencies of hyperjump (content-type, idn-hostname,
punycode) as modules with their named exports.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Move the URI check of run-output into a shared module
(src/io-schema/files.ts) and add the input rules of the profile: paths
only where the file reference has no `schemes`, no `..` segments (also
percent-encoded), no leading `~` or two slashes, absolute paths only
where allowed, and `schemes` narrowing the deployment's allow-list.
run-output keeps its behaviour and re-exports the shared helpers.

The tests run the profile's file-value vectors (33 cases).

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add one renderer for the profile's Markdown subset, on markdown-it:
raw HTML as escaped text, images as their alt text, links only with an
allowed scheme (else their text; they open in a new window without
referrer), and of GFM only tables, strikethrough and autolinks (www.
and bare URLs, not bare host names). It produces the profile's example
HTML exactly. Its output is the only HTML that goes through unsafeHTML.

Descriptions stay plain text by default, as the proposal's default for
open question 4 of #444: setDescriptionFormat("markdown") switches the
components to Markdown. run-output takes its descriptions from the same
template, unchanged by default.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add ecc-client-ga4gh-wes-io-form. It checks the IO schema offline,
describes its inputs as field descriptors (schema -> descriptors ->
controls) and renders them with the design components by type, format
and enum: text, number, checkbox, select, date, time, date-time,
groups for objects and JSON for the rest. Defaults are prefilled,
unset inputs are left out, and every change emits
ecc-io-form-changed with {values, valid, errors}.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings on the schema checks:

- An embedded $id that collides with a schema in use (e.g. the
  profile) is refused without unregistering that schema; the profile
  is registered again if something removed it; checks never reject.
- Documents are registered under their own absolute $id, so
  references by it resolve; embedded $ids are resolved against their
  resource, so error locations point into embedded resources.
- References in outputs and top-level $defs must resolve, too.
- Checks run one after the other (hyperjump's registry is global).

Also export the checks, the validator switch and the description
format from @elixir-cloud/wes/utils, and document them.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Data structures

Define the form’s change-event payload and expose the schema, file-reference, and description helpers as package APIs.

  • packages/ecc-client-ga4gh-wes/package.json L22-26, L54-58
  • packages/ecc-client-ga4gh-wes/src/events/ecc-io-form-changed.ts L1-9
  • packages/ecc-client-ga4gh-wes/src/events/index.ts L7
  • packages/ecc-client-ga4gh-wes/src/utils/index.ts L1-28

API

Add the I/O form element and its public properties, method, and event contract, with the component registered for package consumers.

  • packages/ecc-client-ga4gh-wes/src/components/index.ts L5
  • packages/ecc-client-ga4gh-wes/src/components/io-form/index.ts L1-18
  • packages/ecc-client-ga4gh-wes/src/components/io-form/io-form.ts L1-1290

Provide the replaceable IO Schema validator interface and the package-level configuration and check functions.

  • packages/ecc-client-ga4gh-wes/src/io-schema/validator.ts L1-589

Uses of the API

Connect run-output rendering to the shared file-reference checks and description renderer while retaining its existing output behavior.

  • packages/ecc-client-ga4gh-wes/src/components/run-output/run-output.ts L23, L80-85, L672-673
  • packages/ecc-client-ga4gh-wes/src/components/run-output/utils.ts L31-37 (+3 small edits)

Other changes

Files not grouped.

  • .changeset/wes-io-form.md L1-5
  • apps/documentation/components/packages/wes/IoFormPreview.tsx L1-52
  • apps/documentation/components/packages/wes/ioFormExamples.ts L1-698
  • apps/documentation/pages/docs/wes/_meta.json L4, L6 (removed lines)
  • apps/documentation/pages/docs/wes/components/_meta.json L6-7
  • apps/documentation/pages/docs/wes/components/io-form.mdx L1-143
  • apps/documentation/pages/docs/wes/io-schema.mdx L1-58
  • package-lock.json L3053-3152, L5521-5609, L8601-8679 (+16 small edits)
  • package.json L35-40
  • packages/ecc-client-ga4gh-wes/scripts/sync-io-schema.mjs L1-166
  • packages/ecc-client-ga4gh-wes/src/components/io-form/tests/io-form-defined.test.ts L1-18
  • packages/ecc-client-ga4gh-wes/src/components/io-form/tests/io-form.test.ts L1-1019
  • packages/ecc-client-ga4gh-wes/src/components/run-output/tests/run-output.test.ts L8, L112-149
  • packages/ecc-client-ga4gh-wes/src/io-schema/descriptions.ts L1-136
  • packages/ecc-client-ga4gh-wes/src/io-schema/error-messages.ts L1-51
  • packages/ecc-client-ga4gh-wes/src/io-schema/fields.ts L1-724
  • packages/ecc-client-ga4gh-wes/src/io-schema/file-values.ts L1-414
  • packages/ecc-client-ga4gh-wes/src/io-schema/files.ts L1-145
  • packages/ecc-client-ga4gh-wes/src/io-schema/messages.ts L1-139
  • packages/ecc-client-ga4gh-wes/src/io-schema/pointer.ts L1-53
  • packages/ecc-client-ga4gh-wes/src/io-schema/profile.ts L1-1173
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/descriptions.test.ts L1-164
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/error-messages.test.ts L1-77
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/fields.test.ts L1-513
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/file-values.test.ts L1-331
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/files.test.ts L1-63
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/fixtures/conformance.ts L1-3250
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/fixtures/examples.ts L1-1012
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/fixtures/file-values.ts L1-293
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/validator.test.ts L1-526
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/values.test.ts L1-133
  • packages/ecc-client-ga4gh-wes/src/io-schema/values.ts L1-147
  • packages/ecc-client-ga4gh-wes/src/theming.test.ts L14
  • packages/ecc-client-ga4gh-wes/tsconfig.prod.json L7
  • web-test.runner-config.mjs L5-51, L93-96 (+2 small edits)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.29212% with 230 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.17%. Comparing base (efda2a5) to head (2b9ca89).
⚠️ Report is 1 commits behind head on feat/io-schema.

Files with missing lines Patch % Lines
...client-ga4gh-wes/src/components/io-form/io-form.ts 94.72% 59 Missing and 9 partials ⚠️
...kages/ecc-client-ga4gh-wes/src/io-schema/fields.ts 93.09% 47 Missing and 3 partials ⚠️
...ges/ecc-client-ga4gh-wes/src/io-schema/messages.ts 69.06% 43 Missing ⚠️
.../ecc-client-ga4gh-wes/src/io-schema/file-values.ts 92.51% 29 Missing and 2 partials ⚠️
...es/ecc-client-ga4gh-wes/src/io-schema/validator.ts 97.28% 16 Missing ⚠️
...kages/ecc-client-ga4gh-wes/src/io-schema/values.ts 92.51% 9 Missing and 2 partials ⚠️
...ages/ecc-client-ga4gh-wes/src/io-schema/pointer.ts 86.79% 5 Missing and 2 partials ⚠️
...ecc-client-ga4gh-wes/src/io-schema/descriptions.ts 97.79% 2 Missing and 1 partial ⚠️
...c-client-ga4gh-wes/src/components/io-form/index.ts 94.44% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##           feat/io-schema     #613      +/-   ##
==================================================
+ Coverage           79.71%   85.17%   +5.45%     
==================================================
  Files                  83       98      +15     
  Lines               21629    31011    +9382     
  Branches             1656     2440     +784     
==================================================
+ Hits                17242    26413    +9171     
- Misses               4362     4558     +196     
- Partials               25       40      +15     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@read-the-docs-community

read-the-docs-community Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

uniqueg and others added 9 commits December 3, 2026 09:42
Choose controls by x-ga4gh-ui-widget where the widget fits the schema
that carries it (UI widgets, Rules): textarea, slider with bounds and
step, multiple choice for arrays with items.enum, tags one per line,
typeahead with examples as suggestions, colour picker. Radio and
switch render as dropdown and checkbox, as the profile allows. Misfit,
custom and viewer widgets fall back to the type. Nullable inputs get a
null toggle.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review findings on the form:

- A schema that refers to itself twice per level expanded to 2^33
  fields and froze the tab: references already on the path become JSON
  inputs, and groups stop expanding at 1000 fields.
- References inside embedded resources ($id) aren't followed, as they
  resolve elsewhere; such inputs are edited as JSON.
- Inputs named constructor or prototype can be set; only __proto__
  is ignored. Missing required inputs with such names show at the input.
- Control ids are unique per pointer.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
File references (x-ga4gh-file, also as a branch of anyOf/oneOf such as
CWL's [File, string]) get a text field for a URI or relative path.
Values are checked by the profile's file rules against allowedSchemes,
narrowed by the reference's schemes, and make the form invalid when
refused; refused defaults aren't prefilled. Changing allowedSchemes
re-validates.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
x-ga4gh-error-message replaces the validator's messages of the
failures at the value its schema applies to, once per location; the
outermost message wins (the input's own over its $ref target's).
Hidden inputs go under a collapsed Advanced section, except inputs
that must be set and inputs whose values fail.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Arrays with items get a list editor: a field per item (objects, file
references and widgets included), Add and Remove within minItems and
maxItems; a cleared item stays in the list, empty. Unions (anyOf or
oneOf without a type) get a branch chooser, by title or type, that
renders the chosen branch; the branch is guessed from the value's type
at first. Other arrays (prefixItems) stay JSON.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Branches of allOf with properties (after a local $ref), such as
nf-core's parameter groups, become sections of their object with the
branch's title and description; their required lists apply to their
fields, and their defaults are prefilled. The docs demo gets the
profile's nf-core/fetchngs schema.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quality review: aria-labels on selects, multi-selects, checkboxes and
the null toggle; list buttons name their list; suggestions form a
labelled group; the slider value is announced. Tests for the
allowed-schemes attribute and for new values. Docs: slider steps,
null toggle, required marker, attribute format.

Part of #444.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adversarial review of S5-S9:
- File reference values are checked by walking the values along the
  inputs schema, not the controls: union branches the form doesn't
  show, tags, prefixItems, patternProperties and additionalProperties
  are covered too (high).
- allOf sections stop at the field cap (exponential nesting by $ref).
- Removing a list item moves the pointer-keyed state of later items.
- Live fields are computed once per state; errors find their field by
  pointer instead of a scan.
- A required list stays when its last item is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Second review round of the schema walk of file values:
- In a union, a string that a branch without a file reference takes
  (type, const, enum, pattern) isn't checked as a file reference, so
  presets and free text next to a file branch stay valid.
- The walk keeps the schema nodes seen per value location: linear in
  the schema size instead of exponential in branching references, with
  a node budget that fails closed.
- Refused list defaults are removed last first, so later items don't
  shift into their place.
- then/else, dependentSchemas, unevaluatedProperties/Items and contains
  are walked too.
- Values nested deeper than 64 levels are refused instead of skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 20 issues

Sourcery assessment

Needs a human reviewer. 19 findings to address first, and if the file-reference checks accept a URI or path they should refuse, an app may submit it as a workflow input and the resulting run could access or expose data; the new validator and Markdown renderer also add security-sensitive behavior. Reverting removes the form for future use, but cannot undo runs already submitted or data already exposed.

Blocking findings: packages/ecc-client-ga4gh-wes/src/io-schema/file-values.ts:144, packages/ecc-client-ga4gh-wes/src/io-schema/file-values.ts:69, packages/ecc-client-ga4gh-wes/src/io-schema/file-values.ts:40, packages/ecc-client-ga4gh-wes/src/io-schema/file-values.ts:141, packages/ecc-client-ga4gh-wes/src/io-schema/validator.ts:76, and 14 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

hyperjump decodes URI fragments with decodeURI, which keeps the escapes
of reserved characters such as %23, so a JSON Pointer fragment to a
name with '#' finds nothing. checkIoSchema compiled $defs entries by
fragment, and local $refs use them too, so such schemas couldn't be
used at all. Subschemas of the root resource whose fragment hyperjump
would misread now get a generated $anchor in the registered copy (or
keep their own), and local $refs to them point at the anchor. Error
locations stay JSON Pointers; the document stays unchanged. Inside
embedded $id resources such names still can't be used.

checkIoSchema also compiles every contentSchema and
x-ga4gh-tabular-schema, which validation doesn't evaluate, so that
their references must resolve within the document too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uniqueg and others added 4 commits December 4, 2026 14:17
The file value walk resolved only local JSON Pointer references and
none inside embedded $id resources, so file references behind an
absolute URI, an embedded resource or an $anchor went unchecked. It
now resolves references by the $ids of the document and its embedded
resources, their anchors and JSON Pointers.

In a union, a string skips the file checks only if a branch without a
file reference surely takes it: every keyword it has, also through
allOf and $ref chains, is type, const, enum, pattern, minLength,
maxLength or an annotation, and the value passes them. Other branches
(e.g. with not or format) no longer let a refused value through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Clearing the last value inside a list item keeps the item, empty,
  so later items don't shift
- Inputs named __proto__ are set as own properties instead of being
  ignored
- Controls, suggestions and list buttons of an input set to null are
  disabled
- File reference text is kept as entered, so the checks refuse
  surrounding spaces instead of the form trimming them
- Sliders stay inside exclusive bounds (next step inward)
- A validator that fails instead of checking shows its error instead
  of leaving the form on its skeleton
- The test for a replaced schema now replaces it while the first check
  is pending, and checks the validator in use

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A $ref and its sibling keywords are combined as both apply: required
  and allOf are joined, properties merged, bounds take the tighter
  value and enums the values in both (was a shallow override)
- Names required by allOf branches without properties of their own
  are marked required
- A union without a default of its own starts from the default of its
  first branch
- Inputs with more than MAX_FIELDS properties, and lists with more
  than MAX_FIELDS items, are edited as JSON instead of as fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The React wrappers define each tag before the element's module loads,
so importing the io-form module afterwards threw "name already used".
The module now defines the tag only if it isn't defined yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uniqueg and others added 7 commits December 4, 2026 14:46
Describe which references the file checks follow and when a union
branch takes a string, that file text is kept as entered, how sliders
treat exclusive bounds, the size limits, required names from allOf,
the defaults of unions and of the schema itself, and that
setDescriptionFormat applies to components that render afterwards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A number list item without a default starts as null, which its type
refuses, so the form stays invalid until it is filled. Its field now
shows that null as empty and stays editable: only inputs whose type
allows null are disabled while they are null.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Annotation schemas (contentSchema, x-ga4gh-tabular-schema) inside an
embedded $id resource were compiled by a JSON Pointer from the root,
which hyperjump can't follow across the resource's boundary, so such
valid schemas were refused. They are now compiled through a generated
$defs entry of the registered copy that refers to them by the
resource's URI.

The registered copy now also owns the annotation schemas, so those
under names with '#' get an anchor, and their $refs to such names
point at it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reference index of the file checks skipped subschemas under names
such as default or enum, ignored $dynamicAnchor and stopped at a depth
limit, and the walk didn't follow $dynamicRef; it then skipped the
reference, so file values behind it went unchecked. The index now
walks iteratively without a depth limit, skips data only at keyword
positions, and indexes $dynamicAnchor as an anchor; $dynamicRef is
followed like $ref. A reference that still can't be followed refuses
the value (fail closed).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- An exclusive slider bound also wins over an equal inclusive one, and
  the step inward is rounded and checked, so float steps (e.g. 0.1
  past 4.3) can't land on the bound
- Defaults of unions whose first branch leads back to the union stop
  instead of overflowing the stack
- Group defaults keep a property named __proto__ as an own property

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Union defaults pass the unions on the way down through groups, so a
  recursive tree (union -> group -> union, twice) stops at once
  instead of growing exponentially
- File checks walk every schema a $dynamicRef may reach (all schemas
  with its anchor name), so a dynamic target with a file reference is
  checked like the static one
- References to the meta-schemas, which the schema check accepts, no
  longer refuse values; they have no file references and never count
  as a branch that surely takes a string
- Slider steps past an exclusive bound are rounded to the decimals of
  the step and tried at most twice, so huge bounds can't loop forever
  and large integers stay exact
- Docs: which references must resolve, and that names with '#' don't
  work inside embedded resources

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uniqueg
uniqueg merged commit eb80e24 into feat/io-schema Dec 4, 2026
22 checks passed
@uniqueg
uniqueg deleted the feat/io-form-proposal branch December 4, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant