goblin

module
v0.1.0-proto2g Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: MPL-2.0

README

Goblin - Distributed Orchestrator for GAPI (GoPPydae Agent Process Infrastructure)

Goblin extends GAPI with distributed orchestration capabilities, enabling multi-node agent supervision and cluster-wide coordination.

Overview

While GAPI provides the local runtime library, Goblin is the Production Daemon.

It embeds GAPI to run agents locally, while adding:

  • Cluster membership - node discovery via Serf
  • Consensus - leader election and a replicated instance table via Raft
  • Distributed events - cluster-wide pub/sub messaging
  • Multi-node coordination - reconcile desired state across nodes
  • Capability tokens - every mutating verb authorized against a named subject and audited through Raft
  • Live migration - move a running process between nodes with its memory intact, under an unchanged instance UUID
  • One control-plane port - kernel, RPC, gossip, Raft and checkpoint transfer share a single QUIC address, routed by TLS ALPN

You only need running goblind on your servers. No separate gapid is required.

Architecture

+-------------------------------------------------+
|                  Goblin Cluster                 |
+-------------------------------------------------+
|                                                 |
|  Node A (Leader)      Node B          Node C    |
|  +----------------+   +------------+  +-------+ |
|  | GAPI (embedded)|   | GAPI       |  | GAPI  | |
|  | runtime        |   | (embedded) |  | (emb) | |
|  +--------+-------+   +-----+------+  +---+---+ |
|           |                 |             |     |
|  +--------v-----------------v-------------v---+ |
|  |      Distributed Event Bus (Goblin)        | |
|  |  - Cluster-wide pub/sub                    | |
|  |  - Leader-aware routing                    | |
|  |  - Eventual consistency                    | |
|  +--------------------------------------------+ |
+-------------------------------------------------+

Quick Start

nix develop -c mage build

Single node - with no --join, it bootstraps a cluster of one:

./bin/goblind start

Inspect it. Note that cluster verbs live under goblinctl cluster; a bare goblinctl status is not a command:

./bin/goblinctl cluster status --tls-insecure

For a multi-node cluster see docs/usage.md, and for the full flag and command surface see docs/cli-reference.md.

Documentation

  • Usage: setup and multi-node guide.
  • CLI reference: every goblind flag and goblinctl command.
  • Architecture: Serf, Raft, the event bus, the ALPN registry, live migration.
  • Ecosystem: how Goblin and GAPI divide the work.

Project Structure

goblin/
|-- cmd/
|   |-- goblinctl/        # Control CLI
|   `-- goblind/          # Daemon entry point
|-- core/
|   |-- capability/       # Capability tokens: rights, verbs, revocation
|   |-- cluster/          # Serf membership
|   |-- consensus/        # Raft consensus and the instance FSM
|   |-- eventbus/         # Distributed event bus
|   |-- metrics/          # Prometheus collectors
|   |-- migration/        # Live migration: store, transfer, coordinator
|   |-- scheduler/        # Placement, reconciliation, locators
|   |-- store/            # Distributed KV over Raft
|   `-- transport/        # Shared QUIC listener, ALPN registry
|-- internal/
|   `-- supervisor/       # Daemon wiring and RPC handlers
|-- nix/                  # NixOS module, package, VM tests
|-- proto/goblin/v1/      # Schemas (raft, scheduler, rpc, migration)
|-- docs/                 # Documentation
`-- divergence.jsonl      # Where design and code currently disagree

License

Mozilla Public License 2.0 (MPL-2.0)

Directories

Path Synopsis
cmd
goblinctl command
goblind command
core
capability
Package capability is the orchestrator half of the capability-token scheme (GOBLIN-DIV-015, DDR-9): Ed25519 bearer-token issuance with a clamped TTL, and a revocation Bloom filter that rides gossip.
Package capability is the orchestrator half of the capability-token scheme (GOBLIN-DIV-015, DDR-9): Ed25519 bearer-token issuance with a clamped TTL, and a revocation Bloom filter that rides gossip.
migration
Package migration moves CRIU checkpoint images between nodes and owns everything the kernel deliberately does not know about them: where images live on disk, how they are keyed, and how they travel (GOBLIN-DIV-018).
Package migration moves CRIU checkpoint images between nodes and owns everything the kernel deliberately does not know about them: where images live on disk, how they are keyed, and how they travel (GOBLIN-DIV-018).
internal
cli
hlc
Package hlc is a minimal hybrid logical clock (DDR-4): timestamps order last-writer-wins updates (the gossip locator layer) even when physical clocks disagree.
Package hlc is a minimal hybrid logical clock (DDR-4): timestamps order last-writer-wins updates (the gossip locator layer) even when physical clocks disagree.
ident
Package ident mints and formats the 16-byte UUIDv7 identifiers used for specs, instances, and tokens (operator decision 2026-07-28: all ids are UUIDv7 where reasonable; bytes on the wire, canonical string at CLI/log boundaries).
Package ident mints and formats the 16-byte UUIDv7 identifiers used for specs, instances, and tokens (operator decision 2026-07-28: all ids are UUIDv7 where reasonable; bytes on the wire, canonical string at CLI/log boundaries).
logattr
Package logattr holds goblin's typed log attribute constructors: each pins one key to one value type, so a dropped value, swapped pair, or wrong type is a compile error instead of a quietly wrong JSON field (go-manifesto section 8).
Package logattr holds goblin's typed log attribute constructors: each pins one key to one value type, so a dropped value, swapped pair, or wrong type is a compile error instead of a quietly wrong JSON field (go-manifesto section 8).
version
Package version carries goblin's own build-time version string and nothing else.
Package version carries goblin's own build-time version string and nothing else.
test
cluster command
cluster/fixtures/sleeper command
Sleeper is the cluster-e2e fixture agent: it describes itself for GAPI discovery and then sleeps until signaled, so scheduled instances are real processes whose lifetime the harness can observe and kill.
Sleeper is the cluster-e2e fixture agent: it describes itself for GAPI discovery and then sleeps until signaled, so scheduled instances are real processes whose lifetime the harness can observe and kill.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL