This release is a pre-release and may not be stable for production use.
RXON (Reverse Axon) Protocol
RXON (Reverse Axon) is a lightweight, extensible reverse-connection protocol designed for HLN (Holarchical Logic Network) architectures.
It serves as the "nervous system" for distributed multi-agent systems, providing a strictly typed, Zero Trust foundation for inter-service communication.
🚀 Concept
In traditional networks, commands usually flow "top-down" (Push model). In RXON, the connection initiative always comes from the subordinate node (Shell) to the superior node (Orchestrator). This "Reverse Axon" architecture allows workers to operate behind NAT or Firewalls without complex network configuration, while maintaining a secure, bi-directional control channel.
✨ Key Features
- Reverse Connection (PULL): Nodes connect to the orchestrator to pull tasks, ensuring compatibility with complex network environments (NAT/Firewalls).
- Zero Trust Security: Payload signing via HMAC-SHA256 (symmetric) and Ed25519 (asymmetric digital signatures) with constant-time verification. Support for signed bubbling chains, mTLS certificate identity extraction, and
sig(orchestrator_signature) task verification. - Policy & Cost Headers: Built-in support for job policy constraints (
policy), holarchy depth tracking (depth), transition step counters (step), parent hash linkage (parent_hash), and task execution cost reporting (costs). - Deep Model Restoration: Robust
from_dictutility powered bymsgspec.convertthat recursively restores complex Python types (msgspec.Structs, Enums, UUIDs, datetimes) from raw dictionaries, supporting nested structures andUniontypes. - Secure Serialization:
to_dictutility that recursively stripsNonevalues to reduce payload size and normalizesfloatvalues (e.g.,1.0->1) to ensure stable cryptographic hashes. - Automated Contract Validation: Built-in JSON Schema engine that automatically infers schemas from Python types and validates
TaskPayloadparameters againstSkillInfocontracts. - Advanced Resource Matching: Mathematical logic for resource allocation:
- Numbers: Uses GE (Greater or Equal) logic (Requirement <= Available).
- Lists: Uses Inclusion (val in list) or Intersection (any common element).
- Strings: Case-insensitive partial matching for hardware models.
- Unified Telemetry: Heartbeats include granular metrics for any custom devices (Sensors, GPUs, Actuators) and generic system properties via the extensible
HardwareDevicemodel. - Resilient Transport: HTTP/WebSocket implementation with Secure Token Service (STS) supporting Refresh Tokens, exponential backoff for reconnections, and built-in Rate Limit (HTTP 429) handling with
Retry-After.
🌐 Ecosystem
RXON is the foundational protocol powering the distributed multi-agent automation stack:
- HLN (Holarchical Logic Network): The architectural pattern, manifesto, and design specification for self-similar holarchies.
- Avtomatika: High-performance state-machine based orchestrator for long-running AI workflows and distributed execution.
- Avtomatika Worker SDK: The official Python SDK for building autonomous workers (Holons) that connect to orchestrators via RXON.
🏗 Architecture & Logic
Internal Validation & Normalization
The library ensures data integrity at several layers:
- Serialization Stability: RXON uses a JSON Round-trip mechanism with
orjsonto normalize all numeric types (10.0->10), coerce dictionary keys to strings, and sort keys. This ensures that the same object always produces the exact same HMAC hash regardless of minor formatting differences. - Full Type Support: Native support for
datetime,UUID,Enum, and Pydantic models ensures seamless integration with modern Python ecosystems while maintaining cryptographic consistency. - Recursion Protection: All recursive operations are limited to a depth of 30 to prevent stack overflow or DoS attacks via malicious payloads.
- Schema Enforcement: Fast JSON Schema compilation with thread-safe caching (
SkillInfo.input_validator,SkillInfo.output_validator). Before task execution, the library validates input parameters against the skill's JSON Schema, checking for required fields, type correctness, and allowed enum values.
Smart Matching Logic
RXON formalizes the rules for matching tasks to holons:
- Hardware Matching: Compares
HardwareDeviceproperties. If a task requiresvram_gb: 16, it will match any device withvram_gb >= 16. - Resource Properties: Generic resources (like RAM or CPU cores) are matched via the
propertiesdictionary using the same GE logic. - Capability Intersection: If a task accepts multiple environments (e.g.,
["linux", "darwin"]), a worker withlinuxwill be correctly matched.
Policy, Holarchy & Cost Tracking
RXON standardizes execution governance and metric tracking across distributed holons:
- Policy Constraints (
policy): Dict carrying execution constraints (e.g. allowed skills, token limits, budget caps). - Holarchy & Step Counters (
depth,step,parent_hash): Track call nesting depth (depth), state transition index (step), and parent event cryptographic link (parent_hash). - Signature (
sig): Cryptographic HMAC-SHA256 signature of the task payload generated by the orchestrator usingORCHESTRATOR_SECRET_KEYand verified by the worker. - Timestamp (
timestamp): Strict integer Unix timestamp in seconds (int), ensuring cross-platform stability and preventing float precision drift. - Execution Cost Reporting (
costs):TaskResult.costsfield reporting consumed tokens, computational duration, or financial metrics (e.g.{"tokens": 1500, "usd": 0.02}).
🧪 Quick Start
Worker Side (PULL)
from rxon import create_transport
from rxon.models import Resources, HardwareDevice
# 1. Create transport (supports http, https, ws, wss)
transport = create_transport("ws://api.hln.local", "worker-01", "secret-token")
# 2. Define worker resources
my_res = Resources(
properties={"ram_gb": 64, "cpu_cores": 16},
devices=[HardwareDevice(type="gpu", model="RTX 4090", properties={"vram_gb": 24})],
)
# 3. Smart Matching Logic (Requirement: GPU with at least 16GB VRAM)
req = Resources(devices=[HardwareDevice(type="gpu", properties={"vram_gb": 16})])
if my_res.matches(req):
print("This holon is ready for the task!")
Orchestrator Side (Server)
from aiohttp import web
from rxon import HttpListener
app = web.Application()
listener = HttpListener(app)
# MANDATORY: Register RXON routes before app startup
listener.setup_routes()
async def my_handler(action, payload, context):
if action == "poll":
return {"job_id": "j-1", "task_id": "t-1", "type": "echo"}
return {"status": "ok"}
# Start listening
await listener.start(handler=my_handler)
📜 License
The project is distributed under the Mozilla Public License 2.0 (MPL 2.0).
Mantra: "The RXON is the medium for the Ghost."
Metadata
Release files for rxon 1.0b17
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rxon-1.0b17.tar.gz | 50.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rxon-1.0b17-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 85.2 kB
Release files / rxon-1.0b17.tar.gz
| Download URL | rxon-1.0b17.tar.gz |
|---|---|
| Size | 50.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ce1e39cd770f0ff104c3035682be36b093021bf1a851e42bd22b991f9ff695d
|
|
BLAKE2b-256 checksum How to use checksums |
cd29fc564a94a96005b1a1aa47be0d5fbf9e0bb2b7dc630460ffb1902f07afc1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / rxon-1.0b17-py3-none-any.whl
| Download URL | rxon-1.0b17-py3-none-any.whl |
|---|---|
| Size | 35.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
89ee9dcd638207a98fef97c797e450ecb310602977550c1ada802d6715784ff0
|
|
BLAKE2b-256 checksum How to use checksums |
83065dc580205de8ed6a874fd437cbbe651abb2469b8eee7663495bbbc32d6a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.3 {"installer":{"name":"uv","version":"0.12.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Gentoo","version":"2.18","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|