GOLDEN_CACHE_FOLLOWUP_PLAN

Golden Cache Follow-up Plan

Hardening the cross-language golden cache contract between Python (Galaxy) and TypeScript (galaxy-tool-util-ts).

1. Add format_version to cache_golden.yaml

Use Galaxy’s tool_util version (or a simple integer) as format_version at the top of the manifest. Both Python and TS test suites should check this field and fail with a clear message if they encounter a version they don’t support.

format_version: 1
toolshed_tools:
  ...

Galaxy side:

TS side:

2. Add expected nested parameter type assertions

The current manifest only checks top-level input_names and input_types. Deep nesting (conditionals inside repeats, repeats inside conditionals) is where Python/TS diverge most. Add an expected_nested_structure field for at least one complex tool.

Proposed format — path-based type assertions:

  - tool_id: "toolshed.g2.bx.psu.edu/repos/iuc/multiqc/multiqc/1.11+galaxy1"
    expected_nested_structure:
      "results.software_cond": "gx_conditional"
      "results.software_cond.software": "gx_select"
      "results.software_cond.bamtools.input": "gx_data"

Path format: repeat_name.conditional_name.when_value.param_name

Galaxy side:

TS side:

3. Normalize description nullability

Python produces "" (empty string) for tools with no description, TypeScript may produce null. Decide on one convention and enforce it.

Recommendation: empty string → null normalization on read, both sides.

Galaxy side:

TS side:

4. Add SHA256 checksums for sync validation

Add a checksums.json to the golden cache directory so the TS side can verify it has the correct version without diffing every file.

Format:

{
  "manifest_sha256": "abc123...",
  "files": {
    "4442926e...json": "def456...",
    "index.json": "ghi789..."
  }
}

Galaxy side:

TS side:

5. Stock tool tool_id in index — synthetic path cleanup

Currently both Python and TS produce toolshed.g2.bx.psu.edu/repos/cat1 as the tool_id in the cache index for stock tools. This is a side effect of _tool_id_from_trs being called with a non-TRS ID. It works but is confusing.

Options:

Tracked in jmchilton/galaxy-tool-util-ts#1.

Sequencing

  1. format_version (small, no behavioral change)
  2. description nullability (small, may require golden regeneration)
  3. SHA256 checksums (enables CI validation)
  4. nested structure assertions (larger, tests actual parsing depth)
  5. stock tool_id cleanup (cross-project coordination)

Unresolved