Holonode SDK
Holonode SDK is the official high-performance Python SDK for building distributed execution nodes (Workers / Holons) compatible with the Holarchy orchestrator. It serves as an execution node (Shell) in a Holarchical Logic Network (HLN), coordinating with the orchestrator (Ghost) via the RXON (Reverse Axon Protocol).
The SDK automates all low-level communication concerns: task polling, dynamic registration, heartbeats, S3 payload management, Zero Trust authentication, and graceful shutdown.
🚀 Key Features
- Language: Python 3.11+
- Protocol: Native support for RXON (Reverse Axon Protocol) for HLN (Holarchical Logic Network).
- Communication Model:
- PULL: Workers poll tasks from orchestrators (operates securely behind NAT/Firewall without public incoming ports).
- WebSocket: Optional real-time bidirectional command channel (task cancellation, custom runtime commands).
- Zero Trust Security & Policy Enforcement:
- Mandatory HMAC-SHA256 signing for all worker messages using
WORKER_TOKEN. - Cryptographic verification of
orchestrator_signature(sig) on incoming tasks viaORCHESTRATOR_SECRET_KEY. - Strict enforcement of
allowed_skillstask execution policies. - Automatic collection and reporting of task execution cost metrics (
costs). - Identity Chain and Origin Worker ID support for provenance tracking across infinite holarchy layers.
- Replay protection with timestamp validation.
- Mandatory HMAC-SHA256 signing for all worker messages using
- Traffic & Performance Optimization:
- Telemetry Throttling (Heartbeat Deadband): Hardware telemetry (CPU/RAM/GPU) is only sent when a value changes by >5% or after a 60s forced interval, drastically saving network bandwidth.
- ETag-Based Blob Caching: Heavy assets (e.g. AI model weights) are downloaded only once from S3, cached locally with ETag validation, and symlinked to task workspaces.
- Async Results Uploader: Task results are queued via non-blocking
asyncio.Queuewith automatic retries and exponential backoff, instantly freeing the worker for the next task. - 3-Tier Skill Lifecycle: Supported (catalog), Available (dynamic limits), and Hot (cached in memory/VRAM).
- Stable Hashing: Sends full skill catalog only when changed, using
skills_hashfor ultra-light heartbeats.
- S3 Streaming: High-performance payload streaming using
obstore. Zero OOM on large files. - AI-Agent Support: Supports Chain of Thought and Tool Use via
OrchestratorClientdependency injection for subtask delegation. - Hardware Awareness: Built-in monitoring for CPU, RAM, and NVIDIA GPUs (via
psutilandGPUtil). - Modern Observability:
- Native distributed tracing and metrics with OpenTelemetry.
- Automatic Trace Context Propagation: Extracts
trace_idfrom tasks and propagates it to all events and child spans. - OTLP metrics push export via
OTEL_EXPORTER_OTLP_ENDPOINT.
Table of Contents
- Core Architecture: Orchestrators and Workers
- Ecosystem
- Installation
- Quick Start
- Configuration Reference
- Resilience & Connectivity
- Observability
- Security
- Contributing
- License
Core Architecture: Orchestrators and Workers
Holonode SDK implements the execution tier of a Holarchical Logic Network (HLN):
- Orchestrator: Manages workflow state machines (Blueprints), tracks job lifecycles, and coordinates tasks. The orchestrator acts as a passive HTTP server and never initiates outbound connections to workers.
- Worker: An autonomous execution node. It establishes reverse HTTP polling connections to the orchestrator, registers supported skills and hardware capabilities, pulls assigned tasks into isolated workspaces, and posts results asynchronously.
- Hierarchical Composition: Standardized contracts allow an entire orchestrator instance to be wrapped inside a worker interface, enabling recursive multi-level task delegation across distributed clusters.
Ecosystem
Holonode SDK is an integral part of the Holarchy distributed ecosystem:
- Holarchy Orchestrator: High-performance state-machine workflow engine coordinating tasks and distributed blueprints.
- RXON Protocol: Shared lightweight reverse-connection protocol powering inter-node communication across the HLN ecosystem.
- HLN (Holarchical Logic Network): Architectural pattern, manifesto, and design specification for self-similar holarchies.
- Holonode SDK: The official Python SDK for building execution workers (this repository).
- Full Example: Reference project demonstrating the orchestrator and workers in action.
Installation
-
Install the core SDK only:
pip install holonode
-
Install with S3 payload offloading support:
pip install "holonode[s3]"
-
Install with Pydantic v2 schema inference support:
pip install "holonode[pydantic]"
-
Install with OpenTelemetry metrics and tracing:
pip install "holonode[metrics]"
-
Install all production features (Recommended):
pip install "holonode[s3,pydantic,metrics]"
-
Install for development:
pip install -e ".[dev]"
Quick Start
Usage as a Library
from pydantic import BaseModel, Field
from holonode import OrchestratorClient, TaskFiles, Worker
class GreetingParams(BaseModel):
name: str = Field(default="World", description="Name to greet")
worker = Worker(worker_type="greeter-service")
@worker.skill("hello_world", risk="low", permissions=["greetings:write"])
async def my_skill(params: GreetingParams, files: TaskFiles):
"""The SDK validates incoming task data directly into GreetingParams."""
return {"message": f"Hello, {params.name}!"}
@worker.skill("ai_agent_reasoning", risk="medium", permissions=["ai:reason"])
async def agent_skill(params: dict, orchestrator_client: OrchestratorClient):
"""AI agent skill delegating a subtask (tool use) via OrchestratorClient."""
search_result = await orchestrator_client.call_skill("web_search", {"query": params["search_query"]})
return {"result": f"Based on web search: {search_result['data']}"}
@worker.on_command("reboot")
async def handle_reboot(command: dict):
"""Custom command received over the real-time WebSocket channel."""
print("Rebooting worker...")
if __name__ == "__main__":
worker.run()
For step-by-step guidance, see the Local Worker Development Cookbook.
CLI Usage
The SDK includes a built-in CLI for running workers, inspecting skills, and local debugging:
# Run the worker with health-check server (port 8083 by default)
worker run --app my_worker:worker
# Run with terminal statusline HUD
worker run --app my_worker:worker --hud
# Run on a custom port without health check
worker run --app my_worker:worker --port 9000 --no-health-check
# Run with auto-reload on code changes
worker run --app my_worker:worker --reload
# Execute a single skill locally in an isolated sandbox (no orchestrator required)
worker exec --app my_worker:worker --skill hello_world --params '{"name": "Alice"}'
worker exec --app my_worker:worker --skill hello_world --params @params.json
# Inspect registered skills, risk levels, and permissions
worker inspect --app my_worker:worker
worker inspect --app my_worker:worker --json
worker inspect --app my_worker:worker --skill hello_world
# Start local web testbench for manual skill testing
worker dev --app my_worker:worker --port 8088
Configuration Reference
All settings can be configured via environment variables:
| Variable | Type | Default | Description |
|---|---|---|---|
ORCHESTRATOR_URL |
String | http://localhost:8080 |
Fallback URL when connecting to a single orchestrator |
ORCHESTRATORS_CONFIG |
JSON String | None |
JSON list of orchestrator configs (url, priority, weight) |
MULTI_ORCHESTRATOR_MODE |
String | WATERFALL |
Polling strategy: WATERFALL (priority order) or ROUND_ROBIN |
WORKER_ID |
String | Auto-generated | Unique identifier for the worker instance |
WORKER_TYPE |
String | generic-cpu-worker |
Type tag for skill matching and targeting |
WORKER_PORT |
Integer | 8083 |
Port for the built-in HTTP health check probe (/health) |
WORKER_ENABLE_HUD |
Boolean | False |
Enable statusline TUI HUD in terminal |
WORKER_TOKEN |
String | None |
Secret token used for HMAC-SHA256 message signing (Zero Trust) |
ORCHESTRATOR_SECRET_KEY |
String | None |
Secret key used to verify incoming task signatures (sig) |
REQUIRE_TASK_SIGNATURE |
Boolean | True |
Enforce signature verification when ORCHESTRATOR_SECRET_KEY is set |
COST_PER_SKILL |
JSON String | None |
JSON mapping of skill execution tariffs (e.g. '{"render": 0.05}') |
MAX_CONCURRENT_TASKS |
Integer | None |
Global concurrency limit for parallel task executions |
WORKER_ENABLE_WEBSOCKETS |
Boolean | True |
Enable real-time WebSocket connection for commands and cancellation |
S3_ENDPOINT_URL |
String | None |
S3-compatible storage endpoint URL for payload offloading |
S3_ACCESS_KEY |
String | None |
S3 access key ID |
S3_SECRET_KEY |
String | None |
S3 secret access key |
S3_DEFAULT_BUCKET |
String | None |
Default S3 bucket for task file transfers |
WORKER_BLOB_CACHE_DIR |
String | /tmp/holarchy_cache |
Local directory for caching S3 blobs with ETag validation |
TASK_FILES_DIR |
String | /tmp/payloads |
Local base directory for isolated task workspace files |
WORKER_TELEMETRY_DEADBAND |
Float | 5.0 |
Percentage change threshold for emitting hardware telemetry |
WORKER_TELEMETRY_FORCE_INTERVAL |
Float | 60.0 |
Maximum interval (seconds) before telemetry is forcefully emitted |
POLL_BACKOFF_INITIAL |
Float | 1.0 |
Initial delay (seconds) after network error or 429 response |
POLL_BACKOFF_MAX |
Float | 60.0 |
Maximum backoff delay (seconds) |
POLL_BACKOFF_FACTOR |
Float | 2.0 |
Multiplier for exponential backoff calculations |
STRICT_EVENT_VALIDATION |
Boolean | True |
Validate emitted events against protocol schemas before dispatch |
LOG_LEVEL |
String | INFO |
Logging verbosity (DEBUG, INFO, WARNING, ERROR) |
Resilience & Connectivity
- Independent Orchestrator Managers: Each orchestrator connection is handled by an isolated background task. Outages or rate limits on one orchestrator never block others.
- Smart Backoff & Retry Storm Protection: Unified exponential backoff honors the HTTP
Retry-Afterheader (seconds or HTTP date). Errors with status 429 withoutRetry-Afterenforce a mandatory 30-second safety floor to prevent retry storms. - Heartbeat Debouncing: Throttles heartbeats to a maximum of once every 2 seconds. State updates during the cooldown are coalesced and dispatched cleanly.
- Graceful Shutdown: Handles
SIGINTandSIGTERMcleanly, awaiting active task completion and notifying orchestrators prior to process exit.
Observability
Holonode SDK provides first-class observability using OpenTelemetry:
- Distributed Tracing: Workers extract
trace_idfrom tasks and create child spans (task.{type}). All emitted events and S3 operations share the same trace. - Push Metrics (OTLP): When
OTEL_EXPORTER_OTLP_ENDPOINTis configured, metrics are automatically exported via OTLP. - ObservabilityManager Injection: Handlers can accept
obs: ObservabilityManagerto create custom sub-spans and attach diagnostic metadata.
Security
Security is foundational to the Holarchy ecosystem:
- See the full RXON / HLN Security Model.
- See the Holarchy Security Policy.
- Detailed worker security policies are documented in SECURITY.md.
Contributing
We welcome contributions! Please review our Contributor Guide and Development Guide for environment setup and testing instructions.
License
This project is licensed under the Mozilla Public License 2.0 (MPL 2.0).
Metadata
Release files for holonode 1.0.0.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| holonode-1.0.0.post1.tar.gz | 96.3 kB | Without provenance | Details for holonode-1.0.0.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| holonode-1.0.0.post1-py3-none-any.whl | Python 3 | none | any | Details for holonode-1.0.0.post1-py3-none-any.whl |
Total release size: 151.7 kB
Release files / holonode-1.0.0.post1.tar.gz
| Download URL | holonode-1.0.0.post1.tar.gz |
|---|---|
| Size | 96.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b76cfca8a302303c0d8975324a90ccec4796ae9c0788bac88f5624461ceeaf0
|
|
BLAKE2b-256 checksum How to use checksums |
78cf647c3656bafd88c11c7a3f535114ae17a95e4184abea2555cb882bfdcbb9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Release files / holonode-1.0.0.post1-py3-none-any.whl
| Download URL | holonode-1.0.0.post1-py3-none-any.whl |
|---|---|
| Size | 55.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
371574a0a4ff9f4b44369132dd4e111b942cd56ed10732d825ad66734a96d6e1
|
|
BLAKE2b-256 checksum How to use checksums |
0328ce1852ecd2c0e666311431e01f62d54f627709804d99b22219d3fc872648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.10
|
Security for holonode 1.0.0.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.