Skip to content

About

HeLa Runtime daemon: boots the 10 HeLa cells and multiplexes their tools behind one MCP endpoint.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

HeLa Runtime

HeLa Runtime v1.5.3 — an on-demand supervisor that multiplexes HeLa cells behind one stdio or Streamable HTTP endpoint. Optional companion to the HeLa MCP Ecosystem.

Blotcat plugging MCP server cables into the central AI Hub


Passive mode (external orchestrators)

MITOSIS_EXTERNAL_ORCHESTRATOR=<name> (for example meta7 or passive) hands the control plane to an external coordinator. The runtime hides and refuses hela.agent.run, hela.pipe and every Mitosis tool outside the passive allow-list; other cells are unaffected. hela.agent.plan, hela.catalog.list, hela.catalog.search and the update tools stay. /healthz adds mode and externalOrchestrator. The guarantees inside the Mitosis cell (no Needle process, no state or workspace writes, no launched servers) need Mitosis 3.2.0 or later; with an older cell the runtime only filters the surface. The variable is read from the runtime's environment, so restart the runtime after changing it.

Respectful Attribution & Metaphor

The HeLa Runtime is part of the HeLa MCP Ecosystem, named in respectful recognition of Henrietta Lacks (1920–1951) and the immortal scientific legacy of HeLa cells. In this architecture, the runtime acts as the cytoplasmic matrix that hosts the organelles (cells) and routes signals between them without the host agent needing to manage each one individually.


What It Does

Instead of connecting your AI client to 10 separate MCP servers, you connect to one — the HeLa Runtime. It:

  • Boots the cells defined by your chosen profile as supervised child processes.
  • Multiplexes their tools behind a single MCP stdio endpoint (canonical names by default, opt-in namespaced).
  • Starts only the cell targeted by the first tool call. Discovery starts no cells, and concurrent first calls share one startup.
  • Recovers from crashes and tool timeouts after the old process exits, with up to three cumulative retries per cell/runtime and exponential backoff. Hung processes receive SIGTERM followed by SIGKILL if necessary; other cells stay online.
  • Chains tool calls in-process via hela.pipe (zero host round-trips).
  • Hosts agents via hela.agent.run — a runtime-native Needle 3 agent that plans over the full aggregated catalog and executes cell tools in-process, with no external API key.
  • Controls updates through hela.update.check and confirmation-gated hela.update.apply; checks are read-only, updates use the managed snapshot rollback path, and a successful update reports that the runtime/client must restart.

Quick Start

1. Prerequisites

  • Node.js: Node 22 LTS is the tested runtime and Nix development environment.
  • HeLa MCP Ecosystem: cloned as a sibling directory (or set HELA_ECOSYSTEM_ROOT).

2. Install & Build

git clone https://github.com/Hela-Ecosystem/hela-runtime.git
cd hela-runtime
npm install
npm run build

Or use the pinned Nix package, which fetches npm dependencies through a fixed-output derivation and builds offline:

nix build .
HELA_ECOSYSTEM_ROOT=/path/to/hela-mcp-ecosystem ./result/bin/hela-runtime
nix develop

Keep the output link for deployed packages as a garbage-collection root. Node dependencies are installed from package-lock.json; a populated but stale node_modules directory is not dependency validation.

3. Run

node dist/index.js                              # minimal profile (default, 3 cells)
node dist/index.js --transport http --port 8090   # /mcp and /healthz on one HTTP listener
HELA_PROFILE=minimal node dist/index.js          # 3 cells only
HELA_PROFILE=all node dist/index.js              # all 10 cells
HELA_NAMESPACE_TOOLS=1 node dist/index.js        # opt-in prefixed tool names (hela_<cell>_<tool>)
HELA_HTTP_PORT=8787 node dist/index.js           # enable HTTP /healthz endpoint

4. Via the Ecosystem Installer

cd ../hela-mcp-ecosystem
./setup.sh --profile dev-workspace --client opencode --runtime --non-interactive

This builds all profile cells + the daemon and writes a single-entry client config.


Profile-Aware by Default

The runtime respects HELA_PROFILE exactly like the ecosystem installer. Default is minimal; choose another profile explicitly when needed.

Profile Eligible cells (started only when invoked)
minimal mitosis, genome, enzyme
dev-workspace mitosis, genome, membrane, nucleus, ribosome, enzyme, phenotype, cytosol
headless-server mitosis, genome, membrane, nucleus, ribosome, enzyme, phenotype
research mitosis, genome, enzyme, membrane, cytosol
web-devops mitosis, genome, membrane, nucleus, phenotype, cytosol
android-testing mitosis, genome, nucleus, receptor, enzyme
3d-modeling mitosis, genome, plastid, membrane, nucleus
all all 10 cells

Discovery is profile-scoped, including cached manifests; an unknown profile fails instead of silently booting every cell. Tool counts depend on enabled cell features, so use tools/list rather than a static total. Profiles select eligible cells, not processes that must all run at startup. Standalone MCP servers retain their existing behavior.

The runtime is also the profile-aware instruction boundary. It exposes the current selection through the hela://profile/context resource and the hela-profile-bootstrap MCP prompt. These are rendered from the selected profile and inventory at runtime, so clients do not need copied AGENTS.md/persona files or separate per-cell MCP deployments. The prompt and resource are read-only metadata; they do not start cells.

Discovery without starting cells

The ecosystem's generated config/tool-catalog.json provides standalone tool schemas before any cell starts. It is derived from config/inventory.json, actual isolated MCP probes, and declared feature variants—not a second registry. After installing/building or changing a cell, regenerate the selected profile's catalog from the ecosystem directory:

npm run catalog:generate -- --profile dev-workspace
npm run catalog:check -- --profile dev-workspace
npm run test:profiles -- --profile dev-workspace

The runtime accepts catalog schemas only when the declared/actual revision, version, and build-content digest match. A revision can have multiple build digests, but the generator retains them together only after fresh probes confirm identical schemas for every declared feature variant. Its private format-2 cache additionally separates ecosystem roots, profiles, namespace modes, declared environment settings, and effective tool features. Writes are atomic; only fingerprints and schemas are stored, never environment values. Legacy/corrupt/stale caches are ignored. Configuration changes take effect on a new runtime instance, not by mutating an already-running client's environment.

If neither catalog nor valid cache covers a cell, its tools are not falsely advertised and unknown calls do not scan/start other cells. hela.pipe remains available for explicit {cell, tool, args} routing, which can bootstrap that named cell and learn its schemas. Regenerate the catalog to restore complete cold discovery. A missing catalog does not silently become eager startup.


Environment Variables

Variable Default Description
HELA_ECOSYSTEM_ROOT sibling hela-mcp-ecosystem Path to the ecosystem root (inventory, profiles).
HELA_PROFILE minimal Profile id selecting which cells to boot.
HELA_NAMESPACE_TOOLS unset Set to 1 to expose tools as hela_<cell>_<tool>.
HELA_HTTP_PORT unset Enable HTTP /healthz endpoint on this port.
HELA_NATIVE_AGENT enabled Set to false to disable the runtime-native Needle agent and restore the legacy cell-local agent_run alias.
HELA_WORKSPACE GUARDIAN_PROJECT_ROOT or runtime cwd Workspace used to resolve agent file paths.
HELA_MEMORY_ENTITY project:hela-dev-workspace-runtime Default Genome entity for agent memory observations.
NEEDLE_TIMEOUT_MS 30000 Per-decision timeout for the bundled Needle engine.
NEEDLE_ENGINE_PATH <ecosystem>/chaining-mcp/assets/needle/needle3 Override the Needle executable.
NEEDLE_MODEL_PATH <ecosystem>/chaining-mcp/assets/needle/needle3.cact Override the Needle model weights.
NEEDLE_SYSTEM_PATH profile system prompt under the Needle assets Override the system prompt passed to Needle.

On Windows, the runtime automatically checks needle3.exe and needle.exe before the extensionless Unix names. NEEDLE_ENGINE_PATH remains available for custom locations.


Native Needle Agent

When the bundled Needle 3 engine and weights are present, the runtime registers agent_run / hela.agent.run as a runtime-native agent instead of forwarding to a single cell. It:

  1. Builds the complete catalog from every selected cell (204 tools across the eight dev-workspace cells in a typical installation).
  2. Retrieves a four-tool shortlist with lexical BM25 plus intent rules.
  3. Asks Needle 3 to choose the next tool (or done) and generate its arguments.
  4. Repairs those arguments against the real JSON Schema, executes the tool in-process, and feeds the observation into the next iteration.

The shortlist keeps each decision inside Needle's 8K context. The runtime also passes --forced (low-confidence calls otherwise remain suppressed), sanitizes NOT active roster lines that would trip Needle's negation validator, and falls back to deterministic step plans for recognized browser, shell, file, memory, and academic intents. No OpenRouter key is used.

Inspection tools:

  • hela.agent.plan — show the deterministic plan and retrieved tools without executing anything.
  • hela.catalog.list — list the complete aggregated catalog, optionally by cell or ranked by query.
  • hela.catalog.search — rank catalog tools against a capability query.

Update controls:

  • hela.update.check — compare the managed installation with the remote latest-stable snapshot without changing files.
  • hela.update.apply — apply the reviewed snapshot only with confirm: true; arbitrary installer commands are not exposed to the agent.

If Needle assets are missing, or HELA_NATIVE_AGENT=false, the runtime keeps the previous behavior: hela.agent.run routes to Mitosis's agent_run when that cell is selected.


Cross-Cell Chaining (Two Paths)

  • With runtime: hela.pipe runs a sequence of {cell, tool, args} steps in-process (zero host round-trips). Supports {{prev}} substitution for piping results.
  • Without runtime: use hela-mitosis:workflow_orchestrator (host-mediated, supports dependsOn + outputMapping). Available to every user with the ecosystem installed.

Genome memory and mission coordination

Memory safety belongs to the Genome cell, not the runtime transport. Rebuild project-mcp when updating its backup, vault-sync, or mission-claim implementation; restarting an old build does not install those changes. Keep SQLite as the base engine and Obsidian optional. Use Genome's conflict-aware dist/vault-sync.js hook rather than bidirectional rsync --delete; see the Genome configuration and recovery guide.

Exclusive mission claims coordinate callers of the same Genome ledger. Agents on different machines must use that shared server endpoint; separate local SQLite databases and vault mirrors do not replicate missions or provide a distributed lock. Runtime deployment, cell revisions, and session behavior require separate verification.


Diagnostics

npm test                         # isolated hung-cell, restart, profile, and shutdown tests
# From the ecosystem directory
./setup.sh doctor --profile dev-workspace --runtime  # selected cells, runtime catalog, versions, pins, zero discovery spawns
node scripts/verify-versions.mjs --profile dev-workspace  # initialize/list + package/inventory/snapshot/pin agreement
node scripts/test-runtime-parity.mjs  # parity + crash-recovery harness
npm run test:profiles                 # all eight profiles, namespacing off/on, cold/warm timings

Release steps

After changing dependencies or updating package-lock.json, refresh the fixed-output Nix hash before building release artifacts:

npm run nix:refresh-hash
npm test

The helper obtains the expected hash from Nix's mismatch error, writes it to flake.nix, and runs nix build . again to verify it. If Nix is unavailable, it exits successfully without changing the file.

Ecosystem doctor, integration, and version probes use temporary homes/project memory with vault hooks and credentials excluded. They require real MCP replies; merely staying alive is not a successful handshake. Optional hardware capability still requires separate device/Blender integration tests.


Docker

docker build -t hela-runtime .
docker run -e HELA_ECOSYSTEM_ROOT=/ecosystem -e HELA_PROFILE=dev-workspace -p 8787:8787 hela-runtime

Mount the ecosystem directory at /ecosystem so the daemon can spawn cells.


Documentation Index


License

Distributed under the MIT License. Underlying repositories remain independently copyrighted by their respective authors.

The HeLa project respectfully recognizes Henrietta Lacks and the enduring scientific legacy of HeLa cells.

About

HeLa Runtime daemon: boots the 10 HeLa cells and multiplexes their tools behind one MCP endpoint.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages