Skip to content

chore: cross-package compatibility pins and runtime gates#9

Merged
Mathews-Tom merged 1 commit into
mainfrom
chore/cross-package-compat
Apr 17, 2026
Merged

chore: cross-package compatibility pins and runtime gates#9
Mathews-Tom merged 1 commit into
mainfrom
chore/cross-package-compat

Conversation

@Mathews-Tom

Copy link
Copy Markdown
Owner

Summary

Address the cross-package version-drift risk in the three workspace packages.

  • Tighten "augur-signals" dep specifier in augur-labels and augur-format from unbounded to ~= 0.1.0.
  • Add augur_labels._compat + augur_format._compat — a two-part runtime gate invoked from each package __init__.
    1. importlib.metadata.version("augur-signals") must fall in [_SIGNALS_MIN, _SIGNALS_LT).
    2. augur_signals.models.MODELS_SCHEMA_VERSION major digit must equal the downstream-expected major.
  • Expose MODELS_SCHEMA_VERSION as a module-level constant in augur_signals.models.
  • Bump augur_labels.__version__ and augur_format.__version__ to 0.1.0 to align with the v0.1.0 workspace release.
  • Add docs/contracts/cross-package-compatibility.md spelling out the specifier rule, lock-step release procedure, major/minor/patch semantics, gate behaviour, and the argument against collapsing to a single package.
  • Register the new doc in docs/README.md implementer 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.
  • Manually verified: raising IncompatibleAugurSignalsError at import blocks downstream package initialization.

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.
@Mathews-Tom Mathews-Tom merged commit 9404981 into main Apr 17, 2026
2 checks passed
@Mathews-Tom Mathews-Tom deleted the chore/cross-package-compat branch April 17, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant