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
6 changes: 4 additions & 2 deletions .github/workflows/cpp_server_build_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,9 @@ jobs:
cmake --preset default
cmake --build --preset default --target test_directory_watcher
cmake --build --preset default --target test_latest_version_fallback
cmake --build --preset default --target test_routing_policy_contract
cd build
ctest --output-on-failure -R "DirectoryWatcher|LatestVersionFallback"
ctest --output-on-failure -R "DirectoryWatcher|LatestVersionFallback|RoutingPolicyContract"

- name: Upload .deb package
uses: actions/upload-artifact@v7
Expand Down Expand Up @@ -536,8 +537,9 @@ jobs:
run: |
cmake --build --preset default --target test_directory_watcher
cmake --build --preset default --target test_latest_version_fallback
cmake --build --preset default --target test_routing_policy_contract
cd build
ctest --output-on-failure -R "DirectoryWatcher|LatestVersionFallback"
ctest --output-on-failure -R "DirectoryWatcher|LatestVersionFallback|RoutingPolicyContract"

- name: Upload .pkg package
if: steps.check_signing.outputs.has_signing == 'true'
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/routing_schema_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Routing Schema Tests
on:
push:
branches: ["main"]
pull_request:
merge_group:

permissions:
contents: read

jobs:
routing-schema-tests:
name: Routing schema + fixtures
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v5
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: python -m pip install --upgrade pip jsonschema
# Pure-python, no server binary needed — fast PR gate for the routing
# policy/decision schemas. Keeps the back-compat guardrails enforced.
- name: Validate fixtures against the JSON schemas
run: python test/test_routing_fixtures.py
- name: Verify frozen-major schema lock
run: python test/test_schema_lock.py
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,30 @@ if(EXISTS "${_INSTALL_ATOMICITY_TEST_SRC}")
add_test(NAME InstallAtomicityTest COMMAND test_install_atomicity)
endif()

# Routing engine contract surface (issue #2407). Header-only foundation: the
# shared types/interfaces in routing_policy.h plus the fake ClassifierServices.
# The test loads the L0a-L3 fixtures from the source tree via ROUTING_FIXTURE_DIR.
set(_ROUTING_CONTRACT_TEST_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/test/cpp/test_routing_policy_contract.cpp"
)
if(EXISTS "${_ROUTING_CONTRACT_TEST_SRC}")
add_executable(test_routing_policy_contract
test/cpp/test_routing_policy_contract.cpp
)
target_include_directories(test_routing_policy_contract PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src/cpp/include
${CMAKE_CURRENT_SOURCE_DIR}/test/cpp
${CMAKE_CURRENT_BINARY_DIR}/include
)
target_link_libraries(test_routing_policy_contract PRIVATE nlohmann_json::nlohmann_json)
target_compile_definitions(test_routing_policy_contract PRIVATE
ROUTING_FIXTURE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test/cpp/fixtures/routing"
)

include(CTest)
add_test(NAME RoutingPolicyContractTest COMMAND test_routing_policy_contract)
endif()

# Auto-tune: GGUF array storage, scalar derivation, weighted KV cache computation.
# Covers head_count_kv_per_layer, sliding_window_pattern, SWA precise weighted sum,
# full_attention_interval exact count, and scalar fallback paths.
Expand Down
Loading
Loading