Skip to content

Move TrackerPolicy, TORRENT_PEERS_LIMIT, and PrivateMode from torrust-tracker-configuration to torrust-tracker-primitives #1859

Closed

Description

@josecelano

Summary

Move three domain primitives that are currently misplaced in the torrust-tracker-configuration package into torrust-tracker-primitives, where they semantically belong.

Background

Issue #1856 analysed the coupling of torrust-tracker-configuration and concluded (DEC-07) that the package boundary should remain unchanged — except for three types that are domain policy objects, not service configuration:

  • TrackerPolicy — used by tracker-core, swarm-coordination-registry, and torrent-repository-benchmarking
  • TORRENT_PEERS_LIMIT — used by tracker-core
  • v2_0_0::core::PrivateMode — used by tracker-core for authentication logic

These three types have no relationship to the config file schema, TOML deserialization, or schema versioning. Placing them in a config package creates unnecessary coupling: swarm-coordination-registry and torrent-repository-benchmarking currently depend on torrust-tracker-configuration solely because of these types.

Goal

Move TrackerPolicy, TORRENT_PEERS_LIMIT, and PrivateMode to torrust-tracker-primitives. Update all import sites across the workspace. After this change:

  • swarm-coordination-registry no longer depends on torrust-tracker-configuration
  • torrent-repository-benchmarking no longer depends on torrust-tracker-configuration

Acceptance Criteria

  • TrackerPolicy is defined in torrust-tracker-primitives and re-exported or removed from torrust-tracker-configuration
  • TORRENT_PEERS_LIMIT is defined in torrust-tracker-primitives
  • PrivateMode (v2_0_0::core::PrivateMode) is defined in torrust-tracker-primitives
  • All import sites across the workspace are updated to import from torrust-tracker-primitives
  • swarm-coordination-registry's Cargo.toml no longer lists torrust-tracker-configuration as a direct dependency
  • torrent-repository-benchmarking's Cargo.toml no longer lists torrust-tracker-configuration as a direct dependency
  • All tests pass (cargo test --workspace)
  • No new clippy warnings (cargo clippy -- -D warnings)

Out of Scope

Related

Activity

  1. self-assigned this
    on Jun 1, 2026
  2. added a commit that references this issue on Jun 2, 2026
  3. added a commit that references this issue on Jul 20, 2026
    d33c695
  4. added 2 commits that reference this issue on Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions