RXON (Reverse Axon) Protocol
RXON (Reverse Axon) is a lightweight protocol for reverse connections, task distribution, and typed inter-service communication within HLN (Holarchical Logic Network) systems.
It provides a strictly typed message foundation and Zero Trust payload verification for distributed agent runtimes.
Concept
In conventional client-server architectures, control planes push requests down to worker nodes. In RXON, worker nodes (shells) initiate outbound connections to the orchestrator to pull tasks. This reverse-connection pattern allows workers to operate behind firewalls and NAT without inbound port forwarding, while establishing a bidirectional communication channel.
Key Features
- Reverse connection (pull model): Worker nodes initiate outbound connections to orchestrators to receive tasks, simplifying deployment behind NAT and firewalls.
- Zero Trust verification: Message signing with HMAC-SHA256 and Ed25519 over RFC 8785 canonical JSON (
canonical_json_bytes,canonical_json_str), constant-time signature comparison, call-chain tracking (bubbling_chain), append-only provenance chains (provenance_chain), and full task envelope signing (sign_task_envelope,verify_task_envelope). - Task claiming and version negotiation: Atomic task claim endpoint (
ENDPOINT_TASK_CLAIM:POST /_worker/workers/{worker_id}/tasks/claim) withavailable_skillsandhot_skillsfiltering, plus SemVer protocol compatibility checks (check_protocol_compatibility). - Policy and telemetry tracking: Built-in support for execution constraints (
policy), holarchy call depth (depth), execution step counters (step), event hash linking (parent_hash), lease/retry metadata (lease_ttl_s,orphan_policy,job_epoch,attempt), execution cost reporting (costs), risk levels (risk), and required permissions (permissions). - Execution receipts:
ExecutionReceiptschema for recording advisory routing decisions, candidate evaluations, fallback triggers, and decision latency. - Schema inference and validation: Generates JSON Schemas from Python handler signatures (
msgspec.Struct,dataclass, models implementingmodel_json_schema, primitives) with thread-safe bounded FIFO caches (up to 2048 type schemas and 1024 compiled validators). - Deterministic serialization & model conversion:
to_dictnormalizes whole-number floats (1.0->1), stripsNonevalues from dicts, and sorts keys viaorjson;from_dictconverts dicts back into typed structures (Struct,dataclass,Enum,UUID,datetime). - Resource and skill matching: Matches hardware devices, worker properties, and
SkillInfoSemVer constraints against task requirements. - Transport resilience: WebSocket and HTTP transports with STS token refresh, exponential backoff, and HTTP 429 (
Retry-After) handling.
Ecosystem
RXON is the foundational protocol powering the distributed multi-agent automation stack:
- HLN (Holarchical Logic Network): Architecture and specification for self-similar holarchies.
- Holarchy: State-machine based orchestrator for long-running AI workflows and distributed execution.
- Holonode: Python SDK for building workers (holons) that connect to orchestrators via RXON.
Architecture & Logic
Data Integrity & Validation
- Canonical serialization:
to_dictusesorjsonto sort keys, coerce non-string dict keys to strings, stripNonedict values, and normalize whole-number floats (10.0->10). Cryptographic signatures use RFC 8785 (JCS) viacanonical_json_bytes(UTF-16 key ordering,-0.0->0, rejectingNaN/Infinity) for reproducible hashes across runtimes. - Type support: First-class support for
msgspec.Struct, standard librarydataclass,datetime,UUID,Enum, and models exposingmodel_json_schema()orschema(). - Recursion depth limit: Recursive traversal in
to_dictis bounded to 30 levels to prevent stack exhaustion on deeply nested or cyclic payloads. - Schema enforcement: JSON Schemas are compiled via
fastjsonschemaand cached in memory. Before task execution, parameters can be validated against the skill's input schema to reject missing required fields or type mismatches early.
Resource Matching
RXON defines declarative matching rules between worker resources and task requirements:
- Directional numeric matching: Capacity and throughput properties use greater-than-or-equal matching (
vram_gb >= 16,bitrate >= 500), while cost, latency, and error-rate keys matched on word boundaries (price,cost,latency,ping,jitter,fee,timeout_ms,error_rate,loss_rate,failure_rate,drop_rate) use less-than-or-equal matching. - Capability sets: When requirements specify a collection of acceptable values (e.g.
["linux", "darwin"]), matching checks for membership or non-empty set intersection; keys such asrequired_tags,tags_all,capabilities, andrequired_featuresrequire full subset inclusion (req <= worker). - Skill versions:
SkillInfo.matchessupports exact versions, build metadata (+...), and SemVer ranges (^,>=).
Execution Context & Governance
- Policy constraints (
policy): Dict containing execution constraints (e.g. allowed skills, token limits, budget caps). - Call hierarchy (
depth,step,parent_hash): Tracks call nesting depth (depth), workflow step sequence (step), and parent event hash (parent_hash). - Provenance chain (
provenance_chain): Append-only chain of intermediate hops signed with HMAC-SHA256 or Ed25519 (create_provenance_hop_*,verify_provenance_chain_*). - Task signature (
sig): HMAC-SHA256 signature generated by the orchestrator (full envelope viasign_task_envelopeor payload viasign_payload) and verified by the worker prior to execution. - Lease & retry metadata:
lease_ttl_s,orphan_policy,job_epoch,attempt,target_worker_id, andnonceprotect against stale or misrouted execution. - Timestamp (
timestamp): Integer Unix timestamp in seconds (int) to avoid floating-point rounding discrepancies across systems. - Cost reporting (
costs):TaskResult.costsfield for metrics such as consumed tokens, duration, or currency amounts (e.g.{"tokens": 1500, "usd": 0.02}).
Standard Error Codes
CONTRACT_VIOLATION_ERROR: Payload does not conform to the expected schema.SECURITY_ERROR: Authentication failure, token expiration, or signature mismatch.RESOURCE_EXHAUSTED_ERROR: Worker has insufficient memory, GPU, or compute capacity.DEPENDENCY_ERROR: Required upstream service, worker, or artifact is unavailable.
Quick Start
Worker Side (Pull)
from rxon import create_transport
from rxon.models import HardwareDevice, Resources
# 1. Initialize 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. Match against task requirements (e.g., GPU with at least 16GB VRAM)
req = Resources(devices=[HardwareDevice(type="gpu", properties={"vram_gb": 16})])
if my_res.matches(req):
print("Worker meets requirements")
Orchestrator Side (Server)
from aiohttp import web
from rxon import HttpListener
app = web.Application()
listener = HttpListener(app)
# Register RXON routes before 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"}
await listener.start(handler=my_handler)
License
This project is licensed 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.2.0
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 |
|---|---|---|---|---|
| rxon-1.2.0.tar.gz | 64.9 kB | Without provenance | Details for rxon-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rxon-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for rxon-1.2.0-py3-none-any.whl |
Total release size: 107.5 kB
Release files / rxon-1.2.0.tar.gz
| Download URL | rxon-1.2.0.tar.gz |
|---|---|
| Size | 64.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7bef218b68674fd15516ba6b8bde19570aac2db48b96af98a36e5dfda7b787d0
|
|
BLAKE2b-256 checksum How to use checksums |
d4073974bfe5f01057845a9ba3563a8ab47d0da25f3f88449ba03d88b792d4f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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.2.0-py3-none-any.whl
| Download URL | rxon-1.2.0-py3-none-any.whl |
|---|---|
| Size | 42.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1f3c44ae90461882285dc90052cc3ac4715d5e1b989de86e0472d9d475beaf6
|
|
BLAKE2b-256 checksum How to use checksums |
79c89e6757452784b8e5ca3bf3d9a5ef9e3579f6b6b55734fc69d5177ee060be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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}
|
Security for rxon 1.2.0
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.