Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.
C aiderastclaude-codecode-analysiscode-intelligencecodexcursorcypherdeveloper-toolsgemini-cligraph-visualizationkilocodeknowledge-graphmcpmcp-servermodel-context-protocolopencodesqlitetree-sitterwindsurf
test-infra(win): CI-shaped VM harness, managed-install smoke gate, calibrated suite tier
Martin Vogel664058e86bf9
diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.shindex 472ac8ea9..8fe6d606d 100755--- a/scripts/smoke-test.sh+++ b/scripts/smoke-test.sh@@ -1074,6 +1074,8 @@ echo '# Personal Rovo guidance' > "$ROVO_INSTRUCTIONS"# Run install — override platform config dirs so cbm_app_config_dir() and# cbm_app_local_dir() resolve to FAKE_HOME paths on all platforms.+PHASE8_INSTALL_RC=0+PHASE8_INSTALL_LOG=$(smoke_mktemp_file)HOME="$FAKE_HOME" \XDG_CONFIG_HOME="$FAKE_HOME/.config" \APPDATA="$FAKE_HOME/AppData/Roaming" \@@ -1081,7 +1083,30 @@ HOME="$FAKE_HOME" \KIMI_CODE_HOME="$CUSTOM_KIMI_HOME" \CBM_ROO_CONFIG_PATH="$ROO_CFG" \PATH="$FAKE_HOME/.local/bin:$PATH" \- "$BINARY" install -y 2>&1 || true+ "$BINARY" install -y > "$PHASE8_INSTALL_LOG" 2>&1 || PHASE8_INSTALL_RC=$?+cat "$PHASE8_INSTALL_LOG"+if [[ "$BINARY" == *.exe ]]; then+ # The managed install itself must SUCCEED on Windows — an install-time+ # staging/ACL refusal used to scroll past as tolerated noise while the+ # downstream config assertions kept passing against a previous generation+ # ("staging transaction open failed (status -3, os 0)" hid a real install+ # failure class on Administrators-default-owner profiles).+ if [ "$PHASE8_INSTALL_RC" -ne 0 ]; then+ echo "FAIL 8-0: managed install exited rc=$PHASE8_INSTALL_RC"+ exit 1+ fi+ PHASE8_CANONICAL="$FAKE_HOME/.local/bin/codebase-memory-mcp.exe"+ if [ ! -f "$PHASE8_CANONICAL" ]; then+ echo "FAIL 8-0: canonical launcher missing after managed install"+ exit 1+ fi+ PHASE8_LINKS=$(stat -c %h "$PHASE8_CANONICAL" 2>/dev/null || echo 0)+ if [ "$PHASE8_LINKS" != "2" ]; then+ echo "FAIL 8-0: canonical launcher is not an exact two-link file (links=$PHASE8_LINKS)"+ exit 1+ fi+ echo "OK 8-0: managed install committed an exact two-link canonical launcher"+fi# Helper for JSON validation (pipe file to python — avoids MSYS2 path translation issues)json_get() { cat "$1" 2>/dev/null | python3 -c "import json,sys; d=json.load(sys.stdin); print($2)" 2>/dev/null || echo ""; }diff --git a/test-infrastructure/vm/vm-run-tests.sh b/test-infrastructure/vm/vm-run-tests.shnew file mode 100644index 000000000..ab10b28ca--- /dev/null+++ b/test-infrastructure/vm/vm-run-tests.sh@@ -0,0 +1,81 @@+#!/usr/bin/env bash+# vm-run-tests.sh — run C test suites on the Windows VM under a CI-shaped+# protected temp root. Runs ON the VM (MSYS2 shell), invoked by win.sh+# test / ubsan-test / trap-ubsan-test.+#+# Why the temp root: the daemon/coordination suites fail closed on the+# MSYS-shared /tmp (C:\msys64\tmp), whose ancestry grants mutation rights to+# Authenticated Users — running them there produces security refusals, not+# test signal. CI gives the harness a per-user root under the profile with an+# owner-stamped, protected current-SID DACL (.github/workflows/_test.yml+# "Create protected per-user temp root"); this script mirrors that exactly so+# the VM leg validates what CI will see.+#+# Why the guard: this leg once piped through `tail -40`, and a suite that+# never validly ran looked green — 40 Windows failures reached CI unseen.+# Output now streams in full, and a run whose log lacks the runner's+# completion summary is a hard failure regardless of exit code.+set -uo pipefail++RUNNER="${CBM_VM_RUNNER:-build/c/test-runner}"+LOG="${CBM_VM_TEST_LOG:-/tmp/win-test.log}"++[ $# -ge 1 ] || { echo "usage: vm-run-tests.sh <suite...>" >&2; exit 2; }+[ -x "$RUNNER" ] || { echo "ERROR: runner '$RUNNER' missing — build first" >&2; exit 2; }++# Stale roots from earlier runs are removed up front; the current root is kept+# after the run for post-mortem inspection.+root_windows="$(powershell -NoProfile -Command '+ $ErrorActionPreference = "Stop"+ Get-ChildItem -LiteralPath $env:USERPROFILE -Directory -Filter "cbm-vm-tmp-*" -ErrorAction SilentlyContinue |+ Remove-Item -Recurse -Force -ErrorAction SilentlyContinue+ $root = Join-Path $env:USERPROFILE ("cbm-vm-tmp-" + [guid]::NewGuid().ToString("N"))+ New-Item -ItemType Directory -Path $root | Out-Null+ $sid = [System.Security.Principal.WindowsIdentity]::GetCurrent().User+ $acl = [System.Security.AccessControl.DirectorySecurity]::new()+ $acl.SetOwner($sid)+ $acl.SetAccessRuleProtection($true, $false)+ $rule = [System.Security.AccessControl.FileSystemAccessRule]::new(+ $sid,+ [System.Security.AccessControl.FileSystemRights]::FullControl,+ ([System.Security.AccessControl.InheritanceFlags]::ContainerInherit -bor+ [System.Security.AccessControl.InheritanceFlags]::ObjectInherit),+ [System.Security.AccessControl.PropagationFlags]::None,+ [System.Security.AccessControl.AccessControlType]::Allow)+ $acl.AddAccessRule($rule) | Out-Null+ Set-Acl -LiteralPath $root -AclObject $acl+ Write-Output $root+' | tr -d '\r')"+[ -n "$root_windows" ] || { echo "ERROR: protected temp root creation failed" >&2; exit 2; }++TEMP="$(cygpath -m "$root_windows")"+TMP="$TEMP"+TMPDIR="$(cygpath -u "$root_windows")"+export TEMP TMP TMPDIR++# The runner's directory must look like a real user checkout: repos under a+# profile carry no Authenticated-Users ACE, but C:\cbm (like CI's workspace+# drive) inherits Modify for Authenticated Users from the drive root, which+# the activation transaction's source-directory policy correctly refuses —+# install-flow tests would then fail on the environment, not the code.+# Two steps, both idempotent: protect the DIRECTORY (inheritance flags are+# directory-only — a /T re-root leaves files with empty, deny-all DACLs),+# then /reset the children so they re-inherit the clean set from it.+runner_dir_w="$(cygpath -w "$(dirname "$RUNNER")")"+me="$(whoami | tr -d '\r')"+MSYS2_ARG_CONV_EXCL='*' icacls "$runner_dir_w" /inheritance:r \+ /grant:r "${me}:(OI)(CI)F" '*S-1-5-18:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' \+ /Q >/dev/null 2>&1 || true+MSYS2_ARG_CONV_EXCL='*' icacls "${runner_dir_w}\\*" /reset /T /C /Q >/dev/null 2>&1 || true++echo "=== vm-run-tests: runner=$RUNNER temp=$TEMP suites: $* ==="++"$RUNNER" "$@" 2>&1 | tee "$LOG"+rc="${PIPESTATUS[0]}"++if ! grep -Eq '[0-9]+ passed' "$LOG"; then+ echo "GUARD: test runner produced no completion summary — the suites did" \+ "not validly run; treating as failure (runner rc=$rc)" >&2+ exit 90+fi+exit "$rc"diff --git a/test-infrastructure/vm/win.sh b/test-infrastructure/vm/win.shindex 279cbaa34..592ed1bdc 100755--- a/test-infrastructure/vm/win.sh+++ b/test-infrastructure/vm/win.sh@@ -107,7 +107,11 @@ build);;test)[ $# -ge 1 ] || { echo "usage: win.sh test <suite...>" >&2; exit 2; }- vm clangarm64 "cd /c/cbm && ./build/c/test-runner $* 2>&1 | tail -40"+ # vm-run-tests.sh gives the suites CI's protected per-user temp root+ # (daemon suites fail closed on the MSYS-shared /tmp), streams the FULL+ # output, and refuses to report success without the runner's completion+ # summary. A `| tail -40` here once hid 40 real Windows failures.+ vm clangarm64 "cd /c/cbm && bash test-infrastructure/vm/vm-run-tests.sh $*";;guards)# Match the Windows CI product build: a clean, embedded-UI payload plus the@@ -152,7 +156,7 @@ ubsan-build);;ubsan-test)[ $# -ge 1 ] || { echo "usage: win.sh ubsan-test <suite...>" >&2; exit 2; }- vm clang64 "cd /c/cbm && ./build/c/test-runner $* 2>&1 | tail -40"+ vm clang64 "cd /c/cbm && CBM_VM_TEST_LOG=/tmp/win-ubsan-test.log bash test-infrastructure/vm/vm-run-tests.sh $*";;trap-ubsan-build)# NATIVE ARM64 UBSan via trap mode. -fsanitize-trap=undefined needs NO@@ -170,7 +174,7 @@ trap-ubsan-test)[ $# -ge 1 ] || { echo "usage: win.sh trap-ubsan-test <suite...>" >&2; exit 2; }# A UB trap crashes the runner with SIGILL (exit 132); the harness reports# the failing suite so the emulated diagnosis loop can name the check.- vm clangarm64 "cd /c/cbm && ./build/trap-ubsan/test-runner $* 2>&1 | tail -40"+ vm clangarm64 "cd /c/cbm && CBM_VM_RUNNER=build/trap-ubsan/test-runner CBM_VM_TEST_LOG=/tmp/win-trap-ubsan-test.log bash test-infrastructure/vm/vm-run-tests.sh $*";;pageheap)# OS-level heap verification (page-granular overflow/UAF detection) for the