Skip to content

Commit 0a40fe8

Browse files
committed
feat(ci): local-remote parity lanes — artifact-flow smoke, glibc floor, Defender-ON everywhere
Closes the closable local-vs-remote venue gaps so that, outside arch legs / YAML glue / release plumbing, every local red is a remote red and vice versa on shared legs: - scripts/package-release.sh: THE canonical archive step (names + five-file Windows bundle layout defined once); _build.yml's eight inline archive blocks become calls to it. - scripts/ci/smoke-artifact.sh: the artifact-flow smoke lane — build, package, extract, then the canonical wrapper in artifact mode; wired as run.sh smoke-artifact (compose service), win.sh smoke-artifact, and directly runnable on macOS. Archive-layout bugs now surface locally instead of in a release dry run. - glibc-floor leg (Dockerfile.glibc22 + compose + run.sh): portable binary smokes on ubuntu-22.04/glibc 2.35; the dynamic binary must refuse there (2.38+ floor by design). - Defender-ON parity (user directive): scripts/ci/ensure-defender.ps1 enables + VERIFIES real-time protection, fail-closed; runs in every Windows CI job (_test x2, _soak x3, _smoke, pr.yml) AND in the VM preflight; _smoke.yml's scan engine-failure soft-skip becomes a red gate. Expected cost: slower Windows jobs (AV scanning during install/build/test I/O); the next dry run proves the runner side. - Contracts: launcher-bundle five-file check retargeted onto package-release.sh + per-archive canonical-call association; venue-parity contract requires the new lanes, counts one ensure-defender step per Windows job, adds --help probes for the new entries. Extended contract fails on the pre-change tree (verified: 20 violations on HEAD). - VM README: ephemerality/Defender posture documented — utmctl has no snapshot verb, so per-run revert stays a manual qcow2 option; the sweep preflight remains the standing mechanism. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent afe38ab commit 0a40fe8

15 files changed

Lines changed: 552 additions & 85 deletions

‎.github/workflows/_build.yml‎

Lines changed: 20 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,10 @@ jobs:
7979
if: startsWith(matrix.os, 'macos')
8080
run: codesign --sign - --force build/c/codebase-memory-mcp
8181

82-
- name: Archive standard binary
83-
env:
84-
GOOS: ${{ matrix.goos }}
85-
GOARCH: ${{ matrix.goarch }}
86-
run: |
87-
cp LICENSE install.sh build/c/
88-
scripts/gen-third-party-notices.sh build/c/THIRD_PARTY_NOTICES.md
89-
tar -czf "codebase-memory-mcp-${GOOS}-${GOARCH}.tar.gz" \
90-
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
82+
# Archive layout/name live in the ONE canonical script the local
83+
# artifact-flow smoke lane also runs (venue-parity contract).
84+
- name: Archive standard binary (canonical package-release.sh)
85+
run: scripts/package-release.sh ${{ matrix.goos }} ${{ matrix.goarch }}
9186

9287
- name: Attest standard binary provenance
9388
if: ${{ inputs.attest }}
@@ -115,15 +110,8 @@ jobs:
115110
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
116111
run: scripts/security-ui.sh
117112

118-
- name: Archive UI binary
119-
env:
120-
GOOS: ${{ matrix.goos }}
121-
GOARCH: ${{ matrix.goarch }}
122-
run: |
123-
cp LICENSE install.sh build/c/
124-
scripts/gen-third-party-notices.sh build/c/THIRD_PARTY_NOTICES.md
125-
tar -czf "codebase-memory-mcp-ui-${GOOS}-${GOARCH}.tar.gz" \
126-
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
113+
- name: Archive UI binary (canonical package-release.sh)
114+
run: scripts/package-release.sh ${{ matrix.goos }} ${{ matrix.goarch }} --variant ui
127115

128116
- name: Attest UI binary provenance
129117
if: ${{ inputs.attest }}
@@ -167,18 +155,11 @@ jobs:
167155
scripts/build.sh CC=clang CXX=clang++
168156
fi
169157
170-
- name: Archive standard binary
158+
# Archive layout/name live in the ONE canonical script the local
159+
# artifact-flow smoke lane also runs (venue-parity contract).
160+
- name: Archive standard binary (canonical package-release.sh)
171161
shell: msys2 {0}
172-
run: |
173-
make -f Makefile.cbm build/c/codebase-memory-mcp-launcher.exe CC=clang CXX=clang++
174-
PAYLOAD=build/c/codebase-memory-mcp
175-
[ -f "${PAYLOAD}.exe" ] && PAYLOAD="${PAYLOAD}.exe"
176-
cp build/c/codebase-memory-mcp-launcher.exe codebase-memory-mcp.exe
177-
cp "$PAYLOAD" codebase-memory-mcp.payload.exe
178-
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
179-
zip codebase-memory-mcp-windows-amd64.zip \
180-
codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
181-
LICENSE install.ps1 THIRD_PARTY_NOTICES.md
162+
run: scripts/package-release.sh windows amd64 CC=clang CXX=clang++
182163

183164
- name: Attest standard binary provenance
184165
if: ${{ inputs.attest }}
@@ -197,18 +178,9 @@ jobs:
197178
scripts/build.sh --with-ui CC=clang CXX=clang++
198179
fi
199180
200-
- name: Archive UI binary
181+
- name: Archive UI binary (canonical package-release.sh)
201182
shell: msys2 {0}
202-
run: |
203-
make -f Makefile.cbm build/c/codebase-memory-mcp-launcher.exe CC=clang CXX=clang++
204-
PAYLOAD=build/c/codebase-memory-mcp
205-
[ -f "${PAYLOAD}.exe" ] && PAYLOAD="${PAYLOAD}.exe"
206-
cp build/c/codebase-memory-mcp-launcher.exe codebase-memory-mcp.exe
207-
cp "$PAYLOAD" codebase-memory-mcp.payload.exe
208-
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
209-
zip codebase-memory-mcp-ui-windows-amd64.zip \
210-
codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
211-
LICENSE install.ps1 THIRD_PARTY_NOTICES.md
183+
run: scripts/package-release.sh windows amd64 --variant ui CC=clang CXX=clang++
212184

213185
- name: Attest UI binary provenance
214186
if: ${{ inputs.attest }}
@@ -256,18 +228,9 @@ jobs:
256228
scripts/build.sh CC=clang CXX=clang++
257229
fi
258230
259-
- name: Archive standard binary
231+
- name: Archive standard binary (canonical package-release.sh)
260232
shell: msys2 {0}
261-
run: |
262-
make -f Makefile.cbm build/c/codebase-memory-mcp-launcher.exe CC=clang CXX=clang++
263-
PAYLOAD=build/c/codebase-memory-mcp
264-
[ -f "${PAYLOAD}.exe" ] && PAYLOAD="${PAYLOAD}.exe"
265-
cp build/c/codebase-memory-mcp-launcher.exe codebase-memory-mcp.exe
266-
cp "$PAYLOAD" codebase-memory-mcp.payload.exe
267-
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
268-
zip codebase-memory-mcp-windows-arm64.zip \
269-
codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
270-
LICENSE install.ps1 THIRD_PARTY_NOTICES.md
233+
run: scripts/package-release.sh windows arm64 CC=clang CXX=clang++
271234

272235
- name: Attest standard binary provenance
273236
if: ${{ inputs.attest }}
@@ -286,18 +249,9 @@ jobs:
286249
scripts/build.sh --with-ui CC=clang CXX=clang++
287250
fi
288251
289-
- name: Archive UI binary
252+
- name: Archive UI binary (canonical package-release.sh)
290253
shell: msys2 {0}
291-
run: |
292-
make -f Makefile.cbm build/c/codebase-memory-mcp-launcher.exe CC=clang CXX=clang++
293-
PAYLOAD=build/c/codebase-memory-mcp
294-
[ -f "${PAYLOAD}.exe" ] && PAYLOAD="${PAYLOAD}.exe"
295-
cp build/c/codebase-memory-mcp-launcher.exe codebase-memory-mcp.exe
296-
cp "$PAYLOAD" codebase-memory-mcp.payload.exe
297-
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
298-
zip codebase-memory-mcp-ui-windows-arm64.zip \
299-
codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
300-
LICENSE install.ps1 THIRD_PARTY_NOTICES.md
254+
run: scripts/package-release.sh windows arm64 --variant ui CC=clang CXX=clang++
301255

302256
- name: Attest UI binary provenance
303257
if: ${{ inputs.attest }}
@@ -348,14 +302,8 @@ jobs:
348302
file build/c/codebase-memory-mcp
349303
ldd build/c/codebase-memory-mcp 2>&1 | grep -q "not a dynamic executable" || ldd build/c/codebase-memory-mcp 2>&1 | grep -q "statically linked"
350304
351-
- name: Archive standard binary
352-
env:
353-
ARCH: ${{ matrix.arch }}
354-
run: |
355-
cp LICENSE install.sh build/c/
356-
scripts/gen-third-party-notices.sh build/c/THIRD_PARTY_NOTICES.md
357-
tar -czf "codebase-memory-mcp-linux-${ARCH}-portable.tar.gz" \
358-
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
305+
- name: Archive standard binary (canonical package-release.sh)
306+
run: scripts/package-release.sh linux ${{ matrix.arch }}-portable
359307

360308
- name: Attest standard binary provenance
361309
if: ${{ inputs.attest }}
@@ -373,14 +321,8 @@ jobs:
373321
scripts/build.sh --with-ui CC=gcc CXX=g++ STATIC=1
374322
fi
375323
376-
- name: Archive UI binary
377-
env:
378-
ARCH: ${{ matrix.arch }}
379-
run: |
380-
cp LICENSE install.sh build/c/
381-
scripts/gen-third-party-notices.sh build/c/THIRD_PARTY_NOTICES.md
382-
tar -czf "codebase-memory-mcp-ui-linux-${ARCH}-portable.tar.gz" \
383-
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
324+
- name: Archive UI binary (canonical package-release.sh)
325+
run: scripts/package-release.sh linux ${{ matrix.arch }}-portable --variant ui
384326

385327
- name: Attest UI binary provenance
386328
if: ${{ inputs.attest }}

‎.github/workflows/_smoke.yml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ jobs:
172172
steps:
173173
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
174174

175+
- name: Ensure Windows Defender is active (venue parity)
176+
shell: pwsh
177+
run: scripts/ci/ensure-defender.ps1
178+
175179
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
176180
with:
177181
msystem: ${{ matrix.arch == 'arm64' && 'CLANGARM64' || 'CLANG64' }}
@@ -254,7 +258,9 @@ jobs:
254258
if ($code -eq 2) {
255259
Write-Host "BLOCKED: Windows Defender flagged $binary!"; exit 1
256260
} elseif ($code -ne 0) {
257-
Write-Host "::warning::Windows Defender scan could not run for $binary (exit $code) - skipping AV gate on this runner"
261+
# ensure-defender gates this job earlier, so the engine MUST be
262+
# available here: an engine failure is a red gate, never a skip.
263+
Write-Host "BLOCKED: Defender scan engine could not run for $binary (exit $code) - Defender-ON parity violated"; exit 1
258264
} else {
259265
Write-Host "=== Windows Defender: $binary clean ==="
260266
}

‎.github/workflows/_soak.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ jobs:
9292
timeout-minutes: 560
9393
steps:
9494
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
95+
96+
- name: Ensure Windows Defender is active (venue parity)
97+
shell: pwsh
98+
run: scripts/ci/ensure-defender.ps1
9599
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
96100
with:
97101
msystem: CLANG64
@@ -148,6 +152,10 @@ jobs:
148152
timeout-minutes: 560
149153
steps:
150154
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
155+
156+
- name: Ensure Windows Defender is active (venue parity)
157+
shell: pwsh
158+
run: scripts/ci/ensure-defender.ps1
151159
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
152160
with:
153161
msystem: CLANGARM64
@@ -262,6 +270,10 @@ jobs:
262270
timeout-minutes: 240
263271
steps:
264272
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
273+
274+
- name: Ensure Windows Defender is active (venue parity)
275+
shell: pwsh
276+
run: scripts/ci/ensure-defender.ps1
265277
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
266278
with:
267279
msystem: CLANG64

‎.github/workflows/_test.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,12 @@ jobs:
247247
steps:
248248
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
249249

250+
# Defender parity: every Windows venue (local VM and runner alike) tests
251+
# with real-time protection ACTIVE — enabled + verified, never skipped.
252+
- name: Ensure Windows Defender is active (venue parity)
253+
shell: pwsh
254+
run: scripts/ci/ensure-defender.ps1
255+
250256
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
251257
with:
252258
msystem: ${{ matrix.msystem }}
@@ -375,6 +381,10 @@ jobs:
375381
steps:
376382
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
377383

384+
- name: Ensure Windows Defender is active (venue parity)
385+
shell: pwsh
386+
run: scripts/ci/ensure-defender.ps1
387+
378388
- uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2
379389
with:
380390
msystem: CLANG64

‎.github/workflows/pr.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ jobs:
8484
steps:
8585
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
8686

87+
- name: Ensure Windows Defender is active (venue parity)
88+
if: matrix.os == 'windows-latest'
89+
shell: pwsh
90+
run: scripts/ci/ensure-defender.ps1
91+
8792
- name: Install deps (Ubuntu)
8893
if: matrix.os == 'ubuntu-latest'
8994
run: sudo apt-get update && sudo apt-get install -y zlib1g-dev ccache

‎scripts/ci/ensure-defender.ps1‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# ensure-defender.ps1 — Windows Defender real-time protection must be ACTIVE
2+
# on every Windows venue: the local test VM and every GitHub Windows runner
3+
# alike. The AV interaction surface (file locks on fresh binaries, scan-on-
4+
# first-execute latency, quarantine behavior) is part of what the Windows legs
5+
# test; a venue with Defender off is testing a different operating system.
6+
#
7+
# GitHub's runner images ship with Defender disabled, so this script ENABLES
8+
# it, then VERIFIES it is actually running — and fails closed if it cannot be
9+
# made active. No silent skip: a leg that cannot get Defender on must go red,
10+
# not quietly measure the wrong environment. (Same doctrine as the smoke
11+
# no-skip rules: a gate that can be skipped is not a gate.)
12+
#
13+
# Canonical entry: local VM preflight (win.sh) and the Windows CI jobs all run
14+
# THIS file — venue parity by construction.
15+
16+
$ErrorActionPreference = 'Stop'
17+
18+
function Try-Step {
19+
param([string]$What, [scriptblock]$Action)
20+
try {
21+
& $Action
22+
Write-Host "ensure-defender: $What - ok"
23+
} catch {
24+
# Individual enable steps may legitimately no-op (already enabled,
25+
# service already running); only the final verification gates.
26+
Write-Host "ensure-defender: $What - $($_.Exception.Message)"
27+
}
28+
}
29+
30+
Try-Step "WinDefend service startup type" {
31+
Set-Service -Name WinDefend -StartupType Automatic
32+
}
33+
Try-Step "WinDefend service start" {
34+
Start-Service -Name WinDefend
35+
}
36+
Try-Step "enable real-time monitoring" {
37+
Set-MpPreference -DisableRealtimeMonitoring $false
38+
}
39+
40+
$status = $null
41+
try {
42+
$status = Get-MpComputerStatus
43+
} catch {
44+
Write-Host "ensure-defender: FAIL - Defender engine unavailable: $($_.Exception.Message)"
45+
exit 1
46+
}
47+
48+
if (-not $status.AntivirusEnabled) {
49+
Write-Host "ensure-defender: FAIL - antivirus engine is not enabled on this venue"
50+
exit 1
51+
}
52+
if (-not $status.RealTimeProtectionEnabled) {
53+
Write-Host "ensure-defender: FAIL - real-time protection is OFF and could not be enabled"
54+
exit 1
55+
}
56+
57+
Write-Host ("=== ensure-defender: ACTIVE (engine {0}, signatures {1}, RTP on) ===" -f `
58+
$status.AMEngineVersion, $status.AntivirusSignatureVersion)
59+
exit 0

0 commit comments

Comments
 (0)