Audit: - docs/AUDIT-2026-05-25.md: full protocol audit covering 8 findings (4 critical, 2 high, 5 medium, 4 low) with code references and fix effort estimates - vault/Audit/Tasks.md: Obsidian Tasks plugin file tracking all audit items with priorities, due dates, and per-step checklists Architecture docs updated for Wire format v2 and Wave 5/6 features: - ARCHITECTURE.md: adds wzp-video to dependency graph and project structure; wire format updated to v2 (16B header, 5B MiniHeader); relay concurrency section corrected (DashMap+RwLock is current, not a future optimization); test count 571→702; Android note - PROGRESS.md: Wave 5 and Wave 6 sections appended; test count 372→702; current status and open blockers as of 2026-05-25 - ROAD-TO-VIDEO.md: implementation status table inserted (✅/🟡/🔴/🔲 per phase); 6-step critical path to first video call - WZP-SPEC.md: MediaHeader updated to v2 (16B byte-aligned); MiniHeader updated to 5B with seq_delta; codec IDs 9-12 added (H.264/H.265/AV1); version negotiation section added Obsidian vault (vault/): - 114 files across Architecture/, PRDs/, Reports/, Android/, Reference/, Audit/ with YAML frontmatter - 00 - Home.md index note with wiki links - .obsidian/app.json config Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3.7 KiB
3.7 KiB
tags, type, status
| tags | type | status | ||
|---|---|---|---|---|
|
report | Approved |
T1.2 — Add MediaType enum
Status: Approved Agent: Kimi Code CLI Started: 2026-05-11T06:55Z Completed: 2026-05-11T07:08Z Commit: see git log PRD: ../PRD-wire-format-v2.md
What I changed
crates/wzp-proto/src/media_type.rs:1-55— created new module withMediaTypeenum (Audio=0,Video=1,Data=2,Control=3),to_wire(),from_wire(), and two unit testscrates/wzp-proto/src/lib.rs:18— addedpub mod media_type;crates/wzp-proto/src/lib.rs:28— addedpub use media_type::MediaType;crates/wzp-proto/src/packet.rs:4— addeduse crate::MediaType;crates/wzp-proto/src/packet.rs:168— changedMediaHeaderV2.media_typefromu8toMediaType, resolving theTODO(T1.2)crates/wzp-proto/src/packet.rs:184—write_tonow callsself.media_type.to_wire()crates/wzp-proto/src/packet.rs:202—read_fromnow usesMediaType::from_wire(buf.get_u8())?crates/wzp-proto/src/packet.rs:1292— updatedmedia_header_v2_roundtriptest to useMediaType::Audio
Why these choices
Followed steps T1.2.1 through T1.2.2 without deviation. Since MediaType now exists, I also resolved the TODO(T1.2) placeholder left in MediaHeaderV2 during T1.1 so the v2 header is internally consistent before moving on.
Deviations from the task spec
None.
Verification output
$ cargo test -p wzp-proto media_type
running 2 tests
test media_type::tests::media_type_roundtrip ... ok
test media_type::tests::media_type_unknown_rejected ... ok
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 106 filtered out; finished in 0.00s
$ cargo test -p wzp-proto media_header_v2_roundtrip
running 1 test
test packet::tests::media_header_v2_roundtrip ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 107 filtered out; finished in 0.00s
$ cargo build -p wzp-proto -p wzp-codec -p wzp-fec -p wzp-crypto -p wzp-transport -p wzp-relay -p wzp-client -p wzp-web -p wzp-native
Finished `dev` profile [unoptimized + debuginfo] target(s) in 15.31s
$ cargo test -p wzp-proto -p wzp-codec -p wzp-fec -p wzp-crypto -p wzp-transport -p wzp-relay -p wzp-client -p wzp-web -p wzp-native --no-fail-fast
...
test result: ok. 567 passed; 0 failed; ...
$ cargo clippy -p wzp-proto --all-targets -- -D warnings
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.57s
$ cargo fmt --all -- --check
# (clean)
Test summary
- Tests added: 2 (
media_type_roundtrip,media_type_unknown_rejected) - Tests modified: 1 (
media_header_v2_roundtrip— now usesMediaType::Audio) - Workspace test count before: 565 pass / 0 fail (non-Android subset)
- Workspace test count after: 567 pass / 0 fail (non-Android subset)
cargo clippy -p wzp-proto --all-targets -- -D warnings: passcargo fmt --all -- --check: pass
Risks / follow-ups
None.
Reviewer checklist (filled in by reviewer)
- Code matches PRD intent
- Verification output is real (re-run if suspicious) — re-ran
cargo test -p wzp-proto(112 passed across 2 suites), clippy + fmt clean. - No backward-incompat surprises
- Tests cover the new behavior
- Approved
Reviewer notes (2026-05-11)
Approved. Bonus that the agent resolved the TODO(T1.2) placeholder inside MediaHeaderV2.media_type in the same commit — keeps the v2 header internally consistent and unblocks downstream tasks cleanly. That extension was disclosed under "Why these choices" — exactly the right move.
One small follow-up:
- T1.2.1 — Add rustdoc on
MediaTypevariants and methods. Same rustdoc-coverage concern as T1.1.1 — coding standard #9. Non-blocking.