CENTRALIZER
One runtime. Every language.
Centralizer is a Go-based interoperability runtime
that discovers, connects, supervises, and exposes
software written across different programming
languages through a unified interface.
Official module:
https://pkg.go.dev/github.com/theworker02/centralizer
This version (v0.1.2):
https://pkg.go.dev/github.com/theworker02/centralizer@v0.1.2
hub := centralizer.New()
service, err := hub.Connect(ctx, "./analytics")
if err != nil {
panic(err)
}
result, err := service.Call(ctx, "calculate", centralizer.Args{
"value": 42,
})
The calling application does not need to know which bridge Centralizer selected.
Official module: pkg.go.dev/github.com/theworker02/centralizer · v0.1.2
go get github.com/theworker02/centralizer@latest
# or pin: go get github.com/theworker02/centralizer@v0.1.2
Docs site: theworker02.github.io/centralizer.
License: Proprietary source-available — see LICENSE_TRANSITION_NOTICE.md. Privacy: PRIVACY.md.
Contents
What Centralizer is
Centralizer is a process-local orchestration layer. You point a Hub at a target directory or an in-process Go handler. The Hub:
- Discovers language and runtime markers (
go.mod, pyproject.toml, package.json, Cargo.toml, and the rest of the detect set).
- Builds a capability graph (stdio, process, native, TCP, …).
- Plans a bridge under an explicit policy.
- Starts the selected adapter, converting values through CIR.
- Supervises the live session: health, bounded recovery, circuit breaker.
It is a single Go module. Language-specific work lives in small adapters and generated shims. Planning, protocol, supervision, and CIR stay in the Go core.
v0.1 is a working vertical slice: a Go host, Python / Node / Rust process targets that tests exercise, CIR, a deterministic planner, a supervisor, and a CLI. Later languages are detect-only until invocation is tested. See ROADMAP.md.
Typical uses:
- A Go service that must call a local Python analytics module without writing a one-off RPC.
- A CLI that inspects a tree, explains why stdio beat TCP, and invokes one function.
- A host that registers an in-process Go handler (
native:name) next to process-backed targets on the same Hub.
- A fixture-driven test that asserts planner ranking, CIR conversion, or supervisor quarantine.
What Centralizer is not
- A language VM or interpreter. It does not execute Python bytecode or Java class files itself.
- A package manager. It does not install CPython, Node, or crates. Those runtimes must already be on
PATH when you connect a process target.
- A general FFI / bindgen compiler. It does not generate C headers or rewrite foreign ABIs.
- A service mesh, remote RPC framework, or multi-host orchestrator. Remote
http(s): and file: URLs are rejected in v0.1.
- A sandbox that makes untrusted code safe. Connecting a target runs that code locally. See Security.
- A hosted product. There are no accounts and no Centralizer cloud. See PRIVACY.md.
- Complete polyglot coverage. Files under
adapters/ do not imply Call. The compatibility matrix is the claim.
Module identity
| Item |
Value |
| Module path |
github.com/theworker02/centralizer |
| Go version |
1.23+ |
| Direct dependency |
gopkg.in/yaml.v3 only |
| Public API |
pkg/centralizer, plus pkg/cir, pkg/schema, pkg/adapter, pkg/bridge, pkg/capability, pkg/health, pkg/manifest, pkg/lockfile, pkg/czerr, pkg/diagnostics |
| CLI |
cmd/centralizer |
| Optional daemon |
cmd/centralizerd |
| Protocol |
Centralizer Protocol 1.0 (major 1) |
| pkg.go.dev |
module, Hub API |
| Module proxy |
https://proxy.golang.org/github.com/theworker02/centralizer/ |
Pin a version in go.mod before 1.0. The public API and protocol may change. @latest follows the highest SemVer tag the proxy has seen.
This module is not part of golang.org/x/*. Those paths are reserved for the Go project. Publishing a tagged release makes pkg.go.dev and proxy.golang.org serve github.com/theworker02/centralizer@vX.Y.Z. That is the supported distribution path.
Philosophy
Centralizer should never require the developer to manually solve an interoperability problem that Centralizer can reliably determine itself.
That sentence has limits. Automation that cannot be explained, reproduced, or bounded is not useful in a host process you have to debug. The design constraints are therefore:
- Determinism. Equivalent discovery input, capability graph, and policy produce the same ranking. Ties break on strategy name.
- Explainability. Every selection can be printed.
centralizer explain reports detection score, adapter, Call honesty, and planner detail; Service.Explanation() remains available on a live service.
- Honesty. A capability is complete when tests demonstrate it. Detect-only adapters stay detect-only. Files existing under
adapters/ do not imply Call.
- Bounds. Recovery has a restart budget and exponential backoff. After the budget the target is quarantined. Infinite restart loops are a bug.
- Policy over score. A higher planner score cannot enable a denied transport, native execution, or subprocess.
- One core. Adapters detect and connect. They do not reimplement planning, supervision, or CIR.
- Local by default. The library does not phone home. The optional daemon binds loopback. Cache and doctor output stay on the machine.
When forced to choose, the project prefers stability over more languages, clear behavior over more abstraction, and debuggable automation over automatic magic. See DESIGN.md.
Architecture
flowchart TD
A[Application] --> B[Centralizer API]
B --> C[Capability Graph]
C --> D[Bridge Planner]
D --> E[CIR]
E --> F[Bridge Supervisor]
F --> G[Adapter]
G --> H[Target Runtime]
Centralizer is a single Go module. Each package has one job.
| Package |
Responsibility |
pkg/centralizer |
Public Hub / Service API |
pkg/cir |
Kind-tagged intermediate values |
pkg/schema |
Callable surface above CIR; explicit YAML load |
pkg/adapter |
Adapter interface, registry, catalog |
pkg/bridge |
Plan, Bridge, Stream contracts |
pkg/capability |
Capability graph |
pkg/health |
Supervisor snapshots |
pkg/manifest |
Optional centralizer.yaml |
pkg/lockfile |
Optional resolved-plan snapshot |
pkg/czerr |
Typed errors (errors.Is / errors.As) |
pkg/diagnostics |
doctor checks |
internal/discovery |
Target analysis and fingerprints |
internal/planner |
Deterministic strategy selection |
internal/supervisor |
Lifecycle, recovery, circuit breaker |
internal/session |
Protocol client and native bridge |
internal/protocol |
Framing and messages |
internal/transport |
stdio, TCP, Unix, named-pipe client, experimental SHM |
internal/security |
Paths, policy, environment filtering |
internal/telemetry |
slog, in-process metrics and traces |
internal/registry |
Connected service table |
internal/cache |
Shim and plan cache |
internal/lifecycle |
Handles and shutdown |
internal/shim |
Embedded, versioned shim templates |
internal/version |
SemVer and protocol identity |
adapters/* |
Language-specific detect / connect only |
flowchart LR
subgraph public
API[pkg/centralizer]
end
subgraph decide
D[discovery]
P[planner]
C[capability]
end
subgraph run
S[supervisor]
T[session/transport]
A[adapter]
end
API --> D --> C --> P --> S --> T --> A
Connect path
- Validate the target path (unless
native:). Remote http(s): and file: URLs are rejected in v0.1. Null bytes are rejected. The path must exist after Abs+Clean.
- Run every adapter's
Detect. Keep confidence scores; do not pretend certainty. Ambiguous trees are reported, not hidden.
- Ask the winning adapter for capabilities. Host facts (OS sockets) do not imply the adapter can connect that way.
- Plan under policy. Equivalent inputs produce the same ranking. Policy can reject a candidate;
bench cannot override that.
Prepare then Connect. Prepare may materialize a cache-resident shim if policy allows generated code.
- Load an explicit schema if
schema.yaml or a manifest schema: field is present.
- Wrap the bridge in a supervisor and register it on the Hub.
Hub.Analyze stops after discovery and planning. Hub.Explain returns the same report the CLI prints. Hub.LockPlan writes the resolved snapshot without requiring a live call.
Ownership
The Hub owns services. A Service owns its supervisor. The supervisor owns the live Bridge. A stdio or TCP transport owns the child process and must kill it on Close. Handles never store foreign memory pointers. Service.Close drops locally tracked handles for that bridge (DropBridge) and reaps children. Hub.Close closes every registered service.
Do not leak a Service across Hub lifetime. A CLI invocation constructs a new Hub; that is why list and health without a long-lived process cannot see services started by another command.
Isolation
Default policy isolation is process: the target runs in a child (or as a registered in-process handler if you asked for native: and policy allows it). Centralizer is not a seccomp/jail/container runtime. Process isolation means a separate OS process and a filtered environment, not a security sandbox. Shared memory is typed but disabled (ErrExperimental).