Skip to content

Commit 8eabe19

Browse files
committed
fix(install,daemon): unbreak npx clients, group-writable homes, and legacy updaters
Five field reports in the 24 hours after v0.10.0 all pointed at the same thing: gates that were right in principle refused real, ordinary setups, and then failed to say why. Per the consolidated strictness decision, each gate keeps the protection that matters and drops the part that was refusing legitimate users — and every refusal now names what it refused and how to proceed. **Daemon image gate: npx and every ephemeral install path (DeusData#1539, DeusData#1383).** The admission check treated "the peer's image hashes differently" and "the peer's image cannot be examined at all" as one failure. The second is what `npx codebase-memory-mcp` always produces (ephemeral cache path, unfingerprintable), so every npx-invoked client was rejected — and, because the client never reported it, agents saw a transport that closed mid-handshake with zero bytes on stdout. Reported by @wassolles with the admission path already read and the fix space mapped. An unverifiable image is now admitted: the rendezvous HELLO immediately above it has already proven semantic version, build fingerprint, and protocol/store/ feature ABI, and the image check was trading that real proof for an unavailable one. It logs daemon.client_image_unverifiable_admitted so the weaker check is never invisible. A fingerprint MISMATCH — the tamper case the gate exists for — still rejects hard. Separate test seams keep the two modes testable apart. **Client bootstrap failures are no longer silent (DeusData#1539).** An MCP client that cannot reach the daemon now emits a JSON-RPC error on stdout naming the reason, plus the same text on stderr. Previously the reason sat in bootstrap_result.message and the process exited having written nothing at all. **POSIX activation: group-writable ancestors (DeusData#1535, discussion DeusData#1526).** activation_directory_secure required no group or other write bit on the install directory AND every ancestor. WSL2 ships ~ and ~/.local at 0775, as do several distro skeletons and any site using a shared primary group, so install.sh failed for a large fraction of Linux users — reporting a policy refusal as "activation transaction I/O failed", which sent reporters after disk errors and filesystem types. Root-caused by @AmirF194 in a clean ubuntu container; @shochdoerfer and @iandol confirmed independently. World-writable ancestors are still refused (any local user could swap a path component mid-transaction). Group-writable ancestors are now warned about and admitted. The LEAF directory stays strictly owner-private — that is where the binary is published, and group write there would let another account replace the executable between validation and exec. Refusals now name the directory, its mode, and which rule refused. **The obsolete ui/standard chooser (DeusData#1538, from discussion DeusData#1526).** v0.10.0 consolidated to one archive per platform with the UI always embedded, but `update` still offered a variant choice: "ui" could only 404, and "standard" quietly WAS the UI build. Reported by @iandol upgrading 0.9.0 -> 0.10.0. The chooser, its --standard/--ui flags, and the ui- URL plumbing are removed, along with the CBM_VARIANT=ui remnant in the npm installer. Already-released 0.9.x binaries cannot be fixed retroactively, so the release workflow now publishes byte-identical ui-*-named alias assets — their updaters work again with no user action. The aliases are uploaded AFTER the VirusTotal gate: they are the same bytes as archives it already cleared, and uploading them earlier would duplicate every object in the scan set and the provenance manifest. **macOS install noise and attribution (DeusData#1537).** install.sh silenced the "No such xattr: com.apple.quarantine" line, which is what happens when a curl-downloaded archive carries no quarantine attribute — harmless, and it became the title of a bug report about an unrelated failure. The session-stop refusal now points at `daemon status` to list the client processes actually holding the daemon, instead of asserting sessions exist and leaving the reader to guess. Reported by @listepo. **Riders.** hatchling is pinned in pkg/pypi (an unpinned backend resolved fresh inside `python -m build` is what emitted Metadata-Version 2.5 and broke the v0.10.1 publish); SECURITY.md's supported-versions table moves to 0.10.x. Tests: separate seams for unverifiable vs mismatched peer images with a test per outcome; activation refusal must name directory + mode + rule; a group-writable ancestor must stage successfully. The update tests drop the flag that no longer exists. Verified against each reporter's environment shape. **Open security alerts (all three, OSSF Scorecard).** - HIGH, binary artifact: an 8.8 MB compiled Go ELF wrapper had been committed at pkg/go/codebase-memory-mcp by accident. Removed, and both it and its .exe sibling are gitignored so `go build` in that directory cannot repeat it. - HIGH, GHSA-2v37-7h3g-55p8: nanoid < 3.3.17 loops forever when a custom generator is called with size 0. It reaches us transitively (postcss -> vite), so it is pinned through the existing graph-ui overrides block rather than promoted to a direct dependency; the lockfile resolves 3.3.18. - MEDIUM, unpinned pip command: the publish step installed build/twine by version only, leaving the whole transitive graph resolved at run time. pkg/pypi/requirements-publish.txt now hash-pins the complete toolchain (316 hashes), generated on a linux/amd64 python:3.12 image so the wheels match what ubuntu-latest resolves, and the step runs pip with --require-hashes. Verified by installing from it in that same image. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 564d32c commit 8eabe19

25 files changed

Lines changed: 783 additions & 137 deletions

‎.github/workflows/release.yml‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -360,16 +360,18 @@ jobs:
360360
- name: Build PyPI distribution
361361
working-directory: pkg/pypi
362362
run: |
363-
# Pin to specific versions (typosquatting / supply-chain mitigation).
364-
# OSSF scorecard prefers --require-hashes, but that needs full
365-
# transitive deps; version pinning is the practical compromise.
363+
# Every byte of the publish toolchain is bound by hash: version pins
364+
# alone still let a compromised index serve different content, and a
365+
# bare `pip install` resolves the whole transitive graph at run time
366+
# (OSSF Scorecard pinned-dependencies). requirements-publish.txt is
367+
# generated on a linux/amd64 python:3.12 image — see its header for
368+
# the exact regeneration command.
366369
#
367-
# twine >= 7 is required: `python -m build` resolves the UNPINNED
368-
# hatchling backend fresh in its isolated env, and current hatchling
369-
# emits Metadata-Version 2.5, which twine 6.2.0 rejects as invalid
370-
# ("'2.5' is not a valid metadata version" — the v0.10.1 failure).
371-
# Verified locally: identical artifacts, 6.2.0 rejects / 7.0.0 passes.
372-
python -m pip install --upgrade 'build==1.3.0' 'twine==7.0.0'
370+
# twine must stay >= 7 and hatchling is pinned in pyproject.toml:
371+
# `python -m build` resolves its backend fresh in an isolated env, and
372+
# a hatchling emitting Metadata-Version 2.5 against twine 6.2.0 is
373+
# what broke the v0.10.1 publish.
374+
python -m pip install --require-hashes -r requirements-publish.txt
373375
python -m build
374376
twine check dist/*
375377
@@ -439,6 +441,16 @@ jobs:
439441
permissions:
440442
contents: write
441443
steps:
444+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
445+
446+
# Legacy ui-* aliases so 0.9.x updaters stop 404ing (#1538). Runs after
447+
# verify: same bytes as archives the VirusTotal gate already cleared, and
448+
# publishing earlier would duplicate the scan set and provenance manifest.
449+
- name: Publish legacy ui-* archive aliases
450+
env:
451+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
452+
run: scripts/ci/publish-legacy-aliases.sh "${{ inputs.version }}" "$GITHUB_REPOSITORY"
453+
442454
- name: Un-draft GitHub release
443455
env:
444456
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.gitignore‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,9 @@ soak-results-query-leak/
8080
# scripts/soak-test.sh stay tracked.
8181
/soak*/
8282
/memlab-*
83+
84+
# Compiled Go wrapper binary. `go build` in pkg/go drops the executable beside
85+
# its sources; one was committed by accident (8.8 MB ELF, flagged by OSSF
86+
# Scorecard as a binary artifact in source). Source only, never the build.
87+
/pkg/go/codebase-memory-mcp
88+
/pkg/go/codebase-memory-mcp.exe

‎SECURITY.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ for Linux ELF binaries, so it is not a complete answer either.
288288

289289
| Version | Supported |
290290
|---------|-----------|
291-
| Latest `0.9.x` | Yes — security fixes land in the newest release |
292-
| < 0.9 | No — please upgrade to the latest release |
291+
| Latest `0.10.x` | Yes — security fixes land in the newest release |
292+
| < 0.10 | No — please upgrade to the latest release |
293293

294294
Only the latest release is supported. Security fixes are shipped in a new
295295
patched release rather than backported to older versions; upgrading to the

‎graph-ui/package-lock.json‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎graph-ui/package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
},
4242
"overrides": {
4343
"form-data": ">=4.0.6",
44-
"@babel/core": ">=7.29.6"
44+
"@babel/core": ">=7.29.6",
45+
"nanoid": "^3.3.17"
4546
}
4647
}

‎install.sh‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,13 @@ fi
237237
# macOS: fix signing
238238
if [ "$OS" = "darwin" ]; then
239239
echo "Fixing macOS code signing..."
240-
xattr -d com.apple.quarantine "$DLBIN" 2>/dev/null || true
241-
codesign --sign - --force "$DLBIN" 2>/dev/null || true
240+
# A curl-downloaded archive usually carries no quarantine attribute at all,
241+
# and xattr then prints "No such xattr: com.apple.quarantine" on stderr.
242+
# That harmless line was read as the cause of an unrelated install failure
243+
# and became a bug report's title (#1537) — silence it; nothing here is an
244+
# error worth showing.
245+
xattr -d com.apple.quarantine "$DLBIN" >/dev/null 2>&1 || true
246+
codesign --sign - --force "$DLBIN" >/dev/null 2>&1 || true
242247
fi
243248

244249
# Verify the candidate before it requests account-wide maintenance. The

‎pkg/go/codebase-memory-mcp‎

-8.43 MB
Binary file not shown.

‎pkg/npm/README.md‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ High-quality parsing through [tree-sitter](https://tree-sitter.github.io/tree-si
1515
npm install -g codebase-memory-mcp
1616
```
1717

18-
The standard runtime set for your platform is downloaded automatically at install time. To select the UI runtime set and its verified frontend pack, set `CBM_VARIANT=ui` while installing and when invoking the wrapper:
19-
20-
```bash
21-
CBM_VARIANT=ui npm install -g codebase-memory-mcp
22-
```
18+
The runtime set for your platform is downloaded automatically at install time. There is one composition per platform and the graph UI is always included — the former `CBM_VARIANT=ui` opt-in is obsolete.
2319

2420
Then configure your coding agents:
2521

‎pkg/npm/install.js‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,14 +580,13 @@ async function main() {
580580
// dynamically links glibc 2.38+ and fails on older distros. macOS/Windows
581581
// have no such variant. Keep in sync with install.sh / pypi _cli.py / cli.c.
582582
const variant = platform === 'linux' ? '-portable' : '';
583-
// Opt into the UI build (embedded graph visualization) with CBM_VARIANT=ui.
584-
// Default is the standard (headless) build. Mirrors install.sh --ui.
585-
const ui = (process.env.CBM_VARIANT || '').toLowerCase() === 'ui' ? 'ui-' : '';
586-
const archive = `codebase-memory-mcp-${ui}${platform}-${arch}${variant}.${ext}`;
583+
// No UI/standard split since v0.10.0: one archive per platform, graph UI
584+
// always embedded. The old CBM_VARIANT=ui opt-in pointed at ui-* archives
585+
// that no longer exist, so honoring it could only 404 (#1538).
586+
const archive = `codebase-memory-mcp-${platform}-${arch}${variant}.${ext}`;
587587
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/${archive}`;
588588

589-
const uiLabel = ui ? '(ui) ' : '';
590-
process.stdout.write(`codebase-memory-mcp: downloading v${VERSION} ${uiLabel}for ${platform}/${arch}...\n`);
589+
process.stdout.write(`codebase-memory-mcp: downloading v${VERSION} for ${platform}/${arch}...\n`);
591590

592591
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'cbm-install-'));
593592
const tmpArchive = path.join(tmpDir, `cbm.${ext}`);

‎pkg/pypi/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mcp-name: io.github.DeusData/codebase-memory-mcp
44

55
**Fast code intelligence engine for AI coding agents.** Indexes an average repository in milliseconds, the Linux kernel (28M LOC) in 3 minutes. Answers structural queries in under 1ms.
66

7-
This Python wrapper downloads the selected `codebase-memory-mcp` runtime set from [GitHub Releases](https://github.com/DeusData/codebase-memory-mcp/releases) on first run and verifies it before publishing it in your OS cache directory. The standard set contains the native executable and authenticated integration asset; `CBM_VARIANT=ui` additionally selects the content-addressed UI pack.
7+
This Python wrapper downloads the selected `codebase-memory-mcp` runtime set from [GitHub Releases](https://github.com/DeusData/codebase-memory-mcp/releases) on first run and verifies it before publishing it in your OS cache directory. The set contains the native executable and authenticated integration asset, with the graph UI always embedded.
88

99
## Installation
1010

@@ -14,7 +14,7 @@ pip install codebase-memory-mcp
1414
pipx install codebase-memory-mcp
1515
```
1616

17-
To use the UI variant, set `CBM_VARIANT=ui` when invoking the wrapper (and consistently for any package-managed update or reinstall).
17+
There is one composition per platform: the graph UI ships in every build, so no variant selection is needed.
1818

1919
## Usage
2020

0 commit comments

Comments
 (0)