Files
aevolution/cmake/Network.cmake
T
dingoandClaude Opus 5.5 e640b6d3a3
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Failing after 9m57s
Foundation / checks (network) (push) Successful in 11m17s
Foundation / checks (tsan) (push) Successful in 7m49s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 25m43s
Foundation / checks (postgres) (push) Canceled after 15m44s
Add M10.5a session protocol v2 and snapshot replication core
Session protocol v2 adds Interest, SnapshotChunk and SnapshotAck (v1 is refused).
ReplicationServer filters by a server-capped client focus and a perception
predicate, sends per-tick entity deltas against the acknowledged baseline (kept
up to 40 ticks), nearest first within 16 KiB with a slower distant tier, as
self-contained datagram chunks. SnapshotAssembler applies complete snapshots to
one of two baselines and validates them as presentations. ADR-0093.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 10:22:11 -04:00

80 lines
4.7 KiB
CMake

# M9.6 dev session protocol and TLS adapter (ADR-0082). Opt-in; never part of the
# headless simulation. Mbed TLS comes only from the explicitly prepared, pinned source.
include("${PROJECT_SOURCE_DIR}/tools/mbedtls-pin.cmake")
set(mbedtls_source "${PROJECT_SOURCE_DIR}/build/external/mbedtls/mbedtls-${EVO_MBEDTLS_VERSION}")
if(NOT EXISTS "${mbedtls_source}/evo-verified.sha256")
message(FATAL_ERROR "Prepare Mbed TLS explicitly: cmake -P tools/prepare-mbedtls.cmake")
endif()
file(STRINGS "${mbedtls_source}/evo-verified.sha256" verified)
if(NOT verified STREQUAL EVO_MBEDTLS_SHA256)
message(FATAL_ERROR "Prepared Mbed TLS does not match the reviewed source pin")
endif()
enable_language(C)
set(ENABLE_PROGRAMS OFF CACHE BOOL "" FORCE)
set(ENABLE_TESTING OFF CACHE BOOL "" FORCE)
set(GEN_FILES OFF CACHE BOOL "" FORCE)
set(USE_STATIC_MBEDTLS_LIBRARY ON CACHE BOOL "" FORCE)
set(USE_SHARED_MBEDTLS_LIBRARY OFF CACHE BOOL "" FORCE)
set(USE_STATIC_TF_PSA_CRYPTO_LIBRARY ON CACHE BOOL "" FORCE)
set(USE_SHARED_TF_PSA_CRYPTO_LIBRARY OFF CACHE BOOL "" FORCE)
set(DISABLE_PACKAGE_CONFIG_AND_INSTALL ON CACHE BOOL "" FORCE)
# Warnings-as-errors is policy for owned code. Upstream's own -Werror turns
# compiler-version-specific diagnostics (GCC 13 -O3 maybe-uninitialized in
# ssl_tls.c) into build failures of unmodified upstream sources.
set(MBEDTLS_FATAL_WARNINGS OFF CACHE BOOL "" FORCE)
set(TF_PSA_CRYPTO_FATAL_WARNINGS OFF CACHE BOOL "" FORCE)
set(MBEDTLS_USER_CONFIG_FILE "${PROJECT_SOURCE_DIR}/third_party/mbedtls/evo_mbedtls_config.h"
CACHE FILEPATH "Owned TLS 1.3-only restriction (ADR-0082)" FORCE)
# Upstream code is not compiled with project warning policy or our sanitizer
# instrumentation guarantees; only owned targets use evo_owned_target.
add_subdirectory("${mbedtls_source}" "${PROJECT_BINARY_DIR}/mbedtls" EXCLUDE_FROM_ALL SYSTEM)
# Dependency-free protocol: framing, envelopes, admission. No Mbed TLS types.
add_library(evo_network_protocol STATIC src/network/protocol/codec.cpp
src/network/protocol/admission.cpp src/network/protocol/session_control.cpp
src/network/protocol/session_protocol.cpp src/network/protocol/intent_admission.cpp
src/network/protocol/replication.cpp)
target_link_libraries(evo_network_protocol PUBLIC evo_client_views evo_client_controls)
evo_owned_target(evo_network_protocol)
# Mbed TLS adapters: dev grants (HMAC-SHA256 via PSA) and the TLS 1.3 channel.
# M10.3 session grants (ECDSA P-256 via PSA) share the adapter (ADR-0091).
add_library(evo_network_tls STATIC src/network/tls/dev_grant.cpp src/network/tls/channel.cpp
src/network/tls/dev_credentials.cpp src/network/tls/session_grant.cpp)
target_link_libraries(evo_network_tls PUBLIC evo_network_protocol PRIVATE mbedtls)
evo_owned_target(evo_network_tls)
# M10.3 backend identity adapter: providers, account directory, grant issuer (library only).
add_library(evo_identity STATIC src/identity/identity.cpp)
target_link_libraries(evo_identity PUBLIC evo_network_tls)
evo_owned_target(evo_identity)
# M9.7 sessions: non-blocking TCP, the host-agnostic session server and the client.
add_library(evo_network_session STATIC src/network/socket/tcp.cpp src/network/session/server.cpp
src/network/session/client.cpp src/network/session/grant_ledger.cpp)
target_link_libraries(evo_network_session PUBLIC evo_network_tls)
if(WIN32)
target_link_libraries(evo_network_session PRIVATE ws2_32)
endif()
evo_owned_target(evo_network_session)
# Dev credential and grant tool (ADR-0083); generates throwaway-scale dev secrets only.
add_executable(evo-dev-session apps/evo-dev-session/main.cpp)
target_link_libraries(evo-dev-session PRIVATE evo_network_session)
evo_owned_target(evo-dev-session)
if(BUILD_TESTING)
add_executable(evo-network-tests tests/network_protocol.cpp tests/network_tls.cpp
tests/network_session.cpp tests/network_control.cpp tests/network_replication.cpp
tests/network_main.cpp)
# The TLS tests generate throwaway dev certificates with Mbed TLS directly.
target_link_libraries(evo-network-tests PRIVATE evo_network_session evo_identity mbedtls)
evo_owned_target(evo-network-tests)
add_test(NAME network COMMAND evo-network-tests)
set_tests_properties(network PROPERTIES TIMEOUT 120 LABELS "network")
endif()
if(EVO_BUILD_FUZZER)
# Coverage-guided codec fuzzing (Linux Clang; see the EVO_BUILD_FUZZER guard).
add_executable(evo-dev-session-fuzz tests/fuzz/dev_session_fuzz.cpp
src/network/protocol/codec.cpp)
target_link_libraries(evo-dev-session-fuzz PRIVATE evo_client_views evo_client_controls)
evo_owned_target(evo-dev-session-fuzz)
target_compile_options(evo-dev-session-fuzz PRIVATE -fsanitize=fuzzer,address,undefined -fno-omit-frame-pointer)
target_link_options(evo-dev-session-fuzz PRIVATE -fsanitize=fuzzer,address,undefined)
endif()