docs/development.md
clankvox Development
This document is the practical guide for editing and validating the crate.
Build And Test
From src/voice/clankvox:
cargo test
Release build:
OPUS_STATIC=1 OPUS_NO_PKG=1 cargo build --release
Format:
cargo fmt
From the repo root, Bun uses:
bun run build:voice
Logging
clankvox writes structured logs to stderr through tracing.
Default logging is roughly:
info,davey=warn,davey::cryptor::frame_processors=off
Useful knobs:
RUST_LOG=debugwhen you need transport detailAUDIO_DEBUG=1when you need more audio-path IPC logging
The subprocess intentionally keeps the Bun IPC channel separate from logs. Stdout is for JSON-line IPC. Stderr is for operator logs.
High-Value Edit Locations
If you are changing…
- voice/session connect logic:
- inbound speaking/audio capture:
- TTS/music playback:
- native watch transport:
- native publish transport:
- Bun IPC contracts:
Coordination With Bun
clankvox almost never changes alone.
Most media-plane changes also require checking:
- ../../clankvoxClient.ts
- ../../sessionLifecycle.ts
- ../../voiceSessionManager.ts
- ../../../selfbot/streamDiscovery.ts for Go Live control-plane changes
When you add a new transport event or command, update both sides in the same change.
Manual Validation Checklist
Audio changes
- run
cargo test - run repo tests that cover
clankvoxClient/ voice lifecycle - validate:
- join still works
- inbound capture still arrives
- TTS still drains
- music still starts, pauses, and resumes cleanly
Go Live changes
- run
cargo test - run repo tests for:
src/voice/clankvoxClient.test.ts- stream discovery / screen watch / publish lifecycle tests
- validate which role changed:
stream_watchstream_publish
- confirm the right transport-state events are still emitted
Known Sharp Edges
- DAVE transition handling is protocol-sensitive and easy to break with “small” changes
- stream-server behavior is role-specific; a fix for
voiceis not automatically correct forstream_watchorstream_publish - sender and receiver video paths share protocol code, but not identical lifecycle expectations
- Bun may look logically correct while
clankvoxstill has buffered playback; trust subprocess telemetry for floor state
Related Context
For historical findings and older debugging notes, keep these nearby:
