[DO NOT MERGE] Publish Joern provisioning for review (deployed-but-unmerged since 2026-06-24) - #3
Draft
blocksecdev-agent[bot] wants to merge 1 commit into
Draft
[DO NOT MERGE] Publish Joern provisioning for review (deployed-but-unmerged since 2026-06-24)#3blocksecdev-agent[bot] wants to merge 1 commit into
blocksecdev-agent[bot] wants to merge 1 commit into
Conversation
joern-mcp bridges to a running Joern server, but nothing owned the Joern engine's lifecycle: it was hand-installed into ~/.local/share (the XDG state tree) and used via ambient PATH, absent from agent-setup, any install.sh, and PATH config. Its 2 GB were removed/lost with no retire tarball and no ledger entry while this MCP stayed registered-but-dead. - scripts/install.sh: idempotent provisioner, pins Joern 4.0.489 into ~/tools/joern-mcp/joern (runtime/artifact tree), JDK check + smoke test. - scripts/start-server.sh: starts the engine from its owned location, with no ambient-PATH dependency. - Docs + CHANGELOG updated; version 0.1.0 -> 0.2.0. Verified end-to-end: install.sh -> start-server.sh -> /query-sync responds. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishing work that has been sitting on my disk since 2026-06-24 and never reached anyone else. Not for merge as-is. Opening it so the collective can see and review it, and so the issues that reference it stop pointing at code nobody can read.
What this contains
scripts/install.sh(provisions a pinned Joern engine, idempotent) andscripts/start-server.sh, plus the0.2.0bump, README, and CHANGELOG.Why it was a problem that this was local
origin/mainis0.1.0with noscripts/directory at all. A fresh clone gets an MCP server with no way to provision Joern and no way to start it. Meanwhileinstall.shhad already been run on my host, materializing a 2.0 GB engine into~/tools/. The host was running artifacts whose source existed on no remote.Fleet doctrine covers "local ahead is fine; local authoritative is not." This is a third state: deployed but unmerged. Local ahead is fine right up until you run it, at which point the host has no reproducible provenance and no other agent can reach parity.
It went unnoticed for sixteen days because
/checkand/startreport a branch with no upstream as clean. Filed as https://github.com/BlockSecCA-Agents/agent-template/issues/210.Why it should not merge in this shape
Three defects, all surfaced while diagnosing the invariant failure in https://github.com/BlockSecCA-Agents/security-skills-plugin/issues/5:
1. It installs into
~/tools/, which is the plugin runtime namespace.joern-mcpis not a plugin (noplugin.json). ADR-001 reserves~/tools/<plugin>/<subtree>/for plugin-managed runtime with aVERSIONfile and an install/uninstall contract. This install has none, which is exactly what invariant I3 caught. Relocating to an XDG dir would silence I3 while preserving the condition I3 exists to detect; the real fix is an owning plugin.2. It does not own the Joern process.
src/errors.tstells the user to runjoern --server, andsrc/config.tsdefaults every agent tolocalhost:8080.start-server.shbinds that fixed port. There is no auth anywhere in the client. On this hostdev,appsec, andopsall have homes, so whoever starts a server first binds 8080 and the next agent's MCP client connects to their JVM and can reach CPGs built from someone else's source tree.joern-mcpshould spawn its own Joern on an ephemeral port or a$XDG_RUNTIME_DIRsocket, and reap it when the MCP server exits. Thenstart-server.shstops being something a human must remember.3. Heap is unbounded. Joern's launcher sets
-XX:+UseG1GC,CompressedClassSpaceSize, andUseStringDeduplication, but no-Xmx. The JVM therefore derives max heap from host RAM with no awareness of siblings. Measured on this box:MaxHeapSize = 2.92 GiBagainst 11 GiB total. Per-agent runtimes without an explicit-J-Xmxis not isolation, it is N processes each sizing themselves as though they own the machine, and it fails as an OOM in whoever starts last.Owning the process means owning its resource envelope. Both belong in the same change.
Design settled while diagnosing
Distribution and runtime are separate axes. The on-disk engine is a materialization of a pinned artifact, not a fork. Copies cost ~2.0 GB disk and ~1.8 GB download each, which is noise against 753 G free. They buy no divergence, and should not:
src/cpgql.tsis tuned to a specific Joern release, so two agents on different pins would produce different security findings on identical code. One pin, shared by everyone, materialized per agent. Redundancy without divergence.Runtime is where isolation lives. Per-agent JVMs remove the single point of failure and mean nobody maintains a daemon. RAM is the only genuinely shared resource, and the only coordination needed is a declared ceiling.
Intended sequence
-J-Xmx, and either move out of~/tools/or become a plugin.I3 joern-mcpbacklog entry.@BlockSecCA