GTR094 — TokenizeVersion: @TOOL_VERSION@/@VERSION_SUFFIX@ extraction (opt-in command)

Contract: behaviour-preserving — proof by execution (expansion equality).

The transform

A literal version="<base>+galaxy<suffix>" whose <base> equals a package <requirement> version becomes @TOOL_VERSION@+galaxy@VERSION_SUFFIX@; the matching requirement versions become @TOOL_VERSION@; the two <token> definitions land in the inline <macros> (created when absent).

Proof — by execution, per tool

The mutation is applied to a copy and kept only when macro-expanding the tokenized copy reproduces the original tool’s expansion byte-for-byte (tier-1 expand_from_tree; both sides’ <macros> blocks dropped — Galaxy clears them after harvesting, xml_macros.py:39-45). The tokens substitute back to exactly the literals they replaced, so the post-expansion tool Galaxy sees is unchanged by construction. The gate failing → no mutation at all.

Fail-closed preconditions (tokenization_skip_reason, the single decision

path shared with the tokenize-version surface)

  • non-<base>+galaxy<suffix> / already-tokenized versions;

  • no package requirement pinning <base> (no version to share — the IUC point);

  • @TOOL_VERSION@/@VERSION_SUFFIX@ already defined (inline or imported);

  • <macros> imports on a bytes-parsed tool (the gate could not resolve them).

Scope boundary

A multi-element style restructure — never format/upgrade; applied only by the dedicated opt-in tokenize-version command (GTR094 in OPT_IN_COMMAND_BY_CODE). ~75 corpus candidates (scripts.measure version-tokenization, PR #31).

History

Ledger item A2 (rank 5, approved 2026-06-10); codemod §43.