Skip to content

Commit dc7178c

Browse files
authored
Merge pull request DeusData#1139 from DeusData/feat/shared-coordination-daemon
feat: coordinate concurrent CBM sessions
2 parents 7d6cdb2 + e4400b6 commit dc7178c

192 files changed

Lines changed: 90029 additions & 3477 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/_build.yml‎

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,15 @@ jobs:
170170
- name: Archive standard binary
171171
shell: msys2 {0}
172172
run: |
173-
BIN=build/c/codebase-memory-mcp
174-
[ -f "${BIN}.exe" ] && BIN="${BIN}.exe"
175-
cp "$BIN" codebase-memory-mcp.exe
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
176178
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
177-
zip codebase-memory-mcp-windows-amd64.zip codebase-memory-mcp.exe LICENSE install.ps1 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
178182
179183
- name: Attest standard binary provenance
180184
if: ${{ inputs.attest }}
@@ -196,11 +200,15 @@ jobs:
196200
- name: Archive UI binary
197201
shell: msys2 {0}
198202
run: |
199-
BIN=build/c/codebase-memory-mcp
200-
[ -f "${BIN}.exe" ] && BIN="${BIN}.exe"
201-
cp "$BIN" codebase-memory-mcp.exe
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
202208
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
203-
zip codebase-memory-mcp-ui-windows-amd64.zip codebase-memory-mcp.exe LICENSE install.ps1 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
204212
205213
- name: Attest UI binary provenance
206214
if: ${{ inputs.attest }}
@@ -251,11 +259,15 @@ jobs:
251259
- name: Archive standard binary
252260
shell: msys2 {0}
253261
run: |
254-
BIN=build/c/codebase-memory-mcp
255-
[ -f "${BIN}.exe" ] && BIN="${BIN}.exe"
256-
cp "$BIN" codebase-memory-mcp.exe
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
257267
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
258-
zip codebase-memory-mcp-windows-arm64.zip codebase-memory-mcp.exe LICENSE install.ps1 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
259271
260272
- name: Attest standard binary provenance
261273
if: ${{ inputs.attest }}
@@ -277,11 +289,15 @@ jobs:
277289
- name: Archive UI binary
278290
shell: msys2 {0}
279291
run: |
280-
BIN=build/c/codebase-memory-mcp
281-
[ -f "${BIN}.exe" ] && BIN="${BIN}.exe"
282-
cp "$BIN" codebase-memory-mcp.exe
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
283297
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
284-
zip codebase-memory-mcp-ui-windows-arm64.zip codebase-memory-mcp.exe LICENSE install.ps1 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
285301
286302
- name: Attest UI binary provenance
287303
if: ${{ inputs.attest }}

‎.github/workflows/_smoke.yml‎

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ jobs:
139139
run: scripts/smoke-test.sh ./codebase-memory-mcp
140140
env:
141141
SMOKE_DOWNLOAD_URL: http://localhost:18080
142+
SMOKE_UPDATE_FIXTURE_DIR: /tmp/smoke-server
142143

143144
- name: Security audits
144145
run: |
@@ -210,17 +211,27 @@ jobs:
210211
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
211212
ARCH=${{ matrix.arch }}
212213
unzip -o "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip"
213-
[ -n "$SUFFIX" ] && cp "codebase-memory-mcp${SUFFIX}.exe" codebase-memory-mcp.exe || true
214+
test -s codebase-memory-mcp.exe
215+
test -s codebase-memory-mcp.payload.exe
216+
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
217+
LAUNCH_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-version.XXXXXX")"
218+
trap 'rm -rf "$LAUNCH_DIR"' EXIT
219+
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$LAUNCH_DIR/"
220+
"$LAUNCH_DIR/codebase-memory-mcp.payload.exe" --version
221+
"$LAUNCH_DIR/codebase-memory-mcp.exe" --version
214222
215223
- name: Start artifact server
216224
shell: msys2 {0}
217225
run: |
218226
mkdir -p /tmp/smoke-server
219-
cp codebase-memory-mcp.exe /tmp/smoke-server/
227+
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
228+
LICENSE install.ps1 THIRD_PARTY_NOTICES.md /tmp/smoke-server/
220229
SUFFIX=${{ matrix.variant == 'ui' && '-ui' || '' }}
221230
ARCH=${{ matrix.arch }}
222231
cd /tmp/smoke-server
223-
zip -q "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" codebase-memory-mcp.exe
232+
zip -q "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" \
233+
codebase-memory-mcp.exe codebase-memory-mcp.payload.exe \
234+
LICENSE install.ps1 THIRD_PARTY_NOTICES.md
224235
if [ -n "$SUFFIX" ]; then
225236
cp "codebase-memory-mcp${SUFFIX}-windows-${ARCH}.zip" "codebase-memory-mcp-windows-${ARCH}.zip"
226237
fi
@@ -232,35 +243,51 @@ jobs:
232243
233244
- name: Smoke test
234245
shell: msys2 {0}
235-
run: scripts/smoke-test.sh ./codebase-memory-mcp.exe
246+
run: |
247+
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
248+
SMOKE_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-smoke.XXXXXX")"
249+
trap 'rm -rf "$SMOKE_DIR"' EXIT
250+
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$SMOKE_DIR/"
251+
CBM_CACHE_DIR="$(cygpath -m "$SMOKE_DIR/cache")" \
252+
SMOKE_TEMP_ROOT="$SMOKE_DIR" \
253+
scripts/smoke-test.sh "$SMOKE_DIR/codebase-memory-mcp.exe"
236254
env:
237255
SMOKE_DOWNLOAD_URL: http://127.0.0.1:18080
256+
SMOKE_UPDATE_FIXTURE_DIR: /tmp/smoke-server
238257
SMOKE_ARCH: ${{ matrix.arch }}
239258

240259
- name: Security audits
241260
shell: msys2 {0}
242261
run: |
243262
scripts/security-strings.sh ./codebase-memory-mcp.exe
244-
scripts/security-install.sh ./codebase-memory-mcp.exe
263+
scripts/security-strings.sh ./codebase-memory-mcp.payload.exe
264+
PROFILE_ROOT="$(cygpath -u "$USERPROFILE")"
265+
SECURITY_DIR="$(mktemp -d "$PROFILE_ROOT/cbm-release-security.XXXXXX")"
266+
trap 'rm -rf "$SECURITY_DIR"' EXIT
267+
cp codebase-memory-mcp.exe codebase-memory-mcp.payload.exe "$SECURITY_DIR/"
268+
TMPDIR="$SECURITY_DIR" \
269+
scripts/security-install.sh "$SECURITY_DIR/codebase-memory-mcp.exe"
245270
246271
- name: Windows Defender scan
247272
shell: pwsh
248273
run: |
249274
& "C:\Program Files\Windows Defender\MpCmdRun.exe" -SignatureUpdate 2>$null
250-
$result = & "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "$PWD\codebase-memory-mcp.exe" -DisableRemediation
251-
$code = $LASTEXITCODE
252-
Write-Host $result
253-
# MpCmdRun -Scan exit codes: 0 = clean, 2 = threat found. Any OTHER non-zero
254-
# means the scan engine could not run at all (e.g. hr=0x800106ba: the Defender
255-
# antimalware service is unavailable on the runner) — that is NOT a detection.
256-
# Fail soft on an engine failure so a transient runner-side AV outage can't
257-
# false-fail a release; only a real detection (exit 2) hard-blocks.
258-
if ($code -eq 2) {
259-
Write-Host "BLOCKED: Windows Defender flagged binary!"; exit 1
260-
} elseif ($code -ne 0) {
261-
Write-Host "::warning::Windows Defender scan could not run (exit $code) - skipping AV gate on this runner"
262-
} else {
263-
Write-Host "=== Windows Defender: clean ==="
275+
foreach ($binary in @("codebase-memory-mcp.exe", "codebase-memory-mcp.payload.exe")) {
276+
$result = & "C:\Program Files\Windows Defender\MpCmdRun.exe" -Scan -ScanType 3 -File "$PWD\$binary" -DisableRemediation
277+
$code = $LASTEXITCODE
278+
Write-Host $result
279+
# MpCmdRun -Scan exit codes: 0 = clean, 2 = threat found. Any OTHER non-zero
280+
# means the scan engine could not run at all (e.g. hr=0x800106ba: the Defender
281+
# antimalware service is unavailable on the runner) — that is NOT a detection.
282+
# Fail soft on an engine failure so a transient runner-side AV outage can't
283+
# false-fail a release; only a real detection (exit 2) hard-blocks.
284+
if ($code -eq 2) {
285+
Write-Host "BLOCKED: Windows Defender flagged $binary!"; exit 1
286+
} elseif ($code -ne 0) {
287+
Write-Host "::warning::Windows Defender scan could not run for $binary (exit $code) - skipping AV gate on this runner"
288+
} else {
289+
Write-Host "=== Windows Defender: $binary clean ==="
290+
}
264291
}
265292
266293
smoke-linux-portable:

0 commit comments

Comments
 (0)