scaffold: M0 skeleton + agent onboarding (build, architecture, progress)
Turn the design into a buildable, dependency-free M0 skeleton plus the
onboarding layer so a new agent can pick up instantly.
Build system:
- CMake + CMakePresets (dev = no deps; server-release = vcpkg) + vcpkg.json
- Skeleton builds with just a C++20 compiler; deps stay off until needed
- .gitattributes (LF), .gitignore, .clang-format
Core (libvoicecat):
- core/include/voicecat.h: full C ABI (the client/server contract), stubbed
- core/proto/voicecat.proto: control-plane wire format, matches docs/protocol.md
- src/{net,crypto,codec,protocol,session,audio,core}: subsystem stubs that
return VC_ERR_NOT_IMPLEMENTED, each pointing to its design doc
- server/ (voicecat-server) and tools/vccli/ link the core
- tests/: CTest smoke test asserting the C ABI contract (behavior, not just build)
- clients/{apple,windows}: M4 placeholders
Onboarding for agents:
- CLAUDE.md: hub — build/test commands, architecture at a glance, doc map, rules
- AGENTS.md: working method (behavior-driven; clean compile is the floor not the goal)
- PROGRESS.md: living tracker — M0 done, M1 task checklist, "where we left off"
Verified: cmake --preset dev && cmake --build --preset dev && ctest --preset dev → green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:09:09 +02:00
|
|
|
# libvoicecat — the shared C++ core (docs/architecture.md).
|
|
|
|
|
# Sources are globbed so adding a stub under src/<subsystem>/ needs no CMake edit.
|
|
|
|
|
file(GLOB_RECURSE VOICECAT_SOURCES CONFIGURE_DEPENDS
|
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
|
|
|
|
|
|
|
|
|
|
if(VOICECAT_BUILD_SHARED)
|
|
|
|
|
add_library(voicecat SHARED ${VOICECAT_SOURCES})
|
|
|
|
|
else()
|
|
|
|
|
add_library(voicecat STATIC ${VOICECAT_SOURCES})
|
|
|
|
|
# Static consumers must see VC_API as empty (no dllimport).
|
|
|
|
|
target_compile_definitions(voicecat PUBLIC VOICECAT_STATIC)
|
|
|
|
|
endif()
|
|
|
|
|
add_library(voicecat::voicecat ALIAS voicecat)
|
|
|
|
|
|
|
|
|
|
target_include_directories(voicecat
|
|
|
|
|
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
|
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
|
|
|
|
|
|
|
|
|
target_compile_definitions(voicecat PRIVATE VOICECAT_BUILDING)
|
|
|
|
|
target_compile_features(voicecat PUBLIC cxx_std_20)
|
|
|
|
|
|
|
|
|
|
set_target_properties(voicecat PROPERTIES
|
|
|
|
|
C_VISIBILITY_PRESET hidden
|
|
|
|
|
CXX_VISIBILITY_PRESET hidden
|
|
|
|
|
VISIBILITY_INLINES_HIDDEN ON)
|
|
|
|
|
|
|
|
|
|
if(VOICECAT_USE_VCPKG_DEPS)
|
feat(M1): TCP/TLS control plane -- auth, channels, ephemeral text
Implements the full M1 milestone. Two clients authenticate over TLS 1.3
(guest + Argon2id password) and exchange channel + private text messages
through a real server. All five ctest --preset m1-dev tests pass in ~1 s.
Key components added:
- vcpkg baseline + m1-dev preset (protobuf/mbedTLS/libsodium/asio/sqlite3)
- FrameCodec feed+emit, encode/decode_envelope, protobuf codegen
- TcpServerConn with blocking TLS handshake thread + tls_read_loop
- TlsContext (mbedTLS 1.3, ECDSA-P256 self-signed cert, TOFU on client)
- WorkerPool (3 threads, used for Argon2id)
- Database: SQLite + libsodium Argon2id, account lifecycle, bootstrap admin
- ServerIdentityManager: Ed25519 key + cert generate/persist/fingerprint
- ConnSession state machine: WaitingHello -> WaitingAuth -> Authenticated
- SessionRegistry: channel tree, user map, text routing, broadcast
- vc_client full M1 C ABI: connect/TLS/handshake/auth/text/disconnect
- voicecat-admin CLI: account add/reset/del/list
- test_m1_integration: M1 exit criterion, verified green
Bug fixed: double-framing in ConnSession::send_envelope -- encode_envelope
was adding the [4-byte len] prefix, then TcpServerConn::send_frame added
a second one, causing the client to parse [len][proto] as protobuf (silent
failure). Fixed by serializing raw protobuf bytes in send_envelope and
letting send_frame apply the single length prefix.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-15 23:48:44 +02:00
|
|
|
find_package(protobuf CONFIG REQUIRED)
|
|
|
|
|
find_package(unofficial-sodium CONFIG REQUIRED)
|
|
|
|
|
find_package(MbedTLS CONFIG REQUIRED)
|
|
|
|
|
find_package(asio CONFIG REQUIRED)
|
|
|
|
|
find_package(unofficial-sqlite3 CONFIG REQUIRED)
|
|
|
|
|
find_package(spdlog CONFIG REQUIRED)
|
|
|
|
|
|
|
|
|
|
# Generate C++ from voicecat.proto into the build tree.
|
|
|
|
|
protobuf_generate(
|
|
|
|
|
TARGET voicecat
|
|
|
|
|
PROTOS proto/voicecat.proto
|
|
|
|
|
LANGUAGE cpp
|
|
|
|
|
IMPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/proto
|
|
|
|
|
PROTOC_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated/proto)
|
|
|
|
|
# Generated .pb.h files are included by protocol/envelope.h (consumed by tests and server),
|
|
|
|
|
# so the generated dir and protobuf itself must be PUBLIC.
|
|
|
|
|
target_include_directories(voicecat PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/generated)
|
|
|
|
|
|
|
|
|
|
target_link_libraries(voicecat
|
|
|
|
|
PUBLIC protobuf::libprotobuf
|
|
|
|
|
PRIVATE unofficial-sodium::sodium
|
|
|
|
|
MbedTLS::mbedtls MbedTLS::mbedcrypto MbedTLS::mbedx509
|
|
|
|
|
asio::asio unofficial::sqlite3::sqlite3 spdlog::spdlog)
|
|
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
|
# AcceptEx / GetAcceptExSockaddrs live in mswsock; ws2_32 covers the base Winsock API.
|
|
|
|
|
target_link_libraries(voicecat PRIVATE ws2_32 mswsock)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Signal to C++ code that the real networking/crypto stack is available.
|
|
|
|
|
target_compile_definitions(voicecat PUBLIC VOICECAT_HAS_NET)
|
scaffold: M0 skeleton + agent onboarding (build, architecture, progress)
Turn the design into a buildable, dependency-free M0 skeleton plus the
onboarding layer so a new agent can pick up instantly.
Build system:
- CMake + CMakePresets (dev = no deps; server-release = vcpkg) + vcpkg.json
- Skeleton builds with just a C++20 compiler; deps stay off until needed
- .gitattributes (LF), .gitignore, .clang-format
Core (libvoicecat):
- core/include/voicecat.h: full C ABI (the client/server contract), stubbed
- core/proto/voicecat.proto: control-plane wire format, matches docs/protocol.md
- src/{net,crypto,codec,protocol,session,audio,core}: subsystem stubs that
return VC_ERR_NOT_IMPLEMENTED, each pointing to its design doc
- server/ (voicecat-server) and tools/vccli/ link the core
- tests/: CTest smoke test asserting the C ABI contract (behavior, not just build)
- clients/{apple,windows}: M4 placeholders
Onboarding for agents:
- CLAUDE.md: hub — build/test commands, architecture at a glance, doc map, rules
- AGENTS.md: working method (behavior-driven; clean compile is the floor not the goal)
- PROGRESS.md: living tracker — M0 done, M1 task checklist, "where we left off"
Verified: cmake --preset dev && cmake --build --preset dev && ctest --preset dev → green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 21:09:09 +02:00
|
|
|
endif()
|