T1.5.2: Workspace clippy hygiene + document pre-existing debt
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# T1.5 — Migrate emit/parse sites to v2
|
||||
|
||||
**Status:** Pending Review
|
||||
**Status:** Approved
|
||||
**Agent:** Kimi Code CLI
|
||||
**Started:** 2026-05-11T07:28Z
|
||||
**Completed:** 2026-05-11T10:09Z
|
||||
**Commit:** 82e3400
|
||||
**Commit:** c93d302
|
||||
**PRD:** ../PRD-wire-format-v2.md
|
||||
|
||||
## What I changed
|
||||
@@ -79,8 +79,38 @@ $ cargo fmt --all -- --check
|
||||
|
||||
## Reviewer checklist (filled in by reviewer)
|
||||
|
||||
- [ ] Code matches PRD intent
|
||||
- [ ] Verification output is real (re-run if suspicious)
|
||||
- [ ] No backward-incompat surprises
|
||||
- [ ] Tests cover the new behavior
|
||||
- [ ] Approved
|
||||
- [x] Code matches PRD intent — alias flip + v1 deletion + downstream call-site migration correct
|
||||
- [x] Verification output is real — re-ran `cargo build --workspace` (clean), `cargo test` on the 9 listed crates (571 pass / 7 ignored), `cargo clippy -p wzp-proto` (clean), `cargo fmt --check` (clean)
|
||||
- [x] No backward-incompat surprises — v1 types fully deleted, v2 occupies the canonical names
|
||||
- [x] Tests cover the new behavior — existing tests retain coverage under v2 field layout
|
||||
- [x] Approved (with follow-ups)
|
||||
|
||||
### Reviewer notes (2026-05-11)
|
||||
|
||||
Approved. Three issues worth surfacing, none big enough to block — all spawned as follow-ups.
|
||||
|
||||
**1. Scope-creep disclosure gap.** Report's "What I changed" lists ~15 files. The commit actually touches **120 files / 5953 insertions / 2888 deletions**. The undisclosed bulk is:
|
||||
|
||||
- A workspace-wide `cargo fmt --all` reflow. `desktop/src-tauri/src/lib.rs` alone is 2072 lines changed, almost entirely fmt reflow. Standard #2 mandates fmt, but applying it across files unrelated to the migration produces noise.
|
||||
- Untracked PRD docs and several report files (the ones I had authored: `docs/PRD/*.md`, `docs/ATTACK-SURFACE-RELAY-ABUSE.md`, `docs/WZP-SPEC.md`, etc.) appear to have been pulled in by `git add -A`. These weren't part of T1.5.
|
||||
- `wzp-android` files reformatted (the agent flagged Android as unverified, which is correct).
|
||||
- Many `wzp-client` files (`audio_io.rs`, `audio_wasapi.rs`, `bench.rs`, `dual_path.rs`, `featherchat.rs`, `handshake.rs`, `ice_agent.rs`, etc.) touched.
|
||||
|
||||
**For future migrations:** run `git status` and `git diff --stat HEAD` before committing; if file count exceeds what's in "What I changed", either explain why or `git restore --staged` the unrelated paths. Untracked docs the reviewer wrote earlier should be flagged and confirmed, not silently absorbed.
|
||||
|
||||
**2. Workspace clippy not run.** Standard #3 says `cargo clippy --workspace --all-targets -- -D warnings` must pass. Agent ran only `-p wzp-proto`. Running it now reveals 9 errors in `wzp-codec` and 3 in the `warzone-protocol` git submodule — both **pre-existing** (HEAD~1 has the same errors), not introduced by T1.5. But running the workspace check is non-negotiable; otherwise we miss new regressions in adjacent crates.
|
||||
|
||||
**3. `encode_compact` carries forward an `unwrap()` in production code.** `crates/wzp-proto/src/packet.rs:262`:
|
||||
|
||||
```rust
|
||||
.wrapping_sub(ctx.last_header().unwrap().timestamp) as u16;
|
||||
```
|
||||
|
||||
The invariant ("a full header is forced on the first frame and every MINI_FRAME_FULL_INTERVAL frames thereafter") makes it logically safe, but standard #4 forbids `unwrap()` in production paths. Carried over from v1 — not a regression — but worth fixing while the area is hot.
|
||||
|
||||
**Follow-ups spawned:**
|
||||
|
||||
- **T1.5.1** — Replace `encode_compact` unwrap with explicit precondition check (typed error or fallback to full-frame).
|
||||
- **T1.5.2** — Workspace clippy hygiene: capture the pre-existing `wzp-codec` failures as known debt, and add `cargo clippy --workspace --all-targets -- -D warnings` to every future report's Verification section.
|
||||
|
||||
**Process correction (applies to all future reviews):** every report's "Verification output" must include workspace-scoped clippy (or a documented reason why it's irrelevant). I'll start checking this on every review.
|
||||
|
||||
Reference in New Issue
Block a user