Repository navigation
Conversation
Port the output normaliser of profile 0.3.0 (ga4gh_io_schema.outputs) to TypeScript: normaliseOutputs() finds outputs by name, then by x-ga4gh-output-glob in the run's listing (cwltool, Toil, Cromwell, miniwdl, Conquest, Sapporo, WESkit shapes), turns reported paths into URIs of the output directory, checks listed entries, validates the result (whole object for COMPLETE, per output otherwise) and reports removed, ambiguous, unconverted, undeclared, unmatched and skipped entries. The validator gets an optional validateOutputs(). The sync script copies the wes-outputs vectors (same pin, 2c3dc49); all pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ecc-client-ga4gh-wes-run gains ioSchema, outputOptions, outputProvider and allowedSchemes. With a schema and a run that has ended, the Outputs tab shows the normalised outputs through ecc-client-ga4gh-wes-run-output, warns about partial and non-conformant outputs, names what the normaliser reports, and shows undeclared outputs and unmatched files without descriptions. Without a schema the raw view stays. The normaliser and run-output load on demand. Docs: Run outputs on the I/O Schemas page, the run page's new section and properties, a docs-app demo of the profile's demo workflow, and a changeset. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- validateOutputs validates one output as the only member of the outputs object, so names with '#' no longer break checkIoSchema, and no extra subschemas are compiled - the run view passes the default allowed schemes when none are set, and resolves $ref and single branches of output schemas for display - values nested more than 64 levels are refused (unconverted) instead of overflowing the validator's stack; strings() is iterative - reuse encodeSegment from trs.ts; export outputProperties and displaySchema; FINAL_STATES from states.ts only - tests for validateOutputs, deep values, display schemas; docs on memoising outputOptions, running runs, embedded $id, the validator contract in the changeset Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideData structuresDefine the final WES run states used to gate output normalisation.
APIAdd the output-normalisation API and its result types, and extend schema checks with output validation for that normaliser.
ImplementationUpdate the IO Schema sync script to generate the profile's WES output test-vector fixture alongside the existing fixtures.
UIAdd schema-aware output rendering to the run component, including normalisation, output viewers, reports, and raw-output fallback.
ConfigurationRecord the new run-output feature and utility exports in the WES package changeset.
DocumentationDocument schema-enabled run outputs, normalisation options, and the public component properties, with an interactive preview and example.
Document the output normaliser, its reports, limitations, and usage.
Build the documentation preview for completed and failed runs using the demo workflow and output provider.
TestsAdd coverage for schema-aware run output rendering and its fallback, notices, options, and asynchronous normalisation behavior.
Test the output normaliser against profile vectors and edge cases, including path safety, validation, references, and depth limits.
Verify output validation through the IO Schema validator, including escaped output names and undeclared outputs.
Lock files and vendored codeAdd the generated GA4GH IO Schema WES output test vectors consumed by normaliser tests.
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, 12:19 p.m. UTC |
Values nested too deeply land in unconverted too, so the notice no longer says their files can't be located. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Hey - I've found 12 issues
Sourcery assessment
Needs a human reviewer. 12 findings to address first, and with a schema and output provider configured, the new Outputs path passes normalised run-log file URIs to viewers and downloads. If a hostile or unintended URI gets past the output component’s deployment allow-list, it could trigger a fetch or expose a run file; reverting cannot undo a request already made.
Blocking findings: packages/ecc-client-ga4gh-wes/src/components/run/run.ts:819, packages/ecc-client-ga4gh-wes/src/components/run/run.ts:115, packages/ecc-client-ga4gh-wes/src/io-schema/outputs.ts:738, packages/ecc-client-ga4gh-wes/src/io-schema/outputs.ts:517, packages/ecc-client-ga4gh-wes/src/components/run/run.ts:146, and 7 more
| .schema=${schema as Record<string, unknown>} | ||
| .value=${value} | ||
| .provider=${this.outputProvider} | ||
| .allowedSchemes=${this.allowedSchemes ?? [...DEFAULT_ALLOWED_SCHEMES]} |
There was a problem hiding this comment.
🟠 High · Run outputs trigger arbitrary HTTPS fetches
When a run reports an attacker-controlled HTTPS URI for an output with a viewer, and the host's output provider proxies that URI or adds privileged credentials, renderOutput() passes the scheme-only allowedSchemes check to the output element, which then calls outputProvider.fetchOutput() for an output URI. A malicious workflow author can report an attacker-controlled HTTPS URI for a schema-marked viewer, causing a host provider that proxies URIs or adds credentials to fetch that destination and expose privileged network access or credentials.
Apply a deployment-controlled host/URI allow-list before invoking the output provider, and enforce the same policy in any server-side proxy it uses.
|
|
||
| protected willUpdate(changed: PropertyValues<this>): void { | ||
| if ( | ||
| changed.has("run" as keyof ECCClientGa4ghWesRun) || |
There was a problem hiding this comment.
🟡 Medium · Older runs replace selected outputs
When the provider or run ID changes while an earlier getRunLog() request is pending and that request resolves last, loadRunData() accepts the stale response and assigns it to run; updateOutputs() then normalises it, so the selected run displays another run’s files.
Discard each getRunLog() response unless its provider and run ID are still current.
| } | ||
| } | ||
| } else { | ||
| matches = files.filter((segments) => matchGlob(glob, segments)); |
There was a problem hiding this comment.
🟡 Medium · Malicious schemas freeze run views
When a user opens a run whose schema has long adversarial output globs and whose server-reported listing contains long paths or many entries, takeGlob() applies each schema glob to every listed path, and matchSegment() can repeatedly backtrack across long glob and filename segments. A workflow author who controls the schema and run listing can make updateOutputs() perform excessive synchronous work, freezing the run view in the user's browser.
Bound schema glob lengths, listing entry counts and path lengths before matching, or make matching incremental with a work budget so hostile inputs cannot monopolize the UI thread.
| try { | ||
| if (typeof entry !== "string") { | ||
| throw new Unconvertible("not a path or URI"); | ||
| } | ||
| let segments: Segments; | ||
| if (SCHEME.test(entry)) segments = uriSegments(entry, base ?? ""); | ||
| else if (entry.startsWith("/")) { | ||
| throw new Unconvertible("an absolute path"); | ||
| } else segments = entry.split("/"); | ||
| checkSegments(segments); | ||
| // Checked segments contain no '/', so the joined path is a key | ||
| checked.set(segments.join("/"), segments); | ||
| } catch (error) { | ||
| if (!(error instanceof Unconvertible)) throw error; | ||
| skipped.push({ entry: redact(entry), reason: error.message }); |
There was a problem hiding this comment.
🟡 Medium · Large listings stall output rendering
When a run or supplied files listing contains a very large number of entries and the schema declares output globs, checkListing processes every listed entry and glob matching scans the checked files for each declared glob, with no input-size bound, so a very large run listing can consume substantial browser time and memory before outputs render.
Bound the number of listing entries processed or otherwise cap normalisation work, and report when the limit is reached.
Also at packages/ecc-client-ga4gh-wes/src/io-schema/outputs.ts:720.
| ]); | ||
| const options = | ||
| typeof outputOptions === "function" | ||
| ? await outputOptions(run) |
There was a problem hiding this comment.
🟡 Medium · Outputs stay loading
When the outputOptions function returns a promise for a listing that never resolves, updateOutputs awaits the outputOptions promise without a timeout, so a listing request that never settles leaves the Outputs tab on its loading skeleton indefinitely; the output viewer’s timeout only covers file loads.
Add a timeout or cancellation path for resolving outputOptions and show an error or fallback when it expires.
| const schema = resolver.follow(schemaIn); | ||
| if (!isObject(schema)) return value; | ||
| if ("x-ga4gh-file" in schema) return convertFile(value, context); | ||
| const branch = singleBranch(schema); |
There was a problem hiding this comment.
🟡 Medium · Composed file outputs stay unusable
When an output schema puts its file annotation in an allOf branch and the engine reports a local path, convert() does not handle the allOf branch, leaving the path unconverted, and displaySchema leaves the composition intact; validation fails and the run view shows no usable file output.
Handle file annotations in allOf branches in both convert() and displaySchema.
Also at apps/documentation/pages/docs/wes/io-schema.mdx:99, packages/ecc-client-ga4gh-wes/src/io-schema/outputs.ts:278, packages/ecc-client-ga4gh-wes/src/io-schema/outputs.ts:599.
| const outputs = own(properties, "outputs") ? properties.outputs : undefined; | ||
| return isObject(outputs) && isObject(outputs.properties) | ||
| ? outputs.properties |
There was a problem hiding this comment.
🟠 High · Referenced outputs are missed
When the schema expresses its outputs object through a $ref, outputProperties reads only inline properties.outputs.properties, so when a valid schema places outputs behind a $ref, it returns no declarations; engineNames then cannot match the run’s outputs and the view reports them as undeclared or missing instead of normalising them.
Resolve the outputs schema before extracting its properties and engine-name bindings.
| return html`<ecc-client-ga4gh-wes-run-output | ||
| .name=${name} | ||
| .schema=${schema as Record<string, unknown>} | ||
| .value=${value} |
There was a problem hiding this comment.
🟡 Medium · Nested files lack viewers
When a declared output contains file references nested in record properties, renderOutput passes a nested record value and its schema to the output element, but outputEntries only recognizes a file at the root, an array of files, or an object whose additionalProperties are files. Files nested in record properties are rendered as ordinary values, so their viewer and download actions are unavailable.
Extend the output element to recursively render nested schema/value structures, or explicitly constrain the supported output shapes and explain that limitation.
| } | ||
| let path = value as string; | ||
| if (path.startsWith("/")) { | ||
| if (context.local === undefined || !path.startsWith(`${context.local}/`)) { |
There was a problem hiding this comment.
🟡 Medium · Output directory root is rejected
When an engine reports the local output directory itself as a file or directory output, convertFile() rejects a path equal to localDir because it requires the path to start with localDir/, so the output is marked unconverted instead of becoming outputDir.
Accept a path equal to localDir and convert it to outputDir.
Also at packages/ecc-client-ga4gh-wes/src/io-schema/outputs.ts:570.
| const found = strings(result.outputs); | ||
| result.unmatchedFiles = [...checked] | ||
| .filter(([key]) => !covered.has(key)) | ||
| .map(([, segments]) => buildUri(base as string, segments)) | ||
| .filter((uri) => !found.has(uri)) |
There was a problem hiding this comment.
🟡 Medium · Listed files disappear from Other files
When a non-file output string equals the URI of a listed file, strings(result.outputs) collects every string value, including ordinary text outputs, so a text value equal to a listed file’s URI makes the filter drop that file from unmatchedFiles; the run view then omits it from “Other files.”
Track URIs found in declared file-reference outputs and use only those URIs to filter the listing.
Part of #571
This is a proposal, stacked on the run request proposal #614 (base branch
feat/io-run-request-proposal), which is stacked on the I/O form proposal #613. Like them, 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 #571. Once the questions are answered, it will be rebased on what lands from #613 and #614 and split into reviewable PRs (see "How it will be split"). It stays a draft.What it does
Run views show the outputs of a run by the workflow's I/O Schema instead of raw
RunLog.outputs.src/io-schema/outputs.ts):normaliseOutputs(schema, runLog, options)ports the normaliser of profile 0.3.0 (ga4gh_io_schema.outputs) to TypeScript. It finds outputs by name (property name orx-ga4gh-parameter.name, qualified with the WDL entry point), else byx-ga4gh-output-globamong the listed files (Sapporo lists, WESkitfilesystem, oroptions.files); turns CWLFile/Directoryobjects, paths underlocalDirand relative paths into URIs underoutputDir(segments percent-encoded as the profile says); checks every listed entry (absolute paths,./../empty segments, backslashes, control characters, colon in the first segment, URIs outsideoutputDir, with query/fragment or encoded/) and reports skipped ones without user information, query and fragment; drops WESkit's presignedS3URLs; matches globs in polynomial time; handles secondary files and directory outputs; validates the result againstoutputs(completed runs: kept,non-conformantwith errors) or output by output (other final states: invalid outputsremoved,partial); reportsambiguous,unconverted,undeclared,unmatchedFiles. Whole-input faults raiseNormalisationError; values nested more than 64 levels deep areunconverted. Exported from@elixir-cloud/wes/utils.IoSchemaCheckgets an optionalvalidateOutputs(value, output?)(OutputsValidator); the hyperjump validator compilesoutputswith the document and validates one output as the only member of the outputs object (so output names need no URI fragment). This changes feat(wes): add the I/O Schema form (proposal) #613'svalidator.ts(on this branch only), like feat(wes): build run requests from I/O Schemas (proposal) #614'svalidateAt().ecc-client-ga4gh-wes-run: new propertiesioSchema,outputOptions(object, or a function of the run log, also async),outputProviderandallowedSchemes. With a schema and a run in a final state, the Outputs tab shows each output through the existingecc-client-ga4gh-wes-run-output(titles, descriptions, table viewer, sandboxed HTML viewer, downloads, scheme allow-list), in the schema's order, with local$refs and single branches besidesnullresolved for display; warnings for partial and non-conformant outputs (with the errors); notices for removed, ambiguous, unconverted and skipped entries; undeclared outputs and unmatched files ("Other files") without descriptions and never as links of their own; outputs not produced are named. A running run says outputs come when it has ended; if normalisation fails, the reason is shown with the raw outputs. Without a schema, the current raw view stays. The normaliser andrun-outputare loaded on demand (as feat(wes): build run requests from I/O Schemas (proposal) #614 does for the I/O form), so pages without a schema don't load the validator.scripts/sync-io-schema.mjsalso copies the profile'swes-outputsvectors (same pin,2c3dc49); existing fixtures are unchanged.Which open questions it depends on
Of #613:
validateOutputs). A replacement validator (e.g. Ajv) would have to provide it; without it,normaliseOutputs()raises aNormalisationError.@elixir-cloud/wes(src/io-schema/outputs.ts, exported from@elixir-cloud/wes/utils). If the checks move to a shared@elixir-cloud/io-schemapackage, it moves with them; the run view stays in the WES package.setDescriptionFormat(), asrun-outputalready does.@open-wc/testingand Lit 2.8, as feat(wes): add the I/O Schema form (proposal) #613.Of #614: none (it uses neither the builder nor the engine profiles).
Questions of its own for @anuragxxd (the defaults this branch uses):
ioSchemaonecc-client-ga4gh-wes-run, with the host passing the schema (krini#47 finds it in TRS). Where the run's files are is deployment knowledge, so it comes from the host asoutputOptions(object or function of the run log; a new object or function normalises again, so hosts pass a stable one). Alternative: a separateecc-client-ga4gh-wes-run-outputselement that the host slots into the existingoutputsslot, leavingrununchanged, possibly with arefresh()method.normaliseOutputs()itself. Alternative: fire e.g.ecc-run-outputs-normalised.How it will be split
After the splits of #613 and #614 land, in this order (each with its tests and docs):
wes-outputsvectors in the sync script,validateOutputs()and the normaliser (outputs.ts).ecc-client-ga4gh-wes-run, its demo and the changeset.How it was verified
web-test-runner --group default, 18 test files), including all 18wes-outputsvectors (16 results, 2 errors), the normaliser's own cases (listing checks, percent-encoding, directories, code point order,__proto__, unconvertible and too deeply nested values, WESkitS3, schemes of file references, validators withoutvalidateOutputs),validateOutputs(pointers for names with/,#,%,~; undeclared names; schemas without outputs), glob and secondary-file rules, display schemas, and the run view (raw view kept without a schema, schema order, outputs declared by$refshown as files, default allowed schemes, options function, allowed schemes passed on, partial, non-conformant, undeclared and unmatched, ambiguous/unconverted/skipped notices, running run, fallback to the raw view, no outputs, stale normalisations dropped). WebKit can't launch on the agent host, so it runs in CI only.rungroup (13 passed, Chromium) and ESLint.npm run lintat the root, which builds all packages and the docs app: 21/21 tasks pass (the docs build prerenders/docs/wes/components/runand/docs/wes/io-schema).dev; the local results are the evidence.HUSKY=0, as in feat(wes): add the I/O Schema form (proposal) #613 and feat(wes): build run requests from I/O Schemas (proposal) #614 (the hook's docs build needs Google Fonts, which the agent sandbox blocks by default); lint was run by hand.Declined review findings
Two review rounds (adversarial and quality reviewers). Fixed in e817e63 and c24a517: per-output subschemas compiled through URI fragments made output names with
#breakcheckIoSchema(now validated without fragments; see the remaining#issue below); unsetallowedSchemesreachedrun-outputasundefined; outputs declared by$refor a single branch besidesnulllost their file display (displaySchema()); values nested deeper than the stack allows (nowunconvertedbeyond 64 levels); helper duplication (encodeSegment,FINAL_STATES, declared outputs); directvalidateOutputstests; docs and changeset gaps.Declined:
outputOptionsobject or function normalises again (quality, medium): kept and documented in the JSDoc, the run page and its React example (pass a stable object or function). Comparing options by value can't cover functions; arefresh()method belongs to question D.outputs.tsinto smaller modules (quality, low): left for the split into reviewable PRs, once feat(wes): add the I/O Schema form (proposal) #613's Q3 (place and name) is answered.$refresolver (quality, medium):outputs.tskeeps its ownResolver, with a comment on why: it follows the reference implementation (an unresolvable reference keeps the value for validation to report), unlikefields.ts(merges into{}for the form) andbindings.ts(throws).CONTROLincludes C1 like the Python reference;isObjectandownfollow the per-file convention of the package.$idresources aren't followed (adversarial, low): documented on the I/O Schemas page as a difference from the Python reference; such values stay as reported and validation reports them.#in names still breakscheckIoSchemaelsewhere (adversarial round 2, medium): not fixed here. feat(wes): add the I/O Schema form (proposal) #613'sfragment()(unchanged on this branch) addresses deciding subschemas (anyOf,oneOf,if,contains) and$defsentries by URI fragment, and hyperjump doesn't resolve%23. So an output, input or nested property with#in its name and a union, or a$defskey with#, makes the schema unusable (run view: error notice and raw outputs). It belongs in feat(wes): add the I/O Schema form (proposal) #613 (e.g. generated$anchors in the registered copy, or a clear profile error for such names); this branch picks it up on rebase.MAX_DEPTHin two modules (quality round 2, low): kept local for the proposal; to merge when the module is split.outputsaren't checked when one output is validated (quality round 2, low): by design, since one output alone can't satisfy or breakrequired,minPropertiesoradditionalPropertiesof the whole object; completed runs validate the whole object.🤖 Generated with Claude Code
Summary by Sourcery
Show WES run outputs using GA4GH IO Schema hints, with validation and clear reporting for output states and unmatched data.
New Features:
Enhancements:
Documentation:
Tests:
Chores: