Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/SECURITY_CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ env:
-DVIX_ENABLE_MIDDLEWARE=ON
-DVIX_ENABLE_CLI=ON
-DVIX_ENABLE_WEBSOCKET=ON
-DVIX_ENABLE_REALTIME=ON
-DVIX_REALTIME_WITH_WEBSOCKET=ON
-DVIX_REALTIME_WITH_POSTGRES=OFF
-DVIX_ENABLE_TEMPLATE=ON
-DVIX_ENABLE_UI=ON
-DVIX_ENABLE_NOTE=ON
Expand Down Expand Up @@ -143,6 +146,9 @@ env:
-DVIX_ENABLE_MIDDLEWARE=ON
-DVIX_ENABLE_CLI=ON
-DVIX_ENABLE_WEBSOCKET=ON
-DVIX_ENABLE_REALTIME=ON
-DVIX_REALTIME_WITH_WEBSOCKET=ON
-DVIX_REALTIME_WITH_POSTGRES=OFF
-DVIX_ENABLE_TEMPLATE=ON
-DVIX_ENABLE_UI=ON
-DVIX_ENABLE_NOTE=ON
Expand Down Expand Up @@ -190,6 +196,7 @@ env:
-DVIX_MIDDLEWARE_BUILD_TESTS=ON
-DVIX_CLI_BUILD_TESTS=ON
-DVIX_WEBSOCKET_BUILD_TESTS=ON
-DVIX_REALTIME_BUILD_TESTS=ON
-DVIX_TEMPLATE_BUILD_TESTS=ON
-DTEMPLATE_BUILD_TESTS=ON
-DVIX_UI_BUILD_TESTS=ON
Expand Down Expand Up @@ -255,6 +262,7 @@ jobs:
test -f modules/template/CMakeLists.txt
test -f modules/ui/CMakeLists.txt
test -f modules/note/CMakeLists.txt
test -f modules/realtime/CMakeLists.txt

- name: Select compiler
run: |
Expand Down Expand Up @@ -357,6 +365,11 @@ jobs:
exit 1
fi

if ! grep -Eq 'vix_realtime_' /tmp/vix_ctest_list.txt; then
echo "::error::Realtime tests were not registered."
exit 1
fi

- name: Run module tests
run: |
set -euxo pipefail
Expand Down Expand Up @@ -436,6 +449,11 @@ jobs:
exit 1
fi

if ! grep -Eq 'vix_realtime_' /tmp/vix_san_ctest_list.txt; then
echo "::error::Sanitized Realtime tests were not registered."
exit 1
fi

- name: Run sanitized module tests
run: |
set -euxo pipefail
Expand Down Expand Up @@ -1008,6 +1026,11 @@ jobs:
exit 1
fi

if ! grep -Eq 'vix_realtime_' /tmp/vix_full_tests_list.txt; then
echo "::error::Full test profile did not register Realtime tests."
exit 1
fi

summary:
name: SECURITY_CI Summary
needs:
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ jobs:
# --- web modules: web + all --------------------------------
if has "web all"; then
have_h "vix/websocket.hpp"; have_l "libvix_websocket.a"
have_h "vix/realtime.hpp"; have_l "libvix_realtime.a"
test -d "$ID/include/vix/realtime"
test ! -d "$ID/include/vix/realtime/internal"
grep -R "vix::realtime" "$ID/lib/cmake/Vix" -n
have_h "vix/validation.hpp"
have_h "vix/crypto.hpp"
have_h "vix/webrpc.hpp"
Expand All @@ -290,6 +294,11 @@ jobs:
nm -C "$ID/lib/libvix_websocket.a" | grep "vix::websocket::LongPollingManager::push_to"
fi

if ! has "web all"; then
no_h "vix/realtime.hpp"
no_l "libvix_realtime.a"
fi

# --- data modules: data + all ------------------------------
if has "data all"; then
have_h "vix/db.hpp"
Expand Down Expand Up @@ -405,6 +414,7 @@ jobs:
echo '#include <vix/note/note.hpp>'
if has "web all"; then
echo '#include <vix/websocket.hpp>'
echo '#include <vix/realtime.hpp>'
echo '#include <vix/validation.hpp>'
echo '#include <vix/crypto.hpp>'
echo '#include <vix/webrpc.hpp>'
Expand Down Expand Up @@ -433,7 +443,8 @@ jobs:
if has "web all"; then
echo ' vix::websocket::Config ws_config{};'
echo ' vix::websocket::Router ws_router{};'
echo ' (void)ws_config; (void)ws_router;'
echo ' vix::realtime::Config realtime_config{};'
echo ' (void)ws_config; (void)ws_router; (void)realtime_config;'
fi
echo ' std::cout << "Vix SDK consumer (profile='"$P"') build and link works\n";'
echo ' return 0;'
Expand Down
80 changes: 80 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,86 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# Vix v2.8.5

Vix v2.8.5 stabilizes **Vix Realtime** and significantly strengthens dependency management and modular application architecture.

## Added

### Vix Realtime

- Authoritative stateful rooms with persisted events.
- Transactional snapshots, replay, recovery, and session resume.
- Presence lifecycle and session reconnection support.
- In-memory and PostgreSQL persistence.
- WebSocket and protocol integration.
- Metrics and health APIs.
- Public SDK packaging with isolated, installable headers.
- Concurrency, persistence, recovery, and integration contracts.

### Module-scoped Git dependencies

Git dependencies can now belong to a specific application module.

```bash
vix install https://github.com/gabime/spdlog \
--tag v1.15.3 \
--target spdlog::spdlog \
--module auth
```

The dependency is declared in the module's `vix.module`, while the application continues to use a single root `vix.lock` and the shared Vix dependency cache.

Module dependencies remain isolated from sibling modules and are linked only to the module that owns them.

### Module architecture validation

- Added a canonical `ModuleManifest` model for `vix.module`.
- Added a canonical `ModuleGraph` for module identity, paths, dependencies, cycles, and deterministic dependency ordering.
- Added dependency ownership tracking for application and module dependencies.
- Added cross-module dependency constraint analysis.
- Detects normalized module-name collisions, path collisions, invalid dependencies, disabled dependencies, self-dependencies, and dependency cycles.
- Detects incompatible dependency requirements before they reach the generated CMake graph.

### Atomic project mutations

Dependency and module mutations now use project-scoped transactional updates.

- Project mutation locking prevents concurrent commands from silently overwriting each other's state.
- Multi-file mutations use staged writes and rollback.
- Interrupted transactions can be recovered from `.vix/transactions`.
- Failed operations restore previous project metadata byte-for-byte.
- `vix add`, `vix remove`, `vix update`, `vix install`, and module mutation commands use the common mutation infrastructure.

### Install compatibility contracts

- Deterministic tests for Git-hosted CMake dependencies.
- Coverage for header-only, static, shared, alias targets, generated headers, nested subdirectories, CMake options, compile features, and transitive dependencies.
- Added strict module Git installation, rollback, ownership, constraint, graph, and transaction contracts.

## Improved

- `vix install` now reconciles `vix.app` and `vix.lock`, resolving only new or changed dependencies.
- Unchanged installs avoid remote Git resolution, unnecessary link recreation, and identical CMake rewrites.
- Git checkouts are reused directly from the Vix cache.
- Direct Git installs remain transactional on failure.
- Module-scoped Git installs validate the target module before performing remote work.
- Dependency conflicts across the application and its active modules are detected instead of using last-write-wins behavior.
- Multiple modules can share the same compatible dependency without requiring separate downloads or lockfiles.
- Git dependency identity now normalizes repository-root subdirectories consistently, so omitted subdirectories and `.` are treated as the same source location.
- CMake dependency options are preserved through the lockfile and generated integration.
- Git installation progress now reports remote work immediately and displays real Git receiving progress without inventing global percentages.
- `vix install` dependency operations no longer require a build-complete `vix.app`.
- Vix no longer leaks its internal `SPDLOG_FMT_EXTERNAL` configuration into user dependencies.
- Compiler-specific warning flags are now scoped correctly between GCC and Clang.
- Realtime recovery, session resume, presence, snapshots, PostgreSQL support, SDK integration, and concurrency behavior were stabilized and validated.

## Summary

Vix v2.8.5 makes Realtime a first-class Vix module while making modular applications and dependency installation substantially safer.

Applications can now assign Git dependencies to individual modules, detect dependency and graph conflicts before build generation, recover from interrupted metadata mutations, and reuse a single deterministic dependency graph across the application.

# Vix v2.8.4

Vix v2.8.4 improves the everyday C++ development loop with faster compilation and rebuilds, lighter public headers, safer caching, better diagnostics, and more consistent `build`, `run`, and `dev` behavior.
Expand Down
25 changes: 18 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2069,13 +2069,24 @@ if (VIX_ENABLE_INSTALL)

foreach(_m IN LISTS _VIX_INSTALL_MODULES)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/modules/${_m}/include")
install(DIRECTORY "modules/${_m}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.h"
PATTERN "*.inc"
)
if (_m STREQUAL "realtime")
install(DIRECTORY "modules/${_m}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.h"
PATTERN "*.inc"
PATTERN "internal" EXCLUDE
)
else()
install(DIRECTORY "modules/${_m}/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
FILES_MATCHING
PATTERN "*.hpp"
PATTERN "*.h"
PATTERN "*.inc"
)
endif()
endif()
endforeach()

Expand Down
2 changes: 1 addition & 1 deletion modules/cli
Submodule cli updated 41 files
+16 −1 include/vix/cli/app/AppManifest.hpp
+57 −0 include/vix/cli/modules/DependencyConstraints.hpp
+58 −0 include/vix/cli/modules/DependencyOwnership.hpp
+55 −0 include/vix/cli/modules/ModuleGraph.hpp
+36 −0 include/vix/cli/modules/ModuleManifest.hpp
+87 −0 include/vix/cli/util/GitProgress.hpp
+44 −0 include/vix/cli/util/ProjectMutation.hpp
+4 −0 include/vix/cli/util/Resolver.hpp
+98 −253 src/app/AppCMakeGenerator.cpp
+19 −6 src/app/AppManifest.cpp
+61 −167 src/app/AppProjectResolver.cpp
+8 −0 src/commands/AddCommand.cpp
+8 −0 src/commands/BuildCommand.cpp
+779 −201 src/commands/InstallCommand.cpp
+7 −0 src/commands/RemoveCommand.cpp
+71 −38 src/commands/UpdateCommand.cpp
+1 −1 src/commands/UpgradeCommand.cpp
+98 −290 src/commands/modules/ModulesCommands.cpp
+103 −0 src/modules/DependencyConstraints.cpp
+82 −0 src/modules/DependencyOwnership.cpp
+183 −0 src/modules/ModuleGraph.cpp
+57 −0 src/modules/ModuleManifest.cpp
+4 −4 src/sdk/SdkProfiles.cpp
+102 −0 src/util/ProjectMutation.cpp
+13 −0 src/util/Resolver.cpp
+51 −0 tests/CMakeLists.txt
+34 −0 tests/DependencyConstraintsTests.cpp
+54 −0 tests/DependencyOwnershipTests.cpp
+186 −0 tests/GitDependenciesTest.sh
+23 −0 tests/GitProgressParserTests.cpp
+108 −0 tests/ModuleGitInstallContractTest.sh
+34 −0 tests/ModuleGraphTests.cpp
+41 −0 tests/ModuleManifestTests.cpp
+133 −0 tests/MutationCommandContractsTest.sh
+15 −0 tests/ProjectMutationTests.cpp
+4 −4 tests/SdkProfileCompositionTest.sh
+2 −0 tests/contracts/AllCliContractsTest.sh
+2 −0 tests/contracts/CapabilityCoverage.md
+137 −0 tests/contracts/install/InstallCMakeCompatibilityContractTest.sh
+15 −0 tests/contracts/install/InstallCompatibility.md
+55 −0 tests/contracts/install/InstallReconciliationContractTest.sh
2 changes: 1 addition & 1 deletion modules/io
Submodule io updated 1 files
+48 −6 CMakeLists.txt
2 changes: 1 addition & 1 deletion modules/log
Submodule log updated 1 files
+47 −6 CMakeLists.txt
2 changes: 1 addition & 1 deletion modules/realtime
Submodule realtime updated 44 files
+1 −0 .gitignore
+109 −23 CMakeLists.txt
+47 −0 include/vix/realtime/command_queue_status.hpp
+0 −20 include/vix/realtime/config.hpp
+7 −1 include/vix/realtime/errors.hpp
+1 −51 include/vix/realtime/internal/command_queue.hpp
+17 −0 include/vix/realtime/internal/replay_engine.hpp
+3 −0 include/vix/realtime/realtime.hpp
+16 −18 include/vix/realtime/room.hpp
+19 −11 include/vix/realtime/room_manager.hpp
+2 −2 include/vix/realtime/server.hpp
+27 −20 include/vix/realtime/session_resume.hpp
+52 −15 src/config.cpp
+4 −0 src/errors.cpp
+108 −0 src/internal/replay_engine.cpp
+33 −0 src/internal/room_runtime.hpp
+2 −1 src/postgres_event_store.cpp
+2 −1 src/postgres_snapshot_store.cpp
+73 −59 src/room.cpp
+77 −42 src/room_manager.cpp
+411 −417 src/server.cpp
+417 −411 src/session.cpp
+116 −265 src/session_resume.cpp
+94 −0 tests/CMakeLists.txt
+124 −0 tests/concurrency/room_parallel_commands_test.cpp
+67 −0 tests/config/config_test.cpp
+14 −0 tests/contract/public_header_contract.cpp
+5 −25 tests/integration/realtime_session_flow_test.cpp
+18 −0 tests/manager/room_manager_cleanup_test.cpp
+240 −7 tests/manager/room_manager_routing_test.cpp
+20 −2 tests/manager/room_manager_shutdown_test.cpp
+71 −0 tests/metrics/metrics_health_test.cpp
+42 −0 tests/postgres/postgres_event_batch_test.cpp
+76 −0 tests/postgres/postgres_event_replay_test.cpp
+47 −0 tests/postgres/postgres_event_store_test.cpp
+90 −0 tests/postgres/postgres_snapshot_replay_test.cpp
+60 −0 tests/postgres/postgres_snapshot_store_test.cpp
+105 −0 tests/postgres/support.hpp
+10 −11 tests/room/room_constructor_test.cpp
+44 −0 tests/room/room_restore_test.cpp
+177 −8 tests/session/session_resume_replay_test.cpp
+286 −0 tests/session/session_resume_semantics_test.cpp
+31 −7 tests/session/session_resume_snapshot_test.cpp
+1 −1 tests/session/session_resume_token_test.cpp
2 changes: 1 addition & 1 deletion modules/utils
Loading