Foundry-authored Mold IO schemas live in TypeScript packages. The content/schemas/ tree only holds the human-readable <name>.md schema notes; there are no JSON mirrors there. Mold frontmatter cites schemas as [[wiki-link]] to the schema note — cast resolves the wiki-link, reads package + package_export from the note’s frontmatter, imports the named runtime export, and serializes it into the bundle.
Where a schema lives
The rule: schema lives with its producer; orphan schemas live in foundry.
- A schema with a TypeScript producer in this repo lives in the producer’s package. Today:
summary-nextflowlives in@galaxy-foundry/summarize-nextflowbecause that package emits it. - A schema with no in-repo TS producer (“orphan”) lives in
@galaxy-foundry/gxwf-foundry. Today:summary-cwl,galaxy-tool-discovery,galaxy-tool-summary,tests-format. - Vendored upstream schemas (e.g. nf-core meta schemas, parsed-tool from
@galaxy-tool-util/schema) live in whichever package needs them at runtime.
There is no separate *-schema package. Validators all funnel through one CLI: foundry validate-<name>.
Source chain
- Author the canonical JSON Schema at
packages/<owner>/src/schemas/<name>/<name>.schema.json(foundry) orpackages/summarize-nextflow/src/schema/<name>.schema.json(producer-co-located). - Add the renderable schema note at
content/schemas/<name>.mdwithtype: schema,package,package_export,validator_bin: foundry, andvalidator_subcommand: validate-<name>. - Regenerate
<name>.schema.generated.tsvia the package’sscripts/sync-schema.mjs(run onprebuild). - Wire a subcommand in
packages/gxwf-foundry/src/commands/validate-<name>.tsusingcreateValidator()+runJsonValidator()fromlib/. - Register the schema in
site/src/lib/schema-registry.ts.
Validator invocation
Generated skills validate through the CLI: foundry validate-<name> <artifact-path>. Cast bundles validator_bin + args ([validator_subcommand, "--schema-sha256", <hash>, "{artifact_path}"]) into _verify.json so validate-artifact can spawn the right command.
The bundle copies the schema at cast time; the validator carries whatever schema its installed package release shipped. When the two differ, the gate inverts: conformant output fails and stale output passes (foundry#643). So the bundle pins the copy it made. The hash is the schema ref’s dst_hash in _provenance.json, the sha256 of JSON.stringify(schema, null, 2) + "\n", and every foundry validate-* that checks against one schema computes the same hash from its own copy. A mismatch exits 4 before any validation. Given the pin and no artifact, the command checks only the pin, which is how the skill’s Validation section checks for skew before the work starts. The pin is added only for a subcommand validator whose schema the bundle copied.
Library validators are also exported from @galaxy-foundry/gxwf-foundry and @galaxy-foundry/summarize-nextflow for TS consumers (the site uses these). Skills should still prefer the CLI so failures reproduce on a developer machine without needing a TS toolchain.
Current schemas
| Schema | Owner package | Subcommand |
|---|---|---|
summary-nextflow | @galaxy-foundry/summarize-nextflow | foundry validate-summary-nextflow |
summary-cwl | @galaxy-foundry/gxwf-foundry | foundry validate-summary-cwl |
galaxy-tool-discovery | @galaxy-foundry/gxwf-foundry | foundry validate-galaxy-tool-discovery |
galaxy-tool-summary | @galaxy-foundry/gxwf-foundry | foundry validate-galaxy-tool-summary |
tests-format | @galaxy-foundry/gxwf-foundry (vendored from @galaxy-tool-util/schema) | foundry validate-tests-format |