Repository navigation
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 GuideAPIDefine and expose the run-request builder, TRS helpers, engine-profile contract, and validator subschema-checking interface that the rest of the feature relies on.
Uses of the APIIntegrate schema-based request construction into run creation while retaining raw mode and handling service support, form values, engine parameters, and submission errors.
ImplementationCompile and use subschema validators to determine which schema branches apply during input translation.
UIAdd a documentation preview that demonstrates schema-mode run creation with a dry-run provider and displays the built request.
ConfigurationRecord the proposed WES feature and its public exports in the package changeset.
DocumentationDocument schema-mode run creation, TRS and request-building helpers, engine profiles, and the added test-vector coverage.
TestsExercise 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.
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. 4, 2026, 2:51 a.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
| const engineParameters = JSON.parse(this.formData.workflowEngineParams); | ||
| const base: RunRequest = this.ioSchema | ||
| ? await this.buildSchemaRequest(engineParameters) | ||
| : { |
There was a problem hiding this comment.
🟠 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)) { |
There was a problem hiding this comment.
🟡 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 ( |
There was a problem hiding this comment.
🟡 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 && |
There was a problem hiding this comment.
🟡 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.
| 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); |
There was a problem hiding this comment.
🟡 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) { |
There was a problem hiding this comment.
🟡 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 || |
There was a problem hiding this comment.
🟡 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.
| await toWorkflowParams(schema, { list: ["drs://a/b", "plain"] }) | ||
| ).to.deep.equal({ list: ["drs://a/b", "plain"] }); |
There was a problem hiding this comment.
🟡 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); |
There was a problem hiding this comment.
🟡 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 }); |
There was a problem hiding this comment.
🟡 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.
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.src/io-schema/bindings.ts):toWorkflowParams()andbuildRunRequest()port the engine bindings of profile 0.3.0 forNFL,SMK,WDLandCWLfrom 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 byx-ga4gh-parameter, qualify WDL names with the entry point, turn CWL file values intoFile/Directoryobjects, and refuse what Nextflow or the CWL loader would change (${, keys with-;Fileobjects, keys with$or:). Defaults are never inserted. Errors areTranslationErrors 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$idresources, and on$dynamicRef.unsupportedBy()checks a service'sservice-infofor the type and version.src/io-schema/trs.ts):trsDescriptorUrl()(plain primary descriptor by its path),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_path, derived from the URL of the TRS primary descriptor (raw.githubusercontent.comorgithub.com/.../blob/...). 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, submits only valid values, and shows refused values with their location. Engine parameters, tags and attachments stay in the advanced section. WithoutioSchema, 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).IoSchemaCheckgets an optionalvalidateAt(pointer, value)(SubschemaValidator) for the subschemas whose validity decides which schemas apply (anyOf/oneOfbranches,if,contains); the hyperjump validator compiles them with the schema. This changes feat(wes): add the I/O Schema form (proposal) #613'svalidator.ts(on this branch only).scripts/sync-io-schema.mjsalso copies the profile'swes-params,workflow-urlsandtrs-filesvectors (same pin,2c3dc49); the existing fixtures are unchanged.@elixir-cloud/wes/utils.Which of the open questions of #613 it depends on
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.@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-schemapackage, 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").valuesandvalidofecc-io-form-changed, noterrors; it works with either payload.@open-wc/testingand Lit 2.8, as feat(wes): add the I/O Schema form (proposal) #613.Questions of its own for @anuragxxd (the defaults this branch uses):
trsToolVersionobject (trsUrl,toolId,versionId, and optionallyprimaryDescriptorPath,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.EngineProfileinterface (apply(request, context)) with one built-in profile for Conquest. Alternative: no built-in profiles; hosts pass engine parameters.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):
trs.ts).validateAt()and the request builder (bindings.ts).How it was verified
web-test-runner,npm testin the package), including allwes-params(32),workflow-urlsandtrs-filesvectors, 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 lintat the root, which builds all packages and the docs app (21 of 21 tasks successful, ESLint errors 0, all docs pages prerendered).$refto an embedded$idresource was followed from the document root, so a colliding root$defsentry 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; untesteddecidingLocations(); undocumented fallbacks; internals exported. Round two found no high or medium findings; its two lows are fixed too: a conditional subschema behind a$refinto a non-schema location now fails as aTranslationError, and the Conquest path check also refuses Unicode format and separator characters (e.g. bidi overrides) and segments with leading or trailing whitespace.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
validateAtshould be required onIoSchemaCheckand the builder's "validator can't check subschemas" branch is dead (medium, quality): declined. A validator set withsetIoSchemaValidator()(Q2) may lack it; the branch is reachable that way and tested.schemaRun()once per update instead of per render (low): deferred to the split; it is cheap.--checkmode 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:
Enhancements:
Documentation:
Tests:
Chores: