Repository navigation
test(primitives): [#2824] test the configuration defaults and bounded values - #2852
josecelano merged 17 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…ns and bound Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d serde Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… serde Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…cedence Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the configuration-default and bounded-value test additions.
No open issues 🎉
What changed in this PR
This PR delivers slice S3 of #2824 under testing EPIC #1347, strengthening coverage of configuration defaults and bounded values in torrust-tracker-primitives. It leaves runtime behavior unchanged and keeps final completion work for S4.
Changes:
- Adds 24 tests covering defaults, JSON serialization and deserialization, interval bounds, and pagination precedence, including one property test.
- Corrects doc comments describing key-expiration checks and pagination offsets.
- Records per-file decisions, mutation samples, and reported package line-coverage growth from 85.23% to 93.13%.
| File | Description |
|---|---|
packages/primitives/src/policy.rs |
Tests tracker-policy defaults and JSON keys. |
packages/primitives/src/pagination.rs |
Tests defaults and optional-value precedence; clarifies offset documentation. |
packages/primitives/src/mode.rs |
Tests private-mode defaults and JSON behavior; corrects expiration documentation. |
packages/primitives/src/announce.rs |
Tests announce defaults, JSON behavior, and interval rejection. |
packages/primitives/src/announce_interval.rs |
Tests conversions, display, negative input, and bounds across generated values. |
docs/issues/open/2824-1347-add-tests-primitives/test-refactor-plans/README.md |
Registers the five completed S3 test plans. |
docs/issues/open/2824-1347-add-tests-primitives/test-refactor-plans/policy.md |
Records policy-test decisions and validation evidence. |
docs/issues/open/2824-1347-add-tests-primitives/test-refactor-plans/pagination.md |
Records pagination cases and documentation correction. |
docs/issues/open/2824-1347-add-tests-primitives/test-refactor-plans/mode.md |
Records private-mode tests and expiration-comment correction. |
docs/issues/open/2824-1347-add-tests-primitives/test-refactor-plans/announce.md |
Records announce-test decisions and mutation results. |
docs/issues/open/2824-1347-add-tests-primitives/test-refactor-plans/announce_interval.md |
Documents interval tests and the property-test retention rationale. |
docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md |
Updates slice status, file completion, and progress history. |
docs/issues/open/2824-1347-add-tests-primitives/coverage-evidence.md |
Adds S3 coverage measurements and per-file totals. |
docs/issues/open/1347-overhaul-packages-testing/EPIC.md |
Updates primitives progress and coverage tracking. |
Review effort: Balanced
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at fc203b5be2b93f2bec7cc1dacee858c5f864c3aa. Recomputed from the bytes at this head, against the merge base ec1f58ec9; git merge-tree against develop ec1f58ec9 merges without conflict and writes a tree identical to the head's.
Process: a test-coverage slice governed by write-unit-test, the issue's per-file workflow (one record per file in test-refactor-plans/, then the ledger, plan index, slice table, coverage-evidence.md and both EPIC "Latest" rows), commit-changes and open-pull-request. Every artifact the issue requires of a slice is updated.
The change against its claim: the 24 tests (6, 6, 5, 4, 3) exist as described, each exercises what its name says with literal expectations, and each would fail under the mutants its record lists as killed. The two doc-comment corrections match the expiry check in tracker-core and the .skip(offset) consumers. Every recorded percentage but one recomputes, but the per-file line deltas do not sum to the package delta, and the description's survivor count contradicts the records.
Consistency: every relative link and anchor in the changed Markdown resolves, tables are well formed, the dictionary is unchanged and nothing is moved.
Hygiene: 12 commits with Conventional subjects in the [#2824] form and no bodies; author equals committer; each has one attribution footer line (no rule in the tree on it). git diff --check is clean, the skill's commit-id check prints nothing, and no closing keyword appears in the title, description or commits.
Findings
- F1 Major: the description says one mutant survived; the records list three, and none of the three pre-registered mutants met the property rule.
- F2 Minor: the
i64deserializer mutant is not equivalent, and line 33 of the record says it would be caught. - F3 Minor: per-file line deltas (+197 / +127) do not sum to the package delta (+196 / +126).
- F4 Minor: the description is hard-wrapped.
- F5 Nit: 1,406 / 1,553 is 90.53%, not 90.54%.
- F6 Nit: line references in
mode.mdare the base file's. - F7 Nit: the issue frontmatter is not advanced.
- F8 Suggestion: the REST adapter's
offsetdoc comment still speaks of pages.
Checked, no finding: test logic, imports and serde keys; rustfmt widths (the longest new line is 130 columns); the quickcheck draw range; the 81 to 105 test chain and the pp changes; the EPIC, ledger and plan-index rows; the frontmatter profile; no review threads, so no audit record is due.
Checks
On the loop's compute node at this head, against the merge base ec1f58ec9 (receipt server-gates-kranich-808): the repository's pre-commit gate and lint roster exit 0 and the tree left clean. Package tests at this head on the same node: cargo test -p torrust-tracker-primitives passed 108 tests (105 unit, 2 integration, 1 doc), wall 1.3 s. F1 checked against the bytes and the forge at posting: the description says "One mutant survived", while announce_interval.md marks two rows survived (the single-value bound slip and the i64 read) and announce.md marks a third (the interval_min serde default). F5 recomputed: 1,406 / 1,553 = 90.534%. There are no review threads yet. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-primitives): completed/success; Docker E2E: completed/skipped; Shipped Features: completed/success; Unit (stable): completed/success; Layer Boundary Bans: completed/success; Unit (nightly): completed/success; Workspace Packaging: completed/success; Documented Clippy Allows: completed/success; Docs Lint: completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Build on macos-latest (stable): completed/success; Generate Coverage Report: completed/success; Discover Package Coverage: completed/success; Test (Docker) (release): in_progress/pending". At posting, develop is ec1f58ec9.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
ACK 8174ea2 |
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 8174ea214e6eff2cd293efe2161a6a3dad0ec2c0. Recomputed from the bytes at this head, against the previous round's head fc203b5be and the merge base ec1f58ec9; git merge-tree against develop ec1f58ec9 merges without conflict and writes a tree identical to the head's.
What moved: one commit, 8174ea214, fast-forwards fc203b5be (8 issue-folder files, +69/-21, new lessons.md). Every other path is byte-identical, so the previous conclusions on code and tests stand.
Previous findings, all now fixed:
- F1: the description counts three survivors and says the deciding mutant was not named in advance, as the record now does.
- F2: the
i64mutant is a by-design survivor; line 33 agrees. - F3: per-file deltas sum to +196 / +126 and every step reconciles.
- F4: the description is unwrapped.
- F5: 90.53% in both records.
- F6: line references match this head.
- F7: the frontmatter is advanced.
- F8:
lessons.mdcarries the RESToffsetrow.
The new commit: every figure it adds recomputes, including the step chain from 882 / 1,020 to 1,044 / 1,121. The i64 error text matches from_u64, and the lessons.md rows match handlers.rs:65, the .skip(pagination.offset as usize) consumers and the F2 register row. Links and anchors resolve.
Hygiene: Conventional subject, no body, author equals committer, one attribution footer line (no rule in the tree on it); git diff --check clean, the commit-id check silent, no closing keyword.
Findings
- F9 Minor: no audit record and no thread replies.
- F10 Nit: the edited records keep their old
last-updated-utc. - F11 Nit: the log entry credits the records with the survivor-count fix.
None blocks; COMMENT until the audit record lands.
Checked, no finding: the reconciliation's two explanations (one line removed, readiness.rs at 50 / 52), the appended correction to the 08:55 entry, and the lessons.md frontmatter. The re-measured coverage itself needs a run, which this review did not make.
Checks
On the loop's compute node at this head, against the merge base ec1f58ec9 (receipt server-gates-kranich-812): the repository's pre-commit gate and lint roster exit 0 and the tree left clean. The PR has no review audit record at this head (F9), so the audit validator was not run in the gate. This push changes documentation only, so the previous round's package tests (108 passed at fc203b5be) stand. F1's fix read on the forge at posting: the description now says "Three mutants survived" and names all three. Read on the forge: all 8 review threads are open, with no reply. GitHub checks at this head at posting time: "Publish (Development): completed/skipped; Publish (Release): completed/skipped; Context: completed/skipped; Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-primitives): completed/success; Docker E2E: completed/skipped; Build on macos-latest (nightly): completed/success; Documented Clippy Allows: completed/success; Workspace Packaging: completed/success; Unit (nightly): completed/success; Layer Boundary Bans: completed/success; Unit (stable): completed/success; Shipped Features: completed/success; Build on windows-latest (stable): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on macos-latest (stable): completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Test (Docker) (release): completed/failure; Discover Package Coverage: completed/success; Generate Coverage Report: completed/success; Docs Lint: completed/success". At posting, develop is ec1f58ec9.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 895dc1b783a28ec60632c1e3dc1c8e4729c305ab. Recomputed from the bytes at this head, against the previous round's head 8174ea214 and the merge base ec1f58ec9; git merge-tree against develop ec1f58ec9 merges without conflict and writes a tree identical to the head's.
What moved: one commit, 895dc1b78, fast-forwards 8174ea214. It adds the audit record and edits 7 issue files (citations, five stamps, one log entry); every other path is byte-identical, and the description is unchanged.
Previous findings: F1 to F8 stay fixed. Three changed state:
- F9 fixed: the record exists with 11 rows and details, each thread has one reply on its own thread, all 11 are resolved, and the validator's logic passes offline against the capture (11 rows, 0 failures).
- F10 fixed: the five records read 09:44, the time of the round 1 fix commit.
- F11 fixed: the log entry credits the description with the survivor count.
The new commit: review IDs, severities, source and reply URLs match the forge, and every cited subject is a PR commit. The replies match the record except where F14 notes.
Hygiene: Conventional subject, no body, author equals committer, one attribution footer line (no rule in the tree on it); git diff --check clean, the commit-id check silent, no closing keyword.
Findings
- F12 Nit: the log's 09:50 start stamp predates the review it names.
- F13 Nit: F8 is
FOLLOW_UPbut cites a commit subject. - F14 Nit: the F3 entry says three commits were re-measured, against "each step" elsewhere.
- F15 Nit: one non-canonical finding citation remains in
lessons.md. - F16 Nit: two files this commit edits keep older
last-updated-utcvalues.
None blocks.
Checked, no finding: categories and author classes; the template's sections and the 19 fields; reply-before-resolve order; no row for the round 1 review that made no request.
Checks
On the loop's compute node at this head, against the merge base ec1f58ec9 (receipt server-gates-kranich-819): the repository's pre-commit gate and lint roster exit 0 and the tree left clean; the repository's audit validator on pr-2852-review exit 0 (11 rows, 1 log entry, no failures). Every change since fc203b5be is under docs/, so the package tests of round 1 (cargo test -p torrust-tracker-primitives, 108 passed) stand. F12 checked at posting: the log's only stamp reads 09:50, while the commit that carries the record is dated 10:44:04Z. Read on the forge: all 11 review threads are answered and resolved. GitHub checks at this head at posting time: "". At posting, develop is ec1f58ec9.
|
ACK 895dc1b — F1 to F11 are fixed at this head and its review audit record passes the validator's logic offline against the forge capture |
|
ACK 895dc1b |
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
Asserting an exact JSON string makes this test sensitive to non-semantic serialization changes… · New This asserts the exact JSON string form; it can fail if serialization formatting/order changes even… · New These tests assert exact JSON string output, which is brittle with respect to serialization details… · New
Review effort: Lite
…t by string Co-Authored-By: Claude Sonnet 5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at e78e2eba26e3b665c5c86f6325eef5fc21658159. Recomputed from the bytes at this head, against the previous round's head 895dc1b78 and the merge base ec1f58ec9; git merge-tree against develop ec1f58ec9 merges without conflict and writes a tree identical to the head's.
What moved: one commit, e78e2eba2, fast-forwards 895dc1b78. It makes the three serialization tests compare a serde_json::Value with a json! literal, updates the three records' prose rows, and adds audit rows for the automated review 5889997099. Every other path, and the description, is byte-identical.
Previous findings: none changed state. F1 to F11 stay fixed. F12 to F16 are unchanged: their five threads have no reply, are unresolved, and have no row. This commit also edits announce.md, mode.md and policy.md without advancing their last-updated-utc (F16).
The new commit: the tests still pin every key and value, and Value equality ignores order, as the subject says. The three new rows match the forge (review ID, replies on their own threads, a cited subject that is a PR commit). The validator's logic passes offline (14 rows, 0 failures), but it checks only rows that exist.
Hygiene: Conventional subject, no body, author equals committer, one attribution footer line (no rule in the tree on it); git diff --check clean, the commit-id check silent, no closing keyword.
Findings
- F17 Minor: the round-3 findings have no rows or replies, and the audit's F12 to F14 now name other concerns.
- F18 Nit: the audit update shares the commit with the test fix.
- F19 Nit: the audit says a key-rename mutant was re-run for
announce.rs; its record lists none.
Verdict: COMMENT, no ACK, while the five round-3 threads (F12 to F16) have no reply and no row.
Checked, no finding: the new tests against the old strings; the json! integers against the serialized u32 values; the new log stamp (11:20, replies 11:20:19Z to 11:20:24Z).
Checks
On the loop's compute node at this head, against the merge base ec1f58ec9 (receipt server-gates-kranich-831): the repository's pre-commit gate and lint roster exit 0 and the tree left clean; the repository's audit validator on pr-2852-review exit 0 (14 rows, 2 log entries, no failures), though it checks only the rows the record has. Package tests at this head on the same node: cargo test -p torrust-tracker-primitives passed 108 tests (105 unit, 2 integration, 1 doc), wall 1.4 s. F17 checked on the forge at posting: 14 review threads are resolved and 5 are open, those of review 5889756621. GitHub checks at this head at posting time: "". At posting, develop is ec1f58ec9.
|
ACK e78e2eb |
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
No open issues 🎉
3 resolved since last review
Review effort: Lite
…3 and 4 Co-Authored-By: Claude Sonnet 5 <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at aff444c6407aa488b75d859776e73273aecd9e56. Recomputed from the bytes at this head, against the previous round's head e78e2eba2 and the merge base ec1f58ec9; git merge-tree against develop 24230dd01 merges without conflict: no path changed on both sides, and the merged tree is develop plus exactly this PR's 16 paths.
What moved: one commit, aff444c64, fast-forwards e78e2eba2. It edits the audit record, lessons.md and two stamps. Every other path, and the description, is byte-identical.
Previous findings that changed state:
- F12, F13, F15, F17, F19: fixed.
- F14: partly fixed; five steps now named, but the mismatch sizes are still misstated (F22).
- F16: partly fixed; three records are still stale (F24).
- F18: unchanged by design, and recorded as
FIXED(F23).
The new commit: every thread now has a reply and a row, and all 22 are resolved. Rows F15 to F22 carry the reviewer IDs, the intro names both round-3 reviews, and the validator's logic passes offline (22 rows, 3 log entries, 0 failures).
Hygiene: Conventional subject, no body, author equals committer, one attribution footer line (no rule in the tree on it); git diff --check clean, no closing keyword. The commit-id check prints two PR-branch ids (F20).
Findings
- F20 Minor: the record cites PR-branch commit ids.
- F21 Nit: two log entries were rewritten in place, and the new stamp predates its events.
- F22 Nit: three new statements go beyond the bytes.
- F23 Nit: a no-change concern is recorded as
FIXED. - F24 Nit: three edited records keep 09:44.
None blocks.
Checked, no finding: the reworded F12 entry and its amended reply; the F8 reference; lessons.md:17; no row for the later automated review, which made no request.
Checks
On the loop's compute node at this head, against the merge base ec1f58ec9 (receipt server-gates-kranich-849): the repository's pre-commit gate and lint roster exit 0; the frontmatter check reports the same 15 errors and 4 warnings at this head as on develop, so the PR adds none; the repository's audit validator on pr-2852-review exits 0 (22 rows, 3 log entries, no failures). The new commit changes documentation only, so no package tests apply to this round. F20 checked against the bytes at posting: the record cites the PR-branch ids 895dc1b78 and e78e2eba2. Read on the forge: all 22 review threads are answered and resolved. GitHub checks at this head at posting time: "". At posting, develop is 24230dd01.
|
ACK aff444c — every review thread has a reply and an audit row, the record passes the validator's logic offline, and the trial merge into develop is clean |
|
ACK aff444c |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
ACK fbb6a4a |
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at fbb6a4a1f1e75ec191e4181f9f1058ccab7a3cda. Recomputed from the bytes at this head, against the previous round's head aff444c64 and the merge base ec1f58ec9; git merge-tree against develop 24230dd01 merges without conflict: no path changed on both sides, and the merged tree is develop plus exactly this PR's 16 paths.
What moved: one commit, fbb6a4a1f, fast-forwards aff444c64. It edits the audit record and three record stamps. Every other path, and the description, is byte-identical.
Previous findings that changed state:
- F14, F16: fixed. F3 and F17 give the per-step figures, and the three records read 08:08.
- F18: now recorded as
NO_ACTION/SUPERSEDED, with the prescribed reply. - F20: fixed. The commit-id check is silent.
- F21: fixed. The 09:50 and 11:20 entries are byte-identical to their round-4 text again, and one appended correction names both rewrites, with forge times.
- F22, F23, F24: fixed.
The new commit: rows F23 to F27 carry reviewer IDs F20 to F24. Each of the six replies (08:07:44Z to 08:07:55Z) is on its own thread, and all 27 threads are resolved. The validator's logic passes offline (27 rows, 4 log entries, 0 failures), and the log stamps are in order, each after its events.
Hygiene: Conventional subject, no body, author equals committer, one attribution footer line (no rule in the tree on it); git diff --check clean, no closing keyword.
Findings: none.
Checked, no finding: the round-5 review's "approved" label, since it was dismissed only at 08:11:58Z, after this commit; the form of the Superseded by reply; F21's claim that both later round commits touch only docs/.
Checks
On the loop's compute node at this head, against the merge base ec1f58ec9 (receipt server-gates-kranich-859): the repository's pre-commit gate and lint roster exit 0 (50 s wall); the repository's audit validator on pr-2852-review exits 0. The new commit changes documentation only, so no package tests apply to this round; the crate's tests passed at the code head of round 4. Read on the forge at posting: all 27 review threads are answered and resolved. 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; Documented Clippy Allows: completed/success; Workspace Packaging: completed/success; Layer Boundary Bans: completed/success; Shipped Features: completed/success; Unit (stable): completed/success; Test (Docker) (release): in_progress/pending; Build on macos-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Build on ubuntu-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Build on macos-latest (stable): completed/success; Build on windows-latest (nightly): completed/success; Docs Lint: completed/success; Generate Coverage Report: completed/success; Discover Package Coverage: completed/success". At posting, develop is 24230dd01.
|
ACK fbb6a4a — every review thread has a reply and an audit row, the record passes the validator's logic offline, the commit-id check is silent, and the trial merge into develop is clean |
|
ACK fbb6a4a |
…lues, with the spec of its first application 5af3b9f docs(pr-reviews): record round 14 in the review audit of PR #2851 (josecelano-bot) f8580ac docs(pr-reviews): record the second rebase in the review audit of PR #2851 (josecelano-bot) 4b2a10b docs(pr-reviews): record round 13 in the review audit of PR #2851 (josecelano-bot) e3fc25c docs(pr-reviews): keep the reviewer-provided IDs of round 12 in the audit of PR #2851 (josecelano-bot) 2b7e9db docs(pr-reviews): record round 12 in the review audit of PR #2851 (josecelano-bot) 9ee0657 docs(issues): [#2850] name the UDP rejection as a client-visible change (josecelano-bot) 51f4729 docs(pr-reviews): record round 11 in the review audit of PR #2851 (josecelano-bot) d0044e1 docs(pr-reviews): give one account of the round-7 audit commit in the audit of PR #2851 (josecelano-bot) 7713ef4 docs(pr-reviews): record round 10 in the review audit of PR #2851 (josecelano-bot) 23a3e8a docs(pr-reviews): correct rows and log entries of the review audit of PR #2851 (josecelano-bot) 612dfcc docs(issues): [#2838] check the length of each UDP response in the probe (josecelano-bot) 0aa5c5a docs(issues): [#1347] describe issue #2850 as the planned fix in the sub-issue table (josecelano-bot) 098124c docs(pr-reviews): record round 9 in the review audit of PR #2851 (josecelano-bot) c1b44b3 docs(issues): [#2838] correct the probe evidence timestamp to its commit time (josecelano-bot) 44d07c8 docs(pr-reviews): record round 8 in the review audit of PR #2851 (josecelano-bot) 8e782aa docs(issues): [#2838] document the probe's new error-response exit path (josecelano-bot) 927aa9b docs(pr-reviews): record round 7 in the review audit of PR #2851 (josecelano-bot) 4094f4a docs(issues): [#2838] parse the connect response defensively in the UDP probe (josecelano-bot) 8117f94 docs(pr-reviews): record round 6 in the review audit of PR #2851 (josecelano-bot) 3076c37 docs(issues): [#2850] correct benchmark wording, add a Commit Points row, and record the tolerance write-back (josecelano-bot) 5a63ca6 docs(pr-reviews): record round 5 in the review audit of PR #2851 (josecelano-bot) cbfd4d4 docs(issues): [#2850] plan the performance baseline and the missing UDP announce benchmark (josecelano-bot) da7fc1f docs(issues): [#2838] remove the unused second UDP listener from the replay configuration (josecelano-bot) 454077a docs(pr-reviews): record round 4 in the review audit of PR #2851 (josecelano-bot) 28d1389 docs(issues): [#2850] carry the time of the last content edit in last-updated-utc of two files (josecelano-bot) eb99272 docs(pr-reviews): record round 3 in the review audit of PR #2851 (josecelano-bot) f279b3e docs(issues): [#2850] read the REST output after each accepted announce in scenario M7 (josecelano-bot) 5d1e55f docs(issues): [#2838] add the database directory as a replay prerequisite of the evidence (josecelano-bot) 8f346b3 test(udp-probe): [#2838] reject a response with the wrong transaction id in the UDP probe (josecelano-bot) f5dda4e docs(issues): [#2850] record that the primitives tests of #2824 are merged (josecelano-bot) 338646c docs(pr-reviews): record round 2 in the review audit of PR #2851 (josecelano-bot) fb7ce4f docs(pr-reviews): correct the time and actor of the force push in the audit of PR #2851 (josecelano-bot) 6347bf1 docs(pr-reviews): drop the commit ids of the rewritten branch from the audit of PR #2851 (josecelano-bot) 6500843 docs(issues): [#2850] set last-updated-utc to the time of the last content edits (josecelano-bot) 8cc2e6e docs(issues): [#2838] mark scenario M2 of the unmerged patch as superseded (josecelano-bot) c69c061 docs(pr-reviews): record the review audit of PR #2851, round 1 (josecelano-bot) 4e22891 docs(adrs): [#2842] record that HTTP rejects an announce ip that is not an IP address (josecelano-bot) d1300a7 docs(adrs): [#2842] describe how num_want is handled on each protocol in the inventory (josecelano-bot) 79f6b20 docs(adrs): [#2842] require verdict parity at the acceptance boundary, not at the parser (josecelano-bot) 3220fb6 docs(adrs): [#2842] name the seeder count as the statistic a negative left inflates (josecelano-bot) 4fde2fd docs(issues): [#2838] point the field decision at the progress log (josecelano-bot) f1d4455 docs(issues): [#2850] correct a section reference and a leftover mention of the EPIC (josecelano-bot) 1255e0f docs(issues): [#2838] mark the checkpoints, criteria and recheck of the unmerged patch as superseded (josecelano-bot) 0eb9f64 docs(adrs): [#2842] stop attributing the sign of left to BEP 15 in the description (josecelano-bot) 00f6ec6 docs(adrs): [#2842] describe the udp-core conversion as planned, not as existing (josecelano-bot) a776f2c docs(adrs): [#2842] state in the inventory that UDP still accepts a negative byte count (josecelano-bot) 018624c docs(issues): [#2850] cite the commits of PR #2839 by subject (josecelano-bot) a7c6515 docs(adrs): [#2842] point the inbound tolerance ADR at issue #2850 (josecelano-bot) 6059d94 docs(issues): [#2850] add issue specification (josecelano-bot) e2ee111 docs(issues): [#2838] carry over the spec and evidence from PR #2839 (josecelano-bot) 925a34a docs(adrs): [#2842] cite the client evidence for the byte counts (josecelano-bot) 20e231e docs(adrs): [#2842] add the layering rule and the byte-count first application (josecelano-bot) 9ab2d9b docs(adrs): [#2842] align the inbound tolerance ADR with the byte-count decisions (josecelano-bot) 30af1a1 docs(adrs): [#2842] reject malformed inbound protocol values unless real clients need the tolerance (josecelano-bot) Pull request description: Closes #2842 Related to #2850 Related to #2838 Docs only: no production code changes. The only script touched is the disposable UDP probe in the evidence folder of #2838. This is the spec-only pull request of #2850. It replaces #2843 (the ADR) and the documents of #2839 (the tactical patch), which are closed without merging. ## What - **The ADR of #2842**: "Reject malformed inbound protocol values unless real clients need the tolerance" (`docs/adrs/`), its index entry and its issue specification. The four commits of #2843 are carried over unchanged, with one more commit that points the ADR at #2850 as its first application, and the fix commits of the review rounds. - **The specification of #2850**: "Make the number of bytes non-negative by construction" (`docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md`). It addresses the bug of #2838 at its root. - **The specification and evidence of #2838**, carried over from the branch of #2839: the field audit, the evidence on real clients and other trackers, the reproduction evidence and the UDP probe. The patch plan in it is marked as superseded. - One row for #2838 in the sub-issue table of EPIC #1347, and three words in `project-words.txt`. - The review audit record, `docs/pr-reviews/pr-2851-review/PR-REVIEW.md`. ## Why one pull request The patch, the ADR and the design were three views of one decision, worked on in three sessions. The maintainer decided on 2026-11-12 to review the decision documents together and to address the bug of #2838 at its root instead of merging a patch that the next change would delete. ## The decisions recorded (maintainer, 2026-11-12) 1. The domain `NumberOfBytes` holds a private `u64`, with no upper bound. 2. Implementing a public protocol specification strictly has priority over failing fast. The UDP wire type and `Request::parse_bytes` are not changed; a negative counter is refused at the first conversion into a type the project owns (`peer_builder::from_request` in `udp-core`). 3. The conversion owns its error and `UdpAnnounceError` wraps it. No standalone validation function. 4. The HTTP protocol type holds a private `u64` and its `i64::MAX` limit is removed; the REST fields become `u64`. Wire ranges may differ per protocol; the domain is the same for both. 5. The general rules live in the ADR of #2842 (its points 6 to 9). 6. One standalone issue, not an EPIC. The specification of #2850 has a section "Sources for the Decisions" that maps each question of the review to the ADR or document that answers it. ## Files - `docs/adrs/20261111170611_reject_malformed_inbound_protocol_values_unless_clients_need_tolerance.md`, `docs/adrs/index.md` - `docs/issues/open/2842-inbound-tolerance-adr/ISSUE.md` - `docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md` - `docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/` (specification, evidence, probe) - `docs/issues/open/1347-overhaul-packages-testing/EPIC.md` - `project-words.txt` ## Validation - `linter markdown`, `linter cspell` and `linter lychee` pass. - The frontmatter validator and the other pre-commit checks pass on every commit. - The check for commit ids that are not on `develop` reports nothing. - The closing-keyword scan of the title, this description and the commit messages matches only the intended close of #2842. ## History The history of this branch was rewritten once, during the first review round, to reword two commit messages that paired a closing keyword with #2838: "docs(issues): [#2838] carry over the spec and evidence from PR #2839" and "docs(adrs): [#2842] point the inbound tolerance ADR at issue #2850". No commit was dropped, squashed or reordered, and the tree at the rewritten head was identical to the tree before. The review audit names the commits the first review cites by their subjects. The branch was then rebased onto `develop` twice. The first rebase was needed because #2841 changed the row next to the one this pull request adds to the sub-issue table of EPIC #1347. The conflict was resolved by keeping the row of `develop` and adding the #2838 row after it; every commit was replayed in the same order. The second rebase, after the approval of round 13, was needed for the same reason: #2852 changed that row again and the pull request conflicted with `develop`. The conflict was resolved the same way, and all commits were replayed in the same order with the same changes. The commit ids that the review comments cite no longer name commits on the branch; [this comment](#2851 (comment)) maps each one to its commit subject. ## Not in this pull request - The implementation of #2850, which follows after this merges. Issues #2850 and #2838 stay open until that implementation merges. It takes the tests from the branch `2838-udp-reject-negative-announce-bytes`. - The register of tolerances and the rejection metric of the ADR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) ACKs for top commit: josecelano: ACK 5af3b9f da2ce7: ACK 5af3b9f — all 63 review threads answered, resolved and recorded with the validator's checks passing offline, the second rebase recorded with every cited commit id mapped to its subject, and the head merging into develop ef759e3 without conflict Tree-SHA512: bb0ed8b32a33e28e6e7f702180be5d8251501fbca97d1b89084ec618767f983bc3d123152452fe6544de87587c34f977ba978a04ec433ef2c9ddc0b7d9c89ae0
…request The audit record of torrust#2852 names rounds 1 to 5. The retrospective said six in two places; it now says five, and a progress-log entry corrects the 2026-11-14 12:09 entry without rewriting it. Co-Authored-By: Claude Opus 5.5 <[email protected]>

Related to #2824 (sub-issue of EPIC #1347). This is slice S3 of the plan in
docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md; it does not close the issue (only S4 does).What changes
Tests for the five configuration-defaults and bounded-value files of
torrust-tracker-primitives, with one decision record and two maintainer gates per file (the record before the tests, the completed file after):announce_interval.rsquickcheckproperty)announce.rspolicy.rsmode.rspagination.rsThe line counts include the new in-file test modules. Package unit-only coverage goes from 848 / 995 lines (85.23%) to 1,044 / 1,121 (93.13%), regions from 89.31% to 94.66%, functions from 82.99% to 92.69%, and from 81 to 105 unit tests. Measured with
cargo-llvm-cov 0.6.16on stable Rust 1.99.1. The per-file figures sum to the package change (+196 covered, +126 lines);coverage-evidence.mdshows the step-by-step reconciliation.What the tests protect: the documented defaults that every tracker without those configuration keys gets (interval 120 s, 74 peers, a 900 s peer timeout, key expiration checked, 4,000 results), the serde defaults and keys for partial JSON, the
i32::MAXbound of the announce interval, and the precedence of given and missing pagination values.Two documentation corrections (no behavior change)
PrivateMode::check_keys_expiration: the doc comment said thattrueignores the expiration date; the code intracker-coredoes the opposite (truerejects an expired key).Pagination::offset: the doc comment said "page number"; every consumer uses it as the number of items to skip.Review notes
quickcheckproperty inannounce_interval.rswas kept because it alone kills a mutant that no example test kills (a band of mid-range values wrongly rejected). The plan fixed the rule in advance (keep it only if it kills a mutant that the examples miss) and named three mutants to try; none of those three met the rule, and the deciding band mutant was added after them, when the property had been run.cmp). Three mutants survived: the single-value bound slip inannounce_interval.rs(random search cannot find one value), thei64read in the same file (it still rejects-1, with another error message that the test does not assert), and theinterval_minserde default inannounce.rs(equivalent: both defaults are 120). The sample is evidence for the review, not a gate.docs(issues)commits carry the approved decision records, thetest(primitives)commits carry the completed files and their results, and the last commits carry the slice measurement and the review rounds.Validation
cargo test -p torrust-tracker-primitives,cargo +nightly fmt --all -- --check,cargo clippy -p torrust-tracker-primitives --all-targets,cargo doc -p torrust-tracker-primitives --no-deps,git diff --check,linter markdownandlinter cspell, and the repository pre-commit gate on every commit.🤖 Generated with Claude Code