Skip to content

Commit 7b1606a

Browse files
committed
docs(issues): update spec torrust#1804 with implementation evidence
1 parent 225e74f commit 7b1606a

1 file changed

Lines changed: 43 additions & 38 deletions

File tree

docs/issues/open/1804-use-cargo-machete-with-metadata-and-remove-unused-dev-deps.md

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
doc-type: issue
33
issue-type: task
4-
status: open
4+
status: implemented
55
priority: p2
66
github-issue: 1804
77
spec-path: docs/issues/open/1804-use-cargo-machete-with-metadata-and-remove-unused-dev-deps.md
88
branch: "1804-use-cargo-machete-with-metadata"
99
related-pr: null
10-
last-updated-utc: 2026-05-20 00:00
10+
last-updated-utc: 2026-05-20 12:30
1111
semantic-links:
1212
skill-links:
1313
- create-issue
@@ -78,47 +78,52 @@ files across the workspace.
7878

7979
Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
8080

81-
| ID | Status | Task | Notes / Expected Output |
82-
| --- | ------ | ----------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
83-
| T1 | TODO | Run `cargo machete --with-metadata` and record the full list of flagged dependencies | Baseline list; confirm each is genuinely unused before removal |
84-
| T2 | TODO | Update `contrib/dev-tools/git/hooks/pre-commit.sh` to use `cargo machete --with-metadata` | Hook passes with the new flag |
85-
| T3 | TODO | Update CI workflow(s) that call `cargo machete` without `--with-metadata` | CI step passes with the new flag |
86-
| T4 | TODO | Remove flagged unused dependencies from all `Cargo.toml` files | `cargo machete --with-metadata` reports clean after removals |
87-
| T5 | TODO | Run `cargo build --workspace` and `cargo test --workspace` | Clean build; all tests pass |
88-
| T6 | TODO | Run `linter all` | Exit code `0` |
81+
| ID | Status | Task | Notes / Expected Output |
82+
| --- | ------ | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
83+
| T1 | DONE | Run `cargo machete --with-metadata` and record the full list of flagged dependencies | 22 unused deps found across 13 packages; 1 false-positive (`serde_bytes`) handled via ignore list |
84+
| T2 | DONE | Update `contrib/dev-tools/git/hooks/pre-commit.sh` to use `cargo machete --with-metadata` | Hook passes with the new flag |
85+
| T3 | DONE | Update CI workflow(s) that call `cargo machete` without `--with-metadata` | N/A — only `copilot-setup-steps.yml` exists in this repo and only installs the tool; does not call it |
86+
| T4 | DONE | Remove flagged unused dependencies from all `Cargo.toml` files | `cargo machete --with-metadata` reports clean after removals |
87+
| T5 | DONE | Run `cargo build --workspace` and `cargo test --workspace` | Clean build; all tests pass |
88+
| T6 | DONE | Run `linter all` | Exit code `0` |
8989

9090
## Progress Tracking
9191

9292
### Workflow Checkpoints
9393

9494
- [x] Spec drafted in `docs/issues/drafts/`
95-
- [ ] Spec reviewed and approved by user/maintainer
96-
- [ ] GitHub issue created and issue number added to this spec
97-
- [ ] Spec moved to `docs/issues/open/` with issue number prefix
98-
- [ ] Implementation completed
99-
- [ ] Automatic verification completed (`linter all`, `cargo test --workspace`)
100-
- [ ] Manual verification scenarios executed and recorded (status + evidence)
101-
- [ ] Acceptance criteria reviewed after implementation and updated with evidence
95+
- [x] Spec reviewed and approved by user/maintainer
96+
- [x] GitHub issue created and issue number added to this spec
97+
- [x] Spec moved to `docs/issues/open/` with issue number prefix
98+
- [x] Implementation completed
99+
- [x] Automatic verification completed (`linter all`, `cargo test --workspace`)
100+
- [x] Manual verification scenarios executed and recorded (status + evidence)
101+
- [x] Acceptance criteria reviewed after implementation and updated with evidence
102102
- [ ] Reviewer validated acceptance criteria and updated checkboxes
103-
- [ ] Committer verified spec progress is up to date before commit
103+
- [x] Committer verified spec progress is up to date before commit
104104
- [ ] Issue closed and spec moved from `docs/issues/open/` to `docs/issues/closed/`
105105

106106
### Progress Log
107107

108108
- 2026-05-20 00:00 UTC - josecelano - Spec drafted. Root cause identified: plain `cargo machete`
109109
has false negatives for dev dependencies; `--with-metadata` mode is accurate. Full list of
110110
unused deps generated by running `cargo machete --with-metadata` in the workspace.
111+
- 2026-05-20 12:30 UTC - josecelano - Implementation complete. Removed 21 genuine unused
112+
dev-deps across 13 `Cargo.toml` files; 1 machete false-positive (`serde_bytes` in
113+
`axum-http-tracker-server`, used via `#[serde(with = "serde_bytes")]` string attribute)
114+
kept and suppressed via `[package.metadata.cargo-machete] ignored`. T3 is N/A — no CI
115+
workflow in this repo calls plain `cargo machete`. Commit: `225e74fc`.
111116

112117
## Acceptance Criteria
113118

114-
- [ ] AC1: The pre-commit hook calls `cargo machete --with-metadata` (not plain `cargo machete`).
115-
- [ ] AC2: All CI workflow steps that call `cargo machete` use `--with-metadata`.
116-
- [ ] AC3: `cargo machete --with-metadata` exits `0` across the entire workspace (no unused deps).
117-
- [ ] AC4: `cargo build --workspace` and `cargo test --workspace` pass cleanly after dep removals.
118-
- [ ] AC5: `linter all` exits with code `0`.
119-
- [ ] Manual verification scenarios are executed and documented (status + evidence).
120-
- [ ] Acceptance criteria are re-reviewed after implementation and reflect actual behavior.
121-
- [ ] Documentation is updated when behaviour or workflow changes.
119+
- [x] AC1: The pre-commit hook calls `cargo machete --with-metadata` (not plain `cargo machete`).
120+
- [x] AC2: All CI workflow steps that call `cargo machete` use `--with-metadata` (N/A — no CI step calls it in this repo).
121+
- [x] AC3: `cargo machete --with-metadata` exits `0` across the entire workspace (no unused deps).
122+
- [x] AC4: `cargo build --workspace` and `cargo test --workspace` pass cleanly after dep removals.
123+
- [x] AC5: `linter all` exits with code `0`.
124+
- [x] Manual verification scenarios are executed and documented (status + evidence).
125+
- [x] Acceptance criteria are re-reviewed after implementation and reflect actual behavior.
126+
- [x] Documentation is updated when behaviour or workflow changes.
122127

123128
## Verification Plan
124129

@@ -133,21 +138,21 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
133138

134139
Status values: `TODO`, `IN_PROGRESS`, `DONE`, `FAILED`, `BLOCKED`.
135140

136-
| ID | Scenario | Command/Steps | Expected Result | Status | Evidence |
137-
| --- | -------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------ | ------ | -------- |
138-
| M1 | Pre-commit hook uses `--with-metadata` | `grep machete contrib/dev-tools/git/hooks/pre-commit.sh` | Output includes `--with-metadata` | TODO | |
139-
| M2 | No unused deps remain after removals | `cargo machete --with-metadata` | "didn't find any unused dependencies. Good job!" | TODO | |
140-
| M3 | Workspace builds and tests pass after dep removals | `cargo build --workspace && cargo test --workspace` | Both commands exit `0` | TODO | |
141+
| ID | Scenario | Command/Steps | Expected Result | Status | Evidence |
142+
| --- | -------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------ | ------ | -------------------------------------------------------------------------------- |
143+
| M1 | Pre-commit hook uses `--with-metadata` | `grep machete contrib/dev-tools/git/hooks/pre-commit.sh` | Output includes `--with-metadata` | DONE | Line confirms: `cargo machete --with-metadata` |
144+
| M2 | No unused deps remain after removals | `cargo machete --with-metadata` | "didn't find any unused dependencies. Good job!" | DONE | `cargo-machete didn't find any unused dependencies in this directory. Good job!` |
145+
| M3 | Workspace builds and tests pass after dep removals | `cargo build --workspace && cargo test --workspace` | Both commands exit `0` | DONE | Both exit `0`; full test suite passes |
141146

142147
### Acceptance Verification
143148

144-
| AC ID | Status (`TODO`/`DONE`) | Evidence |
145-
| ----- | ---------------------- | -------- |
146-
| AC1 | TODO | |
147-
| AC2 | TODO | |
148-
| AC3 | TODO | |
149-
| AC4 | TODO | |
150-
| AC5 | TODO | |
149+
| AC ID | Status (`TODO`/`DONE`) | Evidence |
150+
| ----- | ---------------------- | ------------------------------------------------------------------------------------------------------ |
151+
| AC1 | DONE | `grep` on pre-commit.sh confirms `cargo machete --with-metadata` |
152+
| AC2 | DONE | N/A — no CI workflow in this repo calls `cargo machete` directly |
153+
| AC3 | DONE | `cargo machete --with-metadata` exits `0`: "didn't find any unused dependencies. Good job!" |
154+
| AC4 | DONE | `cargo build --workspace` and `cargo test --workspace` both exit `0` |
155+
| AC5 | DONE | `linter all` exits `0`: all linters (markdown, yaml, toml, cspell, clippy, rustfmt, shellcheck) passed |
151156

152157
## Risks and Trade-offs
153158

0 commit comments

Comments
 (0)