Context
CrackingShells/Hatch-Validator#19 adds v2.0.0 schema support to the library: a new v2_0_0/ validator module, a corrected version-dispatch key (hatch_schema_version), and a fixed "latest" fallback. Once that PR merges, Hatch CLI still needs to be updated to actually reach the new chain. This issue covers the Hatch side.
Prerequisite: CrackingShells/Hatch-Validator#19 merged and published.
Problem
Three independent wiring problems in Hatch CLI prevent v2.0.0 validation from working even after Hatch-Validator is fixed:
-
Dependency pin is too loose: pyproject.toml declares hatch-validator>=0.8.0. This must be tightened to require the version that ships Hatch-Validator#19's changes so old installs cannot silently use a pre-v2.0.0 build.
-
Two divergent import paths for HatchPackageValidator:
hatch/cli/cli_system.py:35 — from hatch_validator import HatchPackageValidator
hatch/installers/hatch_installer.py:20 — from hatch_validator.package_validator import HatchPackageValidator
Both work today but the inconsistency should be resolved; the public __init__ export is the correct import.
-
HatchInstaller creates its own HatchPackageValidator without a version argument (hatch/installers/hatch_installer.py:39):
self.validator = HatchPackageValidator(registry_data=registry_data)
This falls through to the "latest" fallback. After Hatch-Validator#19, "latest" resolves correctly to "2.0.0" only if the upstream fallback fix is in place — but this call site is silent about version intent and must be verified explicitly.
Tasks
Success Gate
hatch validate <path-to-v2.0.0-package-dir>
- Exits
0 on a well-formed v2.0.0 hatch_metadata.json (with hatch_schema_version, citations[], provenance{}).
- Exits
1 with a field-named error (e.g., citations[0].value: does not match DOI pattern) on a deliberately broken field.
- No
ValueError: Unsupported schema version anywhere in output or logs.
Reference
Context
CrackingShells/Hatch-Validator#19 adds v2.0.0 schema support to the library: a new
v2_0_0/validator module, a corrected version-dispatch key (hatch_schema_version), and a fixed"latest"fallback. Once that PR merges, Hatch CLI still needs to be updated to actually reach the new chain. This issue covers the Hatch side.Prerequisite: CrackingShells/Hatch-Validator#19 merged and published.
Problem
Three independent wiring problems in Hatch CLI prevent v2.0.0 validation from working even after Hatch-Validator is fixed:
Dependency pin is too loose:
pyproject.tomldeclareshatch-validator>=0.8.0. This must be tightened to require the version that ships Hatch-Validator#19's changes so old installs cannot silently use a pre-v2.0.0 build.Two divergent import paths for
HatchPackageValidator:hatch/cli/cli_system.py:35—from hatch_validator import HatchPackageValidatorhatch/installers/hatch_installer.py:20—from hatch_validator.package_validator import HatchPackageValidatorBoth work today but the inconsistency should be resolved; the public
__init__export is the correct import.HatchInstallercreates its ownHatchPackageValidatorwithout a version argument (hatch/installers/hatch_installer.py:39):This falls through to the
"latest"fallback. After Hatch-Validator#19,"latest"resolves correctly to"2.0.0"only if the upstream fallback fix is in place — but this call site is silent about version intent and must be verified explicitly.Tasks
Bump dependency pin in
pyproject.toml: changehatch-validator>=0.8.0tohatch-validator>=<version-that-ships-Hatch-Validator#19>once that release tag is known.Unify import style: change
hatch/installers/hatch_installer.py:20to use the public export (from hatch_validator import HatchPackageValidator) to matchcli_system.py.Verify dispatch in
handle_validate()(cli_system.py:105-109): the call isHatchPackageValidator(version="latest", ...). After Hatch-Validator#19,"latest"should resolve to"2.0.0". Confirm by checking that validation of a v2.0.0hatch_metadata.jsonno longer raisesValueError: Unsupported schema versionand no longer silently falls through to the v1.1.0 chain.Verify
HatchInstallerpath (hatch_installer.py:39): run a dry-run install of a v2.0.0 package and confirm no version dispatch errors.Success Gate
0on a well-formed v2.0.0hatch_metadata.json(withhatch_schema_version,citations[],provenance{}).1with a field-named error (e.g.,citations[0].value: does not match DOI pattern) on a deliberately broken field.ValueError: Unsupported schema versionanywhere in output or logs.Reference