galaxyproject / galaxyproject/foundry
summarize-cwl: emit a skinny packed CWL (docs + schema.org stripped) alongside the full pack
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 3
- Avg merge
- 1d 22m
- Merged PRs (30d)
- 63
Description
## Summary
`summarize-cwl` is LLM-only by design (#231). The Mold's procedure asks the runtime LLM to read a normalized/packed CWL document and emit `summary-cwl.json`. That works fine for small workflows, but the packed JSON gets noisy fast — most of the bulk is not topology- or command-relevant.
Test-driving the 5-step CWL→Galaxy pipeline against `Barski-Lab/ga4gh_challenge/biowardrobe_chipseq_se.cwl` made this concrete: an 11-step single-end ChIP-seq workflow produced a 3752-line / ~85 KB packed JSON. Breakdown:
| Category | Bytes |
| --- | --- |
| `doc:` strings (220 of them, mostly per-flag help text) | ~22 KB |
| Two heavy tools (`bowtie-alignreads`, `macs2-callpeak-biowardrobe-only`) exposing every CLI flag as an input | ~38 KB |
| `http://schema.org/*` metadata on the main workflow | ~1 KB |
| Actual workflow topology (main inputs/outputs/steps + edges) | ~12 KB |
| CommandLineTool requirements, `baseCommand`, `arguments` | ~12 KB |
In the test-drive run I reached for a one-off `extract.mjs` deterministic transcriber to avoid having the LLM digest the full pack — but that bypasses the Mold's intended runtime contract. The right answer isn't a deterministic extractor (that's #231 and we don't want it); it's a thin pre-processor that strips the *non-semantic* bulk so the LLM-driven Mold runs on a tractable input.
## Proposal
Have the `summarize-cwl` runtime produce **two** normalized artifacts side by side:
1. `.packed.json` — the existing full packed/normalized CWL. Preserves everything; used when the Mold needs to drop down to a fidelity check.
2. `.packed.skinny.json` — a strip-down of (1) that removes ONLY content that cannot affect generated command lines or topology:
- All `doc:` and `label:` fields (preserve them on workflow-level inputs/outputs since those drive Galaxy labels; strip them inside CommandLineTools).
- `http://schema.org/*` keys (creator, license, codeRepository, …). Source provenance belongs in the summary's `source:` block.
- Whitespace / pretty-printing minimized.
The LLM uses (2) for navigation and topology, and reads (1) when it needs to verify command-line fidelity for a specific tool.
## Explicitly do NOT strip
Per discussion: unconnected tool inputs can still influence command lines via `default`, `valueFrom`, `InitialWorkDirRequirement`, or `ShellCommandRequirement` shell-fragment binding. Keep all CommandLineTool inputs, their `inputBinding`, `default`, `valueFrom`, requirements/hints, and `arguments` intact.
## Scope
- Land in `@galaxy-foundry/foundry` (or a sibling package) as a small TS function: `produceSkinnyPacked(packed: object): object`. ~50 lines.
- Wire into the cast bundle's procedure: `summarize-cwl` SKILL.md "Procedure" step 2 emits both files; "Procedure" step 3 reads the skinny one by default.
- Add a test that asserts the skinny output is byte-stable for a fixed input and that no `doc`/`label`/`schema.org` survive inside `CommandLineTool` graph entries.
## Acceptance
- Re-running the 5-step pipeline on `biowardrobe_chipseq_se.cwl` produces a skinny pack <1500 lines.
- LLM-driven `summarize-cwl` produces a valid `summary-cwl.json` from the skinny pack alone, without dropping any step, tool, or edge present in the full pack.
## Notes
- Test-drive run that surfaced this: `casts/claude/skills/_emulated-runs/ga4gh-challenge-cwl-galaxy-5step/` (not committed; research artifact).
- Refinement entry: `content/molds/summarize-cwl/refinements/2026-05-11-ga4gh-challenge-cwl-galaxy-5step.md`.
- Related: #231 (keep summarize-cwl LLM-only).
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.