Skip to content

feat: build forms from I/O schemas (proposal) - #155

Draft
uniqueg wants to merge 9 commits into
devfrom
feat/io-schema-forms-proposal
Draft

uniqueg wants to merge 9 commits into
devfrom
feat/io-schema-forms-proposal

Conversation

@uniqueg

@uniqueg uniqueg commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Part of #47

Important

Proposal, not for merge. This branch builds on the unreleased Cloud Components proposals elixir-cloud-aai/cloud-components#613 (I/O Schema form) and elixir-cloud-aai/cloud-components#614 (run request from a schema), at f28c15c. They are vendored as npm tarballs under vendor/cloud-components/ until Cloud Components releases them. Nothing here merges before anuragxxd has answered the open design questions in elixir-cloud-aai/cloud-components#444 and reviewed the Cloud Components side, and Krini's maintainer has reviewed this side.

Summary

The workflow page can now build its form from a GA4GH I/O Schema, so users fill in typed inputs and no longer write workflow_params JSON by hand (#47, How 1-3):

  • Schema sources: from a tool registry (TRS) listed in the service registry (the schema file next to the primary descriptor, ga4gh-io.schema.json of type OTHER, or an IO_SCHEMA file), by upload, or by URL. With an uploaded or linked schema, Krini still reads the tool version from the registry the schema names. It skips the registry's own schema then.
  • Form and request: the Cloud Components WES run-create form renders the schema (ioSchema, trsToolVersion). Its values become workflow_params, and workflow_url and workflow_type/_version come from the TRS tool version. On Conquest, Krini passes the built-in conquestEngineProfile (detected by the service-info name). allowedSchemes follows the service's supported_filesystem_protocols.
  • Fallback: "Use the plain form" returns to the existing WES form. The panel is hidden when the registry lists no TRS.
  • Server route: GET /api/workflows/trs-tool-version reads the tool version and the schema from the TRS on the server, because TRS-Filer sends no CORS headers. It only talks to TRS URLs that the service registry lists (otherwise 400). It uses https only, no redirects, a 10 s timeout and a 2 MiB limit, and maps TRS errors to 404/422/502. GET /api/workflows/get-trs-servers lists the registry's TRS services.
  • Demo (How 4): "Use the demo workflow" loads ga4gh-io-schema-demo 1.0.0 from the registered TRS-Filer. It is shown only with the built-in examples (WORKFLOW_EXAMPLES unset).
  • Docs: user guide "Workflows from I/O Schemas", the demo in "Workflow examples", and the operator section "Tool registries (proposal)". The development guide and vendor/cloud-components/README.md say how to swap the tarballs out.

The example workflow and why

ga4gh-io-schema-demo 1.0.0 (WDL 1.1) in the TRS-Filer at trs-filer.rahtiapp.fi (registry entry EJW598), meant to run on Conquest at CERIT:

  • It is already registered with its schema (type OTHER), so no new registry content is needed.
  • Its descriptor URL is a raw GitHub URL at a fixed commit (e80692a), which conquestEngineProfile maps to what Conquest accepts.
  • Conquest lists WDL 1.1 and https/s3 inputs.
  • Other tools in that TRS don't fit: greetings-nextflow and example_workflow are Nextflow (Conquest's Nextflow support waits on Conquest: Nextflow runs fail without main.nf at the repo root generic-issues#194), Conquest doesn't list report-snakemake's Snakemake version 8, and word-count-cwl is CWL, which none of our listed WES runs.

The run itself is not verified live yet (see Open questions).

Design questions this depends on (cloud-components#444)

  • Q2 (validator): Krini's CSP has no 'unsafe-eval', so the form must validate without code generation (the hyperjump-based validator in #613, not Ajv's compiled mode). A choice that needs unsafe-eval would break this page.
  • Q3 (where helpers live): Krini imports findSchemaFile, conquestEngineProfile and friends from @elixir-cloud/wes/utils. If they move or are renamed, the imports in src/lib/io-schema.ts and src/lib/trs.ts follow.
  • A (who fetches): the host app fetches TRS content and passes it in. Krini needs a server route anyway because TRS-Filer has no CORS. A component that fetches by itself would make the route redundant for the schema but not for the descriptor lookup.
  • B (engine profiles): uses the built-in conquestEngineProfile. A profile registry or an operator setting would replace engineProfileFor's detection by service-info name.
  • Q6 and C don't affect this branch.

What changes once Cloud Components releases

  1. Replace the two file: entries in package.json (@elixir-cloud/wes, and the @elixir-cloud/design override) with the released versions, run bun install, and commit bun.lock.
  2. Delete vendor/ and the COPY vendor ./vendor line (marked TEMPORARY) in the Dockerfile.
  3. Drop the vendoring note in docs/development/index.md and the "proposal" markers in the user and operator guides.
  4. Adjust the imports and props to whatever the release settles for the questions above.

Verification

Run locally on the branch head (Bun 1.4.4):

  • bun run lint (Biome): clean.
  • bunx tsc --noEmit: clean.
  • npx vitest run --coverage: 583 tests passed, 100% statements, branches, functions and lines.
  • npx playwright test: 72 passed (Chromium and Firefox). These include the new e2e/io-schema.spec.ts: a form loaded from the mock TRS and submitted with the expected workflow_url, type, version and workflow_params; an uploaded schema; a file that isn't JSON; an unknown tool; and the way back to the plain form.
  • next build (as part of the e2e run): passed.
  • mkdocs build --strict with docs/requirements.txt: passed.
  • CI: to be updated.

Declined review findings

  • Quality review, low: small record/text helpers are duplicated between src/lib/trs.ts and src/lib/io-schema.ts. Left as they are for the proposal; they get tidied when this is split into mergeable PRs.
  • Quality review, low: end-to-end tests for an unsupported workflow type and invalid field values. Both are Cloud Components behaviour and covered there; Krini's unit tests cover the type mapping.

Open questions

  • Live run (acceptance criterion): the demo has not run end to end against Conquest. That needs a deployment of this branch and a member token (uniqueg).
  • Krini (maintainer): is the panel above the form the right place? Should Conquest be detected by the service-info name or by an operator setting?
  • Cloud Components (anuragxxd): the answers to cloud-components#444 listed above.

🤖 Generated with Claude Code

Summary by Sourcery

Add proposal-stage support for creating workflow runs from GA4GH I/O Schemas while preserving the existing plain workflow form.

New Features:

  • Build workflow run forms from GA4GH I/O Schemas obtained from registered TRS services, uploaded files, or HTTPS URLs, and submit the resulting WES requests.
  • Offer a demo I/O Schema workflow when deployments use the built-in workflow examples.

Enhancements:

  • Keep the existing plain WES form available as a fallback and hide the schema panel when no TRS services are registered.

Build:

  • Vendor unreleased Cloud Components tarballs as local package dependencies and copy them into the Docker build.

Documentation:

  • Document I/O Schema workflows, the demo, tool registry requirements, and temporary dependency vendoring.

Tests:

  • Add end-to-end coverage for schema-based submission, uploaded schemas, invalid inputs, unknown tools, and returning to the plain form.

Chores:

  • Add a mock TRS service and I/O Schema fixture for integration testing.

uniqueg and others added 7 commits December 4, 2026 07:04
TEMPORARY, for the I/O Schema proposal (#47): @elixir-cloud/wes and
@elixir-cloud/design come from tarballs in vendor/cloud-components/,
built with npm pack from the cloud-components proposal branches
(#613, #614, head f28c15c), as those versions aren't released. The
version is 2.0.0-alpha.51-io.f28c15c, so that it can't be mistaken
for the published alpha.51. The design package is pinned through
overrides, so that the TES package uses the same one. The Dockerfile
copies vendor/ before installing. Swap back to released versions as
docs/development/index.md describes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #47. Two routes for the workflow form in schema mode:
/api/workflows/get-trs-servers lists the TRS services of the service
registry, and /api/workflows/trs-tool-version reads a tool version
from one of them on the server (tool registries need not allow
cross-origin requests): its descriptor type, the TRS tool version
reference of the Cloud Components and its I/O Schema, found as the
profile proposes (findSchemaFile). Only registry entries over https
are read, with timeouts, size limits and no redirects.

src/lib/schema-run.ts takes the user's choice in the browser: the
schema from the tool registry, an upload or an https URL (fetched
without credentials), with tool and version defaulting to those the
schema names. src/lib/io-schema.ts picks the engine profile (Conquest
by its service-info name) and the allowed URI schemes (the service's
supported_filesystem_protocols).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #47. The panel "Workflow from a tool registry" above the
workflow form loads a tool version and its I/O Schema (from the tool
registry, an upload or a URL) and switches the form to the schema mode
of ecc-client-ga4gh-wes-run-create: the inputs as a form, the run
request built from the values and the TRS tool version, with the
Conquest engine profile for Conquest and the service's URI schemes for
file inputs. "Use the plain form" goes back; without a schema the plain
WES form is used. "Use the demo workflow" enters the I/O Schema demo
(ga4gh-io-schema-demo 1.0.0, WDL 1.1).

End-to-end tests against a mock tool registry with the word count
example of the I/O Schema: a run from the schema form, and an error for
a missing tool version. Docs: user guide, examples, operator config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the user uploads a schema or names one by URL, the TRS lookup
only needs the tool version and its descriptor. The route takes
schema=0 and the loader no longer fetches the registry's schema file,
so a broken registry schema can't block a user's own one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The demo button points at a tool in our own registry, so it only
makes sense where Krini shows its built-in workflow examples. The
page reads ioSchemaDemo() on the server, which returns the demo only
while WORKFLOW_EXAMPLES is unset, and the panel renders the button
only when it gets one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Operators learn how Krini finds tool registries, which outbound
requests it makes for them, how schema URLs relate to the CSP and
when the demo shows. The vendor folder gets a README with the
provenance of the Cloud Components tarballs and how to remove them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A member uploads a schema file and gets the form for the tool and
version it names; a file that isn't JSON shows why it can't be used.

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

sourcery-ai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Expose endpoints for listing registered TRS services and loading a tool version, descriptor metadata, and its I/O Schema.

  • src/app/api/workflows/get-trs-servers/route.ts L1-17
  • src/app/api/workflows/trs-tool-version/route.ts L1-59

Uses of the API

Connect the workflow page and WES form to the schema-loading flow, pass service-specific run settings, and retain the plain-form fallback.

  • src/app/dashboard/workflows/_components/ecc-wes-create-run-wrapper.tsx L9-16, L36-43, L75-116 (+4 small edits)
  • src/app/dashboard/workflows/create/page.tsx L7, L18, L61

Implementation

Implement schema parsing and source validation, browser-side schema-run loading, registered-TRS discovery, and secure TRS tool-version and schema retrieval.

  • src/lib/io-schema.ts L1-169
  • src/lib/schema-run.ts L1-116
  • src/lib/trs-registry.ts L1-35
  • src/lib/trs.ts L1-242

UI

Provide the tool-registry, upload, and URL controls, including schema-loading errors, the optional demo, and switching back to the plain form.

  • src/app/dashboard/workflows/_components/io-schema-source.tsx L1-234

Configuration

Use the proposal Cloud Components tarballs during dependency installation and document the temporary Docker build input.

  • Dockerfile L11-15
  • package.json L18, L57-58

Documentation

Explain how to develop with the vendored proposal dependencies and configure tool registries and schema-based workflow submissions.

  • docs/development/index.md L32-42
  • docs/operator-guide/configuration.md L217-245
  • docs/user-guide/index.md L37-39, L61-102
  • docs/user-guide/workflow-examples.md L101-121
  • vendor/cloud-components/README.md L1-34

Tests

Verify registered-TRS discovery, TRS tool-version loading, schema parsing and source handling, and end-to-end form submission and fallback.

  • e2e/io-schema.spec.ts L1-137
  • e2e/mock/server.ts L11-15, L132-137, L457-503 (+2 small edits)
  • e2e/mock/word-count.schema.json L1-70
  • src/app/api/workflows/get-trs-servers/route.test.ts L1-74
  • src/app/api/workflows/trs-tool-version/route.test.ts L1-162
  • src/lib/io-schema.test.ts L1-165
  • src/lib/schema-run.test.ts L1-178
  • src/lib/trs.test.ts L1-308

Lock files and vendored code

Record the updated dependency resolution and include the proposal Cloud Components packages as vendored tarballs.

  • bun.lock L137-141, L159-170, L741-746 (+12 small edits)
  • vendor/cloud-components/elixir-cloud-design-2.0.0-alpha.51-io.f28c15c.tgz
  • vendor/cloud-components/elixir-cloud-wes-2.0.0-alpha.51-io.f28c15c.tgz

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

@read-the-docs-community

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

Copy link
Copy Markdown

📖 4 files modified


Preview · build overview · krini · built Dec. 4, 2026, 12:29 p.m. UTC

@codecov

codecov Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (88d787e) to head (4fe0ca6).

Additional details and impacted files
@@            Coverage Diff             @@
##               dev      #155    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           30        36     +6     
  Lines         1040      1205   +165     
  Branches       301       353    +52     
==========================================
+ Hits          1040      1205   +165     

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

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

@uniqueg uniqueg changed the title feat: build workflow forms from I/O schemas (proposal) feat: build forms from I/O schemas (proposal) Dec 4, 2026
uniqueg and others added 2 commits December 4, 2026 13:25
Tool and version IDs "." and ".." are refused, because the HTTP
client would resolve them to other paths of the tool registry. A
missing files list, descriptor or schema file now says which one is
missing instead of claiming that the tool version doesn't exist. A
regression test pins that schema files with ".." in their path are
ignored.

Found by the adversarial review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An uploaded schema file over 1 MiB is refused by its size, before the
browser reads it, so a large file picked by mistake can't freeze the
tab.

Found by the adversarial review.

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