Skip to content

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.

test: checkpoint cross-platform harness fixes

Martin Vogel78772eb3011f
diff --git a/tests/test_runtime_isolation_contract.sh b/tests/test_runtime_isolation_contract.sh
index 217230c7f..0d6865a49 100644
--- a/tests/test_runtime_isolation_contract.sh
+++ b/tests/test_runtime_isolation_contract.sh
@@ -93,6 +93,7 @@ ENTRY_POINTS=(
scripts/security-install.sh scripts/security-fuzz.sh scripts/security-fuzz-random.sh
scripts/security-network.sh tests/test_parent_watchdog.sh tests/test_worker_watchdog.sh
tests/test_worker_error_response.sh tests/test_hook_conflict_notice.sh
+ tests/test_watcher_disabled.sh
)
for entry in "${ENTRY_POINTS[@]}"; do
grep -q 'test-runtime.sh' "$ROOT/$entry" || fail "$entry does not source the helper"
diff --git a/tests/test_security_fuzz_harness.sh b/tests/test_security_fuzz_harness.sh
index 713107b1f..79f43ad3e 100644
--- a/tests/test_security_fuzz_harness.sh
+++ b/tests/test_security_fuzz_harness.sh
@@ -41,24 +41,35 @@ if "$ROOT/scripts/security-fuzz.sh" "$ECHO_ONLY" \
exit 1
fi
+# One python3 process answers the requests; the harness needs python3 for its
+# interactive case anyway. A shell `read` of the 1 MB request costs seconds
+# where the shell runs emulated, and the harness's 10-second hang limit then
+# decides this test instead of its assertions.
+ENV_RESPONDER="$WORKDIR/environment-probe-responder.py"
+cat > "$ENV_RESPONDER" <<'EOF'
+import re
+import sys
+
+# Echo a JSON-RPC result for every request with a numeric id. This keeps the
+# fixture compatible with both the current fixed ids and a future per-case
+# acknowledgement id without depending on the malformed payload itself: the
+# last id of a line is the one that counts.
+REQUEST_ID = re.compile(rb'"id"\s*:\s*([0-9]+)')
+
+for line in sys.stdin.buffer:
+ ids = REQUEST_ID.findall(line)
+ if not ids:
+ continue
+ result = b'{"isError":true}' if b'"name":"index_repository"' in line else b'{}'
+ sys.stdout.buffer.write(b'{"jsonrpc":"2.0","id":' + ids[-1] + b',"result":' + result + b'}\n')
+ sys.stdout.buffer.flush()
+EOF
+
ENV_PROBE="$WORKDIR/environment-probe-mcp"
cat > "$ENV_PROBE" <<'EOF'
#!/usr/bin/env bash
printf '%s\t%s\t%s\n' "${HOME-}" "${CBM_CACHE_DIR-}" "${CBM_RUNTIME_DIR-}" >> "$CBM_FUZZ_ENV_PROBE"
-
-# Echo a JSON-RPC result for every request with a numeric id. This keeps the
-# fixture compatible with both the current fixed ids and a future per-case
-# acknowledgement id without depending on the malformed payload itself.
-while IFS= read -r line; do
- id=$(printf '%s\n' "$line" | sed -n 's/.*"id"[[:space:]]*:[[:space:]]*\([0-9][0-9]*\).*/\1/p')
- if [[ -n "$id" ]]; then
- if [[ "$line" == *'"name":"index_repository"'* ]]; then
- printf '{"jsonrpc":"2.0","id":%s,"result":{"isError":true}}\n' "$id"
- else
- printf '{"jsonrpc":"2.0","id":%s,"result":{}}\n' "$id"
- fi
- fi
-done
+exec python3 "${BASH_SOURCE[0]%/*}/environment-probe-responder.py"
EOF
chmod +x "$ENV_PROBE"
diff --git a/tests/test_version_metadata_contract.sh b/tests/test_version_metadata_contract.sh
index fa66caeaa..05655a148 100644
--- a/tests/test_version_metadata_contract.sh
+++ b/tests/test_version_metadata_contract.sh
@@ -107,8 +107,8 @@ SURFACES=(
"pkg/go/cmd/codebase-memory-mcp/main.go|release"
"pkg/chocolatey/codebase-memory-mcp.nuspec|release"
"pkg/chocolatey/tools/chocolateyInstall.ps1|release"
+ "pkg/scoop/codebase-memory-mcp.json|release"
"pkg/homebrew/Formula/codebase-memory-mcp.rb|pin:0.10.3"
- "pkg/scoop/codebase-memory-mcp.json|pin:0.11.0"
"pkg/aur/PKGBUILD|pin:0.8.1"
"pkg/aur/.SRCINFO|pin:0.8.1"
)
@@ -119,7 +119,6 @@ SURFACES=(
# AND every sha256 it pins, then move the entry to "release" above.
PIN_REASONS=(
"pkg/homebrew/Formula/codebase-memory-mcp.rb|pins 4 per-asset sha256 (darwin/linux x arm/intel); last re-pinned for v0.10.3"
- "pkg/scoop/codebase-memory-mcp.json|pins 2 per-asset sha256 (Windows amd64 + arm64 zip); last re-pinned for v0.11.0"
"pkg/aur/PKGBUILD|pins sha256sums_x86_64 + sha256sums_aarch64; last re-pinned for v0.8.1"
"pkg/aur/.SRCINFO|generated from PKGBUILD, so it must move with it, not before it"
)
diff --git a/tests/test_watcher_disabled.sh b/tests/test_watcher_disabled.sh
index 23d91ae74..bc6209350 100755
--- a/tests/test_watcher_disabled.sh
+++ b/tests/test_watcher_disabled.sh
@@ -39,18 +39,27 @@ esac
[[ -x "${BINARY}" ]] || { echo "missing binary: ${BINARY}" >&2; exit 2; }
command -v git >/dev/null 2>&1 || { echo "git required for fixture" >&2; exit 2; }
-work="$(mktemp -d)"
+# A private runtime directory, not only a private cache: daemon admission is
+# decided per runtime directory, so in the account-wide one a released CBM that
+# a developer has in use refuses this build ("a conflicting CBM process is
+# active") and the test could never start. With the helper's root these daemons
+# never meet a developer's real one. Its root is short enough for the socket
+# path; everything this test creates lives under it.
+# shellcheck source=../scripts/test-runtime.sh
+source "${ROOT}/scripts/test-runtime.sh"
+cbm_test_runtime_init
+work="${CBM_TEST_RUNTIME_ROOT}/work"
+mkdir "${work}"
-# Every run gets its own CBM_CACHE_DIR, and the daemon endpoint is derived from
-# it, so these daemons are private to the test and can never touch a developer's
-# real one. Retire them on any exit path regardless.
+# Every run gets its own CBM_CACHE_DIR (and so its own daemon log). Retire the
+# daemons on any exit path, then let the helper remove the root.
cleanup() {
local cache
for cache in "${work}"/cache-*; do
[[ -d "${cache}" ]] || continue
CBM_CACHE_DIR="${cache}" "${BINARY}" daemon stop >/dev/null 2>&1 || true
done
- rm -rf "${work}"
+ cbm_test_runtime_cleanup "${BINARY}"
}
trap cleanup EXIT