| doc-type | issue | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| issue-type | task | |||||||||||
| status | draft | |||||||||||
| priority | p2 | |||||||||||
| github-issue | ||||||||||||
| spec-path | docs/issues/drafts/1669-extract-torrust-tracker-contrib-bencode-to-torrust-bencode.md | |||||||||||
| branch | ||||||||||||
| related-pr | ||||||||||||
| last-updated-utc | 2026-05-15 12:00 | |||||||||||
| semantic-links |
|
Rename the crate torrust-tracker-contrib-bencode to torrust-bencode, and migrate it from
the tracker workspace (contrib/bencode) back into torrust/torrust-bittorrent
(packages/bencode) replacing the legacy copy there.
The contrib/bencode package is a pure bencode encode/decode library with no
tracker-specific logic. Several facts confirm it is ready for independent life:
- No tracker dependencies: its only runtime dependency is
thiserror. - No crates.io publication blockers: all runtime dependencies are external crates already on crates.io. The extraction can proceed without publishing any other workspace package first. (Publication blocker analysis reviewed May 2026.)
- Separate license: Apache-2.0, unlike the tracker's AGPL-3.0-only. Having it in the same workspace creates a mixed-license surface that confuses downstream users.
- Already published on crates.io as
torrust-tracker-contrib-bencode(verified May 2026). - Destination is now explicit in EPIC #1669:
torrust/torrust-bittorrentis the target workspace for this migration, and the tracker copy is treated as the newer lineage that replaces legacypackages/bencodethere. - Only one internal consumer:
packages/http-protocoldepends on it. After extraction that dependency becomes a normal crates.io dependency — no other workspace packages change. contrib/is the wrong home: thecontrib/prefix signals community-contributed code living temporarily in the workspace; this crate has been here long enough to graduate.
The rename drops the torrust-tracker-contrib- prefix:
torrust-tracker-scopes it to the tracker — wrong.-contrib-marks it as transient community code — no longer accurate.torrust-bencodeis the shortest accurate name: Torrust-namespace, bencode purpose.
This issue is a subissue of EPIC #1669 (Overhaul: Packages).
- Rename the crate
nameincontrib/bencode/Cargo.tomltotorrust-bencode. - Use
torrust/torrust-bittorrentas the destination workspace. - Move/merge the crate source to
packages/bencodeintorrust/torrust-bittorrent, preserving relevant history. - Ensure CI passes in the destination repository after migration.
- Publish
torrust-bencodefrom the destination repository. - Update
packages/http-protocol/Cargo.tomlto depend on the publishedtorrust-bencodecrate (remove the local path dependency). - Remove
contrib/bencode/from the tracker workspace:- Remove from
membersin the rootCargo.toml. - Remove the workspace dependency entry for
torrust-tracker-contrib-bencode.
- Remove from
- Update
packages/AGENTS.md,AGENTS.mdPackage Catalog, anddocs/packages.md. - Handle the old crates.io name
torrust-tracker-contrib-bencode: yank all versions and publish a notice pointing totorrust-bencode.
- Changes to the crate's API or behaviour.
- Updating other downstream repositories (e.g.,
torrust-index) — separate task per repo. - Extracting other
bittorrent-*orcontrib/crates — each gets its own subissue.
Status values: TODO, IN_PROGRESS, BLOCKED, DONE.
| ID | Status | Task | Notes / Expected Output |
|---|---|---|---|
| T1 | TODO | Rename name in contrib/bencode/Cargo.toml to torrust-bencode |
name = "torrust-bencode" |
| T2 | TODO | Update repository URL in contrib/bencode/Cargo.toml and destination crate metadata |
Point to https://github.com/torrust/torrust-bittorrent |
| T3 | TODO | Confirm destination workspace torrust/torrust-bittorrent migration path |
Target path agreed: packages/bencode |
| T4 | TODO | Move/merge crate source into destination workspace, preserving history where practical | packages/bencode replaced by tracker lineage |
| T5 | TODO | Set up/adjust CI in destination repository if needed | CI green after migration |
| T6 | TODO | Publish torrust-bencode on crates.io from destination repository |
Successful cargo publish; crate visible at crates.io/crates/torrust-bencode |
| T7 | TODO | Update packages/http-protocol/Cargo.toml: replace path dep with published torrust-bencode |
torrust-bencode = "X.Y.Z" (no path) |
| T8 | TODO | Remove contrib/bencode/ from tracker workspace (members + workspace dep in Cargo.toml) |
cargo build --workspace succeeds without the local crate |
| T9 | TODO | Delete contrib/bencode/ directory from the tracker repo |
Directory gone; workspace still builds |
| T10 | TODO | Update packages/AGENTS.md, AGENTS.md, docs/packages.md, and any README references |
No stale references to torrust-tracker-contrib-bencode |
| T11 | TODO | Run cargo build --workspace, cargo test --workspace, linter all |
All green |
| T12 | TODO | Handle old crates.io name torrust-tracker-contrib-bencode |
Yank and/or deprecate old name with redirect to torrust-bencode |
| T13 | TODO | Update EPIC #1669 Package Inventory and Desired Package State tables |
Remove torrust-tracker-contrib-bencode from torrust-tracker- table; mark as extracted |
- Spec drafted in
docs/issues/drafts/ - Spec reviewed and approved by user/maintainer
- GitHub issue created and issue number added to this spec
- Spec moved to
docs/issues/open/with issue number prefix - Implementation completed
- Automatic verification completed (
linter all,cargo test --workspace) - Manual verification scenarios executed and recorded
- Acceptance criteria reviewed after implementation and updated with evidence
-
torrust-bencodepublished fromtorrust/torrust-bittorrent; old name yanked - EPIC #1669 Active Subissues table updated to
DONE - Issue closed and spec moved to
docs/issues/closed/
- 2026-05-15 12:00 UTC - josecelano - Spec drafted as subissue of EPIC #1669
-
contrib/bencode/directory no longer exists in the tracker workspace. - Root
Cargo.tomldoes not listcontrib/bencodeas a workspace member. - No
Cargo.tomlin the tracker workspace referencestorrust-tracker-contrib-bencode. -
packages/http-protocol/Cargo.tomldepends on the publishedtorrust-bencode. -
cargo build --workspacesucceeds without the local bencode crate. -
cargo test --workspacepasses with zero failures. -
linter allexits with code0. -
torrust-bencodeis published and visible on crates.io. -
torrust-tracker-contrib-bencodeis yanked or carries a deprecation notice. - Destination repository (
torrust/torrust-bittorrent) has passing CI and a published release. -
packages/AGENTS.md,AGENTS.md, anddocs/packages.mdno longer listtorrust-tracker-contrib-bencode.
cargo build --workspacecargo test --doc --workspacecargo test --tests --workspace --all-targets --all-featureslinter allcargo machete
Status values: TODO, IN_PROGRESS, DONE, FAILED, BLOCKED.
| ID | Scenario | Command/Steps | Expected Result | Status | Evidence |
|---|---|---|---|---|---|
| M1 | No stale workspace reference to old crate | grep -r "torrust-tracker-contrib-bencode|contrib/bencode" . --include="*.toml" --include="*.rs" |
Zero matches in tracker repo | TODO | |
| M2 | New crate visible on crates.io | Visit https://crates.io/crates/torrust-bencode |
Crate page exists, latest version shown | TODO | |
| M3 | Old crate yanked | Visit https://crates.io/crates/torrust-tracker-contrib-bencode |
All versions show "yanked" or deprecation notice | TODO | |
| M4 | Destination repository CI green | Check CI status on torrust/torrust-bittorrent default branch |
All checks pass | TODO |