@@ -878,9 +878,18 @@ windows_match = re.search(
878878)
879879windows_smoke = windows_match.group(1) if windows_match else ""
880880require(bool(windows_smoke), "_smoke.yml must contain the smoke-windows job")
881+ # The staging/execution behavior lives in the canonical wrapper now; the
882+ # workflow only provisions the artifact and calls it (venue-parity contract).
883+ vm_smoke = read("test-infrastructure/vm/vm-smoke.sh")
884+ smoke_local = read("scripts/smoke-local.sh")
881885require(
882- 'scripts/smoke-test.sh "$SMOKE_DIR/codebase-memory-mcp.exe"' in windows_smoke,
883- f"Windows release smoke must execute the canonical {launcher}",
886+ 'scripts/smoke-test.sh "$SMOKE_DIR/codebase-memory-mcp.exe"' in vm_smoke,
887+ f"Windows smoke wrapper must execute the canonical {launcher}",
888+ )
889+ require(
890+ "bash test-infrastructure/vm/vm-smoke.sh" in windows_smoke
891+ and 'CBM_SMOKE_ARTIFACT_DIR="$(cygpath -u "$RUNNER_TEMP")/cbm-artifact"' in windows_smoke,
892+ "Windows release smoke must call the canonical wrapper on the extracted artifact",
884893)
885894require(
886895 launcher in windows_smoke and payload in windows_smoke,
@@ -891,25 +900,19 @@ require(
891900 any("zip" in block and launcher in block and payload in block for block in smoke_blocks),
892901 "Windows artifact-server smoke archive must contain launcher and payload",
893902)
894- windows_release_smoke_blocks = [
895- re.sub(r"\s+", " ", re.sub(r"\\\s*\n\s*", " ", block)).strip()
896- for block in smoke_blocks
897- if 'scripts/smoke-test.sh "$SMOKE_DIR/codebase-memory-mcp.exe"' in block
898- ]
899903require(
900- len(windows_release_smoke_blocks) == 1
901- and all(
902- needle in windows_release_smoke_blocks[0]
904+ all(
905+ needle in vm_smoke
903906 for needle in (
904907 'PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"',
905- 'SMOKE_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release -smoke.XXXXXX")"',
906- 'cp codebase-memory-mcp.exe codebase-memory-mcp.payload. exe "$SMOKE_DIR/ "',
907- 'CBM_CACHE_DIR="$(cygpath -m "$SMOKE_DIR/cache")" '
908- 'SMOKE_TEMP_ROOT ="$SMOKE_DIR" '
909- 'scripts/smoke-test.sh "$SMOKE_DIR/codebase-memory-mcp.exe "',
908+ 'SMOKE_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-vm -smoke.XXXXXX")"',
909+ 'cp "$LAUNCHER_SRC" "$SMOKE_DIR/ codebase-memory-mcp.exe"',
910+ 'cp "$PAYLOAD_SRC" "$SMOKE_DIR/codebase-memory-mcp.payload.exe"',
911+ 'CBM_CACHE_DIR ="$(cygpath -m "$ SMOKE_DIR/cache")"',
912+ 'SMOKE_TEMP_ROOT= "$SMOKE_DIR"',
910913 )
911914 ),
912- "Windows release smoke must keep every launcher fixture beneath the current account profile",
915+ "Windows smoke wrapper must keep every launcher fixture beneath the current account profile",
913916)
914917windows_release_version_blocks = [
915918 re.sub(r"\s+", " ", re.sub(r"\\\s*\n\s*", " ", block)).strip()
@@ -922,16 +925,31 @@ require(
922925 needle in windows_release_version_blocks[0]
923926 for needle in (
924927 'PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"',
925- 'cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$LAUNCH_DIR/"',
928+ 'cp "$ARTIFACT_DIR/ codebase-memory-mcp.exe" "$ARTIFACT_DIR/ codebase-memory-mcp.payload.exe" "$LAUNCH_DIR/"',
926929 '"$LAUNCH_DIR/codebase-memory-mcp.payload.exe" --version',
927930 '"$LAUNCH_DIR/codebase-memory-mcp.exe" --version',
928931 )
929932 ),
930933 "Windows release version checks must execute the pair beneath the current account profile",
931934)
935+ # RUNNER_TEMP is legitimate ONLY for artifact provisioning/scanning; every
936+ # launcher fixture and execution must stay beneath the account profile.
937+ runner_temp_allowed = (
938+ re.compile(r'ARTIFACT_DIR="\$\(cygpath -u "\$RUNNER_TEMP"\)/cbm-artifact"'),
939+ re.compile(r'Join-Path \$env:RUNNER_TEMP "cbm-artifact"'),
940+ )
941+ runner_temp_lines = [
942+ line.strip() for line in windows_smoke.splitlines() if "RUNNER_TEMP" in line
943+ ]
932944require(
933- "$RUNNER_TEMP" not in windows_smoke,
934- "Windows release smoke must not treat GitHub's shared RUNNER_TEMP ancestry as private",
945+ bool(runner_temp_lines)
946+ and all(
947+ any(pattern.search(line) for pattern in runner_temp_allowed)
948+ for line in runner_temp_lines
949+ )
950+ and 'mktemp -d "$RUNNER_TEMP' not in windows_smoke
951+ and re.search(r'"\$RUNNER_TEMP[^"\n]*\.exe"', windows_smoke) is None,
952+ "Windows release smoke may use RUNNER_TEMP only to provision/scan the artifact, never as a launcher root",
935953)
936954windows_release_security_blocks = [
937955 re.sub(r"\s+", " ", re.sub(r"\\\s*\n\s*", " ", block)).strip()
@@ -945,7 +963,7 @@ require(
945963 for needle in (
946964 'PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"',
947965 'SECURITY_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-security.XXXXXX")"',
948- 'cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$SECURITY_DIR/"',
966+ 'cp "$ARTIFACT_DIR/ codebase-memory-mcp.exe" "$ARTIFACT_DIR/ codebase-memory-mcp.payload.exe" "$SECURITY_DIR/"',
949967 'TMPDIR="$SECURITY_DIR" '
950968 'scripts/security-install.sh "$SECURITY_DIR/codebase-memory-mcp.exe"',
951969 )
@@ -990,8 +1008,11 @@ require(
9901008 "installer and raw download smoke phases must retain loopback HTTP coverage",
9911009)
9921010require(
993- smoke_workflow.count("SMOKE_UPDATE_FIXTURE_DIR: /tmp/smoke-server") == 2,
994- "Unix and Windows release smoke must identify their local update fixture",
1011+ 'SMOKE_UPDATE_FIXTURE_DIR="$FIXTURE_DIR"' in vm_smoke
1012+ and 'SMOKE_UPDATE_FIXTURE_DIR="$FIXTURE_DIR"' in smoke_local
1013+ and "scripts/smoke-local.sh" in smoke_workflow
1014+ and smoke_workflow.count("CBM_SMOKE_ARTIFACT_DIR") >= 2,
1015+ "Unix and Windows release smoke must identify their local update fixture via the canonical wrappers",
9951016)
9961017
9971018cli_source = read("src/cli/cli.c")
0 commit comments