Skip to main content

RXON (Reverse Axon) - Lightweight Inter-node Reverse Communication Protocol

Project description

RXON (Reverse Axon) Protocol

EN | ES | RU

License: MPL 2.0 Python 3.11+ PyPI version

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_dict utility that recursively restores complex Python types (NamedTuples, Dataclasses, Enums, UUIDs) from raw dictionaries, supporting nested structures and Union types.
  • Secure Serialization: to_dict utility that recursively strips None values to reduce payload size and normalizes float values (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 TaskPayload parameters against SkillInfo contracts.
  • 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 HardwareDevice model.
  • 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-After support.

🏗 Architecture & Logic

Internal Validation & Normalization

The library ensures data integrity at several layers:

  1. Serialization Stability: When signing messages, RXON normalizes all numeric types and sorts dictionary keys to ensure the same object always produces the same HMAC hash regardless of minor formatting differences.
  2. Recursion Protection: All recursive operations are limited to a depth of 100 to prevent stack overflow or DoS attacks via malicious payloads.
  3. 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:

  1. Hardware Matching: Compares HardwareDevice properties. If a task requires vram_gb: 16, it will match any device with vram_gb >= 16.
  2. Resource Properties: Generic resources (like RAM or CPU cores) are matched via the properties dictionary using the same GE logic.
  3. Capability Intersection: If a task accepts multiple environments (e.g., ["linux", "darwin"]), a worker with linux will 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rxon-1.0b11.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rxon-1.0b11-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

Details for the file rxon-1.0b11.tar.gz.

File metadata

  • Download URL: rxon-1.0b11.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.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}

File hashes

Hashes for rxon-1.0b11.tar.gz
Algorithm Hash digest
SHA256 8f6e89ff46c167352b7c99e4b299456720705993565f3984198921874150b96b
MD5 adfabeeb8168c80f3aeab422faada5eb
BLAKE2b-256 3422c27a368bcc3147c6098bb2a80eb7261d64a27495cc85040ba46b4ad2f649

See more details on using hashes here.

File details

Details for the file rxon-1.0b11-py3-none-any.whl.

File metadata

  • Download URL: rxon-1.0b11-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.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}

File hashes

Hashes for rxon-1.0b11-py3-none-any.whl
Algorithm Hash digest
SHA256 f4b8cfed5b801faa4b7df30d0ae8a75ff218b75fe81c868c6669348643316676
MD5 8530dd8b570095e6a12b93745e058be0
BLAKE2b-256 c417191c5731891bcaba5e56d1cfd0d107ea85aedb0f46f65a342ad896c3f718

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page