chore: cross-package compatibility pins and runtime gates#9
Merged
Conversation
Tighten augur-signals dependency specifier in both dependent packages
to ~= 0.1.0 so a transitive resolver cannot drag augur-signals past
the 0.1.x range that the installed augur-labels / augur-format was
compiled against.
Add a two-part runtime gate in augur_labels._compat and
augur_format._compat, invoked from each package __init__:
1. Reads importlib.metadata.version('augur-signals') and rejects
anything outside [_SIGNALS_MIN, _SIGNALS_LT).
2. Asserts augur_signals.models.MODELS_SCHEMA_VERSION major digit
matches the downstream-expected major, catching cases where a
version-pin loophole somehow delivered a mismatched schema.
Expose MODELS_SCHEMA_VERSION as a module-level constant in
augur_signals.models so the contract is a single source of truth
instead of scattered Literal annotations across every Pydantic model.
Bump augur-labels and augur-format __version__ strings from 0.0.0 to
0.1.0 to align with the v0.1.0 workspace release.
Document the policy in docs/contracts/cross-package-compatibility.md:
compatible-release specifier, lock-step release rule, major/minor/
patch bump semantics, runtime gate behaviour, release procedure, and
the rationale against collapsing to a single package.
14 new unit tests exercise the gates against manufactured version
strings without requiring a mismatched install.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Address the cross-package version-drift risk in the three workspace packages.
"augur-signals"dep specifier inaugur-labelsandaugur-formatfrom unbounded to~= 0.1.0.augur_labels._compat+augur_format._compat— a two-part runtime gate invoked from each package__init__.importlib.metadata.version("augur-signals")must fall in[_SIGNALS_MIN, _SIGNALS_LT).augur_signals.models.MODELS_SCHEMA_VERSIONmajor digit must equal the downstream-expected major.MODELS_SCHEMA_VERSIONas a module-level constant inaugur_signals.models.augur_labels.__version__andaugur_format.__version__to0.1.0to align with the v0.1.0 workspace release.docs/contracts/cross-package-compatibility.mdspelling out the specifier rule, lock-step release procedure, major/minor/patch semantics, gate behaviour, and the argument against collapsing to a single package.docs/README.mdimplementer reading order.Test plan
uv run pytest tests/test_cross_package_compat.py -v— 14 new unit tests.uv run pytest— 365 passed.uv run ruff check .+uv run mypy --strict src/ scripts/clean.IncompatibleAugurSignalsErrorat import blocks downstream package initialization.