Skip to content

Conversation

@Coldaine
Copy link
Owner

@Coldaine Coldaine commented Sep 1, 2025

Summary

  • Completes the workspace split architecture with proper module re-exports
  • Fixes all import paths and test compilation issues
  • Ensures all 112 tests pass across the workspace

Changes

Architecture Improvements

  • ✅ Added re-export modules (mod.rs) for vad, telemetry, and foundation in app crate
  • ✅ Mapped app-level features to subcrate features properly
  • ✅ Fixed module visibility and import paths throughout codebase

VAD Integration

  • Connected Level3 and Silero engines through proper feature flags
  • Updated VadProcessor to consume coldvox_audio::AudioFrame
  • Fixed frame type conversions (f32 samples with Instant timestamps)

Test Fixes

  • Fixed vad_pipeline_tests to use new AudioFrame structure
  • Updated chunker_timing_tests timestamp calculations
  • Corrected test_transcription_config_default expectations
  • Fixed NoOp injector metrics recording
  • Cleaned up all unused imports

Build Fixes

  • Added missing parking_lot dependency to app crate
  • Fixed feature flag guards in main.rs (compile-time vs runtime)
  • Resolved all type inference issues

Test Plan

  • All workspace tests pass: cargo test --workspace --lib
  • Examples compile: cargo check --examples
  • Release build with vosk: cargo build --release --features vosk
  • VAD pipeline test with Level3: cargo test -p coldvox-app --test vad_pipeline_tests --features level3

Impact

This refactoring provides better separation of concerns and makes the codebase more maintainable by clearly defining module boundaries and dependencies.

🤖 Generated with Claude Code

Coldaine and others added 4 commits August 31, 2025 06:14
Major refactoring to complete the workspace split architecture:

Core Changes:
- Add re-export modules in app crate for vad, telemetry, and foundation
- Fix all import paths across tests and examples to use new structure
- Map app-level features to subcrate features in Cargo.toml
- Add missing parking_lot dependency to app crate

VAD Integration:
- Create vad module re-exporting UnifiedVadConfig, VadMode, constants
- Wire up Level3 and Silero engines through feature flags
- Update VadProcessor to consume coldvox_audio::AudioFrame
- Fix frame type conversions (f32 samples with Instant timestamps)

Audio Module:
- Re-export AudioChunker, ChunkerConfig, ResamplerQuality, FrameReader
- Re-export AudioRingBuffer, AudioProducer, CaptureStats, AudioFrame
- Disambiguate AudioFrame types in chunker tests

Text Injection:
- Add public get_method_priority() wrapper for tests
- Fix NoOp injector to properly record metrics
- Update processor tests with confidence fields
- Fix feature flag guards in main.rs

Test Fixes:
- Update vad_pipeline_tests to new AudioFrame structure
- Fix chunker_timing_tests timestamp calculations
- Correct test_transcription_config_default expectations
- Remove invalid text-injection feature flag in tests
- Clean up all unused imports via cargo fix

All tests pass (112 total), examples compile, and release builds successfully.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings September 1, 2025 19:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR completes the workspace split refactoring for ColdVox, transforming it from a monolithic crate into a well-organized workspace with specialized subcrates. The purpose is to improve modularity, reduce compilation times, and better isolate optional dependencies.

Key changes include:

  • Complete workspace architecture with proper module re-exports and feature mapping
  • Fixed all import paths and compilation issues across 112 tests
  • Added comprehensive linter remediation documentation and migration guides

Reviewed Changes

Copilot reviewed 128 out of 142 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
linter_remediation_plan.md Documents fixes for the first 10 linter errors from incorrect crate imports
linter/remediation_plan_*.md Batch remediation plans for different categories of linter warnings
examples/vosk_test.rs* Feature-gated Vosk example with fallback when feature disabled
examples/vad_demo.rs Updated imports to use new workspace structure
docs/*.md Updated documentation to reflect new crate organization and architecture
docs/tasks/*.md Comprehensive task planning and implementation guides for workspace features
docs/MIGRATION_GUIDE.md User migration guide from monolithic to workspace structure

Comment on lines +22 to +23
- **Line:** `use crate::vad::config::{UnifiedVadConfig, VadMode};
- **Fix:** `use coldvox_vad::config::{UnifiedVadConfig, VadMode};
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 22. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::vad::config::{UnifiedVadConfig, VadMode};
- **Fix:** `use coldvox_vad::config::{UnifiedVadConfig, VadMode};
- **Line:** `use crate::vad::config::{UnifiedVadConfig, VadMode};`
- **Fix:** `use coldvox_vad::config::{UnifiedVadConfig, VadMode};`

Copilot uses AI. Check for mistakes.
Comment on lines +26 to +27
- **Line:** `use crate::foundation::error::AudioConfig;
- **Fix:** `use coldvox_foundation::error::AudioConfig;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 26. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::foundation::error::AudioConfig;
- **Fix:** `use coldvox_foundation::error::AudioConfig;
- **Line:** `use crate::foundation::error::AudioConfig;`
- **Fix:** `use coldvox_foundation::error::AudioConfig;`

Copilot uses AI. Check for mistakes.
5. **Error:** `unresolved import
`crate::audio::capture
`
- **Line:** `use crate::audio::capture::AudioCaptureThread;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 32. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::audio::capture::AudioCaptureThread;
- **Line:** `use crate::audio::capture::AudioCaptureThread;`

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +39
- **Line:** `use crate::audio::chunker::{AudioChunker, ChunkerConfig};
- **Fix:** `use coldvox_audio::chunker::{AudioChunker, ChunkerConfig};
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 38. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::audio::chunker::{AudioChunker, ChunkerConfig};
- **Fix:** `use coldvox_audio::chunker::{AudioChunker, ChunkerConfig};
- **Fix:** `use coldvox_audio::chunker::{AudioChunker, ChunkerConfig};`

Copilot uses AI. Check for mistakes.
Comment on lines +44 to +45
- **Line:** `use crate::audio::frame_reader::FrameReader;
- **Fix:** `use coldvox_audio::frame_reader::FrameReader;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 44. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::audio::frame_reader::FrameReader;
- **Fix:** `use coldvox_audio::frame_reader::FrameReader;
- **Line:** `use crate::audio::frame_reader::FrameReader;`
- **Fix:** `use coldvox_audio::frame_reader::FrameReader;`

Copilot uses AI. Check for mistakes.
### File: `crates/app/src/hotkey/listener.rs`

10. **Error:** `failed to resolve: could not find 'vad' in the crate root`
- **Line:** `use crate::vad::types::VadEvent;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 62. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::vad::types::VadEvent;
- **Line:** `use crate::vad::types::VadEvent;`

Copilot uses AI. Check for mistakes.
### File: `crates/app/src/probes/vad_mic.rs`

1. **Error:** `unresolved import `crate::audio::ring_buffer``
- **Line:** `use crate::audio::ring_buffer::AudioRingBuffer;
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 10. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `use crate::audio::ring_buffer::AudioRingBuffer;
- **Line:** `use crate::audio::ring_buffer::AudioRingBuffer;`

Copilot uses AI. Check for mistakes.
` - **Fix:** `use coldvox_audio::ring_buffer::AudioRingBuffer;
`
2. **Error:** `could not find `chunker` in `audio``
- **Line:** `resampler_quality: crate::audio::chunker::ResamplerQuality::Balanced,
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 14. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `resampler_quality: crate::audio::chunker::ResamplerQuality::Balanced,
- **Line:** `resampler_quality: crate::audio::chunker::ResamplerQuality::Balanced,`

Copilot uses AI. Check for mistakes.
### File: `crates/app/src/audio/vad_adapter.rs`

3. **Error:** `use of undeclared type `Level3Vad``
- **Line:** `Box::new(Level3Vad::new(level3_config))
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 21. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `Box::new(Level3Vad::new(level3_config))
- **Line:** `Box::new(Level3Vad::new(level3_config))`

Copilot uses AI. Check for mistakes.
- **Fix:** Change the import from `use coldvox_vad::Level3Vad;` to `use coldvox_vad::level3::Level3Vad;`.

4. **Error:** `mismatched types`
- **Line:** `Box::new(SileroEngine::new(config.silero.clone())?)
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing closing quote mark on line 26. The line should end with a closing quote mark to match the opening quote.

Suggested change
- **Line:** `Box::new(SileroEngine::new(config.silero.clone())?)
- **Line:** `Box::new(SileroEngine::new(config.silero.clone())?)`

Copilot uses AI. Check for mistakes.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex Review: Here are some suggestions.

// Add clipboard injectors if available
#[cfg(feature = "text-injection-clipboard")]
{
if has_wayland || has_x11 {

[P1] Clipboard injector gate references undeclared variables

The app crate’s injector registry shows the same mismatch: backend flags were renamed _has_wayland and _has_x11, yet the conditional still uses has_wayland/has_x11. Enabling the text-injection-clipboard feature causes an unresolved-name compiler error. Update the condition to use the defined _has_* variables so builds with clipboard support succeed.


Reply with @codex fix comments to fix any unresolved comments.

About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".

Comment on lines +86 to +89
// Add clipboard injectors if available
#[cfg(feature = "wl_clipboard")]
{
if has_wayland || has_x11 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Use renamed backend flags to avoid compile error

In InjectorRegistry::build the backend detection variables were renamed to _has_wayland/_has_x11, but the clipboard branch still tests if has_wayland || has_x11. When the wl_clipboard feature is enabled this code does not compile because those identifiers no longer exist. Switch the condition to the _has_* names (or keep the original names) so the clipboard injectors can build successfully.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants