Skip to content

Commit 23e4fb0

Browse files
committed
fix(ci): scan extracted UI release files only
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 1ad53bb commit 23e4fb0

17 files changed

Lines changed: 204 additions & 288 deletions

‎.github/workflows/_build.yml‎

Lines changed: 14 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ on:
1212
description: 'Generate build provenance attestations for release artifacts'
1313
type: boolean
1414
default: false
15-
ui_only:
16-
description: 'Build only the UI runtime archives'
17-
type: boolean
18-
default: false
19-
2015
permissions:
2116
contents: read
2217
id-token: write
@@ -67,34 +62,7 @@ jobs:
6762
with:
6863
node-version: "22"
6964

70-
- name: Build standard binary
71-
if: ${{ !inputs.ui_only }}
72-
env:
73-
VERSION: ${{ inputs.version }}
74-
CC: ${{ matrix.cc }}
75-
CXX: ${{ matrix.cxx }}
76-
run: |
77-
if [ -n "$VERSION" ]; then
78-
scripts/build.sh --version "$VERSION" "CC=$CC" "CXX=$CXX"
79-
else
80-
scripts/build.sh "CC=$CC" "CXX=$CXX"
81-
fi
82-
83-
- name: Ad-hoc sign macOS standard binary
84-
if: ${{ !inputs.ui_only && startsWith(matrix.os, 'macos') }}
85-
run: codesign --sign - --force build/c/codebase-memory-mcp
86-
87-
- name: Archive standard binary (canonical package-release.sh)
88-
if: ${{ !inputs.ui_only }}
89-
run: scripts/package-release.sh ${{ matrix.goos }} ${{ matrix.goarch }}
90-
91-
- name: Attest standard binary provenance
92-
if: ${{ inputs.attest && !inputs.ui_only }}
93-
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
94-
with:
95-
subject-path: codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
96-
97-
- name: Build UI binary
65+
- name: Build release binary with UI
9866
env:
9967
VERSION: ${{ inputs.version }}
10068
CC: ${{ matrix.cc }}
@@ -106,7 +74,7 @@ jobs:
10674
scripts/build.sh --with-ui "CC=$CC" "CXX=$CXX"
10775
fi
10876
109-
- name: Ad-hoc sign macOS UI binary
77+
- name: Ad-hoc sign macOS release binary
11078
if: startsWith(matrix.os, 'macos')
11179
run: codesign --sign - --force build/c/codebase-memory-mcp
11280

@@ -116,10 +84,10 @@ jobs:
11684

11785
# Archive layout/name live in the ONE canonical script the local
11886
# artifact-flow smoke lane also runs (venue-parity contract).
119-
- name: Archive UI binary (canonical package-release.sh)
87+
- name: Archive release binary (canonical package-release.sh)
12088
run: scripts/package-release.sh ${{ matrix.goos }} ${{ matrix.goarch }} --variant ui
12189

122-
- name: Attest UI binary provenance
90+
- name: Attest release binary provenance
12391
if: ${{ inputs.attest }}
12492
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
12593
with:
@@ -150,30 +118,7 @@ jobs:
150118
with:
151119
node-version: "22"
152120

153-
- name: Build standard binary
154-
if: ${{ !inputs.ui_only }}
155-
shell: msys2 {0}
156-
env:
157-
VERSION: ${{ inputs.version }}
158-
run: |
159-
if [ -n "$VERSION" ]; then
160-
scripts/build.sh --version "$VERSION" CC=clang CXX=clang++
161-
else
162-
scripts/build.sh CC=clang CXX=clang++
163-
fi
164-
165-
- name: Archive standard binary (canonical package-release.sh)
166-
if: ${{ !inputs.ui_only }}
167-
shell: msys2 {0}
168-
run: scripts/package-release.sh windows amd64 CC=clang CXX=clang++
169-
170-
- name: Attest standard binary provenance
171-
if: ${{ inputs.attest && !inputs.ui_only }}
172-
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
173-
with:
174-
subject-path: codebase-memory-mcp-windows-amd64.zip
175-
176-
- name: Build UI binary
121+
- name: Build release binary with UI
177122
shell: msys2 {0}
178123
env:
179124
VERSION: ${{ inputs.version }}
@@ -186,11 +131,11 @@ jobs:
186131
187132
# Archive layout/name live in the ONE canonical script the local
188133
# artifact-flow smoke lane also runs (venue-parity contract).
189-
- name: Archive UI binary (canonical package-release.sh)
134+
- name: Archive release binary (canonical package-release.sh)
190135
shell: msys2 {0}
191136
run: scripts/package-release.sh windows amd64 --variant ui CC=clang CXX=clang++
192137

193-
- name: Attest UI binary provenance
138+
- name: Attest release binary provenance
194139
if: ${{ inputs.attest }}
195140
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
196141
with:
@@ -225,30 +170,7 @@ jobs:
225170
with:
226171
node-version: "22"
227172

228-
- name: Build standard binary
229-
if: ${{ !inputs.ui_only }}
230-
shell: msys2 {0}
231-
env:
232-
VERSION: ${{ inputs.version }}
233-
run: |
234-
if [ -n "$VERSION" ]; then
235-
scripts/build.sh --version "$VERSION" CC=clang CXX=clang++
236-
else
237-
scripts/build.sh CC=clang CXX=clang++
238-
fi
239-
240-
- name: Archive standard binary (canonical package-release.sh)
241-
if: ${{ !inputs.ui_only }}
242-
shell: msys2 {0}
243-
run: scripts/package-release.sh windows arm64 CC=clang CXX=clang++
244-
245-
- name: Attest standard binary provenance
246-
if: ${{ inputs.attest && !inputs.ui_only }}
247-
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
248-
with:
249-
subject-path: codebase-memory-mcp-windows-arm64.zip
250-
251-
- name: Build UI binary
173+
- name: Build release binary with UI
252174
shell: msys2 {0}
253175
env:
254176
VERSION: ${{ inputs.version }}
@@ -259,11 +181,11 @@ jobs:
259181
scripts/build.sh --with-ui CC=clang CXX=clang++
260182
fi
261183
262-
- name: Archive UI binary (canonical package-release.sh)
184+
- name: Archive release binary (canonical package-release.sh)
263185
shell: msys2 {0}
264186
run: scripts/package-release.sh windows arm64 --variant ui CC=clang CXX=clang++
265187

266-
- name: Attest UI binary provenance
188+
- name: Attest release binary provenance
267189
if: ${{ inputs.attest }}
268190
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
269191
with:
@@ -297,34 +219,7 @@ jobs:
297219
with:
298220
node-version: "22"
299221

300-
- name: Build standard binary (static)
301-
if: ${{ !inputs.ui_only }}
302-
env:
303-
VERSION: ${{ inputs.version }}
304-
run: |
305-
if [ -n "$VERSION" ]; then
306-
scripts/build.sh --version "$VERSION" CC=gcc CXX=g++ STATIC=1
307-
else
308-
scripts/build.sh CC=gcc CXX=g++ STATIC=1
309-
fi
310-
311-
- name: Verify standard static linking
312-
if: ${{ !inputs.ui_only }}
313-
run: |
314-
file build/c/codebase-memory-mcp
315-
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"
316-
317-
- name: Archive standard binary (canonical package-release.sh)
318-
if: ${{ !inputs.ui_only }}
319-
run: scripts/package-release.sh linux ${{ matrix.arch }}-portable
320-
321-
- name: Attest standard binary provenance
322-
if: ${{ inputs.attest && !inputs.ui_only }}
323-
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
324-
with:
325-
subject-path: codebase-memory-mcp-linux-${{ matrix.arch }}-portable.tar.gz
326-
327-
- name: Build UI binary (static)
222+
- name: Build release binary with UI (static)
328223
env:
329224
VERSION: ${{ inputs.version }}
330225
run: |
@@ -334,15 +229,15 @@ jobs:
334229
scripts/build.sh --with-ui CC=gcc CXX=g++ STATIC=1
335230
fi
336231
337-
- name: Verify UI static linking
232+
- name: Verify release static linking
338233
run: |
339234
file build/c/codebase-memory-mcp
340235
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"
341236
342-
- name: Archive UI binary (canonical package-release.sh)
237+
- name: Archive release binary (canonical package-release.sh)
343238
run: scripts/package-release.sh linux ${{ matrix.arch }}-portable --variant ui
344239

345-
- name: Attest UI binary provenance
240+
- name: Attest release binary provenance
346241
if: ${{ inputs.attest }}
347242
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
348243
with:

‎.github/workflows/_smoke.yml‎

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ on:
88
description: 'Smoke the shipped binaries on the broad platform matrix (extra OS versions) instead of the core set'
99
type: boolean
1010
default: false
11-
ui_only:
12-
description: 'Smoke only the UI runtime archives'
13-
type: boolean
14-
default: false
15-
1611
permissions:
1712
contents: read
1813

@@ -34,7 +29,6 @@ jobs:
3429
id: set
3530
env:
3631
BROAD: ${{ inputs.broad_platforms }}
37-
UI_ONLY: ${{ inputs.ui_only }}
3832
run: |
3933
CORE_UNIX='[
4034
{"os":"ubuntu-latest","goos":"linux","goarch":"amd64"},
@@ -77,14 +71,9 @@ jobs:
7771
WIN=$(jq -cn --argjson a "$CORE_WIN" '$a')
7872
PORTABLE=$(jq -cn --argjson a "$CORE_PORTABLE" '$a')
7973
fi
80-
# Keep the variant dimension explicit because the smoke wrappers use it
81-
# to require and validate the UI pack. VT-focused dry runs select only
82-
# UI; release compatibility retains both variants until migration.
83-
if [ "$UI_ONLY" = "true" ]; then
84-
VARIANTS='["ui"]'
85-
else
86-
VARIANTS='["standard","ui"]'
87-
fi
74+
# Keep the UI marker explicit because the smoke wrappers use it to
75+
# require and validate the shipped content-addressed frontend pack.
76+
VARIANTS='["ui"]'
8877
UNIX_M=$(jq -cn --argjson a "$UNIX" --argjson v "$VARIANTS" '{include:[$a[] as $o | $v[] as $t | ($o + {variant:$t})]}')
8978
WIN_M=$(jq -cn --argjson a "$WIN" --argjson v "$VARIANTS" '{include:[$a[] as $o | $v[] as $t | ($o + {variant:$t})]}')
9079
PORTABLE_M=$(jq -cn --argjson a "$PORTABLE" --argjson v "$VARIANTS" '{include:[$a[] as $o | $v[] as $t | ($o + {variant:$t})]}')
@@ -140,7 +129,7 @@ jobs:
140129
scripts/security-network.sh "$BIN"
141130
142131
- name: MCP robustness test (selected linux-amd64 runtime)
143-
if: matrix.goos == 'linux' && matrix.goarch == 'amd64' && (inputs.ui_only || matrix.variant == 'standard')
132+
if: matrix.goos == 'linux' && matrix.goarch == 'amd64'
144133
run: |
145134
BIN="$RUNNER_TEMP/cbm-artifact/codebase-memory-mcp"
146135
scripts/security-fuzz.sh "$BIN"

‎.github/workflows/dry-run.yml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ jobs:
9191
uses: ./.github/workflows/_build.yml
9292
with:
9393
attest: false
94-
ui_only: true
9594

9695
# ── Smoke test every binary ────────────────────────────────────
9796
# Run unless builds were skipped or a build leg FAILED. Every build leg
@@ -103,7 +102,6 @@ jobs:
103102
uses: ./.github/workflows/_smoke.yml
104103
with:
105104
broad_platforms: true
106-
ui_only: true
107105

108106
# ── Soak tests (optional, parallel with smoke) ────────────────
109107
soak:
@@ -148,8 +146,8 @@ jobs:
148146
merge-multiple: true
149147
path: ${{ runner.temp }}/release-archives
150148

151-
# Same extraction the release verify job performs, so the bytes handed to
152-
# VirusTotal here are the bytes a user would download and run.
149+
# Same extraction the release verify job performs. VirusTotal receives
150+
# only extracted files and unpacked UI assets, never .tar.gz/.zip containers.
153151
- name: Extract archive artifacts
154152
run: |
155153
scripts/ci/extract-release-archives.sh "$RUNNER_TEMP/release-archives" binaries \
@@ -167,7 +165,7 @@ jobs:
167165
files: binaries/objects/*
168166
request_rate: 4
169167

170-
# Same ZERO-tolerance gate as the release. Every artifact must arrive
168+
# Same ZERO-tolerance gate as the release. Every extracted object must arrive
171169
# naturally clean; any malicious or suspicious verdict fails this run.
172170
- name: Wait for VirusTotal results
173171
env:

‎.github/workflows/release.yml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,15 +216,16 @@ jobs:
216216
mkdir -p "$ARCHIVE_DIR" binaries
217217
gh release download "$VERSION" --dir "$ARCHIVE_DIR" --repo "$GITHUB_REPOSITORY" --pattern '*.tar.gz' --pattern '*.zip'
218218
scripts/ci/extract-release-archives.sh "$ARCHIVE_DIR" binaries \
219-
--expect-archives=16 \
220-
--expect-binaries=16 \
219+
--archive-scope=ui \
220+
--expect-archives=8 \
221+
--expect-binaries=8 \
221222
--expect-packs=8 \
222-
--expect-runtime-files=64
223+
--expect-runtime-files=32
223224
224-
- name: Security audits on all unique release objects
225+
- name: Security audits on all unique extracted release objects
225226
run: |
226-
# Audit every distinct archive/member/UI-asset byte sequence. The
227-
# associations manifest preserves every shipped archive location.
227+
# Audit every distinct extracted member/UI-asset byte sequence. The
228+
# associations manifest retains each source archive's SHA-256.
228229
# security-strings.sh detects file type and applies binary-only
229230
# rules (URL allowlist, dangerous-command detection) only to real
230231
# binaries; for shell scripts it still runs credential and base64
@@ -243,7 +244,7 @@ jobs:
243244
files: binaries/objects/*
244245
request_rate: 4
245246

246-
# ZERO tolerance: every artifact must arrive naturally clean. Any
247+
# ZERO tolerance: every extracted object must arrive naturally clean. Any
247248
# malicious or suspicious verdict blocks the release with no exception.
248249
- name: Wait for VirusTotal results
249250
env:
@@ -275,7 +276,7 @@ jobs:
275276
VT_RESULTS_PATH: binaries/vt-results.tsv
276277
run: bash scripts/ci/publish-vt-evidence.sh
277278

278-
# Renders the exact scan scope plus archive SHA-256/engine evidence. It
279+
# Renders extracted-file scan results plus archive SHA-256 provenance. It
279280
# runs only after the exact-set zero-tolerance gate passed.
280281
- name: Append VirusTotal scan links to release notes
281282
env:

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-si
2020

2121
> **Research** — The design and benchmarks behind this project are described in the preprint [*Codebase-Memory: Tree-Sitter-Based Knowledge Graphs for LLM Code Exploration via MCP*](https://arxiv.org/abs/2603.27277) (arXiv:2603.27277). Evaluated across 31 real-world repositories: 83% answer quality, 10× fewer tokens, 2.1× fewer tool calls vs. file-by-file exploration.
2222
23-
> **Security & Trust** — This tool reads your codebase and writes to your agent configuration files. That is what it is designed to do. If you prefer to audit before running, the [full source is here](https://github.com/DeusData/codebase-memory-mcp). Release archives are signed and checksummed; every distinct shipped archive, member, and UI-asset byte object is submitted to VirusTotal. The release notes record the measured engine count and exact 0/N result; publication requires at least 50 decisive engine results with zero malicious and zero suspicious verdicts. All processing happens 100% locally; your code never leaves your machine. Found a security issue? We want to know — see [SECURITY.md](SECURITY.md). Security is Priority #1 for us.
23+
> **Security & Trust** — This tool reads your codebase and writes to your agent configuration files. That is what it is designed to do. If you prefer to audit before running, the [full source is here](https://github.com/DeusData/codebase-memory-mcp). Release archives are signed and checksummed; every distinct extracted member and unpacked UI asset is submitted to VirusTotal, while the downloadable `.tar.gz`/`.zip` containers themselves are not. The release notes record the measured engine count and exact 0/N result; publication requires at least 50 decisive engine results with zero malicious and zero suspicious verdicts. All processing happens 100% locally; your code never leaves your machine. Found a security issue? We want to know — see [SECURITY.md](SECURITY.md). Security is Priority #1 for us.
2424
2525
<p align="center">
2626
<img src="docs/graph-ui-screenshot.png" alt="Graph visualization UI showing the codebase-memory-mcp knowledge graph" width="800">
@@ -791,7 +791,7 @@ internal/cbm/ Vendored tree-sitter grammars (158 languages) + AST extrac
791791

792792
Every release is verified through a multi-layer pipeline before publication:
793793

794-
- **VirusTotal** — every release object is scanned (minimum 50 decisive engines; zero malicious and zero suspicious required). Release notes summarize the archive rows and link durable public association, exact-scan-set, and per-object result files containing every measured engine count and VirusTotal report URL.
794+
- **VirusTotal** — every distinct extracted release file and unpacked UI asset is scanned; downloadable `.tar.gz`/`.zip` containers are not submitted (minimum 50 decisive engines; zero malicious and zero suspicious required). Release notes retain archive SHA-256 provenance and link durable public association, exact-scan-set, and per-object result files containing every measured engine count and VirusTotal report URL.
795795
- **SLSA Level 3** — cryptographic build provenance generated by the trusted GitHub Actions build workflow; verify with `gh attestation verify <file> --repo DeusData/codebase-memory-mcp --signer-workflow DeusData/codebase-memory-mcp/.github/workflows/_build.yml`
796796
- **Sigstore cosign** — keyless signatures on all artifacts; bundles included in every release
797797
- **SHA-256 checksums** — `checksums.txt` published with every release; verified by both install scripts before extraction

‎SECURITY.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ disclosure. Research conducted under this policy is considered authorised.
9595

9696
## Security Measures
9797

98-
This project implements multiple layers of security verification. Every release archive and its extracted runtime objects must pass all checks before users can download it (draft → verify → publish flow).
98+
This project implements multiple layers of security verification. Every release archive is signed and checksummed, and every extracted runtime object must pass its applicable checks before users can download it (draft → verify → publish flow).
9999

100100
### Build-Time (CI — every commit)
101101

@@ -126,7 +126,7 @@ Releases are created as **drafts** (invisible to users) and only published after
126126
2. **Sigstore cosign signing** — keyless digital signatures verifiable by anyone
127127
3. **SBOM** — Software Bill of Materials (SPDX) listing all vendored dependencies
128128
4. **SHA-256 checksums** — published with every release
129-
5. **VirusTotal scanning** — every distinct shipped archive, member, and UI-asset byte object is scanned. Each completed analysis must contain at least 50 decisive engine results, zero malicious verdicts, and zero suspicious verdicts. Release notes summarize archive results and link durable public association, exact-scan-set, per-object-result, and evidence-checksum assets.
129+
5. **VirusTotal scanning** — every distinct extracted member and unpacked UI asset is scanned; downloadable `.tar.gz`/`.zip` containers are not submitted. Each completed analysis must contain at least 50 decisive engine results, zero malicious verdicts, and zero suspicious verdicts. Release notes retain archive SHA-256 provenance and link durable public association, exact-scan-set, per-object-result, and evidence-checksum assets.
130130
6. **OpenSSF Scorecard** — repository security health score
131131

132132
Scope of the SLSA claim: this is a build provenance claim for release

0 commit comments

Comments
 (0)