Skip to content

feat(wes): build run requests from I/O Schemas (proposal) - #614

Open
uniqueg wants to merge 20 commits into
feat/io-schemafrom
feat/io-run-request-proposal
Open

uniqueg wants to merge 20 commits into
feat/io-schemafrom
feat/io-run-request-proposal

Conversation

@uniqueg

@uniqueg uniqueg commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Part of #570

This is a proposal, stacked on the I/O form proposal #613 (base branch feat/io-form-proposal). Like #613, it is built before the open design questions of #444 are answered, so that the choices can be judged on running code. Nothing here should merge as it is, and it doesn't close #570. Once the questions are answered, it will be rebased on what lands from #613 and split into reviewable PRs (see "How it will be split"). It stays a draft.

What it does

Krini users can submit a workflow without choosing a workflow type or writing workflow_params: given a TRS tool version, its I/O Schema and the values from the form, the request is built by the profile's engine bindings.

  • Request builder (src/io-schema/bindings.ts): toWorkflowParams() and buildRunRequest() port the engine bindings of profile 0.3.0 for NFL, SMK, WDL and CWL from the profile's reference implementation (ga4gh_io_schema.wes). They check the schema, validate the values, check every file reference value (also in union branches, if/then/else, contains, unevaluated*), rename inputs by x-ga4gh-parameter, qualify WDL names with the entry point, turn CWL file values into File/Directory objects, and refuse what Nextflow or the CWL loader would change (${, keys with -; File objects, keys with $ or :). Defaults are never inserted. Errors are TranslationErrors with the JSON Pointer of the value. It fails closed on references that don't resolve within the document, on references and branches inside embedded $id resources, and on $dynamicRef. unsupportedBy() checks a service's service-info for the type and version.
  • TRS helpers (src/io-schema/trs.ts): trsDescriptorUrl() (plain primary descriptor by its path), findPrimaryDescriptorPath() and findSchemaFile() (the IO schema among a tool version's files, for krini#47).
  • Engine profiles (src/io-schema/engine-profiles.ts), kept out of the generic builder: conquestEngineProfile sets the GitHub repository as workflow_url and adds revision (full commit SHA) and main_script / snakefile / main_workflow_path, derived from the URL of the TRS primary descriptor (raw.githubusercontent.com or github.com/.../blob/...). It refuses CWL, branches and tags, as Conquest does.
  • Schema mode of ecc-client-ga4gh-wes-run-create: with ioSchema and trsToolVersion (plus optional engineProfile and allowedSchemes), the form shows the I/O form and the workflow that will run (type, version, URL) instead of the raw fields, says when the service doesn't run the type or version, submits only valid values, and shows refused values with their location. Engine parameters, tags and attachments stay in the advanced section. Without ioSchema, the raw mode is unchanged. The I/O form element is loaded on demand: a static import made the docs app's prerendering of the I/O form page fail (Lit SSR, this._$EM is not a function).
  • Validator: IoSchemaCheck gets an optional validateAt(pointer, value) (SubschemaValidator) for the subschemas whose validity decides which schemas apply (anyOf/oneOf branches, if, contains); the hyperjump validator compiles them with the schema. This changes feat(wes): add the I/O Schema form (proposal) #613's validator.ts (on this branch only).
  • Test vectors: scripts/sync-io-schema.mjs also copies the profile's wes-params, workflow-urls and trs-files vectors (same pin, 2c3dc49); the existing fixtures are unchanged.
  • Docs: "Run requests" on the I/O Schemas page, "Schema mode" and "Engine profiles" on the Run Create page; a docs-app demo with the profile's examples and a dry-run provider that shows the request instead of submitting it; a changeset; exports in @elixir-cloud/wes/utils.

Which of the open questions of #613 it depends on

  • Q2 (validator): the builder needs subschema checks, so validateAt() is part of the validator interface here. A replacement validator (e.g. Ajv) would have to provide it; without it, buildRunRequest() refuses to run.
  • Q3 (place and name): the builder, the TRS helpers and the engine profiles sit in @elixir-cloud/wes (src/io-schema/, exported from @elixir-cloud/wes/utils), next to feat(wes): add the I/O Schema form (proposal) #613's checks. If they move to a shared @elixir-cloud/io-schema package, these files move with them; the run-create schema mode stays in the WES package. feat(wes): build run requests from I/O Schemas #570 itself leaves this to the component owner ("or a shared package").
  • Q6 (event payload): run-create uses values and valid of ecc-io-form-changed, not errors; it works with either payload.
  • Q7 (split): see below.
  • Q8 (tests) and Q9 (Lit): WTR + @open-wc/testing and Lit 2.8, as feat(wes): add the I/O Schema form (proposal) #613.
  • Q1, Q4, Q5: not affected (the form is used as it is).

Questions of its own for @anuragxxd (the defaults this branch uses):

  • A. Schema mode API: one trsToolVersion object (trsUrl, toolId, versionId, and optionally primaryDescriptorPath, descriptorTypeVersions, primaryDescriptorUrl) rather than separate properties, and the host fetches the schema and the TRS data (krini#47 would do that). Alternative: run-create fetches them itself from a TRS provider.
  • B. Engine profiles: a small EngineProfile interface (apply(request, context)) with one built-in profile for Conquest. Alternative: no built-in profiles; hosts pass engine parameters.
  • C. Version choice: if the schema has no descriptor_type_version, the first version of the TRS tool version that the service runs is used, without a choice for the user.

How it will be split

After #613's split lands, in this order (each with its tests and docs):

  1. Test vectors in the sync script, TRS helpers (trs.ts).
  2. validateAt() and the request builder (bindings.ts).
  3. Engine profiles with the Conquest profile.
  4. The schema mode of run-create, its demo and the changeset.

How it was verified

  • WES package: 539 tests pass in Chromium and in Firefox (web-test-runner, npm test in the package), including all wes-params (32), workflow-urls and trs-files vectors, the builder's own cases (unions, unevaluated*, contains, references to the root $id, refusals), the Conquest profile, and run-create's schema mode with a fake provider (raw mode kept, request built and submitted, engine profile, invalid values, unsupported type, refused file value, missing TRS tool version). WebKit can't launch on the agent host, so it runs in CI only.
  • npm run lint at the root, which builds all packages and the docs app (21 of 21 tasks successful, ESLint errors 0, all docs pages prerendered).
  • Reviews: adversarial and quality review, then a second adversarial round on the fixes. Fixed: a $ref to an embedded $id resource was followed from the document root, so a colliding root $defs entry could skip file reference checks (high; now fails closed, with a regression test); a member named __proto__ was dropped; the Conquest URL parser accepted ./.. names, control characters and backslashes; schema mode accepted engine parameters that aren't an object; duplicated tags/attachments code; untested decidingLocations(); undocumented fallbacks; internals exported. Round two found no high or medium findings; its two lows are fixed too: a conditional subschema behind a $ref into a non-schema location now fails as a TranslationError, and the Conquest path check also refuses Unicode format and separator characters (e.g. bidi overrides) and segments with leading or trailing whitespace.
  • Commits were made with HUSKY=0, as in feat(wes): add the I/O Schema form (proposal) #613 (the hook's docs build needs Google Fonts, which the agent sandbox blocks by default); lint was run by hand.

Declined review findings

  • validateAt should be required on IoSchemaCheck and the builder's "validator can't check subschemas" branch is dead (medium, quality): declined. A validator set with setIoSchemaValidator() (Q2) may lack it; the branch is reachable that way and tested.
  • Compute schemaRun() once per update instead of per render (low): deferred to the split; it is cheap.
  • A --check mode for the sync script (low): deferred, as in feat(wes): add the I/O Schema form (proposal) #613.

🤖 Generated with Claude Code

Summary by Sourcery

Build GA4GH I/O Schema-based WES run requests and let users submit workflows through a schema-driven form.

New Features:

  • Add an optional schema mode to WES run creation that presents I/O Schema inputs and builds requests for supported workflow types and versions.
  • Expose request-building helpers, TRS descriptor and schema discovery helpers, service compatibility checks, and a Conquest engine profile through the utilities package.
  • Add TRS file discovery and descriptor URL construction, plus Conquest support for workflows hosted at full-commit GitHub URLs.

Enhancements:

  • Keep raw run-creation mode unchanged while preserving engine parameters, tags, and attachments in schema mode.
  • Extend I/O Schema validation results with optional subschema validation needed when applying conditional schemas and union branches.

Documentation:

  • Document run requests, schema mode, engine profiles, and add an interactive dry-run preview to the WES component documentation.

Tests:

  • Add conformance-vector and unit coverage for request translation, TRS helpers, engine profiles, subschema validation, and schema-mode run creation.

Chores:

  • Add a changeset for the new WES utilities and schema-mode component API.
  • Sync engine-binding, workflow URL, and TRS-file test vectors from the pinned GA4GH I/O Schema profile.

uniqueg and others added 19 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>
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>
Port the engine bindings of the GA4GH IO Schema Profile 0.3.0 (NFL,
SMK, WDL, CWL) from the profile's reference implementation:
toWorkflowParams() and buildRunRequest() check the schema, validate the
values, check file references and translate the values; trs.ts builds
the TRS workflow URL and finds the schema among a tool version's files.

The sync script now also copies the wes-params, workflow-urls and
trs-files test vectors, which the tests run. The validator gains an
optional validateAt() for the subschemas whose validity decides which
schemas apply (anyOf/oneOf branches, if, contains).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Engine profiles turn the generic run request into one for a particular
WES server, kept out of the builder. conquestEngineProfile sets the
GitHub repository as workflow_url and adds revision and the main
workflow path (main_script, snakefile or main_workflow_path) from the
URL of the primary descriptor at a full commit SHA.

Also declare SubschemaValidator and the optional validateAt() on
IoSchemaCheck, which the previous commit used without the type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With ioSchema and trsToolVersion, ecc-client-ga4gh-wes-run-create shows
the workflow's I/O form instead of the raw fields, says when the WES
service doesn't run the workflow's type or version, and submits the
request built by the engine bindings, adapted by an optional engine
profile. The raw mode stays. The I/O form is loaded on demand: a static
import broke the docs app's prerendering of the I/O form page.

Export the builder, TRS helpers and engine profile from
@elixir-cloud/wes/utils; document them; add a docs-app demo with a
dry-run provider; add a changeset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Fail closed on $ref targets in or under embedded $id resources: they
  resolve their own references against their $id, so following the
  document could skip file reference checks.
- Build workflow_params from entries, so a member named __proto__ stays
  a key.
- Tighten the Conquest URL parser: no '.' or '..' owner or repository
  names, control characters, backslashes or segments starting with '-'.
- Require engine parameters to be a JSON object in schema mode; load
  the I/O form with an error message if its chunk fails; build tags and
  attachments once.
- Test decidingLocations() and validateAt(); export fewer internals;
  document the version fallback and the error text of schema mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Wrap validateAt() failures for conditional subschemas behind a $ref
into a non-schema location in a TranslationError, and refuse Unicode
format and separator characters and whitespace-padded segments in
Conquest descriptor paths.

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

sourcery-ai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

API

Define and expose the run-request builder, TRS helpers, engine-profile contract, and validator subschema-checking interface that the rest of the feature relies on.

  • packages/ecc-client-ga4gh-wes/src/io-schema/bindings.ts L1-761
  • packages/ecc-client-ga4gh-wes/src/io-schema/engine-profiles.ts L1-138
  • packages/ecc-client-ga4gh-wes/src/io-schema/trs.ts L1-182
  • packages/ecc-client-ga4gh-wes/src/io-schema/validator.ts L55-76
  • packages/ecc-client-ga4gh-wes/src/utils/index.ts L3-5, L17, L31-53

Uses of the API

Integrate schema-based request construction into run creation while retaining raw mode and handling service support, form values, engine parameters, and submission errors.

  • packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts L258-323, L483-534, L642-676 (+13 small edits)

Implementation

Compile and use subschema validators to determine which schema branches apply during input translation.

  • packages/ecc-client-ga4gh-wes/src/io-schema/validator.ts L315-357, L559-563, L601-608 (+1 small edits)

UI

Add a documentation preview that demonstrates schema-mode run creation with a dry-run provider and displays the built request.

  • apps/documentation/components/packages/wes/RunCreateSchemaPreview.tsx L1-102

Configuration

Record the proposed WES feature and its public exports in the package changeset.

  • .changeset/wes-run-requests.md L1-5

Documentation

Document schema-mode run creation, TRS and request-building helpers, engine profiles, and the added test-vector coverage.

  • apps/documentation/pages/docs/wes/components/run-create.mdx L4, L16-19, L78-134
  • apps/documentation/pages/docs/wes/io-schema.mdx L9, L54-77

Tests

Exercise the builder, TRS helpers, engine profile, validator additions, and run-create integration against unit cases and profile vectors, with the sync script generating the added vector fixtures.

  • packages/ecc-client-ga4gh-wes/scripts/sync-io-schema.mjs L10-11, L128-209
  • packages/ecc-client-ga4gh-wes/src/components/run-create/tests/run-create.test.ts L1-266
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/bindings.test.ts L1-465
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/engine-profiles.test.ts L1-91
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/fixtures/trs.ts L1-688
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/fixtures/wes-params.ts L1-1685
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/trs.test.ts L1-84
  • packages/ecc-client-ga4gh-wes/src/io-schema/tests/validator.test.ts L5, L362-412

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

@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 13 issues

Sourcery assessment

Needs a human reviewer. 13 findings to address first, and a faulty input binding or engine-profile adaptation can submit a workflow with unintended parameters or source to the WES service. Reverting prevents future submissions but cannot stop a job already launched or undo effects and outputs it produced.

Blocking findings: packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:565, packages/ecc-client-ga4gh-wes/src/io-schema/bindings.ts:460, packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:173, packages/ecc-client-ga4gh-wes/src/io-schema/trs.ts:66, packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:295, and 8 more


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

const engineParameters = JSON.parse(this.formData.workflowEngineParams);
const base: RunRequest = this.ioSchema
? await this.buildSchemaRequest(engineParameters)
: {

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.

🟠 High · Each click submits twice

The submit button’s click handler and the form’s submit handler both call handleSubmit(), and handleSubmit() has no re-entry guard. A single click therefore starts two runWorkflow() calls and creates duplicate workflow runs.

Invoke submission from only one of the click or submit handlers, and guard handleSubmit() against re-entry.

if (isObject(schema.patternProperties)) {
for (const pattern of Object.keys(schema.patternProperties)) {
// The values passed validation, which compiled the same patterns
if (new RegExp(pattern, "u").test(key)) {

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.

🟡 Medium · Malicious schema hangs the form

When a workflow publisher supplies a valid schema with a pathological pattern or patternProperties expression and a user enters a long near-matching value or key, a schema can supply a catastrophic-backtracking regular expression; validateInputs or new RegExp(pattern).test(key) then blocks the browser’s main thread on a long near-match, leaving the form unresponsive.

Limit or safely constrain regex complexity for untrusted schemas, or evaluate patterns in a mechanism that can enforce execution limits.

Also at packages/ecc-client-ga4gh-wes/src/io-schema/bindings.ts:639.

}

protected updated(changedProperties: Map<PropertyKey, unknown>): void {
if (

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.

🟡 Medium · Previous inputs reach new workflow

When the host replaces ioSchema while the previous form has valid values and before the child emits its updated state, ioChange retains the previous form’s valid values, so the submit button stays enabled and buildSchemaRequest() can use those values with the new schema and workflow; the run submits inputs from the previous form.

Clear or invalidate ioChange when ioSchema changes and keep submission disabled until the replacement form reports its state.

Also at packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:516, packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:668-669.

const { path } = entry;
const normalised = normalisePath(path);
if (
entry.file_type === PRIMARY_DESCRIPTOR_FILE_TYPE &&

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.

🟡 Medium · Wrong workflow descriptor is selected

When a TRS tool version lists multiple primary descriptors and the first is not the descriptor identified by the schema, findPrimaryDescriptorPath() returns the first usable primary descriptor without matching it to the schema, so schema mode builds workflow_url for the wrong workflow.

Select the primary descriptor identified by the schema, and reject the tool version when it cannot be identified unambiguously.

Also at packages/ecc-client-ga4gh-wes/src/io-schema/trs.ts:70.

Comment on lines +284 to +295
offered.find((candidate) => supported.includes(candidate)) ??
offered[0];
if (version === undefined) {
return {
error:
"The workflow's language version is unknown: neither the IO schema nor the TRS tool version names one.",
};
}
binding = { ...binding, descriptorTypeVersion: version };
}
if (this.serviceInfo) {
const unsupported = unsupportedBy(this.serviceInfo, binding);

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.

🟡 Medium · Old service capabilities are used

When the provider changes while its previous getServiceInfo() request is pending, an older response can overwrite serviceInfo, so schemaRun() selects a version or checks support against the previous service while handleSubmit() submits through the current provider; the form can reject a runnable workflow or submit an unsupported version.

Ignore service-info responses that no longer belong to the current provider.

: undefined;
const [uri] = ref.split("#");
const pointer = fragmentPointer(ref);
if ((uri === "" || uri === id) && ref.includes("#") && pointer !== null) {

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.

🟡 Medium · Valid schema references are rejected

When a checked IO schema uses a bundled $ref to a named $anchor or directly to its root $id, Translator.resolve() only follows references whose fragment is a JSON Pointer. A valid bundled $ref to a named $anchor (or to the document’s root $id without a fragment) therefore falls through and throws, so callers cannot build requests from those schemas.

Resolve anchors and root-resource references in Translator.resolve(), or explicitly reject these reference forms during schema checking and document that limitation.

const parameters = JSON.parse(this.formData.workflowEngineParams);
if (
typeof parameters !== "object" ||
parameters === null ||

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.

🟡 Medium · Invalid engine parameter values pass

When a user enters a JSON object with a non-string member as workflow engine parameters, the check verifies only that the parsed value is an object, so values such as numbers, arrays, or nested objects pass and are assigned to workflow_engine_parameters; RestWesProvider serializes them and the WES service receives values that violate the declared string-to-string request type, resulting in a rejected or misinterpreted run.

Require every engine-parameter value to be a string before building the request, or update the request type and contract if the service supports other JSON values.

Comment on lines +216 to +217
await toWorkflowParams(schema, { list: ["drs://a/b", "plain"] })
).to.deep.equal({ list: ["drs://a/b", "plain"] });

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.

🟡 Medium · Contains binding check goes unnoticed

When the translator stops applying contains subschemas during translation, toWorkflowParams returns the same strings when it ignores the contains file annotation, because the matching value already uses the allowed drs scheme; the deep-equality assertion passes without proving the annotation was checked.

Use a value with a scheme excluded by the annotation and assert that translation rejects it.

const error = await rejection(
toWorkflowParams(schema, {}, { allowedSchemes: ["https", "file"] })
);
expect(error).to.be.instanceOf(Error);

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.

🟡 Medium · Forbidden-scheme test accepts success

When toWorkflowParams fulfills instead of rejecting the forbidden file scheme, rejection() throws new Error("The promise was fulfilled.") when toWorkflowParams succeeds, and this assertion accepts that error too; the test passes even when the forbidden scheme is not rejected.

Assert a distinctive rejection message or use a rejection assertion that fails when the promise fulfills.

.engineProfile=${extra.engineProfile}
></ecc-client-ga4gh-wes-run-create>`
);
await waitUntil(() => ioForm(el), "no I/O form", { timeout: 5000 });

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.

🟡 Medium · Schema-mode tests race form upgrade

When the form's dynamic import resolves after render() returns but before or during the tests' input setup, when the I/O form's dynamic import has not registered the element yet, render()'s waitUntil(() => ioForm(el)) at run-create.test.ts:131 succeeds on the unupgraded tag. The “submits the request built from the values” and “applies the engine profile” tests then inject values at :104 before the form initializes; its initial invalid change can overwrite them, making these tests fail with correct code.

Have render() await custom-element registration and the I/O form's initial schema load before tests inject values.

Base automatically changed from feat/io-form-proposal to feat/io-schema December 4, 2026 15:54
#613 was squash-merged (eb80e24); conflicts resolved as a 3-way
merge against the old base 8f06592. deciding locations now compile
through the location logic (uriFor). WIP: tests not yet run.

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

This branch has not been deployed

No deployments
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