Repository navigation
fix(primitives): [#2914] remove source locations from peer role and peer id errors - #2955
Conversation
…r id errors name no source path The three error variants built in FromStr for PeerRole and TryFrom<Vec<u8>> for Id print a fixed source line of peer.rs. The tests call through str::parse and try_into, as callers do, and fail until the location is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e and peer id errors
ParsePeerRoleError::InvalidPeerRole and IdConversionError::{NotEnoughBytes,
TooManyBytes} lose their location field, its Location::caller() captures and
its text. The location was always a fixed line of peer.rs, never the caller's
(ADR 20261118045443).
The peer role message now quotes the rejected text and the accepted names:
'invalid peer role "x", expected "seeder" or "leecher"'.
BREAKING CHANGE: the public variants have no location field. Recorded for the
4.0.0 release of torrust-tracker-primitives.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…king change for primitives 4.0.0 Adds manual-verification-evidence.md (before and after messages from a scratch consumer crate, red and green test output), marks T1 to T5 and the acceptance criteria done, and lists the removed location fields under "Semver bumps owed" in the first-publish plan (torrust#2583). Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the changes removing source locations from peer-role and peer-ID errors.
No open issues 🎉
What changed in this PR
Implements SI-2 of #2912 by removing source locations from peer-role and peer-ID errors in torrust-tracker-primitives, while preserving useful input details.
Changes:
- Removes
locationfields and captures from three error variants, and clarifies the invalid peer-role message. - Adds regression tests through
str::parseandtry_into, with recorded before-and-after verification. - Updates issue progress and records the public API breaking change for the planned 4.0.0 release.
| File | Description |
|---|---|
packages/primitives/src/peer.rs |
Removes source locations, improves the peer-role message, and adds regression tests. |
docs/issues/open/2914-2912-si-2-primitives/manual-verification-evidence.md |
Records consumer reproductions, red/green results, and test-design evidence. |
docs/issues/open/2914-2912-si-2-primitives/ISSUE.md |
Updates implementation progress and acceptance-criteria evidence. |
docs/issues/open/2583-1669-first-publish-of-workspace-crates/ISSUE.md |
Records the removed public fields and message changes for release notes. |
Review effort: Balanced
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 2c137e3c1d93990d83d092a1960db557803167aa. Recomputed from the bytes at this head, against the merge base 7e8df95ec; git merge-tree against develop 7a4c16eaf reports one content conflict, the last-updated-utc line of the SI-2 spec, which both sides changed; every other path merges cleanly.
Process: a bug fix, so fix-bug governs, with write-unit-test, handle-errors-in-code, commit-changes and open-pull-request. The sequence holds: a tests-only commit, the fix, then the evidence (consumer output before and after, red and green runs) and the breaking change under "Semver bumps owed".
The change against its claim: the three variants lose location, the three Location::caller() captures and the import go, and no Location remains under packages/primitives. The before texts recompute from the merge base (peer.rs:73:27, :395:27, :401:27). Each new test fails on the old text, which holds .rs:, so none passes with the fix reverted. 123 #[test] plus 5 quickcheck properties give the 128 unit tests, and the doc fences give the 8 doctests. No other crate builds or matches these variants; the http-protocol hits are its own PeerIdConversionError.
Consistency: no links added; the evidence frontmatter follows the template; the task rows, criteria and M1/M2 match the code; the new words already occur in linted files.
Hygiene: three Conventional Commits with [#2914], author equal to committer, bodies matching their diffs. Each commit carries one attribution footer and the description ends with an attribution line; no rule in the tree forbids either. git diff --check is clean, the skill's commit-id check prints nothing, and the closing-keyword scan matches only the implemented issue in the description and nothing in the title or the commits.
Findings: F1 Minor (conflict with develop), F2 Nit (red-run location), F3 Nit (publish-plan state line), F4 Suggestion (pin the new wording), F5 Suggestion (#[track_caller] on the helper). None blocks.
Checked, no finding: the .. in the existing destructuring still compiles; .err().expect() is needed because peer::Id has no Debug; the layout matches rustfmt's widths at max_width = 130; the red tests-only commit is the spec's planned commit point and the pre-commit hook runs no unit tests; the EPIC row is updated at archive time; the mid-file use thiserror::Error; predates this change.
Checks
On the loop's compute node at this head, against the merge base 7e8df95ec (receipt server-gates-kranich-1216): the repository's pre-commit gate and lint roster exit 0 (467 s wall), and the audit validator passes this pull request's record (1 row, 2 log entries, 0 failures). In a fresh per-PR target directory, cargo test --workspace passes 4212 tests with 0 failed and 5 ignored across 123 binaries (367 s wall), and cargo clippy --workspace --all-targets --all-features -- -D warnings is clean (47 s wall). cargo deny check exits 5 with the same 35 license rejections and four advisories as on develop, so this pull request changes nothing in that result. Checked against the bytes at posting: git grep Location finds nothing under packages/primitives at this head. The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "Publish (Development): completed/skipped; Publish (Release): completed/skipped; Context: completed/success; Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-primitives): completed/success; Docker E2E: completed/skipped; Unit (stable): completed/success; Workspace Packaging: completed/success; Layer Boundary Bans: completed/success; Shipped Features: completed/success; Unit (nightly): completed/success; Documented Clippy Allows: completed/success; Test (Docker) (release): completed/success; Generate Coverage Report: completed/success; Discover Package Coverage: completed/success; Build on windows-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (stable): completed/success; Docs Lint: completed/success". At posting, develop is f212ae33b.
|
ACK 2c137e3 — the three primitives error variants lose their location field and source path, with tests that fail on the old text, and the evidence, spec rows and 4.0.0 entry were recomputed against these bytes |
|
ACK 2c137e3 |
Resolves the conflict on the last-updated-utc line of the SI-2 spec, which the archive of the torrust#2804 spec (PR torrust#2957) also changed; develop's value is kept and later commits move it on. Review finding F1 of PR torrust#2955. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rust#2804 audit and record the PR PR torrust#2957 closed the torrust#2804 audit and moved its scenario M3 ("x".parse::<PeerRole>() through str::parse, old and fixed code) to this issue. The red and green runs of the str::parse regression test and V1 already cover it; evidence section V3 maps them. Also records PR torrust#2955 and the passed hooks and checks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s at the test line Marks assert_names_no_source_path #[track_caller], which ADR 20261118045443 rule 6 allows for assertion helpers, so a failure names the calling test's line instead of the helper's. Review finding F5 of PR torrust#2955. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eer role
The no-source-path test checks only the rejected text and the absence of a
path, so a return to "invalid param {raw_param}" would pass it. The new test
compares the whole Display with the text recorded for the 4.0.0 release notes.
Review finding F4 of PR torrust#2955.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…tate line of the publish plan The state line still gave SI-2 as TODO while the new Semver bullet records the change as made. It and row 1 now name PR torrust#2955. Review finding F3 of PR torrust#2955. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…commit and the review-fix evidence The first red run was made on the working tree before rustfmt split the helper's array, so its panics name peer.rs:680, not the committed 688. The evidence now names that state, adds a re-run at the commit, and records the mutations behind the F4 and F5 test fixes. Also corrects the state the V1 and V2 before-runs used. Review finding F2 of PR torrust#2955. Co-Authored-By: Claude Opus 5.5 <[email protected]>
with findings F1 to F5 Records da2ce7's review 5971033415 (approved, five findings) and the commits that fix them. Reply URLs and thread states follow the push. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…PR instead of rebased The rebase onto 7a4c16e stayed local; develop at f212ae3 was merged into the PR head instead. The evidence, the spec log and the audit's F1 now say so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ads of PR torrust#2955 round 1 Adds the reply URLs of F1 to F5, marks their threads resolved, and logs the push, the replies, the validator run and the resolution. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
ACK 4081555 |
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 4081555cf840726f4c0198a141af0e2748fb9d6a. Recomputed from the bytes at this head, against the merge base f212ae33b; git merge-tree against develop f212ae33b returns the head's own tree, because develop is an ancestor of the head.
Process: this round adds the review fixes under fix-bug and write-unit-test, the audit under process-pr-review, and a merge of develop under open-pull-request. The pushed history is a fast-forward of 2c137e3c1.
Earlier findings, all fixed and answered on resolved threads. F1: the merge e9c8f6121 resolves only the conflicting timestamp line. F2: the evidence names the first red run's pre-format state and records a re-run at the tests-only commit that panics at peer.rs:688:13. F3: the plan's state line drops TODO. F4: a new test pins the whole message. F5: the helper is #[track_caller], and the recorded mutation lands on line 1449, the calling test's line at that commit.
The change against its claim: each new commit does what its subject says. The code change is test-only. 124 #[test] plus 5 quickcheck properties give the recorded 129, and no Location remains under packages/primitives. The peer_role filter selects 9 tests, which matches the recorded 8 passed and 1 failed.
Audit: the record follows the template's sections. Each of the five threads has one reply, a row citing that reply, and the row's RESOLVED state, matching the capture. Run offline, the validator's logic reports ok: 5 rows, 3 log entries, 0 failures. The new log entry's times match the reply times.
Hygiene: the commit subjects are Conventional with [#2914], and author equals committer. Each new commit carries one attribution footer; no rule in the tree forbids it. git diff --check is clean, the skill's commit-id check prints nothing, and the closing-keyword scan matches only the implemented issue, in the description.
Findings: F7 Minor (the description still describes the first head) and F8 Nit (an evidence sentence claims more than the recorded run); neither blocks. F6, raised at a46a0070e against the audit's missing reply URLs and open thread states and never posted, is fixed by 4081555cf.
Checked, no finding: the progress-log and audit corrections are appended, not rewritten; related-pr: 2955 and the ticked automatic-verification boxes match the log.
Checks
On the loop's compute node at this head, against the merge base f212ae33b (receipt server-gates-kranich-1229): the repository's pre-commit gate and lint roster exit 0 (65 s wall), and the audit validator passes this pull request's record (5 rows, 3 log entries, 0 failures). In this PR's own target directory at a46a0070e, whose Rust sources this head leaves unchanged (it adds one audit commit), cargo test --workspace passes 4213 tests with 0 failed and 5 ignored across 123 binaries (87 s wall, incremental), and cargo clippy --workspace --all-targets --all-features -- -D warnings is clean. F7 checked against the forge at posting: the description still says "128 unit tests and 8 doctests". The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-primitives): completed/success; Docker E2E: completed/skipped; Unit (nightly): in_progress/pending; Workspace Packaging: completed/success; Layer Boundary Bans: completed/success; Shipped Features: completed/success; Unit (stable): in_progress/pending; Documented Clippy Allows: completed/success; Docs Lint: completed/success; Generate Coverage Report: in_progress/pending; Discover Package Coverage: completed/success; Build on ubuntu-latest (nightly): completed/success; Build on macos-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Build on windows-latest (nightly): in_progress/pending; Build on macos-latest (stable): completed/success; Build on ubuntu-latest (stable): completed/success; Test (Docker) (release): in_progress/pending". At posting, develop is b646c52a4.
|
ACK 4081555 — the five round-one findings are fixed and answered on resolved threads, the test-only code change and its evidence recompute, and the audit record passes the validator's logic at these bytes |
…cted and add a full-suite run The peer_role filter selected 9 tests, only one of them a no-source-path test, so the evidence's claim about all three went further than the run. It now names what the filter selected and adds the same mutation run over every unit test of the crate: 128 passed, 1 failed (the new test). Review finding F8 of PR torrust#2955. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…2955 (F7 and F8) Adds the rows of F7 (PR description) and F8 (evidence claim), their replies and resolved threads, and the round-2 log entry. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
The accepted role strings are duplicated between the parsing match arms and the#[error(...)]… · New The accepted role strings are duplicated between the parsing match arms and the#[error(...)]… · New The “no source path” guard is based on raw substring containment (notably.rs:andsrc/), which… · New
Review effort: Lite
…C close-out Resolves the conflict on the last-updated-utc line of the first-publish plan (torrust#2583), which the torrust#1488 EPIC close-out (PR torrust#2951) also changed; the later value of this branch is kept. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t#2955 round 1 (F9 to F11) Three Copilot comments on the round-1 head, all answered with no change: the role names (F9, repeated as F10) and the substring guard (F11). Also logs the second develop merge. Co-Authored-By: Claude Opus 5.5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at db710d130ff0c0b82aa649dfbad06fc35ddf7aa5. Recomputed from the bytes at this head, against the merge base 3aa88bf19; git merge-tree against develop 3aa88bf19 returns the head's own tree, because the head now contains develop. The conflict this round had found on the first-publish plan is gone.
The merge e22c1d2cf resolves only the plan's last-updated-utc line, keeping this branch's later 07:41. Against its branch parent it changes exactly the 95 files develop changed since f212ae33b, each with develop's own patch. Against its develop parent it changes only the PR's five files, four of them with the branch's own patch and the plan with the PR's edits plus that line. packages/primitives is unchanged since a46a0070e; the Rust the merge brings in is develop's.
Audit: the record keeps the template's sections. All ten threads (F1 to F5, F7 and F8 from the reviewer, F9 to F11 from an automated review on 4081555cf) have one reply on their own thread, a row citing it, and a resolution, as captured. The automated rows are NO_ACTION/SUPERSEDED with severities inferred from that review's "Medium"/"Low" markers, which the review body shows. Run offline, the validator's logic reports ok: 10 rows, 5 log entries, 0 failures. On the merits the three automated suggestions need no change here: two roles, a pinned message, and the fragment list the spec prescribes for fixed inputs.
Hygiene: the new commits' subjects and bodies match their diffs, author equals committer, and each carries one attribution footer, which no rule in the tree forbids. git diff --check is clean. The description lists all 16 first-parent commits since f212ae33b and says "10 rows, 0 failures". The closing-keyword scan matches only the implemented issue, in the description. The commit-id check, run against 3aa88bf19, prints one id (F12).
Findings: F12 Minor (the audit cites a branch commit by id) and F13 Suggestion (a gendered pronoun for the reviewer); neither blocks. F9 to F11 are the audit's IDs for the automated review, so this review's findings start at F12.
Checked, no finding: the merge brings in the agent reply validator crate and the #1488 close-out unchanged; the audit's line references (peer.rs 59-60 and 70-71, spec lines 68 and 107) point where they say.
Checks
On the loop's compute node at this head, against the merge base 3aa88bf19 (receipt server-gates-kranich-1239): the repository's pre-commit gate and lint roster exit 0 (124 s wall), and the audit validator passes this pull request's record (10 rows, 5 log entries, 0 failures). At this head, which merges develop and its new agent-reply-validator crate, cargo test --workspace in this PR's own target directory passes 4401 tests with 0 failed and 5 ignored across 129 binaries (83 s wall, incremental), and cargo clippy --workspace --all-targets --all-features -- -D warnings is clean (9 s wall). F12 checked against the bytes at posting: lines 165 and 202 of the audit record name the merge as e22c1d2cf. The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-primitives): completed/success; Docker E2E: completed/skipped; Unit (nightly): in_progress/pending; Workspace Packaging: completed/success; Shipped Features: completed/success; Unit (stable): in_progress/pending; Documented Clippy Allows: completed/success; Layer Boundary Bans: completed/success; Discover Package Coverage: completed/success; Generate Coverage Report: in_progress/pending; Build on ubuntu-latest (nightly): in_progress/pending; Build on macos-latest (stable): in_progress/pending; Build on ubuntu-latest (stable): in_progress/pending; Build on windows-latest (nightly): in_progress/pending; Build on macos-latest (nightly): in_progress/pending; Build on windows-latest (stable): in_progress/pending; Test (Docker) (release): queued/pending; Docs Lint: completed/success". At posting, develop is 3aa88bf19.
…ject and name the reviewer by account F9's verification and the 08:38 log entry named the merge by its branch id, which the commit-id check forbids (F12); the Findings introduction and the 08:24 entry used a pronoun for the reviewer (F13). Both are corrected in place and the correction is logged. Review findings F12 and F13 of PR torrust#2955. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
ACK db710d1 |
…ads of PR torrust#2955 round 3 Adds the reply URLs of F12 and F13, marks their threads resolved, and logs the push, the replies, the validator run and the resolution. Co-Authored-By: Claude Opus 5.5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at cc67d0fe17e66771173ede9000edabfbbd907699. Recomputed from the bytes at this head, against the merge base 3aa88bf19; git merge-tree against develop 3aa88bf19 returns the head's own tree, so there is no conflict.
Process: since round 3 the head has gained two audit commits under process-pr-review, one for F12 and F13 and one recording their replies and resolutions. Only docs/pr-reviews/pr-2955-review/PR-REVIEW.md changed, and packages/primitives is unchanged since a46a0070e.
Earlier findings: F12 is fixed, because no line of the record carries the merge's id and the skill's commit-id check prints nothing. F13 is fixed, because the reviewer is named by account; the only remaining pronoun matches are the line that spells the search and the correction entry that quotes the replaced text. The 08:24 and 08:38 entries were edited in place, with an appended correction naming each edit, which reconciles the append-only rule with the commit-id rule and with F13, which pointed at a log entry.
Audit: the record keeps the template's sections. All twelve threads have one reply on their own thread, a row citing it, and a resolution, as captured. F12 and F13 now cite r4626395952 and r4626396327 and are RESOLVED. The 08:57 entry's times match the capture. Run offline, the validator's logic reports ok: 12 rows, 7 log entries, 0 failures.
Hygiene: both new subjects are Conventional with [#2914], author equals committer, and each commit carries one attribution footer, which no rule in the tree forbids. git diff --check is clean, and the skill's commit-id check prints nothing. The description lists all 18 first-parent commits since f212ae33b, has a round 3 section and says "12 rows, 0 failures". The closing-keyword scan matches only the implemented issue, in the description.
Findings: none. Two findings drafted against 40b99b5a7 and never posted are fixed at this head: the rows of F12 and F13 now cite their replies, and the description now names every commit.
Checked, no finding: the round 3 review is shown dismissed after the push, as before; no review was posted after this head's audit commit.
Checks
On the loop's compute node at this head, against the merge base 3aa88bf19 (receipt server-gates-kranich-1246): the repository's pre-commit gate and lint roster exit 0 (103 s wall), and the audit validator passes this pull request's record (12 rows, 7 log entries, 0 failures), where at 40b99b5a7 it failed on the two open rows. Rust sources are unchanged since db710d130, where the fresh workspace tests passed (4401 passed, 0 failed, 5 ignored) and clippy was clean. Checked against the bytes at posting: rows F12 and F13 now read RESOLVED. The head was confirmed with git ls-remote before posting. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-primitives): completed/success; Docker E2E: completed/skipped; Unit (stable): in_progress/pending; Unit (nightly): in_progress/pending; Shipped Features: completed/success; Workspace Packaging: completed/success; Layer Boundary Bans: completed/success; Documented Clippy Allows: completed/success; Test (Docker) (release): queued/pending; Docs Lint: completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (stable): completed/success; Build on macos-latest (stable): completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on windows-latest (nightly): completed/success; Discover Package Coverage: completed/success; Generate Coverage Report: completed/success". At posting, develop is 3aa88bf19.
|
ACK cc67d0f |
…tate list changed after 2026-11-18 The list is introduced as the state on 2026-11-18, but its primitives bullet now records the merge of PR torrust#2955 on 2026-11-19. The introduction now says so. Review finding F1 of PR torrust#2965. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue #2914 (SI-2 of EPIC #2912) closed with the merge of PR #2955. Sets status done, spec-path and the remaining checkpoints, repairs the parent EPIC link, marks SI-2 DONE in the EPIC's sub-issue table, and records in the first-publish plan (#2583) that the SI-2 constraint on primitives 4.0.0 is met. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ssues/closed c36b908 docs(pr-reviews): [#2914] add the review audit of PR #2965 (josecelano-bot) 8c9b52e docs(issues): [#2914] say which bullet of the publish plan's state list changed after 2026-11-18 (josecelano-bot) 061ee3a chore(issues): archive closed issue #2914 spec to docs/issues/closed (josecelano-bot) Pull request description: Related to #2914 (SI-2 of EPIC #2912), closed on GitHub with the merge of PR #2955 on 2026-11-19. Archives the spec of issue #2914 from `docs/issues/open/` to `docs/issues/closed/`, following the `cleanup-completed-issues` skill. - Verified issue #2914 is `CLOSED` on GitHub and the merge commit `f6d2f4df8` of PR #2955 is on `develop`. - `docs/issues/closed/2914-2912-si-2-primitives/ISSUE.md`: `status: done`, `spec-path`, `last-updated-utc`, the last workflow checkpoints ticked (reviewer validation, the not-applicable agent-review-reports item, issue closed and spec moved), a progress-log entry, and the parent EPIC link now points back into `open/` (`../../open/...`), because the EPIC stays in `open/` while this spec moved to `closed/`. - `manual-verification-evidence.md`: `issue-spec` path. - `docs/issues/open/2912-remove-source-locations-from-errors/EPIC.md`: SI-2 row points to `docs/issues/closed/` and is `DONE`. - `docs/issues/open/2583-1669-first-publish-of-workspace-crates/ISSUE.md`: the `primitives` state line and row 1 say the EPIC #2912 SI-2 constraint on `primitives` 4.0.0 is met, and (review finding F1) the introduction of the state list says that only the `primitives` bullet changed since 2026-11-18; progress-log entries. - A search for the folder name finds no remaining `docs/issues/open/` reference; the commit-id check prints nothing. - Pre-commit and pre-push hooks passed. Review round 1 (da2ce7, F1 and F2, both Nits, fixed): `docs(issues): [#2914] say which bullet of the publish plan's state list changed after 2026-11-18` (F1); this description's wording of the link repair (F2, no commit); the audit, `docs/pr-reviews/pr-2965-review/PR-REVIEW.md`, is added in `docs(pr-reviews): [#2914] add the review audit of PR #2965`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ACKs for top commit: da2ce7: ACK c36b908 — the archive move and the F1 fix are correct, both round-1 threads have a reply, a FIXED row and a resolution in the audit record, the validator's logic passes that record offline, and the branch merges into develop without conflict at these bytes josecelano: ACK c36b908 Tree-SHA512: f147de782fa2b1e1f66d114e001b3ac5e54f1c2e1f949605558ef97022bbcb071efa9d0001338c6700b84f6d1544dbd40224f55bea010c477e51dd83f7b591b5


Closes #2914
Sub-issue SI-2 of EPIC #2912 (remove source locations from errors), following ADR
docs/adrs/20261118045443_errors_do_not_record_source_locations.md. Spec:docs/issues/open/2914-2912-si-2-primitives/ISSUE.md.Summary
ParsePeerRoleError::InvalidPeerRoleandpeer::IdConversionError::{NotEnoughBytes, TooManyBytes}intorrust-tracker-primitivesno longer have alocationfield. TheirDisplayno longer ends in a source path: the location was always a fixed line ofpeer.rs(filled byLocation::caller()inside aFromStr/TryFromimpl), never the caller's. This closes finding F3 of the primitives test work (EPIC #1347)."x".parse::<PeerRole>()invalid param x in <path>/packages/primitives/src/peer.rs:73:27invalid peer role "x", expected "seeder" or "leecher"Id::try_from(vec![0; 19])not enough bytes for peer id: got 19 bytes, expected 20 <path>/peer.rs:395:27not enough bytes for peer id: got 19 bytes, expected 20Id::try_from(vec![0; 21])too many bytes for peer id: got 21 bytes, expected 20 <path>/peer.rs:401:27too many bytes for peer id: got 21 bytes, expected 20The peer role message also changed wording (the spec allows "keep or improve"): "invalid param" did not say which parameter or what is accepted.
Breaking change for library consumers (public fields removed). The crate's 4.0.0 is not published yet; the change is recorded under "Semver bumps owed" in the first-publish plan,
docs/issues/open/2583-1669-first-publish-of-workspace-crates/ISSUE.md. No production path of the tracker prints these two errors (audit #2804, re-checked against the tree).Commits
Implementation:
test(primitives): [#2914] add red tests that peer role and peer id errors name no source path: three unit tests throughstr::parseandtry_into, with a helper that forbids.rs:,packages/,packages\,src/,src\,.cargo/registryandrustlib/src. Red on this commit.fix(primitives): [#2914] remove source locations from peer role and peer id errors: the fields, theLocation::caller()calls and thestd::panic::Locationimport go. Tests green. This is the only production change.docs(issues): [#2914] record the evidence of SI-2 and its breaking change for primitives 4.0.0:manual-verification-evidence.md, spec progress, and the publish-plan entry.docs(issues): [#2914] cover scenario M3 handed over by the #2804 audit and record the PR: scenario M3 of the Audit and fix errors that record a wrong Location::caller() #2804 audit (now archived), handed to this issue, mapped to the existing runs (evidence V3).developmerge:Merge torrust/develop into 2914-primitivesbrings indevelopatf212ae33b; the only conflict was the spec'slast-updated-utcline. A second merge,Merge torrust/develop into 2914-primitives after the #1488 EPIC close-out, brings indevelopat3aa88bf19; its only conflict was thelast-updated-utcline of the first-publish plan, where this branch's later value is kept. Neither merge changespackages/primitives. A local rebase was not pushed; the branch history is a fast-forward of the first head.Review round 1 (da2ce7, findings F1 to F5, all fixed; audit
docs/pr-reviews/pr-2955-review/PR-REVIEW.md):test(primitives): [#2914] report source-path assertion failures at the test line(F5): the assertion helper is#[track_caller].test(primitives): [#2914] pin the full message of a rejected peer role(F4): a test compares the whole peer-role message.docs(issues): [#2914] name PR #2955 in the primitives state line of the publish plan(F3).docs(issues): [#2914] record the red re-run at the tests-only commit and the review-fix evidence(F2): red re-run at the tests-only commit, and the F4/F5 mutations.docs(pr-reviews): [#2914] add the review audit of PR #2955 with findings F1 to F5,docs(issues): [#2914] record that develop was merged into the PR instead of rebasedanddocs(pr-reviews): [#2914] record the replies and resolved threads of PR #2955 round 1: the audit record and its corrections.Review round 2 (da2ce7, findings F7 and F8, both fixed):
docs(issues): [#2914] say which tests the F4 mutation run selected and add a full-suite run(F8): the F4 mutation's evidence names the tests its filter selected and adds a run over every unit test of the crate.docs(pr-reviews): [#2914] record review round 2 of PR #2955 (F7 and F8): the audit rows and log entry.Copilot's review of the round-1 head (F9 to F11, all answered with no change; F10 repeats F9):
docs(pr-reviews): [#2914] record Copilot's review of PR #2955 round 1 (F9 to F11): the audit rows and log entry.Review round 3 (da2ce7, findings F12 and F13, both fixed in the audit):
docs(pr-reviews): [#2914] cite the second develop merge by subject and name the reviewer by account(F12, F13).docs(pr-reviews): [#2914] record the replies and resolved threads of PR #2955 round 3.Files
packages/primitives/src/peer.rsdocs/issues/open/2914-2912-si-2-primitives/ISSUE.md,manual-verification-evidence.md(new)docs/issues/open/2583-1669-first-publish-of-workspace-crates/ISSUE.md("Semver bumps owed", theprimitivesstate line, row 1 and progress log)docs/pr-reviews/pr-2955-review/PR-REVIEW.md(new)Validation
cargo test -q -p torrust-tracker-primitives --lib -- no_source_path(stable Rust 1.100.0); output inmanual-verification-evidence.md, including a red re-run at the tests-only commit itself.cargo test -q -p torrust-tracker-primitivesat the final code: 129 unit tests and 8 doctests pass.grep -rn 'Location' packages/primitives/srcfinds nothing.linter all, machete, deny bans, nightly fmt) passed for each commit and the pre-push hook for each push. The audit validator passes the record (12 rows, 0 failures).Out of scope: errors of other packages (SI-3 to SI-5) and dropping
torrust-located-error(SI-6).🤖 Generated with Claude Code