Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
schema-version: 1
doc-type: issue
issue-type: task
status: in-progress
status: done
priority: p2
epic: 1347
github-issue: 2824
spec-path: docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md
spec-path: docs/issues/closed/2824-1347-add-tests-primitives/ISSUE.md
branch: "2824-1347-add-tests-primitives-final"
related-pr: 2864
last-updated-utc: "2026-11-15 08:36"
last-updated-utc: "2026-11-15 21:07"
semantic-links:
skill-links:
- create-issue
Expand All @@ -24,7 +24,7 @@ semantic-links:
- docs/issues/closed/2637-1347-add-tests-axum-rest-api-server/ISSUE.md
- docs/issues/closed/1349-1347-add-tests-http-core/ISSUE.md
- docs/issues/closed/1348-1347-add-tests-udp-core/ISSUE.md
- docs/issues/open/2824-1347-add-tests-primitives/coverage-evidence.md
- docs/issues/closed/2824-1347-add-tests-primitives/coverage-evidence.md
- packages/primitives
---

Expand Down Expand Up @@ -236,7 +236,7 @@ the maintainer (2026-11-10):
| S1 | Defect fixes decided in this issue (T2a): F2 `PeerRole` JSON casing, only (F1 fixed upstream; F3, F4, F5 handed off). Merged first, so the test slices pin the fixed behavior. | - | `2824-1347-add-tests-primitives-fixes` | #2834 | DONE |
| S2 | T2, then `peer.rs` (rank 1, the largest gap) | 1 | `2824-1347-add-tests-primitives-peer` | #2841 | DONE |
| S3 | Configuration defaults and bounded values: `announce.rs`, `policy.rs`, `mode.rs`, `pagination.rs`, `announce_interval.rs` | 2-6 | `2824-1347-add-tests-primitives-defaults` | #2852 | DONE |
| S4 | `swarm_metadata.rs`, no-change decisions for the covered and wiring files, then T4-T6; updates the EPIC tables; the spec moves to `docs/issues/closed/` in a separate `cleanup-completed-issues` PR after the issue closes (as for #2637) | 7-16 | `2824-1347-add-tests-primitives-final` | #2864 | IN_PROGRESS |
| S4 | `swarm_metadata.rs`, no-change decisions for the covered and wiring files, then T4-T6; updates the EPIC tables; the spec moves to `docs/issues/closed/` in a separate `cleanup-completed-issues` PR after the issue closes (as for #2637) | 7-16 | `2824-1347-add-tests-primitives-final` | #2864 | DONE |

Rules: S0 to S3 use `Related to #2824`; only S4 uses `Closes #2824`. Do not stack
branches; keep at most one implementation PR open. Titles follow the repository convention, for
Expand Down Expand Up @@ -318,7 +318,7 @@ The 16 rows are every `.rs` file under `packages/primitives/src/`, each once.
- [x] Bounded mutation assessment in `mutation-evidence.md`.
- [x] Independent reviewer reports in `agent-review-reports.md` (if used): not used; the PR reviews are audited in `docs/pr-reviews/`.
- [x] Acceptance criteria and implementation retrospective.
- [ ] Issue closed (by the S4 PR); spec moved to `docs/issues/closed/` (separate PR after the close).
- [x] Issue closed (by the S4 PR); spec moved to `docs/issues/closed/` (separate PR after the close).

### Progress Log

Expand All @@ -338,6 +338,7 @@ The 16 rows are every `.rs` file under `packages/primitives/src/`, each once.
- 2026-11-15 08:36 UTC - Claude Code (Opus 5.5) - T4-T6: the package mutation run (147 mutants) found one real survivor, `instance_index` replaced by `1`, killed after the maintainer approved index `2` in its test; M1 and M2 passed against a built tracker; the T5 reconciliation updated the tasks, slices, checkpoints, acceptance rows, coverage evidence and both EPIC tables. `implementation-retrospective.md` records the deviations. F5 still has no GitHub issue (`lessons.md`). The spec moves to `docs/issues/closed/` in a separate PR after the issue closes.
- 2026-11-15 12:35 UTC - Claude Code (Opus 5.5) - Correction to the 2026-11-14 12:09 entry: the audit record of #2852 (`docs/pr-reviews/pr-2852-review/PR-REVIEW.md`) records five review rounds, not six; `implementation-retrospective.md` now says five.
- 2026-11-15 12:47 UTC - Claude Code (Opus 5.5) - F5 draft spec: after review finding F1 of #2864 (AC9 checked without an F5 draft), the maintainer had a separate session write `docs/issues/drafts/peer-id-test-helper/ISSUE.md`; its PR #2865 was opened at 12:47 UTC. The Findings Register, the AC9 row, the `peer::fixture` risk and the `lessons.md` row now cite it. It has no GitHub issue yet.
- 2026-11-15 21:07 UTC - Claude Code (Opus 5.5) - S4 merged through #2864 (2026-11-15 21:05 UTC, `Closes #2824`) and issue #2824 is `CLOSED` on GitHub. Archived the spec to `docs/issues/closed/` (this clean-up pull request): `status: done`, `spec-path` and the artifact paths updated, AC10 and the close checkpoint ticked, the EPIC row set to `DONE`, and the live references to the old path repaired.

## Acceptance Criteria

Expand All @@ -352,7 +353,7 @@ The 16 rows are every `.rs` file under `packages/primitives/src/`, each once.
- [x] AC8: Reconciliation confirms plans, evidence, slice table and both EPIC tables agree.
- [x] AC9: Every finding needing a production change has a draft spec, a log entry and a `lessons.md`
row, and no test pins its reported behavior without a recorded maintainer decision.
- [ ] AC10: Merged through the planned slices; only the last PR closes the issue.
- [x] AC10: Merged through the planned slices; only the last PR closes the issue.
- [x] AC11: `cargo +nightly fmt --all -- --check`, `linter all` and
`cargo test -p torrust-tracker-primitives` pass.
- [x] AC12: Manual verification executed and recorded.
Expand Down Expand Up @@ -398,7 +399,7 @@ Reviewed against observed behavior after the last slice, before the issue is clo
| AC7 | DONE | `mutation-evidence.md` (no score target, no CI gate). |
| AC8 | DONE | The T5 reconciliation (S4): ledger, plan index, slice table, acceptance rows, coverage evidence and both EPIC "Latest" tables carry the final figures; no record says `status: proposed` or `in-progress`. |
| AC9 | DONE | F1 #2798, F2 fixed in S1 (#2834), F3 #2804, F4 #2823, F6 #2838 and #2850, each with its owner in the Findings Register and a `lessons.md` row. F5 is handed off by decision (2026-11-11); its draft spec is PR #2865 (`docs/issues/drafts/peer-id-test-helper/ISSUE.md`), with no GitHub issue yet; its `lessons.md` row says so. |
| AC10 | IN_PROGRESS | S0-S3 merged (#2828, #2834, #2841, #2852) with `Related to #2824`; S4 is the only PR that uses `Closes #2824`. |
| AC10 | DONE | S0-S3 merged (#2828, #2834, #2841, #2852) with `Related to #2824`; S4 merged through #2864 (2026-11-15 21:05 UTC), the only PR that uses `Closes #2824`, and the issue closed with it. |
| AC11 | DONE | `cargo +nightly fmt --all -- --check` (nightly Rust), `linter all` (the pre-commit gate of every S4 commit), `cargo test -p torrust-tracker-primitives` (stable Rust 1.99.1: 109 unit tests and 3 doctests pass). |
| AC12 | DONE | `manual-verification-evidence.md`: M1 and M2 passed on 2026-11-15. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ semantic-links:
- write-markdown-docs
related-artifacts:
- docs/templates/IMPLEMENTATION-RETROSPECTIVE.md
- docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md
- docs/issues/open/2824-1347-add-tests-primitives/lessons.md
- docs/issues/closed/2824-1347-add-tests-primitives/ISSUE.md
- docs/issues/closed/2824-1347-add-tests-primitives/lessons.md
- docs/issues/closed/2637-1347-add-tests-axum-rest-api-server/implementation-retrospective.md
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package: torrust-tracker-primitives

Candidate lessons collected while working on Issue #2824. Promoting any of them into `docs/testing/`,
`.github/skills/`, or a production change is a separate decision after this issue, per the
[subissue guidelines](../1347-overhaul-packages-testing/subissue-spec-guidelines.md).
[subissue guidelines](../../open/1347-overhaul-packages-testing/subissue-spec-guidelines.md).

## Follow-Up Candidates

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
doc-type: manual-verification-evidence
issue-spec: docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md
last-updated-utc: "2026-11-15 07:58"
issue-spec: docs/issues/closed/2824-1347-add-tests-primitives/ISSUE.md
last-updated-utc: "2026-11-15 21:07"
---

# Manual Verification Evidence
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
doc-type: test-design-review
issue-spec: docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md
issue-spec: docs/issues/closed/2824-1347-add-tests-primitives/ISSUE.md
scope: slice S1, the two `PeerRole` serialization tests in `packages/primitives/src/peer.rs`
last-updated-utc: "2026-11-11 14:37"
last-updated-utc: "2026-11-15 21:07"
---

# S1 test design review: `peer_role_serialization`
Expand Down
4 changes: 2 additions & 2 deletions docs/issues/drafts/error-locations-si-2-primitives/ISSUE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ github-issue: null
spec-path: docs/issues/drafts/error-locations-si-2-primitives/ISSUE.md
branch: "{issue-number}-error-locations-si-2-primitives"
related-pr: null
last-updated-utc: "2026-11-11 17:39"
last-updated-utc: "2026-11-15 21:07"
semantic-links:
skill-links:
- create-issue
Expand Down Expand Up @@ -278,4 +278,4 @@ findings, and reusable lessons.
- Parent EPIC draft: `docs/issues/drafts/remove-source-locations-from-errors/EPIC.md`
- Audit: `docs/issues/open/2804-location-caller-track-caller-audit/ISSUE.md`, `inventory.md`, `options.md`, `experiments.md` (issue #2804)
- Related issues: #2804 (audit), #384 (external report), #2583 (first publish of the workspace crates)
- Reporting work: `docs/issues/open/2824-1347-add-tests-primitives/` (EPIC #1347)
- Reporting work: `docs/issues/closed/2824-1347-add-tests-primitives/` (EPIC #1347)
9 changes: 5 additions & 4 deletions docs/issues/open/1347-overhaul-packages-testing/EPIC.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ epic: null
github-issue: 1347
spec-path: docs/issues/open/1347-overhaul-packages-testing/EPIC.md
epic-owner: josecelano
last-updated-utc: "2026-11-15 08:37"
last-updated-utc: "2026-11-15 21:07"
semantic-links:
skill-links:
- create-issue
Expand Down Expand Up @@ -96,7 +96,7 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
| 8 | #2301 - Review package coverage rollout | `docs/issues/open/2301-1347-review-package-coverage-rollout/ISSUE.md` | TODO | After the EPIC completes, review real rollout evidence before retaining, revising, or proposing a required coverage check. |
| 9 | #2361 - Keep the report-only package coverage summary from failing on a discovery failure | `docs/issues/open/2361-1347-package-coverage-summary-discovery-failure/ISSUE.md` | TODO | Bug follow-up of #2347 (`review-finding:pr-2293-f1`): the #2222 summary check goes red with a JSON parse error when discovery fails. |
| 10 | #2637 - Add tests to the axum-rest-api-server package | `docs/issues/closed/2637-1347-add-tests-axum-rest-api-server/ISSUE.md` | DONE | S0 (spec and T1 baseline) merged through #2638; S1 (authentication and shared responses) merged through #2667; S2 (routes) merged through #2687; S3 (auth-key and whitelist contexts) merged through #2702; S4 (torrent and stats contexts) merged through #2718; S5 (server lifecycle) merged through #2744; S6 (crate root, wiring and final tasks) merged through #2772; the issue is closed. Replaces the former draft that was misfiled under #1349. |
| 11 | #2824 - Add tests to the primitives package | `docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md` | IN_PROGRESS | Spec-only PR carries the specification and the T1 baseline and inventory; S0 (the spec, #2828) is merged and S1 (the `PeerRole` JSON casing fix, #2834) is merged and S2 (the `peer.rs` tests, #2841) is merged and S3 (the configuration defaults and bounded values, #2852) is merged; S4 (`swarm_metadata.rs`, the no-change files, the mutation run, the manual checks and the close-out) is in review and closes the issue. Findings F1 (fixed through #2811), F3 (#2804) and the `AddAssign` and `peer::Id::new` follow-ups are handed off to their own issues. |
| 11 | #2824 - Add tests to the primitives package | `docs/issues/closed/2824-1347-add-tests-primitives/ISSUE.md` | DONE | S0 (the spec, #2828), S1 (the `PeerRole` JSON casing fix, #2834), S2 (the `peer.rs` tests, #2841), S3 (the configuration defaults and bounded values, #2852) and S4 (`swarm_metadata.rs`, the no-change files, the mutation run, the manual checks, #2864) are merged; the issue is closed. Unit-only lines 60.56% → 94.07%. Findings F1 (fixed through #2811), F2 (fixed in S1), F3 (#2804), F4 (#2823), F6 (#2838, #2850) and F5 (draft spec PR #2865) have owners. |
| 12 | #2838 - UDP tracker accepts announces with a negative left, uploaded or downloaded | `docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/ISSUE.md` | BLOCKED | Bug found by the #2824 primitives tests work. Planned fix: the standalone issue #2850 (`docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md`), whose implementation will close it; until then the bug is present on `develop`. The patch of PR #2839 was not merged. |
| 13 | Additional package-testing subissues | Create a folder-style spec when a concrete package need is identified | TODO | Permitted but not required upfront; retain scope in this EPIC. |

Expand All @@ -122,7 +122,7 @@ level or determine whether unit coverage is adequate.
| `torrust-tracker-udp-core` | [#1348](../../closed/1348-1347-add-tests-udp-core/ISSUE.md) | Lines: 72.49%; regions: 78.56%; functions: 71.27% | Lines: 98.04%; regions: 98.15%; functions: 97.61% | Lines: +25.55 pp; regions: +19.58 pp; functions: +26.34 pp | [Coverage evidence](../../closed/1348-1347-add-tests-udp-core/coverage-evidence.md) |
| `torrust-tracker-http-core` | [#1349](../../closed/1349-1347-add-tests-http-core/ISSUE.md) | Lines: 88.88%; regions: 90.41%; functions: 84.29% | Lines: 99.28%; regions: 99.25%; functions: 99.74% | Lines: +10.40 pp; regions: +8.84 pp; functions: +15.45 pp | [Coverage evidence](../../closed/1349-1347-add-tests-http-core/coverage-evidence.md) |
| `torrust-tracker-axum-rest-api-server` | [#2637](../../closed/2637-1347-add-tests-axum-rest-api-server/ISSUE.md) | Lines: 87.98%; regions: 84.10%; functions: 83.42% | Lines: 97.67%; regions: 97.13%; functions: 95.48% | Lines: +9.69 pp; regions: +13.03 pp; functions: +12.06 pp | [Coverage evidence](../../closed/2637-1347-add-tests-axum-rest-api-server/coverage-evidence.md) |
| `torrust-tracker-primitives` | [#2824](../2824-1347-add-tests-primitives/ISSUE.md) | Lines: 60.56%; regions: 67.94%; functions: 57.23% | Lines: 94.07%; regions: 95.30%; functions: 94.17% | Lines: +33.51 pp; regions: +27.36 pp; functions: +36.94 pp | [Coverage evidence](../2824-1347-add-tests-primitives/coverage-evidence.md) |
| `torrust-tracker-primitives` | [#2824](../../closed/2824-1347-add-tests-primitives/ISSUE.md) | Lines: 60.56%; regions: 67.94%; functions: 57.23% | Lines: 94.07%; regions: 95.30%; functions: 94.17% | Lines: +33.51 pp; regions: +27.36 pp; functions: +36.94 pp | [Coverage evidence](../../closed/2824-1347-add-tests-primitives/coverage-evidence.md) |

### Unit-Only Coverage

Expand All @@ -137,7 +137,7 @@ weak unit-only result with aggregate, integration, example, or end-to-end covera
| `torrust-tracker-udp-core` | [#1348](../../closed/1348-1347-add-tests-udp-core/ISSUE.md) | Lines: 72.49%; regions: 78.56%; functions: 71.27% | Lines: 98.04%; regions: 98.15%; functions: 97.61% | Lines: +25.55 pp; regions: +19.58 pp; functions: +26.34 pp | [Coverage evidence](../../closed/1348-1347-add-tests-udp-core/coverage-evidence.md) |
| `torrust-tracker-http-core` | [#1349](../../closed/1349-1347-add-tests-http-core/ISSUE.md) | Lines: 88.88%; regions: 90.41%; functions: 84.29% | Lines: 99.28%; regions: 99.25%; functions: 99.74% | Lines: +10.40 pp; regions: +8.84 pp; functions: +15.45 pp | [Coverage evidence](../../closed/1349-1347-add-tests-http-core/coverage-evidence.md) |
| `torrust-tracker-axum-rest-api-server` | [#2637](../../closed/2637-1347-add-tests-axum-rest-api-server/ISSUE.md) | Lines: 63.87%; regions: 63.98%; functions: 51.34% | Lines: 96.67%; regions: 96.38%; functions: 93.97% | Lines: +32.80 pp; regions: +32.40 pp; functions: +42.63 pp | [Coverage evidence](../../closed/2637-1347-add-tests-axum-rest-api-server/coverage-evidence.md) |
| `torrust-tracker-primitives` | [#2824](../2824-1347-add-tests-primitives/ISSUE.md) | Lines: 60.56%; regions: 67.94%; functions: 57.23% | Lines: 94.07%; regions: 95.30%; functions: 94.17% | Lines: +33.51 pp; regions: +27.36 pp; functions: +36.94 pp | [Coverage evidence](../2824-1347-add-tests-primitives/coverage-evidence.md) |
| `torrust-tracker-primitives` | [#2824](../../closed/2824-1347-add-tests-primitives/ISSUE.md) | Lines: 60.56%; regions: 67.94%; functions: 57.23% | Lines: 94.07%; regions: 95.30%; functions: 94.17% | Lines: +33.51 pp; regions: +27.36 pp; functions: +36.94 pp | [Coverage evidence](../../closed/2824-1347-add-tests-primitives/coverage-evidence.md) |

## Delivery Strategy

Expand Down Expand Up @@ -350,6 +350,7 @@ For each subissue implementation, the completion policy is:
- 2026-11-12 18:24 UTC - Claude Code - #2824 S2 review round 3 of #2841: two assertions were added to the `is_completed` test, so `primitives` unit-only (= aggregate) is lines 85.23% (848 / 995), regions 89.31%, functions 82.99%, 81 unit tests. Both "Latest" tables carry the new values.
- 2026-11-13 08:58 UTC - Claude Code - #2824 S3 (configuration defaults and bounded values, 24 tests added) re-measured `primitives` unit-only (= aggregate) at lines 93.13% (1,044 / 1,121), regions 94.66%, functions 92.69%, 105 unit tests. Both "Latest" tables carry the new values.
- 2026-11-15 08:37 UTC - Claude Code - #2824 S4 (`swarm_metadata.rs` tests, the no-change rows, T4-T6) re-measured `primitives` unit-only (= aggregate) at lines 94.07% (1,078 / 1,146), regions 95.30%, functions 94.17%, 109 unit tests. The package mutation run (147 mutants) left no non-equivalent survivor after one test fix. Both "Latest" tables carry the final values; the row stays `IN_PROGRESS` until the S4 PR merges and the issue closes.
- 2026-11-15 21:07 UTC - Claude Code - #2824 closed by #2864 (merged 2026-11-15 21:05 UTC); row 11 set to `DONE` and the spec archived to `docs/issues/closed/2824-1347-add-tests-primitives/`.

## Acceptance Criteria

Expand Down
4 changes: 2 additions & 2 deletions docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ github-issue: 2850
spec-path: docs/issues/open/2850-non-negative-number-of-bytes/ISSUE.md
branch: "2850-non-negative-number-of-bytes-spec"
related-pr: null
last-updated-utc: "2026-11-14 08:47"
last-updated-utc: "2026-11-15 21:07"
semantic-links:
skill-links:
- create-issue
Expand Down Expand Up @@ -44,7 +44,7 @@ semantic-links:
- docs/adrs/20260727000000_events_are_objective_facts.md
- .github/skills/dev/rust-code-quality/handle-errors-in-code/SKILL.md
- docs/benchmarking.md
- docs/issues/open/2824-1347-add-tests-primitives/ISSUE.md
- docs/issues/closed/2824-1347-add-tests-primitives/ISSUE.md
- docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/ISSUE.md
- docs/issues/open/2838-1347-udp-reject-negative-announce-bytes/manual-verification-evidence.md
- docs/issues/open/2842-inbound-tolerance-adr/ISSUE.md
Expand Down
Loading