PROTOCOL ENGINEERING · v2.0.0

Argus RPC

TypeScript RPC Over Persistent TCP

Overview

Argus RPC v2 is a compact TypeScript RPC runtime and wire protocol built from first principles over persistent TCP. It uses a 14-byte binary frame header and uint32 message IDs to multiplex independent calls without imposing HTTP semantics on the transport, with explicit failure behaviour for deadlines, cancellation, overload, retries, backpressure, and unhealthy connections.

Platform proof

The v2 rewrite focuses on the failure cases that make network runtimes difficult in practice: hostile declared frame lengths, arbitrary TCP fragmentation, write backpressure, out-of-order completion, message-ID wraparound, deadline and cancellation races, overloaded servers, transient retry classification, failed pooled connections, circuit breaking, and bounded observability. The result remains deliberately small and unary-RPC focused rather than hiding incomplete streaming or cross-language features behind a broad feature list.

Key capabilities

Argus Wire Protocol v214-byte Binary Frame HeaderOut-of-Order MultiplexingDistributed DeadlinesCANCEL Frames + AbortSignalBounded Server ConcurrencyBounded Backpressure WriterIncremental Frame DecoderTransient-Aware RetriesLeast-Loaded Connection PoolCircuit BreakerPING/PONG + RTT KeepaliveMetadata + InterceptorsCanonical RPC StatusesBounded Runtime MetricsPluggable Codecs

Protocol and resource limits

1 KiB Default Method Limit8 MiB Default Payload Limit4 MiB Default Write Queueuint32 Message IDsOversized Length Rejection Before Body BufferingDirection Validation

Argus validates declared lengths before waiting for frame bodies, separates practical configurable ceilings from wider wire-field maxima, reserves message ID zero, and safely wraps uint32 IDs while avoiding collisions with live calls.

Reliability model

Deadline PropagationBest-Effort CancellationAbortable Server HandlersFIFO Concurrency QueueOverload ProtectionExponential Backoff + JitterElapsed Retry BudgetFailed-Channel RetirementBounded Acquisition Wait

Calls can complete out of order on a shared connection. Retries are opt-in and status-aware rather than applied to every application failure, while transport failures retire unhealthy pooled channels so capacity can be recreated instead of leaving dead connections occupying pool slots.

Technical profile

TypeScriptNode.js 20 / 22 / 24Raw TCP SocketstsupVitestGitHub ActionsZero Runtime Dependencies

Architecture signal

Caller ↓ Collision-safe uint32 message ID ↓ Deadline + metadata envelope ↓ Frame encoder ↓ SocketWriter · bounded queue / drain handling ↓ Persistent TCP connection ↓ Incremental frame decoder ↓ Protocol + resource validation ↓ Bounded concurrency limiter ↓ Interceptor chain ↓ Method handler + AbortSignal ↓ RESPONSE / ERROR / cancellation lifecycle ↓ Message-ID correlation back to caller

Observability and extensibility

Aggregate CountersFixed-Bucket HistogramsConnection / Call GaugesPool StatisticsServer InterceptorsNormalized MetadataArgusCodecRegistryJSON CodecRaw Buffer Codec

The metrics model keeps bounded aggregate state rather than retaining per-call latency samples. Interceptors provide a composable policy boundary for authentication, authorization, tracing, tenant context, and application-specific measurements without coupling those concerns to the wire decoder.

Verification and release

v2.0.0128 Tests37 Test FilesNode 20 CINode 22 CINode 24 CInpm pack VerificationDeterministic Fragmentation Fuzzing

The v2 release checkpoint is verified by CI across Node 20, 22, and 24 with clean install, strict TypeScript typechecking, the full test suite, and package build; Node 22 additionally runs npm pack --dry-run. The suite covers malformed and oversized frames, random fragmentation, backpressure races, out-of-order concurrency, deadline/cancellation races, retry behaviour, multiplexed pooling, circuit breaking, keepalive, interceptors, metrics, and benchmark execution.

Benchmark discipline

The benchmark harness now records error rate, average latency, p50/p90/p95/p99/max latency, requests per second, warmup configuration, and machine/runtime metadata, with optional machine-readable JSON output. Argus intentionally does not publish a made-up throughput multiplier: performance results are only meaningful with the commit, machine, Node version, concurrency, payload shape, request count, and methodology attached.

Engineering focus

Protocol EngineeringDistributed Failure SemanticsBinary FramingConcurrency ControlBackpressureCancellation RacesConnection HealthResource BoundingObservabilityReproducible Benchmarking

Skills

TypeScriptNode.jsTCP NetworkingBinary Protocol DesignRPC SystemsDistributed SystemsConcurrencyResilience EngineeringTestingCI/CD

Technical note

Argus v2 keeps the network mechanics explicit: bytes belong to the protocol layer, sockets and backpressure belong to transport, deadlines and cancellation belong to RPC semantics, retry/pool/health behaviour belongs to policy, and observability measures the runtime without changing correctness. The project is intentionally scoped to robust unary request/response RPC over raw TCP; it does not claim integrated TLS, streaming, negotiated compression, service discovery, or cross-language code generation as completed v2 features.

Discuss this project

Open to backend, platform, API, tooling, CMS, and business software conversations.

Work emailwilliams@zivoralabs.xyz

link Book 30min call