RXON (Reverse Axon) - Lightweight Inter-node Reverse Communication Protocol
Project description
RXON (Reverse Axon) Protocol
RXON (Reverse Axon) is a lightweight, extensible reverse-connection protocol designed for HLN (Hierarchical 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 with constant-time verification. Support for identity chains and mTLS certificate identity extraction.
- Deep Model Restoration: Robust
from_dictutility that recursively restores complex Python types (NamedTuples, Dataclasses, Enums, UUIDs) 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 automatic token refresh (STS), exponential backoff for reconnections, graceful session closing, and built-in Rate Limit (HTTP 429) handling with
Retry-Aftersupport.
🏗 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 100 to prevent stack overflow or DoS attacks via malicious payloads.
- Schema Enforcement: 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.
🧪 Quick Start
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 (RAM/CPU cores are now part of properties)
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!")
📜 License
The project is distributed under the Mozilla Public License 2.0 (MPL 2.0).
Mantra: "The RXON is the medium for the Ghost."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rxon-1.0b12.tar.gz.
File metadata
- Download URL: rxon-1.0b12.tar.gz
- Upload date:
- Size: 41.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00b622d1f9bd379ca54dae896e90d4b08ac29b16f3250b7cb001d9899a3fa8b3
|
|
| MD5 |
cecae9adf9ad49f9a5f3a2f430363a11
|
|
| BLAKE2b-256 |
b5b1501ad9fdba5ea3868163312d2dc9ff738a457e6fb0bb00d7e1b6f33ae0c9
|
File details
Details for the file rxon-1.0b12-py3-none-any.whl.
File metadata
- Download URL: rxon-1.0b12-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
066578e2d58c2e91c61ba270960cca24fab32afabaef0119cc192c29b262bbf1
|
|
| MD5 |
429b404faeb0455fbbb048e758f0538a
|
|
| BLAKE2b-256 |
e933bfe7b0a36bf506b610db408bbca117c8c77bdd97b806fb8d1f2b146c554e
|