| doc-type | issue | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| issue-type | task | ||||||||||
| status | draft | ||||||||||
| priority | p1 | ||||||||||
| github-issue | |||||||||||
| spec-path | docs/issues/drafts/1669-define-package-versioning-strategy.md | ||||||||||
| branch | |||||||||||
| related-pr | |||||||||||
| last-updated-utc | 2026-05-27 00:00 | ||||||||||
| semantic-links |
|
Define an explicit and maintainable SemVer policy for workspace packages, replacing the implicit "everything shares one workspace version" rule with a policy that matches package ownership, coupling, and release cadence.
This issue defines policy now, but does not activate the migration immediately. Policy activation is intentionally deferred until boundary-refactor subissues have reduced layer coupling and package ownership is clearer.
This issue is a subissue of EPIC #1669 (Overhaul: Packages).
Current state:
- All workspace crates use
version.workspace = trueand currently resolve to3.0.0-develop. - This keeps internal releases simple but couples unrelated packages to the same release cadence.
Observed downside:
- Generic crates and tool crates are version-bumped even when no API or behavior changed in those crates.
- Consumers cannot infer change risk from version numbers when every crate bumps together.
- Extraction and independent publication plans in EPIC #1669 become harder to execute cleanly when package identity and version cadence are still mixed.
From current workspace topology:
- There is a tightly-coupled tracker runtime cluster (
tracker-core, protocol cores, servers, configuration, REST API, root binary) that changes together frequently. - There are utility/platform crates (
torrust-clock,torrust-metrics,torrust-located-error,torrust-net-primitives,torrust-server-lib) with broader reuse potential and slower API churn. - There are package candidates intended for extraction or broader reuse
(
bittorrent-peer-id,torrust-tracker-contrib-bencode, tracker client library/CLI split).
Conclusion:
- A single lockstep version for every crate is suboptimal long-term.
- Full per-crate independence immediately is also too expensive operationally.
- A hybrid policy is the best fit now.
Adopt a two-tier strategy.
These crates stay version-linked and move together per tracker release:
torrust-tracker(root)torrust-tracker-coretorrust-tracker-http-tracker-coretorrust-tracker-udp-tracker-coretorrust-tracker-http-tracker-protocoltorrust-tracker-udp-tracker-protocoltorrust-tracker-axum-servertorrust-tracker-axum-http-servertorrust-tracker-axum-rest-api-servertorrust-tracker-axum-health-check-api-servertorrust-tracker-rest-api-coretorrust-tracker-rest-api-clienttorrust-tracker-configurationtorrust-tracker-eventstorrust-tracker-primitivestorrust-tracker-swarm-coordination-registrytorrust-tracker-test-helperstorrust-tracker-udp-server
Rationale:
- High internal coupling and coordinated behavior changes.
- Reduces coordination overhead for the main tracker artifact.
- Keeps release management simple for the core product.
These crates should evolve with independent versions:
torrust-clocktorrust-metricstorrust-located-errortorrust-net-primitivestorrust-server-libbittorrent-peer-idtorrust-tracker-contrib-bencodetorrust-tracker-client-libtorrust-tracker-client(console package)workspace-coupling(dev tool)torrust-tracker-torrent-repository-benchmarking
Rationale:
- Distinct consumer surface and release cadence from core tracker runtime.
- Lower risk of unnecessary version churn.
- Better SemVer signaling for external users and extraction targets.
The policy is documented in this issue now, but implementation is deferred.
Activation preconditions:
- SI-13 (
http-protocoldecoupling fromudp-protocol) is completed. - SI-14 (
http-protocoldecoupling fromtorrust-tracker-primitives) is completed. - No unresolved layer-guardrail violations remain for protocol/core/server boundaries relevant to package grouping decisions.
- Package ownership boundaries are stable enough that version grouping changes are unlikely to be immediately invalidated by follow-up refactors.
Until these conditions are met, the repository keeps the current workspace version behavior as the operational default.
Use an incremental transition, not a one-shot migration.
Phase 1 (this issue): policy definition only.
- Define policy contract in docs (EPIC + this issue + optional ADR).
- Define activation gate and prerequisites.
- Open follow-up implementation issues, but do not migrate versions yet.
Phase 2 (follow-up, after activation gate passes): migration.
- Keep Tier A on workspace-linked version management.
- Move Tier B crates to explicit per-package
version = "..."values. - Update internal path dependency constraints to reference intended ranges for independent crates.
- Add CI checks to prevent accidental rollback to all-linked versions.
- Validate publish workflows and changelog discipline for independent crates.
Why considered:
- Minimal tooling complexity.
- Very easy coordinated release process.
Why discarded:
- Over-couples unrelated packages and inflates churn.
- Weak SemVer signal for external consumers.
- Conflicts with EPIC extraction goals and independent release cadence.
Why considered:
- Maximum SemVer precision and package autonomy.
Why discarded:
- High immediate operational complexity.
- Larger migration surface while layering work (SI-13/SI-14 and follow-ups) is still in progress.
- Increases short-term release friction without enough near-term benefit for tightly coupled runtime crates.
- Define and document the two-tier versioning policy.
- Classify each workspace package into linked vs independent tier.
- Specify migration sequence, activation gate, and validation checks.
- Update EPIC documentation with the adopted proposal once approved.
- Activating or executing version migration before boundary-refactor preconditions are satisfied.
- Full migration of every package to the new policy in this issue.
- Publishing extracted crates in external repositories.
- Renaming packages as part of this policy issue.
- A documented package-by-package classification exists (linked vs independent).
- The proposal includes explicit rationale for each tier.
- At least two alternatives are documented with discard reasons.
- The policy activation gate is explicit (deferred implementation until boundary refactors are completed).
- EPIC #1669 references the approved versioning policy.
- Follow-up implementation issues are opened for migration steps.
cargo metadata --no-deps --format-version 1(validate package inventory)linter all
| ID | Scenario | Expected Result |
|---|---|---|
| MV1 | Review package table in this spec | Every workspace package is assigned to one tier |
| MV2 | Review alternatives section | Discarded options and reasons are explicit |
| MV3 | Cross-check policy against EPIC extraction map | Independent tier aligns with extraction/reuse direction in EPIC #1669 |
- EPIC: docs/issues/open/1669-overhaul-packages/EPIC.md
- Decisions: docs/issues/open/1669-overhaul-packages/DECISIONS.md
- Workspace manifest: Cargo.toml
- Package catalog: docs/packages.md