chore: simplify and clarify audio, core, and container nodes#402
Conversation
Remove stale, redundant, and overly verbose comments across 27 files in the audio/, core/, and containers/ node directories. Keep only comments where code is inherently complex (codec quirks, buffer management subtleties, timing constraints, RFC references). No behavioral changes to any ProcessorNode implementations. Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
📝 Info: Dead code removal of decode_mp3_streaming is safe
The PR removes the decode_mp3_streaming function from crates/nodes/src/audio/codecs/mp3.rs (previously around lines 400-563 on the LEFT side). This function was annotated with #[allow(dead_code)] and its doc comment explicitly stated "Legacy decode function (kept for reference, not used)". The removal also correctly removes the now-unused use std::io::Cursor import at the former line 11. No callers exist in the codebase for this function, so the removal is safe and reduces maintenance burden.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
Restore inline rationale comments on #[allow(clippy::...)] attributes per AGENTS.md linting discipline. Also restore non-obvious select! branch comments explaining deadlock-avoidance in input_done patterns. Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
There was a problem hiding this comment.
📝 Info: Some pre-existing #[allow] directives lack rationale comments
AGENTS.md requires lint suppressions to include a comment explaining the rationale. Several pre-existing #[allow] directives in files touched by this PR lack rationale — e.g. #[allow(clippy::too_many_lines)] at crates/nodes/src/audio/filters/mixer.rs:215 and #[allow(clippy::needless_range_loop)] at line 979. These were not introduced or modified by this PR (verified via git show on the parent commit), so they are pre-existing debt rather than a violation introduced here. The PR did correctly preserve rationale on all suppressions it touched (reformatting some from above-line to inline).
(Refers to line 215)
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Confirmed — these are pre-existing and not introduced by this PR. Fixing pre-existing lint rationale gaps is out of scope here but could be addressed in a follow-up.
| #[allow(clippy::cognitive_complexity)] // Decoder state machine is inherently complex | ||
| fn decode_flac_streaming_incremental( | ||
| reader: StreamingReader, | ||
| result_tx: &mpsc::Sender<DecodeResult>, |
There was a problem hiding this comment.
📝 Info: Removed doc comments on internal functions are acceptable
Several /// doc comments were removed from non-public functions (e.g. decode_flac_streaming_incremental, decode_mp3_streaming_incremental, demux_wav_streaming_incremental). CONTRIBUTING.md requires "doc comments for public APIs" but these are all fn (not pub fn), so removing the doc comments does not violate the rule. The #[allow(clippy::cognitive_complexity)] annotations on these functions still retain their inline rationale comments.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Correct — these are all crate-internal functions, so the /// doc comments were removed intentionally as redundant.
Summary
Pre-release cleanup pass across 27 files in
crates/nodes/src/audio/,crates/nodes/src/core/, andcrates/nodes/src/containers/, plus root-level utility files (lib.rs,codec_utils.rs,streaming_utils.rs,test_utils.rs).Net change: −772 lines (77 insertions, 849 deletions) — all comment removals/edits, no behavioral changes.
What was removed
// --- Register X ---,// Stats tracking,// Declare the submodules, etc.)decode_mp3_streaming— explicitly marked as legacy/unused with#[allow(dead_code)])What was kept
input_doneselect! branches, jitter buffer timeout sync in mixerFiles changed (27)
Audio (8 files):
codecs/{flac,mp3,opus,mod}.rs,filters/{gain,mixer,resampler}.rs,pacer.rsCore (11 files):
{passthrough,pacer,file_read,file_write,bytes_input,bytes_output,json_serialize,telemetry_tap,text_chunker,mod}.rsContainers (5 files):
{mod,wav,ogg,webm,mp4,tests}.rsRoot-level (3 files):
lib.rs,streaming_utils.rs,test_utils.rsNo functionality changes. No bugs found.
Review & Testing Checklist for Human
ogg.rsstage_frame/granule comments,webm.rsrebase-reset logic,mixer.rsjitter buffer comments)just testpasses (479 nodes tests pass;plugin_integration_testfailures are pre-existing and unrelated)Notes
plugin_integration_testsuite (8 failures instreamkit-server) fails on the base branch as well — not related to this change.mp4.rsandwebm.rshave extensive codec-domain documentation that was intentionally preserved. Only clearly redundant structural/inline comments were removed from those files.containers/tests.rswas left mostly untouched since test comments aid readability.Link to Devin session: https://staging.itsdev.in/sessions/25d0ff011ddd4978b0673f2fe7442ed0
Requested by: @streamer45
Devin Review
3ebb58d