Repository navigation
fix(udp-server): [#2244] review metric aggregate conversions and fix the UDP average processing time - #2552
Conversation
…tainer decisions Add the T1-T2 review table classifying all 72 owned entries, record the moving-average truncation defect, and capture the maintainer decisions. Synchronize stale workflow checkboxes with the GitHub issue body, migrate the spec frontmatter to v1, and mark the subissue in progress in EPIC torrust#2243. Co-authored-by: Copilot <[email protected]>
…ssing time The moving average read the previous average back as a truncated u64 before each update. The running sum then lost (n - 1) times the dropped fraction on every request, so the reported average ratcheted toward the fastest requests and stuck there. A local tracker reported 10227 ns for a true mean of 17812 ns after about 39k connect requests. Read the moving-average gauge as f64 and add regression tests for a fractional previous average and for drift over many requests. Co-authored-by: Copilot <[email protected]>
… conversion Replace the four per-accessor f64-to-u64 casts and their temporary allowances with one private whole_total helper. Its #[expect] records the invariant: the torrust-metrics Sum API returns f64, and a counter sum is a finite, non-negative whole number, exact below 2^53. Co-authored-by: Copilot <[email protected]>
…conversion Replace the six per-accessor f64-to-u64 casts and their temporary allowances with one private whole_total helper. Its #[expect] records the invariant: the torrust-metrics Sum API returns f64, and a counter sum is a finite, non-negative whole number, exact below 2^53. Co-authored-by: Copilot <[email protected]>
…sions - Route the counter totals and the banned-IP count gauge through one private whole_total helper with a single documented #[expect]. - Route the three averaged processing-time accessors through one averaged_processing_time_ns helper; truncating to whole nanoseconds is the stats API contract. - Narrow the moving-average allowance to the two exact integer-to-f64 conversions it needs. - Retain the banned-IP gauge input cast with a native reason. - Assert on the f64 gauge directly in the repository test instead of casting it. Co-authored-by: Copilot <[email protected]>
…ve-count gauge conversions Replace the temporary allowances on the inactive peer and torrent gauge inputs with #[expect] reasons: the gauge API takes f64, and an in-memory count is far below 2^53, so the usize-to-f64 conversion is exact. Co-authored-by: Copilot <[email protected]>
…rification evidence - Reconcile the 72 owned torrust#2158 inventory entries by ID: 68 removed, A113, A114, A170, and A178 retained with native reasons. - Add the bug-fix process, regression test strategy, and completed plan and acceptance evidence to the torrust#2244 spec. - Add manual verification evidence for the UDP average processing time reproduction, red/green tests, recheck, and scenario M1. - Record progress in EPIC torrust#2243. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[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
2 open findings
What changed in this PR
This PR audits and documents metric aggregate conversion boundaries introduced/owned by #2244, and fixes a correctness bug that biased UDP moving-average processing time metrics toward faster requests.
Changes:
- Fixes UDP moving-average processing time calculation by preserving the fractional part of the stored gauge (reading it as
f64). - Consolidates repeated metric aggregate casts into small per-package helpers (
whole_total,averaged_processing_time_ns) with permanent#[expect]reasons. - Adds/updates tests and issue documentation (including manual verification evidence and updated inventory reconciliation).
| File | Description |
|---|---|
| packages/udp-server/src/statistics/repository.rs | Updates a repository test to assert on f64 gauge values directly (removing truncating casts). |
| packages/udp-server/src/statistics/metrics.rs | Fixes UDP moving-average bias, introduces helper accessors, and adds regression tests for the moving average behavior. |
| packages/udp-server/src/banning/event/handler.rs | Narrows a usize -> f64 gauge cast to a statement-level #[expect] with rationale. |
| packages/udp-core/src/statistics/metrics.rs | Replaces repeated counter-sum casts with a whole_total helper and a single #[expect]. |
| packages/swarm-coordination-registry/src/statistics/activity_metrics_updater.rs | Narrows usize -> f64 gauge casts to statement-level #[expect] with rationale. |
| packages/http-core/src/statistics/metrics.rs | Replaces repeated counter-sum casts with a whole_total helper and a single #[expect]. |
| docs/issues/open/2244-2243-review-metric-aggregate-conversions/manual-verification-evidence.md | Adds detailed manual verification evidence and artifacts for the reproduced/fixed UDP average defect. |
| docs/issues/open/2244-2243-review-metric-aggregate-conversions/evidence/reproduce_avg_processing_time.py | Adds a reproduction script used for manual verification evidence. |
| docs/issues/open/2244-2243-review-metric-aggregate-conversions/evidence/before-fix-log-excerpt.txt | Adds a log excerpt capturing biased averages before the fix. |
| docs/issues/open/2244-2243-review-metric-aggregate-conversions/evidence/after-fix-log-excerpt.txt | Adds a log excerpt capturing corrected averages after the fix. |
| docs/issues/open/2244-2243-review-metric-aggregate-conversions/ISSUE.md | Updates the issue spec with the review table, outcomes, decisions, and completion evidence. |
| docs/issues/open/2243-review-numeric-conversion-boundaries/EPIC.md | Updates epic progress/status for #2244 to IN_PROGRESS with implementation notes. |
| docs/issues/closed/2158-2003-inventory-existing-clippy-allows/clippy-allow-inventory.md | Reconciles the #2158 inventory entries with #2244 outcomes (removed/retained) and updates narrative text. |
🧠 Review effort: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…uge assertions f64::EPSILON is the machine epsilon around 1.0, not a general absolute tolerance, so the two assertions that read the processing-time gauge directly could fail on a value that is merely very close. Compare with 1e-9 instead. Co-authored-by: Copilot <[email protected]>
…asons The whole_total reasons said the cast saturates above 2^53. A float to integer cast saturates only for NaN, infinities, negative values, and values beyond u64::MAX. Between 2^53 and u64::MAX the f64 may already have been rounded by the earlier integer-to-f64 conversion. Say that instead, in the HTTP core, UDP core, and UDP server helpers. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at e8e46807b62a303b88883c87638d17b93ab1d055. Recomputed from the bytes at this head, against the merge base 702cff6cc, which is develop; git merge-tree against it is clean (exit 0, no conflicted paths), over eleven commits and 14 files, +876/−564.
The defect and the fix. At the base the previous average came back through as u64, so each update computed trunc(prev) + (x − trunc(prev)) / n and n·avg lost (n−1)·frac(prev). By hand, [100, 101, 101, 101] gives 100, 100.5, 100.333…, 100.25 under the old code and 100, 100.5, 100.666…, 100.75 under the new; for 10,000 alternating 100/101 values trunc(prev) stays 100, so the old code ends at 100 + 1/10,000 = 100.0001 and the new at 100.5. Both are the true means (403/4 and 1,005,000/10,000), so the stated red values are what the old code yields. The before excerpt shows the truncation itself (43982.5 read back as 43982, then 52818.67 where the exact update gives 52819). Nothing else changes: the stored gauge was already f64, the three *_averaged accessors still truncate to whole nanoseconds, the first update still divides by 1 after the increment, and only the debug! line differs (a fractional previous value, -0 on the first update as the after excerpt shows). With .trunc() restored around the previous average, both new tests miss by about 0.5 against tolerances of 1e-9 and 1e-6, so both fail.
The helpers. f64 as u64 raises both cast_possible_truncation and cast_sign_loss, and u64/u128 as f64 raises cast_precision_loss; all three are pedantic and denied here, so every #[expect] is fulfilled. The three whole_total texts differ only where the UDP server one also covers count gauges. Per the Reference, a float-to-integer as rounds toward zero, maps NaN to 0 and saturates at the target's bounds; every f64 at or above 2^53 is whole, so the cast is exact up to u64::MAX and any loss above 2^53 sits in the f64 sum. The head text now says so. A113, A114 and A170 keep native, true reasons (usize counts of in-memory peers, torrents and ban-map entries); A178's two statement-level reasons hold (2^53 ns ≈ 104.2 days).
The inventory. The 72 IDs (8+2+12+1+45+4) end as 68 Removed and 4 Retain, matching the source: no accessor keeps a cast, grep -rn 'temporary: #2244' packages src finds nothing, and the only other attribute in those modules, A236, belongs to the earlier inventory. Ten rows attach the wrong outcome to their IDs (F1). Editing the closed record follows the inventory's ownership rule and the earlier follow-ups' precedent.
The tests. The repository assertions compare exactly computed values: the f64 spacing at 1000 is 2^-43 ≈ 1.1e-13, so < f64::EPSILON was an exact comparison, correct and not fragile, only unidiomatic. 1e-9 is about 8,800 ulps at 1000 and 4,400 at 2000, a sound absolute tolerance. The new tolerances sit far above the per-step rounding (≈1e-14) and far below the defect's 0.5. recalculate_for_all drives the method the response handler reaches through the repository, with one label set and one clock value, all the arithmetic depends on.
The spec, evidence and EPIC. The spec carries Bug-Fix Process and Regression Test Strategy, and the plan has red, fix and green-plus-recheck tasks. The script measures rather than models: it averages the logged req_processing_time values, which a correct running mean must equal. The excerpts recompute (10227 + 11654/39113 = 10227.298; 13851.336 + 3200.664/38341 = 13851.420), and 7585.4/17812.4 is 43%. Each last-updated-utc equals its newest log entry (spec 21:10, EPIC 21:00) but postdates the author dates of the commits carrying it. The captured issues match the titles, are open and assigned to the maintainer.
Hygiene. Eleven Conventional subjects with package or area scopes and the issue tag; bodies match their diffs; author equals committer; git diff --check is clean per commit. All eleven commits carry a footer naming the review bot as co-author, which no rule in the tree forbids. The open-pull-request commit-id check prints nothing. project-words.txt is untouched and the new words are dictionary words or script identifiers. Every changed relative link resolves.
The review bot. Its second thread is right by the Reference and the head fixes it; I would rate that class Minor, since a reason that misstates a cast misleads a reader about the code. Its first is right that f64::EPSILON is no general tolerance but wrong that these assertions could fail spuriously; Nit. The audit follows the template, and its source and reply URLs, review ID, thread states and resolution subjects match the capture; the audit validator passes against the captured comments. Its log stamp does not match its commit (F3).
Findings
- F1 Minor: wrong per-ID outcome for A185–A186, A189–A192, A195–A198 in the inventory and the spec's ranges.
- F2 Nit: the averaged reason calls truncation the stats API contract; the API type says rounded.
- F3 Nit: the audit's log stamp postdates its commit, the replies and the push.
- F4 Nit: evidence details the committed bytes do not reproduce.
- F5 Nit: the spec's G3 outcome is stale.
None blocks: the code and the totals are right, and each is a record a later edit can repair.
Checked, no finding: merge base and merge-tree; the hand derivation and the mutant expectation; lint names, #[expect] fulfilment and as semantics; the retained reasons; the 72-entry count and 68/4 split; the temporary: #2244 grep; unaccounted attributes; repository and parallel-update tests under the fix; frontmatter profiles (strict spec valid, others permissive, closed/ advisory); per-commit whitespace; the commit-id check; links; words; the audit's URLs, states and validator run.
Checks
On the loop's compute hub at this head, merge base 702cff6cc, which is develop (receipt server-gates-krkavec-343): pre-commit profile gate exit 0 (85 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 18 errors / 4 warnings at this head and 19 / 4 at the base re-measured, the one difference being the error in the #2244 spec's frontmatter at the base, which this PR resolves, and the other 22 diagnostics the same by path and category; the process-pr-review audit validator over docs/pr-reviews/pr-2552-review/PR-REVIEW.md with the live review comments: exit 0, 0 failures; cargo test for torrust-tracker-http-core (34 passed), torrust-tracker-udp-core (102 passed, 3 ignored), torrust-tracker-udp-server (242 passed, 1 ignored) and torrust-tracker-swarm-coordination-registry (112 passed) all exit 0; a mutant that truncates the previous average before the update (the behaviour of the old u64 round trip) fails both new moving-average tests with 100.25 and 100.0001, as the description says, and the tree was restored; cargo doc --no-deps with -D warnings exit 0 for the four packages; cargo clippy --workspace --all-targets --all-features -D warnings exit 0 (0 diagnostics); cargo fmt --all --check exit 0; cargo machete --with-metadata exit 0; no temporary: #2244 reason remains under packages/ or src/. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Docker E2E: completed/skipped; Documented Clippy Allows: completed/success; Unit (stable): completed/success; Unit (nightly): completed/success; Layer Boundary Bans: completed/success; Package Coverage (torrust-tracker-http-core): completed/success; Package Coverage (torrust-tracker-swarm-coordination-registry): completed/success; Package Coverage (torrust-tracker-udp-core): completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Test (Docker) (release): in_progress/pending; Build on ubuntu-latest (stable): 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 windows-latest (stable): completed/success; Discover Package Coverage: completed/success; Generate Coverage Report: completed/success; Docs Lint: completed/success". At posting, develop is 702cff6cc.
|
ACK e8e4680 — the moving-average fix, both regression tests' arithmetic, the helper reasons against the cast semantics and the 68/4 reconciliation of the 72 entries were recomputed from the bytes at this head |
…tory entries The IDs are keyed by the 2026-09-15 scan's line anchors, and I had assigned the outcomes by accessor order instead. Per the anchors, A185-A190 are the aborted, discarded, and banned-requests counters, A191-A192 the banned-IP gauge, and A193-A198 the three averaged accessors. Fix the ten inventory rows (A185-A186, A189-A192, A195-A198) and the spec's G1, G2, and G4 ID ranges. The group sizes and the 68 removed and 4 retained totals stand. Co-authored-by: Copilot <[email protected]>
…ard zero The REST API documents the three average processing-time fields as an average rounded time and nowhere says truncated, so calling truncation the stats API contract overstated it. The behavior is unchanged: as u64 rounds toward zero to whole nanoseconds. State that in the helper's reason and doc comment, the six inventory rows, the spec, and the evidence. Co-authored-by: Copilot <[email protected]>
…producible - Record the red run of the committed tests (mutate-then-restore at the PR head) next to the first run, and say why the panic lines differ. - Correct the claim that each log excerpt holds lag warnings: only the before excerpt does. - Save the V5 sender as evidence/m1_stats_check.py and name its command. Co-authored-by: Copilot <[email protected]>
…eep its simulation The G3 row said the processed count is read as f64 and that only the as_nanos cast is retained. The code reads the count through whole_total and keeps two statement-level expects, as the A178 inventory row and AC2 say. Save the simulation the row cites, with its output, next to the real-tracker evidence. Co-authored-by: Copilot <[email protected]>
…plementation round The spec's 21:00 and 21:10 entries, the EPIC's 21:00 entry, and the evidence's 20:55 stamp were estimates later than the commits that carry them. Append correction entries with the real author times, as the logs are append-only, and set each last-updated-utc to the time of this change. Co-authored-by: Copilot <[email protected]>
…e PR torrust#2552 audit Co-authored-by: Copilot <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 18227cec15bdeed930a283190549698ced66ad92. Recomputed from the bytes at this head, against the merge base 702cff6cc; git merge-tree against it is clean (exit 0, no conflicted paths), and against develop at ae4288087 clean too (exit 0, no conflicted paths; the 23 commits develop gained since the merge base touch no file this PR changes, and the merge base of the head and ae4288087 is still 702cff6cc).
Round-1 findings. R1-F1 RESOLVED: re-deriving all 72 IDs from the anchors in the 2026-09-15 file (the parent of 63aefa1), the ten rows now carry their anchor's accessor, the spec reads G1 A181–A190 and A199–A222, G2 A191–A192, G4 A193–A198, and the head still has 68 Removed and 4 Retain. R1-F2 RESOLVED: the reason and doc comment say the mean is rounded toward zero, which is what as u64 does and one of the roundings the REST type's "rounded" covers; A193–A198, the spec's G4 row and decision 4, V4 and the PR description agree. One phrase is left (F2). R1-F3 RESOLVED: the corrections give 20:52 and 20:54 UTC, the author times of 4857cdc (20:52:30Z) and bde00d0 (20:54:45Z). Each "2026-10-16 11:12" stamp equals its newest entry, is no later than 485202a (11:12:03Z) and no earlier than the edits it covers. The audit's correction gives 10:37:10, and its 11:14 lines follow the replies (11:14:32–11:14:38Z) and precede 18227ce (11:15:51Z). R1-F4 PARTLY: the lag sentence matches both excerpts (three warnings, none), and m1_stats_check.py prints V5's lines in V5's order, but the committed-test red run names a revision whose lines differ (F1). R1-F5 RESOLVED: the G3 row matches whole_total and the two statement-level #[expect]s (metrics.rs:95-105). The simulation replays trunc(prev) + (x − trunc(prev)) / n with n incremented first, seeded, over 200,000 uniform 20,000–60,000 ns values, and its last output line is the cited 20,175.1 against 40,009.1.
The audit. Rows F3–F7 match my five comments: severities Minor and four Nits, summaries from my first lines, reviewer IDs F1–F5, source URLs on my comment ids under review 5546913953, and reply URLs on the PR author's replies, each in reply to its own source. All seven threads are resolved, and each resolution subject occurs once on the branch. The audit validator passes against the captured comments with either base (7 rows, 3 log entries). Two details remain: the bot's two rows now carry my rating (F3), and the dismissal of my approval is not recorded (F4).
The code change. Two /// lines and the reason string; no token outside a comment or that string changes, and the attribute still names cast_sign_loss and cast_possible_truncation, both raised by f64 as u64.
Nothing else moved. The interdiff is 9 files, +221/−32; under packages/ only that file changes, nothing under src/. Every new relative link resolves (the sender from the evidence file, the simulation pair from the G3 row); project-words.txt is untouched; the new words are dictionary words or a standard-library name.
Hygiene. Six Conventional subjects (issues, udp-server, pr-reviews) with the issue tag; bodies match their diffs; author equals committer; git diff --check is clean per commit. All six carry a footer naming the review bot as co-author, seventeen of seventeen on the branch, which no rule in the tree forbids. The open-pull-request commit-id check prints nothing, as in round 1.
The review bot. No review after 08:44:03Z; its two threads stay resolved.
Findings
- F1 Nit: the committed-test red run names the wrong revision for its panic lines.
- F2 Nit: the new reason's "before this review" has no referent once merged.
- F3 Suggestion: the bot's rows carry another reviewer's rating instead of their own marks.
- F4 Nit: the audit records the round-1 review as approved; it was dismissed before the audit commit.
None blocks: the code and the counts are right, and each is a record a later edit can repair.
Checked, no finding: both merge-trees and the merge base; all 72 anchors; the wording sweep; every stamp against its commit; the sender against V5; the simulation's arithmetic; the attribute's lints; the interdiff scope; links; words; per-commit whitespace; the commit-id check; the audit's ids, replies, thread states and validator run.
Checks
On the loop's compute hub at this head, merge base 702cff6cc (receipt server-gates-krkavec-349; develop is ae4288087, and git merge-tree against it is clean): pre-commit profile gate exit 0 (86 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 18 errors / 4 warnings at this head and 19 / 4 at the base re-measured, the one difference being the error in the #2244 spec's frontmatter at the base, which this PR resolves, and the other 22 diagnostics the same by path and category; the process-pr-review audit validator over docs/pr-reviews/pr-2552-review/PR-REVIEW.md with the live review comments: exit 0, 7 rows, 3 log entries, 0 failures; cargo test for torrust-tracker-http-core (34 passed), torrust-tracker-udp-core (102 passed, 3 ignored), torrust-tracker-udp-server (242 passed, 1 ignored) and torrust-tracker-swarm-coordination-registry (112 passed) all exit 0; the mutant that truncates the previous average before the update fails both new moving-average tests with 100.25 and 100.0001, and the tree was restored; cargo doc --no-deps with -D warnings exit 0 for the four packages; cargo clippy --workspace --all-targets --all-features -D warnings exit 0 (0 diagnostics); cargo fmt --all --check exit 0; cargo machete --with-metadata exit 0; no temporary: #2244 reason remains under packages/ or src/. 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-udp-core): completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Package Coverage (torrust-tracker-http-core): completed/success; Package Coverage (torrust-tracker-swarm-coordination-registry): completed/success; Docker E2E: completed/skipped; Layer Boundary Bans: completed/success; Documented Clippy Allows: completed/success; Unit (stable): completed/success; Unit (nightly): 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 macos-latest (nightly): completed/success; Build on windows-latest (stable): completed/success; Build on ubuntu-latest (stable): completed/success; Build on macos-latest (stable): completed/success; Docs Lint: completed/success; Build on ubuntu-latest (nightly): completed/success". At posting, develop is ae4288087.
|
ACK 18227ce — the five round-1 fixes, all 72 inventory IDs against their original anchors, the comment-only code change and the audit against the captured threads were recomputed from the bytes at this head |
…red run The mutate-then-restore run that gave panics on lines 1300 and 1310 ran on the tree of the round-toward-zero commit, whose doc comment adds one line above the tests. One commit earlier they sit on lines 1299 and 1309. Name the commit whose tree ran, as the fix-bug skill asks. Co-authored-by: Copilot <[email protected]>
…ot on this review The reason said the cast keeps the behavior from before this review, which a reader of the code cannot resolve once the review is merged. Name the test that pins the rounding toward zero instead, in the reason and in the six inventory rows A193-A198. Co-authored-by: Copilot <[email protected]>
… PR torrust#2552 audit Co-authored-by: Copilot <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 7ef5d8f472ab29a344fd9709d130cb1f4199e28f. Recomputed from the bytes at this head, against the merge base 702cff6cc; git merge-tree against it is clean (exit 0, no conflicted paths), and against develop at ae4288087 clean too (exit 0, no conflicted paths; the merge base with it is still 702cff6cc, and no file develop changed since then is in this PR).
Round-2 findings and the audit.
- R2-F1 RESOLVED: the evidence (
:169-173) now names 2337ac8 by subject. The assertions are at 1299/1309 at ec7f81c and at 1300/1310 from 2337ac8 on. The new stamp, 11:54, is no later than f644d5e (authored 11:54:11Z, committed 11:55:18Z). - R2-F2 RESOLVED: the reason still names the REST interface and the cast, and now ends on
it_should_handle_fractional_averages_with_truncation. That#[test]sets 1000, 1001 and 1001 and asserts 1000 for the 1000.67 mean, which separates rounding toward zero from rounding to nearest. A193–A198 say the same. - R2-F3 RESOLVED: rows F1/F2 read
Minor (inferred)andNit (inferred), matching the Medium and Low marks the Round 1 paragraph cites, and my rating stays as prose. - R2-F4 RESOLVED for round 2: the Round 2 paragraph names the 11:13:45 UTC dismissal and its commit by subject, as the timeline shows (485202a).
Rows F8–F11 match my four comments (severities Nit, Nit, Suggestion, Nit, my first lines, reviewer IDs F1–F4), with source URLs on my comment ids and reply URLs on the PR author's replies, each to its own source. All eleven threads are resolved, and each resolution subject occurs once on the branch. The replies for F10 and F11 say the fix lands in the following audit commit, which it does. The 11:58 log lines precede 7ef5d8f (11:59:24Z) and follow the replies (11:58:09–11:58:16Z). The audit validator passes against the captured comments with either base (11 rows, 5 log entries). The round-3 record repeats the gap R2-F4 closed for round 2 (F1).
The code change. One reason string; the word diff changes nothing outside it, and the attribute still names cast_sign_loss and cast_possible_truncation, both raised by f64 as u64.
Nothing else moved. Four files, +121/−17; under packages/ only that string, nothing under src/. The spec, the EPIC, the evidence/ files and project-words.txt are unchanged. No relative link was added, and no new word lacks a precedent in the tree.
Hygiene. Three Conventional subjects (issues, udp-server, pr-reviews) with the issue tag; bodies match their diffs. The author is the committer, with f644d5e committed 67 s after authoring. git diff --check is clean per commit. All three carry a footer naming the review bot as co-author, twenty of twenty on the branch, which no rule in the tree forbids. The open-pull-request commit-id check prints nothing.
The review bot. No review after 08:44:03Z; its two threads stay resolved.
Findings
- F1 Nit: the Round 3 record calls review 5547398388 approved and omits its dismissal before the audit commit.
None blocks.
Checked, no finding: both merge-trees; the line numbers per revision; the named test; the six rows; the restored severities; the round-2 dismissal; rows, ids, replies, threads and subjects; log times; the validator run; the word diff of the code change; the interdiff scope; per-commit whitespace; the commit-id check.
Checks
On the loop's compute hub at this head, merge base 702cff6cc (receipt server-gates-krkavec-354; develop is ae4288087, and git merge-tree against it is clean): pre-commit profile gate exit 0 (83 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 18 errors / 4 warnings at this head and 19 / 4 at the base re-measured, the one difference being the error in the #2244 spec's frontmatter at the base, which this PR resolves, and the other 22 diagnostics the same by path and category; the process-pr-review audit validator over docs/pr-reviews/pr-2552-review/PR-REVIEW.md with the live review comments: exit 0, 11 rows, 5 log entries, 0 failures; cargo test for torrust-tracker-http-core (34 passed), torrust-tracker-udp-core (102 passed, 3 ignored), torrust-tracker-udp-server (242 passed, 1 ignored) and torrust-tracker-swarm-coordination-registry (112 passed) all exit 0; the mutant that truncates the previous average before the update fails both new moving-average tests with 100.25 and 100.0001, and the tree was restored; cargo doc --no-deps with -D warnings exit 0 for the four packages; cargo clippy --workspace --all-targets --all-features -D warnings exit 0 (0 diagnostics); cargo fmt --all --check exit 0; cargo machete --with-metadata exit 0; no temporary: #2244 reason remains under packages/ or src/. GitHub checks at this head at posting time: "Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-http-core): completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Package Coverage (torrust-tracker-swarm-coordination-registry): completed/success; Package Coverage (torrust-tracker-udp-core): completed/success; Docker E2E: completed/skipped; Documented Clippy Allows: completed/success; Unit (nightly): completed/success; Unit (stable): completed/success; Layer Boundary Bans: completed/success; Test (Docker) (release): in_progress/pending; Build on macos-latest (stable): completed/success; Build on windows-latest (stable): completed/success; Discover Package Coverage: completed/success; Docs Lint: completed/success; Build on ubuntu-latest (nightly): completed/success; Build on ubuntu-latest (stable): completed/success; Generate Coverage Report: completed/success; Build on windows-latest (nightly): completed/success; Build on macos-latest (nightly): completed/success". At posting, develop is ae4288087.
|
ACK 7ef5d8f — the four round-2 fixes, the one-string code change, the named test's assertion and the audit's round-3 rows against the captured threads were recomputed from the bytes at this head |
…approval in the PR torrust#2552 audit Name when and by which push review 5547398388 was dismissed, as the Round 2 paragraph does for its review, and record round 4's single finding. Co-authored-by: Copilot <[email protected]>
…approval in the PR torrust#2552 audit The push that fixed F12 dismissed review 5547644742. Record when and by which push, so the audit no longer lags one approval behind the PR. Co-authored-by: Copilot <[email protected]>
da2ce7
left a comment
There was a problem hiding this comment.
Reviewed at 8037065bb210d88cdc2bb55016a580ac31bc63ef. Recomputed from the bytes at this head, against the merge base 702cff6cc; git merge-tree against it is clean (exit 0, no conflicted paths), and against develop at ae4288087 clean too (exit 0, no conflicted paths; the merge base with it is still 702cff6cc).
R3-F1 and the Round 4 record. R3-F1 is RESOLVED. The Round 3 paragraph now gives 11:57:39 UTC and the push whose newest commit is e4a34dc's subject, which occurs once on the branch and is the timeline's dismissal commit. The appended 12:18 correction leaves the 11:58 entry intact, and the sentence has the Round 2 paragraph's form.
The Round 4 paragraph matches my round-3 review: one Nit, no bot review after 08:44:03Z. Its dismissal sentence matches the timeline (12:20:58 UTC, dismissal commit f4dad0a), and my ACK named 7ef5d8f, the head before that push. Row F12 carries my severity and first line, reviewer ID F1, source URL r4294554917 and reply URL r4294562980 (in reply to it), and its thread is resolved. The resolution subject occurs once.
The two 12:18 log lines precede f4dad0a (12:19:07Z), and the 12:21 line precedes 8037065 (12:21:22Z). The capture has no time for the thread's resolution, so that part of the 12:21 line cannot be timed. Every approval the audit names now has its dismissal recorded.
The 12:18:28Z reply says "Fixed" and that the fix lands in "the audit commit that follows this reply", which it did (f4dad0a, pushed by 12:20:58Z). The rule to re-derive every reply claim from the current tree is met for its facts but not for that disposition, which is the clash already queued. The audit validator passes against the captured comments with either base (12 rows, 8 log entries).
No code moved. The interdiff is the audit alone, +46/−3; git diff of the two heads under packages/ and src/ is empty.
Nothing else moved. The spec, the EPIC, the inventory, every evidence file and project-words.txt are unchanged; no relative link was added.
Hygiene. Two Conventional subjects (pr-reviews) with the issue tag; bodies match their diffs; author equals committer; git diff --check is clean per commit. Both carry a footer naming the review bot as co-author, twenty-two of twenty-two on the branch, which no rule in the tree forbids. The open-pull-request commit-id check prints nothing.
The review bot. No review after 08:44:03Z; all twelve threads are resolved.
Findings: none.
Checked, no finding: both merge-trees; the three dismissal sentences against their timeline events; rows, ids, reply, thread and subject; log times; the validator run; the empty code interdiff; the unchanged files; per-commit whitespace; the commit-id check. The Round 3 paragraph counts rounds as my reviews do ("round-1 findings"), and the Round 4 paragraph counts them as the audit does ("round-3 findings"). Each is right in its own frame.
Checks
On the loop's compute hub at this head, merge base 702cff6cc (receipt server-gates-krkavec-357; develop is ae4288087, and git merge-tree against it is clean): pre-commit profile gate exit 0 (85 s); linter markdown, linter cspell, linter lychee exit 0; frontmatter-validator --all: 18 errors / 4 warnings at this head and 19 / 4 at the base re-measured, the one difference being the error in the #2244 spec's frontmatter at the base, which this PR resolves, and the other 22 diagnostics the same by path and category; the process-pr-review audit validator over docs/pr-reviews/pr-2552-review/PR-REVIEW.md with the live review comments: exit 0, 12 rows, 8 log entries, 0 failures; cargo test for torrust-tracker-http-core (34 passed), torrust-tracker-udp-core (102 passed, 3 ignored), torrust-tracker-udp-server (242 passed, 1 ignored) and torrust-tracker-swarm-coordination-registry (112 passed) all exit 0; the mutant that truncates the previous average before the update fails both new moving-average tests with 100.25 and 100.0001, and the tree was restored; cargo doc --no-deps with -D warnings exit 0 for the four packages; cargo clippy --workspace --all-targets --all-features -D warnings exit 0 (0 diagnostics); cargo fmt --all --check exit 0; cargo machete --with-metadata exit 0; no temporary: #2244 reason remains under packages/ or src/. GitHub checks at this head at posting time: "Publish (Release): completed/skipped; Publish (Development): completed/skipped; Context: completed/success; Package Coverage Regression: completed/success; Package Coverage (torrust-tracker-http-core): completed/success; Package Coverage (torrust-tracker-swarm-coordination-registry): completed/success; Package Coverage (torrust-tracker-udp-core): completed/success; Package Coverage (torrust-tracker-udp-server): completed/success; Docker E2E: completed/skipped; Unit (stable): in_progress/pending; Layer Boundary Bans: completed/success; Unit (nightly): in_progress/pending; Documented Clippy Allows: completed/success; Test (Docker) (release): completed/success; Build on ubuntu-latest (stable): completed/success; Build on windows-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 macos-latest (stable): completed/success; Discover Package Coverage: completed/success; Generate Coverage Report: completed/success; Docs Lint: completed/success". At posting, develop is ae4288087.
|
ACK 8037065 — the R3-F1 fix, all three recorded dismissals against their timeline events, the F12 row against the captured thread and the empty code interdiff were recomputed from the bytes at this head |
|
ACK 8037065 |
…/issues/closed Issue #2244 closed with PR #2552, the last subissue of EPIC #2243. Move both specs to docs/issues/closed/, set their status to done, tick the completed checkpoints, mark #2244 done in the EPIC table, and verify the EPIC's acceptance criteria against the tree: all 77 owned inventory entries have an outcome and none is temporary. Two references to the old paths stay on purpose because they are historical records. Co-authored-by: Copilot <[email protected]>
…EPIC #2243 6915a41 chore(issues): archive closed issue #2244 spec and EPIC #2243 to docs/issues/closed (Jose Celano) Pull request description: ## Summary Archives the closed issue #2244 spec and the EPIC #2243 spec from `docs/issues/open/` to `docs/issues/closed/`, and closes the EPIC. Issue #2244 closed with PR #2552, which was the last of the EPIC's three subissues (#2245 and #2246 closed earlier). Closes #2243 ## What changed - Moved `docs/issues/open/2244-2243-review-metric-aggregate-conversions/` and `docs/issues/open/2243-review-numeric-conversion-boundaries/` to `docs/issues/closed/`, with `git mv` so history follows. - Set both specs to `status: done` with the new `spec-path`, set `related-pr: 2552` on the #2244 spec, and refreshed `last-updated-utc`. - Ticked the completed workflow checkpoints and added a progress-log entry to each spec. - Marked #2244 `DONE` in the EPIC's subissue table and linked its archived path. - Verified the EPIC's acceptance criteria against the tree and ticked them with evidence. All 77 owned #2158 inventory entries are present with an outcome (73 `Removed`, 4 `Retain`), none is `Temporary`, and no `temporary: #2244`, `#2245`, or `#2246` reason remains in the source. The three child folders each hold a `manual-verification-evidence.md`, and every child spec has all its acceptance criteria checked. - Updated the evidence file's `issue-spec` path. ## Deliberately retained references Two files still mention the old `docs/issues/open/...` paths, and both are historical records, so I left them: the scope list in the closed spec #2281, and a quoted example in `docs/discussions/2429-templated-documentation/.../maintainer-review-session.md`. I checked all eight relative links in the moved files by script, because `linter lychee` skips `docs/issues/closed/`. ## Follow-ups, not part of this PR - torrust/torrust-metrics#1 (an exact `u64` counter sum) is optional. Adopting it later would let the tracker drop its `whole_total` helpers. - #2466 is the configuration-load follow-up of #2245 and belongs to a different EPIC, so it does not block closing this one. ## Validation - The pre-commit hook passed (`linter all`, the frontmatter validator on the staged files, and the other steps). - `git diff --cached --check` is clean, and `linter markdown`, `linter cspell`, and `linter lychee` pass. - The change touches only `docs/issues/`. No code changed. ACKs for top commit: josecelano: ACK 6915a41 Tree-SHA512: 5a2c252af65cb42ada420979d5c2b6761d5a3855bd0deb9bf10c61de000302e28e0e5cce62da29840c71c8f4e901f3b288e317a9d27b547c042a3ef8e911429a
- #2414, #2415, #2416: `branch:` names each implementation branch, and the obsolete note about setting `epic` is removed. - Sub-EPIC and #2416: the #2471 prerequisite of T9 is satisfied (merged in PR #2544 on 2026-10-16). - Sub-EPIC T10 step and #2416: T10 adds the swarm bus, its producers, and its three consumers to docs/architecture/events.md (finding from #2413 T1). - #2414: the Implementation Plan asks to revalidate the code that PRs #2545 and #2552 changed after the spec was written. - #1488: roadmap row 15 is In progress and notes #2413 done. Co-authored-by: Copilot <[email protected]>
… the SI-22 specs before #2414 f24a690 docs(issues): [#2413] record the Task Reviewer re-review and fix its three nits (Jose Celano) fb9f1ef docs(issues): [#2413] record the post-merge Task Reviewer report and the implementation retrospective (Jose Celano) cbebd8d docs(shutdown): [#2413] attribute the publish-nothing facts to D Versus F, not entry 27 (Jose Celano) dc537ee docs(issues): [#2410] refresh stale SI-22 spec text before #2414 (Jose Celano) Pull request description: Prep work for SI-22 (sub-EPIC #2410, under EPIC #1488) before #2414 starts. It has two parts, each in its own signed commits. Documentation only: no code, tests, or workflows change. ## A. Close the two skipped delivery gates of #2413 (after merge) The sub-EPIC's Shared Delivery Gates required an independent Task Reviewer report and an implementation retrospective before PR #2553 was pushed. Both were skipped, so they are done here, after merge, and recorded as such. - `docs/issues/closed/2413-2410-si-22-1-document-event-flows-and-draft-adr/agent-review-reports.md`: the Task Reviewer report of 2026-10-19 17:12 UTC. Verdict `POST_MERGE_FINDINGS`: AC1 to AC3 and `linter all` pass on the merged tree, with four should-fix findings and two nits. The entry records the maintainer's decision on each finding. The file also holds the re-review of this branch (19:08 UTC, `REVIEW PASSED`, three nits, all fixed in the last commit). - `implementation-retrospective.md` in the same folder (the maintainer chose a retrospective over a log-only statement). It covers what the PR review retrospective `docs/pr-reviews/pr-2553-review/review-retrospective.md` does not: the pre-push hook's `GIT_DIR` leak into fixture tests, the entry 27 recheck error, a T1 finding that stayed in progress logs, and the skipped gates (including the missing Arrange-Act-Assert review of the two `clippy-allow-reasons` tests). - Finding F1 is fixed: the "Recheck of record entry 27" table in `docs/features/shutdown-process/task-inventory.md` credited entry 27 with two facts it does not state and reported a difference that did not exist. Those facts now sit in a table attributed to the sub-EPIC's "D Versus F" section, both marked Confirmed. Dated corrections are in the #2413 and sub-EPIC logs. - The #2413 spec's two gate checkpoints are ticked. A late log entry covers review rounds 9 and 10 of PR #2553, which were only in the audit. ## B. Refresh stale SI-22 spec text - #2414, #2415, #2416: `branch:` names each implementation branch (`2414-drain-listener-queues-on-shutdown`, `2415-per-component-cancellation-tokens`, `2416-stop-producers-before-listeners`), and the obsolete "`epic` is set ..." note is removed. - The #2471 prerequisite of T9 is now marked satisfied (merged in PR #2544 on 2026-10-16): sub-EPIC Subissues row 4, Chosen Design, the T9 row, Prerequisites, Dependencies, and #2416 Scope. - T10 (sub-EPIC step, #2416 Scope, and its T10 row) adds the swarm bus, its producers, and its three consumers to `docs/architecture/events.md`, which omits them (finding from #2413 T1). - #2414's Implementation Plan asks for a revalidation of the code that PRs #2545 and #2552 changed after the spec was written. The file lists come from `git diff --stat` of each merge commit against its first parent. - #1488: roadmap row 15 is `In progress` and notes #2413 done. This, plus its `last-updated-utc` (approved by the maintainer), is the only #1488 change. Each touched spec has a progress-log entry naming the model (GitHub Copilot, Claude Opus 5.5), and its `last-updated-utc` equals its newest entry. ## Validation - `linter all` exited 0 before each commit; the pre-commit hook passed for all four commits, which are GPG signed. - The `open-pull-request` check for PR-branch commit ids in changed files printed nothing. - `linter lychee` skips `docs/issues/closed/`, so the relative links in the two new files were checked by hand: all resolve. - Independent Task Reviewer re-review of the whole branch: `REVIEW PASSED` (recorded in `agent-review-reports.md`). Related to #2410, #2413, #2414, #2415, #2416, #1488 ACKs for top commit: josecelano: ACK f24a690 Tree-SHA512: 14a4ce5e3c8852615921745c3d7330b2cb4ec7a5cb4e5fc04112c4893c3f5e6f55272afd86a3dfec3d7dea69ca23cbd8432443df64d4b7a7a620db051dd82bf0
develop changed statistics/metrics.rs again (#2244, merged through #2552). Rebase S1 and re-measure: lines 1,737 / 1,953 (88.94%), regions 90.40%, functions 84.21%; only metrics.rs differs from the first T1 measurement. Co-authored-by: Copilot <[email protected]>
…ry and the first test plan f2ad929 docs(pr-reviews): [#2558] record the sixth review round in the audit (Jose Celano) 8a521b6 docs(issues): [#1349] link the PR 2558 review audit from the specification (Jose Celano) 4eabe37 docs(issues): [#1349] list the post-approval amendments of the announce plan (Jose Celano) 7b4fd60 docs(pr-reviews): [#2558] record the fifth review round in the audit (Jose Celano) d855aa4 docs(pr-reviews): [#2558] correct F6's source finding ID and the claims about it (Jose Celano) c44471d docs(pr-reviews): [#2558] record the fourth review round in the audit (Jose Celano) a32b11c docs(pr-reviews): [#2558] record N/A as F5's reviewer finding ID (Jose Celano) 602c699 docs(pr-reviews): [#2558] record the third review round in the audit (Jose Celano) 9369d20 docs(issues): [#1349] run mutation M5 with the lint cap in the announce plan (Jose Celano) 87a67e8 docs(pr-reviews): [#2558] record the second review round in the audit (Jose Celano) 6ca22a0 docs(issues): [#1349] say that ClientConnectionContext::port is called by client_port (Jose Celano) 809f8df docs(issues): [#1349] name the mutations that prove the announce tests (Jose Celano) 91cce8b docs(issues): [#1349] add the instance public URL case to the announce plan (Jose Celano) 6c2c9ae docs(pr-reviews): [#2558] record the review audit for the #1349 S1 PR (Jose Celano) 11d051e docs(issues): [#1349] add the external-IP setup to the precedence test in the announce plan (Jose Celano) 223c961 docs(issues): [#1349] record the S1 pull request #2558 in the specification (Jose Celano) 1f8a578 docs(issues): [#1349] record the re-measurement review reports (Jose Celano) 79c6ce2 docs(issues): [#1349] point the coverage evidence at the re-measured reports (Jose Celano) 437f79b docs(issues): [#1349] re-measure the http core baseline after #2244 (Jose Celano) 046079d docs(issues): [#1349] record the S1 Task Reviewer reports and the review round (Jose Celano) d76b143 docs(issues): [#1349] record the misleading tcp6 event test name in the announce plan (Jose Celano) a48e168 docs(issues): [#1349] mark the announce ledger row in progress (Jose Celano) eb066a0 docs(issues): [#1349] correct the listener, scrape and doc-test evidence (Jose Celano) 076f43b docs(issues): [#1349] record the approval of the announce plan and slices (Jose Celano) b95b36c docs(issues): [#1349] add http core plan guidance and the announce test plan (Jose Celano) 85bc235 docs(issues): [#1349] record http core coverage baseline and inventory (Jose Celano) Pull request description: ## Summary Slice S1 of #1349 (tests for the `torrust-tracker-http-core` package, EPIC #1347): the coverage baseline, the module inventory, the shared plan guidance, and the first file test plan. It changes documentation only; no Rust, test or manifest file changes. The implementation follows in the slices S2-S6 of [the specification](https://github.com/torrust/torrust-tracker/blob/develop/docs/issues/open/1349-1347-add-tests-http-core/ISSUE.md), each starting after the previous one merges. Related to #1349 Parent EPIC: #1347 ## What this slice adds - **T1, `coverage-evidence.md`.** The package was measured again, because `packages/http-core` changed on `develop` after the spec baseline (#2536 through #2545, and #2244 through #2552, both on statistics files): lines 1,737 / 1,953 (88.94%), regions 2,335 / 2,583 (90.40%), functions 160 / 190 (84.21%), from the same 32 unit tests, with unit-only equal to aggregate (no integration target). It records the 13 source files with per-file numbers and test counts, the uncovered-line groups with a hypothesis each, and the regions that line coverage hides: the early-return paths of every `?` in `handle_announce` and `handle_scrape`, which are the order-of-checks decisions. It flags dead-code candidates for the file plans to confirm (the `ConnectionContext` getters, `ClientConnectionContext::port` and `Metrics::set_gauge`), and an unprotected listener decision (no test dispatches a `TcpAnnounce` event). - **T2, plan guidance and first plan.** `test-refactor-plans/README.md` holds the shared guardrails and the two udp-core testing lessons that apply here (re-check "untestable" error paths against `tracker-core`'s exported store mocks; prove an ordering decision with an expectation-free double). `services-announce-tests.md` plans R1 (refactor the 8 existing tests) and R2a-R2j (private mode, listed mode, the order of the checks, loopback substitution for a non-loopback client, the request-to-announcement mapping, `numwant`, absent sender, failure reasons, and a failing downloads store), plus a peer-IP property that is kept only if a hand-made mutation survives the examples. - **T3, approval.** The maintainer approved the announce plan, the ledger order, the slices S1-S6, and adding `rstest` as a dev-dependency in S2 (recorded in the plan and the spec). - **Records.** The specification goes to `in-progress` (ledger row 1 `IN_PROGRESS`), the EPIC #1347 row and both coverage tables carry the baseline, and the independent Task Reviewer's reports are in `agent-review-reports.md`. ## Files - `docs/issues/open/1349-1347-add-tests-http-core/coverage-evidence.md` (new) - `docs/issues/open/1349-1347-add-tests-http-core/test-refactor-plans/README.md` (new) - `docs/issues/open/1349-1347-add-tests-http-core/test-refactor-plans/services-announce-tests.md` (new) - `docs/issues/open/1349-1347-add-tests-http-core/agent-review-reports.md` (new) - `docs/issues/open/1349-1347-add-tests-http-core/ISSUE.md` - `docs/issues/open/1347-overhaul-packages-testing/EPIC.md` ## Validation - Coverage: `cargo-llvm-cov 0.6.16` on stable Rust 1.99.0, clean aggregate and `--lib` runs at `develop` `a3810b813`; the commands are in the evidence file. - Independent Task Reviewer: three rounds, recorded in `agent-review-reports.md`. The first review failed with accuracy findings that were fixed; the re-measurement after the rebase failed on three stale-anchor findings that were fixed; the final confirmation passed. - Pre-commit (`./contrib/dev-tools/git/hooks/pre-commit.sh --format=json`) passed for every commit, including `linter all`. - Pre-push (`./contrib/dev-tools/git/hooks/pre-push.sh`: nightly Rust format, check and docs, then the stable Rust 1.99.0 test suite) passed on the final head. - `linter markdown`, `linter cspell` and `linter lychee`, and the commit-id citation check from the `open-pull-request` skill (no branch commit ids cited), pass. ACKs for top commit: josecelano: ACK f2ad929 Tree-SHA512: 731d602c31342d8d2fdd413bf8b0b158412a3ffcfa9b28bffca5f4a8988fd2e2229ebf69fbb21f31d56f50132019f597ad29ccd30f57b8f8b7f4f2957ee5f949


Summary
Reviews every metric-boundary cast owned by #2244 (72 entries from the #2158 inventory, A080-A087, A113-A114, A143-A154, A170, A178-A222 and A224-A227) and gives each a recorded outcome. The review also found and fixed a real defect: the UDP average processing time was biased toward the fastest requests.
Closes #2244
Part of EPIC #2243.
Defect fixed
Metrics::recalculate_udp_avg_processing_time_nsread the previous moving average back through au64cast before each update. Every update therefore dropped the fraction of the previous average, so the running sum lost(n - 1)times that fraction per request. After enough requests the reported average ratcheted toward the fastest requests and stuck there. The REST API fieldsudp_avg_{connect,announce,scrape}_processing_time_nsexposed the biased value.On a local release tracker, 50,000 sequential connect requests gave an API value of 10,227 ns against a true mean of 17,812.4 ns (43% low). After the fix, the same run gave 13,851 ns against a true mean of 13,851.4 ns. The fix reads the gauge as
f64, its native type. Two new unit tests failed before the fix (100.25 and 100.0001 instead of 100.75 and 100.5) and pass after it. The red and green runs, the reproduction and the recheck are recorded in the issue-localmanual-verification-evidence.md.Outcomes for the other entries
f64-to-u64casts were replaced by one privatewhole_totalhelper per package. Its single#[expect]records the invariant:torrust-metricsreturnsf64sums, and a counter sum is a finite, non-negative whole number, exact below 2^53. Behavior is unchanged. The reason is permanent, so this PR does not depend on an external release. An exactu64counter sum is tracked upstream in Add an exact u64 sum aggregate for counters torrust-metrics#1.averaged_processing_time_nshelper that keeps the current behavior:as u64rounds the mean toward zero to whole nanoseconds, and the REST API documents the fields as an average rounded time.usizecounts converted tof64gauge inputs, exact because in-memory counts are far below 2^53) and A178, whose function-level allowance is narrowed to two statement-level#[expect]attributes.f64gauge directly.Totals: 68 entries removed, 4 retained, no
#2244temporary reason left in the source.#[expect]makes Clippy fail if a lint stops firing.Files and packages touched
packages/udp-server: the fix and tests, the helpers, the banned-IP gauge input, and the repository test.packages/http-coreandpackages/udp-core: thewhole_totalhelper.packages/swarm-coordination-registry: the two inactive-count gauge inputs.docs/issues/: the Review Metric Aggregate Conversions #2244 spec (review table, maintainer decisions, bug-fix process, regression test strategy), the manual verification evidence and its artifacts, the Inventory Existing Clippy Allows #2158 inventory rows reconciled by ID, and the EPIC progress log.Validation
cargo clippy -p torrust-tracker-http-core -p torrust-tracker-udp-core -p torrust-tracker-udp-server -p torrust-tracker-swarm-coordination-registry --all-targets --all-features -- -D warningsis clean, also after the rebase onto the latestdevelop.linter allamong others) passed on every commit, andpre-push.shpassed (nightly format, check and docs, all tests) before the rebase.The branch history is kept as is: the spec commit, the fix with its regression tests, one refactor commit per package, the documentation commits, and one commit per review finding with the audit in
docs/pr-reviews/pr-2552-review/PR-REVIEW.md.Follow-up
The EPIC #2243 table keeps this subissue as in progress until the PR is merged and the spec is archived.