Unified, code-addressable rule registry + named presets for the Galaxy tool refactoring tiers — tier 3.6, a library-first facade the CLI (and a future MCP server) compose.
Project description
galaxy-tool-refactor-registry
The rule-registry facade (tier 3.6) of the Galaxy tool refactoring framework: a single, code-addressable view over every baked-in rule across the three rule families — codemod (tier 2, structural GTR), fmt (tier 3, cosmetic GTR), and check (tier 3.5, advisory) — plus named rulesets and per-rule enable/disable, behind a library-first API.
galaxy-tool-refactor-registry (this package, tier 3.6)
↑ ↑
galaxy-tool-refactor-cli (tier 4) galaxy-tool-refactor-mcp (tier 4, future)
It depends on the rule tiers (0.5 / 1 / 2 / 3 / 3.5); the lower tiers do not
depend on it. It is the orchestration core the galaxy-tool-refactor CLI sits on
top of, and the core the agent-facing MCP server sits on
(galaxy-tool-refactor-mcp). All XML serialisation goes through fmt, preserving
"fmt is the only tier that writes/serialises XML".
Why library-first
No click / sys.exit / printing in the call path; functions take a path, raw
bytes, or a ToolDocument and return structured results; files are written
only when a write_path is given; and the rule/ruleset catalogs are
introspectable (list_rules() / list_rulesets()). That shape lets both the CLI
and a future agent-facing MCP server be thin adapters over the same core. See
../galaxy-tool-refactor-mcp/docs/vision.md.
Rulesets
| Ruleset | Contents | Notes |
|---|---|---|
cosmetic |
fmt cosmetic rules (GTR001/003/004) | whitespace / indent / shorthand only |
default (default) |
canonical codemods (GTR006/002/005/013) + cosmetic | today's format — the opinionated formatter |
iuc |
mirrors default (placeholder) |
reserved for an IUC-specific divergence |
strict |
default + advisory checks |
format + flag everything IUC cares about (report-only) |
Membership is declared per rule (RuleMeta.rulesets): the registry derives
each ruleset's code set by grouping every registered rule by the names in its
meta.rulesets. Adding or changing rules and rulesets is a developer task —
there are no user-defined rules or rulesets.
Selection
resolve_codes(rulesets=…, select=…, ignore=…) turns ruleset names plus
--select/--ignore code lists into a concrete code set — the base is the
union of the named rulesets (or the default ruleset when none are named).
Precedence is ruff-style: --ignore ▸ --select ▸ --ruleset — an explicit
--select replaces the rulesets' set, then --ignore subtracts. Unknown
ruleset names / rule codes raise the typed UnknownRuleset / UnknownRuleCode.
Public API (by submodule import; no re-exports)
from galaxy_tool_refactor_registry.facade import (
run, upgrade, detect, list_rulesets, list_rules,
)
from galaxy_tool_refactor_registry.resolve import resolve_codes, resolve_upgrade_codes
from galaxy_tool_refactor_registry.registry import by_code, known_codes, advisory_codes
run(source, *, codes, write_path=None) -> FormatResult— apply the fixable rules in the selection (codemods in canonical order, then cosmetic fmt), reporting advisory findings as notes.upgrade(source, *, codes, write_path=None) -> UpgradeResult— profile-upgrade plus the selected fixable rules.detect(source, *, codes) -> DetectResult— report-only over the selection.by_code(code) -> RuleHandle— the uniform, callable handle for one rule (meta,family,fixable,detect(document),apply(document)orNone).
Develop
Run from the workspace root (galaxy-tool-refactor/):
uv run --package galaxy-tool-refactor-registry pytest galaxy-tool-refactor-registry/tests/
uv run ruff check galaxy-tool-refactor-registry/src galaxy-tool-refactor-registry/tests
uv run mypy --config-file galaxy-tool-refactor-registry/pyproject.toml galaxy-tool-refactor-registry/src
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file galaxy_tool_refactor_registry-0.2.0.tar.gz.
File metadata
- Download URL: galaxy_tool_refactor_registry-0.2.0.tar.gz
- Upload date:
- Size: 86.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a7af652610b14a324b9f3a5f966b0c6c98717a1f028016c430aad6d33683c392
|
|
| MD5 |
9bbd07ca8c6227b48d34e0530d4853a7
|
|
| BLAKE2b-256 |
2b948f2c45724317891600d81289269c06e989553f7a70755c9f7a6502a11e34
|
Provenance
The following attestation bundles were made for galaxy_tool_refactor_registry-0.2.0.tar.gz:
Publisher:
release.yml on richard-burhans/galaxy-tool-refactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
galaxy_tool_refactor_registry-0.2.0.tar.gz -
Subject digest:
a7af652610b14a324b9f3a5f966b0c6c98717a1f028016c430aad6d33683c392 - Sigstore transparency entry: 1792701009
- Sigstore integration time:
-
Permalink:
richard-burhans/galaxy-tool-refactor@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/richard-burhans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file galaxy_tool_refactor_registry-0.2.0-py3-none-any.whl.
File metadata
- Download URL: galaxy_tool_refactor_registry-0.2.0-py3-none-any.whl
- Upload date:
- Size: 43.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
878fede1a99747c4aec043a42579f3a142d582fd26f9801ee5f3a858d3b0b49f
|
|
| MD5 |
8b84c22da62c657b2fe62e9abcfe631e
|
|
| BLAKE2b-256 |
35f93be727bd77ae206d20fc2b89121f0c877dddb9a80d5113aa4518aedfcf97
|
Provenance
The following attestation bundles were made for galaxy_tool_refactor_registry-0.2.0-py3-none-any.whl:
Publisher:
release.yml on richard-burhans/galaxy-tool-refactor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
galaxy_tool_refactor_registry-0.2.0-py3-none-any.whl -
Subject digest:
878fede1a99747c4aec043a42579f3a142d582fd26f9801ee5f3a858d3b0b49f - Sigstore transparency entry: 1792701117
- Sigstore integration time:
-
Permalink:
richard-burhans/galaxy-tool-refactor@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/richard-burhans
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@524c6b6ee8dba405f5d3b1d192d120d996140a65 -
Trigger Event:
workflow_dispatch
-
Statement type: