Repository navigation
feat(wes): build run requests from I/O Schemas - #614
Conversation
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>
Reviewer's GuideData structuresDefine the public request-building, translation, engine-profile, TRS-reference and subschema-validator types that the implementation and callers depend on.
APIExpose the run-request builders, compatibility check, TRS helpers, engine profile and validator extensions through the package utilities and the run-create component's schema-mode properties and events.
Provide the public builder and TRS helper functions, including their validation and workflow-URL contracts.
ImplementationImplement schema validation, conditional subschema traversal, engine-binding translation, file-value checks, and WES request compatibility decisions.
Implement Conquest request adaptation and strict parsing of supported GitHub descriptor URLs.
Add subschema-location discovery and compiled validateAt support to the IO schema validator.
Make schema-mode run creation resolve workflow metadata, validate form and engine parameters, build and adapt one request per submission, and guard against stale providers or replaced inputs.
UIRender the schema-derived workflow summary and I/O form in schema mode while retaining the raw-mode form and adapting submit-button availability to schema validity and service support.
Add an interactive documentation preview that uses a dry-run WES provider to display the built request without submitting a real workflow.
ConfigurationExtend the IO Schema synchronization script to generate fixtures for engine-binding, workflow-URL and TRS-file vectors.
Record the WES package minor release and summarize the new schema-based run-request capability.
DocumentationDocument schema-mode usage, its properties and events, engine profiles, and the request-builder and TRS helper behavior and limits.
TestsCover builder translations and errors, binding extraction, WES service compatibility, run-request construction, and Conquest engine-profile behavior.
Test schema-mode rendering and submission, validation failures, provider and form replacement races, timeout behavior, and version and descriptor-path selection.
Test deciding subschema locations and validateAt behavior, including schema paths containing hash characters.
Verify TRS descriptor URL construction, schema-file discovery, primary descriptor lookup, and path normalization against the profile vectors.
Lock files and vendored codeAdd generated profile test-vector fixtures for WES parameter translation and TRS workflow URLs and files.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📖 58 files changed · 2 added · 56 modified
Preview · build overview · cloud-components · built Dec. 5, 2026, 12:57 p.m. UTC |
There was a problem hiding this comment.
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
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feat/io-schema #614 +/- ##
==================================================
+ Coverage 85.11% 87.20% +2.09%
==================================================
Files 98 103 +5
Lines 31011 34926 +3915
Branches 2439 2811 +372
==================================================
+ Hits 26394 30457 +4063
+ Misses 4572 4425 -147
+ Partials 45 44 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Schema mode of run-create submits once per click (re-entry guard), drops the values of a replaced form, ignores service-info answers of a replaced provider, refuses to submit without service-info, and checks duplicate tag keys and string engine parameters as raw mode does. Tests cover the version choice, the declared descriptor path and engine profiles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Schemas that apply to one input and name different engine parameters were resolved by expansion order; they are now a TranslationError at the input. A forbidden scheme on the allow-list is a TranslationError too, and the contains and allow-list tests can no longer pass on a fulfilled promise. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Describe the new submission checks, correct the detail types of ecc-run-submitted and ecc-run-create-failed, export TrsToolVersionRef from the utils and name the public types in the changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Say that references by $anchor or to the bare $id are refused, and that conflicting parameter names for one input are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The utils entry point no longer imports from the component module; the component re-exports the type. The @fires lines name the detail types, and the replaced-schema, descriptor-path and profile-refusal tests assert what the component does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Schema mode showed a "couldn't be loaded" alert before the first service-info request started, and cleared the service-info whenever the provider was replaced. It now shows a neutral note until a request fails, keeps the earlier answer while a new one loads (submission stays off while loading), and run-create takes allowedSchemes from an allowed-schemes attribute, as the I/O form does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Also say to keep the provider stable, document the allowed-schemes attribute, list unsupportedBy apart from the TRS helpers and say what changes for raw mode in the changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@sourcery-ai review |
There was a problem hiding this comment.
Hey - I've found 6 issues
Sourcery assessment
Needs a human reviewer. 6 findings to address first, and if the schema translation or engine profile builds the wrong request, the WES service can receive unintended parameters or file references and start a workflow with them. Reverting stops future submissions through this mode, but cannot retract a run that has already started or undo effects it produced.
Blocking findings: packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:596, packages/ecc-client-ga4gh-wes/src/components/run-create/run-create.ts:223, packages/ecc-client-ga4gh-wes/src/io-schema/bindings.ts:524, packages/ecc-client-ga4gh-wes/src/io-schema/bindings.ts:142, packages/ecc-client-ga4gh-wes/src/io-schema/engine-profiles.ts:12, and 1 more
A submission takes the provider and engine profile when it starts, and isn't sent if the schema, TRS tool version, engine profile, allowed schemes or provider change while it is prepared; a run submitted meanwhile doesn't reset the replaced form. service-info gives up after serviceInfoTimeout (default 30 s) and a new request forgets an earlier failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Values nested more than 64 levels deep are a TranslationError before any recursive walk, so deep inputs can't overflow the stack. The Conquest engine profile refuses a request whose workflow_type isn't the context's descriptor type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#614 landed squashed (2254142); this branch carried its pre-squash commits. The tree is feat/io-schema plus this branch's own changes. Validator: the outputs schema is compiled once, as validateOutputs, through the anchor-aware location URIs of #614 (names with '#'), and the annotation-schema locations of #614 stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Guards the merge with #614: the outputs schema is compiled through the anchor-aware location URIs, so outputs whose names contain '#' and use a union validate as a whole and one by one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings this branch onto #615's head (b692f05), which already holds the squashed #613 and #614, so that the PR into feat/io-schema shows only the task list once #615 has merged. invalidateRunLog() of #615 now also resets the task list and cached logs, so a cleared run ID doesn't keep the tasks of the previous run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011FSoqPsbB5s4NvhhYYcDJk
Part of #570
This merges into the integration branch
feat/io-schema, a branch offdevthat won't be released, so that the full I/O Schema integration can run in ELIXIR On-Cloud (as #613 did). It was built before the open design questions of #444 are answered; they stay listed below and still steer the work: anything @anuragxxd decides differently gets changed or rolled back onfeat/io-schema. The split into reviewable PRs applies to the later step fromfeat/io-schemaintodev, which needs his review. It doesn't close #570 for that reason.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.src/io-schema/bindings.ts):toWorkflowParams()andbuildRunRequest()port the engine bindings of profile 0.3.0 forNFL,SMK,WDLandCWLfrom the profile's reference implementation. They check the schema, validate the values, check every file reference value (also in union branches,if/then/else,contains,unevaluated*), rename inputs byx-ga4gh-parameter(schemas that name different parameters for one input are refused), qualify WDL names with the entry point, turn CWL file values intoFile/Directoryobjects, and refuse what Nextflow or the CWL loader would change. Defaults are never inserted. Errors areTranslationErrors with the location of the value. It fails closed on references that don't resolve within the document, on references and branches inside embedded$idresources, and on$dynamicRef.unsupportedBy()checks a service'sservice-infofor the type and version.src/io-schema/trs.ts):trsDescriptorUrl(),findPrimaryDescriptorPath()andfindSchemaFile()(the IO schema among a tool version's files, for krini#47).src/io-schema/engine-profiles.ts), kept out of the generic builder:conquestEngineProfilesets the GitHub repository asworkflow_urland addsrevision(full commit SHA) andmain_script/snakefile/main_workflow_pathfrom the URL of the TRS primary descriptor. It refuses CWL, branches and tags, as Conquest does.ecc-client-ga4gh-wes-run-create: withioSchemaandtrsToolVersion(plus optionalengineProfileandallowedSchemes), 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, and submits only valid values. It drops the values of a replaced form, shows a note whileservice-infoloads and doesn't submit when it can't be loaded, and checks duplicate tag keys and that engine parameters are strings.allowedSchemesalso comes from anallowed-schemesattribute, as on the I/O form. The I/O form element is loaded on demand (a static import broke the docs app's prerendering). WithoutioSchema, raw mode keeps its fields and API; both modes now submit once per click and ignore theservice-infoanswer of a replaced provider (keeping the earlier answer while a new one loads).IoSchemaCheckgets an optionalvalidateAt(pointer, value)(SubschemaValidator) for the subschemas that decide which schemas apply (anyOf/oneOfbranches,if,contains), also under names with#.scripts/sync-io-schema.mjsalso copies the profile'swes-params,workflow-urlsandtrs-filesvectors (same pin,2c3dc49).TrsToolVersionRef) in@elixir-cloud/wes/utils.Open questions of #444 it depends on
validateAt()is part of the validator interface; a replacement validator would have to provide it, elsebuildRunRequest()refuses to run.@elixir-cloud/wesnext to feat(wes): add the I/O Schema form (proposal) #613's checks; they would move with them to a shared package.valuesandvalidofecc-io-form-changed.trsToolVersionobject, with the host fetching schema and TRS data (krini#47); B. a smallEngineProfileinterface with one built-in profile for Conquest; C. withoutdescriptor_type_versionin the schema, the first version of the TRS tool version that the service runs is used.How it was verified
npm testinpackages/ecc-client-ga4gh-wes): 588 tests pass in Chromium and Firefox, including allwes-params,workflow-urlsandtrs-filesvectors and 26 run-create tests (new: double click, a context change while preparing, a replaced form after an earlier submission, a service-info timeout, replaced schema, duplicate tags, non-string engine parameters, loading, missing and staleservice-info, theallowed-schemesattribute, version choice, declared descriptor path, engine parameter merge and engine profile refusal). The tests of the double click, the replaced schema and the staleservice-infowere checked to fail without their fix. WebKit can't launch on the agent host, so it runs in CI only.npm run lint(pre-commit hook: builds all packages and the docs app, ESLint errors 0).origin/feat/io-schema...HEAD: adversarial, quality and contract, then a second adversarial and quality round on the fixes (no high or medium findings left). The adversarial review probed the file reference check with bundled Node probes and found no bypass.Review findings fixed
service-inforace and failure; duplicate tags and non-string engine parameters in schema mode; thecontainsand forbidden-scheme tests could pass without the check; the schema-mode tests raced the form's on-demand load.TrsToolVersionRefexported from the utils; changeset names the public types; event detail types in the docs; the allow-list check throws aTranslationError.x-ga4gh-parameternames for one input were resolved by order (now refused); a false "couldn't be loaded" alert before the firstservice-inforequest, and a new provider object clearingservice-info(now a note while loading, the earlier answer kept).allowed-schemesattribute;unsupportedBylisted apart from the TRS helpers and raw-mode changes named in the changeset; an HTML example of schema mode.service-infogives up afterserviceInfoTimeout(30 s); a new request forgets an earlier failure; values nested more than 64 levels deep are aTranslationErrorbefore any recursive walk; the Conquest profile refuses a request whoseworkflow_typeisn't the context's descriptor type.TrsToolVersionRefmoved toio-schema/trs.ts(the utils no longer import the component),@fireslines name the detail types, sharper tests.#(from a local fix branch) was already in feat(wes): add the I/O Schema form (proposal) #613; its remaining test case (validateAtat deciding locations under such names) is added here.Declined review findings
findPrimaryDescriptorPath()should refuse several primary descriptors (Sourcery): declined, the profile'strs-filesvectorprimary-descriptors-in-one-directoryrequires the first one. Hosts that know the path passprimaryDescriptorPath.workflow_type_versionlist should count as unsupported (Sourcery): declined, it is deliberately read as "any version" (tested); the WES service still checks the request.dev; schema mode checks it.schemaRun()once per update (low, quality) and a sharedisObjecthelper (low): deferred to the split intodev.Merge gate
CI green and bot threads resolved; merged (squash) into
feat/io-schemaby the main session (allowed without the co-owner's review for this branch).🤖 Generated with Claude Code