Skip to content
mojoatomic edited this page Oct 1, 2025 · 68 revisions

RDCP SDK Wiki

Complete JavaScript/TypeScript SDK for Runtime Debug Control Protocol v1.0

npm: @rdcp.dev/core npm: @rdcp.dev/client npm: @rdcp.dev/server CI Protocol Compliance

New: Read the in-depth RDCP Technical Analysis and Architecture Overview rdcp-technical-analysis

What is RDCP SDK?

RDCP stands for Runtime Debug Control Protocol β€” a standardized HTTP-based protocol for controlling configurable behaviors in distributed applications at runtime.

While RDCP started as a protocol for debug logging control, it has evolved into enterprise-grade runtime system control infrastructure. The protocol defines 5 required endpoints (discovery, control, status, health, plus protocol discovery) that allow external tools to enable/disable categorized behaviors without requiring application restarts.

Infrastructure Control Plane

  • Kubernetes = Container Control Plane
  • Istio = Service Mesh Control Plane
  • RDCP = Application Behavior Control Plane

Network effect potential

Once services are RDCP-compliant:

  • ANY admin tool can work with ANY service
  • ANY incident response system can control ANY application
  • ANY compliance system can audit ANY behavior
  • ANY monitoring tool can dynamically enable debugging

Standards positioning

HTTP β†’ Web communication standard
gRPC β†’ RPC communication standard
OTEL β†’ Observability data standard
RDCP β†’ Operational control standard

RDCP aims to serve as a general-purpose operational control primitive that complements monitoring and configuration systems. It fills a practical gap between observing systems and safely changing their behavior at runtime.

See also: Universal Service Discovery β€” how services advertise capabilities for environment-wide inventory and tooling.

Core Use Cases

πŸ”§ Performance & Profiling Controls

  • Enable/disable CPU profiling and memory allocation tracking
  • Control database query timing and expensive instrumentation
  • Toggle stack trace collection and adjust sampling rates

πŸš€ Feature Flag Management

  • Runtime enable/disable of experimental features
  • A/B testing controls adjustable without deployments
  • Circuit breaker controls for external services

πŸ”’ Security & Audit Controls

  • Detailed security logging for auth attempts and authorization failures
  • PII logging levels for compliance requirements
  • Request/response logging for security analysis

βš™οΈ Development vs Production Behaviors

  • Switch between dev-friendly and production-safe error messages
  • Control mock vs real external API usage
  • Toggle local vs cloud storage backends

πŸ“Š Resource Usage Controls

  • Enable/disable caching mechanisms and connection pool behaviors
  • Control sync vs async processing modes
  • Toggle retry mechanisms and timeout behaviors

🌐 Third-party Integration Controls

  • Enable/disable specific external service integrations
  • Toggle between primary and backup service endpoints
  • Control service discovery and load balancing behaviors

The RDCP SDK provides a complete implementation of RDCP v1.0, making it easy to add these standardized runtime control capabilities to any JavaScript/Node.js application with zero overhead when controls are disabled.

Quick Start

# Server SDK (adapters, endpoints, auth)
npm install @rdcp.dev/server
# Client SDK (fetch-based)
npm install @rdcp.dev/client
# Core (protocol constants, error codes, schemas)
npm install @rdcp.dev/core
const { adapters, auth } = require('@rdcp.dev/server')
const express = require('express')

const app = express()
app.use(express.json())

// Add RDCP endpoints with authentication
const rdcpMiddleware = adapters.express.createRDCPMiddleware({
  authenticator: auth.validateRDCPAuth
})

app.use(rdcpMiddleware)
app.listen(3000)

// βœ… RDCP endpoints now available:
// GET  /.well-known/rdcp
// GET  /rdcp/v1/discovery 
// POST /rdcp/v1/control
// GET  /rdcp/v1/status
// GET  /rdcp/v1/health

What's New (2025-09-25)

  • RDCP v1.0/v2.0 delivers a complete runtime control ecosystem:
    • @rdcp.dev/client 1.0.0 β€” control applications (Node 18+, native fetch)
    • @rdcp.dev/server 2.1.0 β€” target applications (adapters/endpoints/auth)
    • @rdcp.dev/core 1.0.0 β€” shared protocol definitions (schemas, constants, error codes)
    • OpenTelemetry integration β€” end-to-end trace correlation of control operations
  • End-to-end developer workflows: programmatic control via client SDK (no more curl-first examples)
  • Updated install snippets and docs; demo app integration with client SDK is tracked

Previous highlights (2025-09-20)

  • New error code: RDCP_REQUEST_ID_INVALID (400) for malformed X-RDCP-Request-ID headers
  • Adapters now always echo the correlation header as X-Request-Id on all RDCP responses; a UUID is generated when the client does not supply X-RDCP-Request-ID
  • RateLimit draft-7 headers (RateLimit, RateLimit-Policy, RateLimit-Remaining, RateLimit-Reset) are emitted consistently across adapters when enabled; 429 responses include Retry-After and structured error details
  • Audit failure behavior now supports ignore, warn, and fail modes. In warn mode, responses include Warning: 199 rdcp "audit-write-failed" when the audit sink fails

See: Error-Responses.md (error codes, rate-limit details) and Basic-Usage.md (capabilities configuration and examples).

Documentation

Start Here

More Resources

Getting Started

Framework Integration

OpenTelemetry Integration

Enterprise Deployment

Authentication & Security

  • Authentication-Setup - 3 security levels: Basic, Standard, Enterprise
  • Multi-Tenancy - Tenant isolation and context management
  • Error-Responses - Standardized error schema, codes, and assertions
  • Testing-Helpers - JWT scopes, mTLS simulation, hybrid and tenant patterns
  • JWKS - Enable JWKS, security notes, and HS256 β†’ RS256 migration
  • Logging - Debug-by-default with env-gated warnings

Migration & Advanced

API Reference

Protocol Reference (Advanced)

Notes:

  • These are authoritative but dense. Most users should start with the Quick Reference and Demo App pages above.

Development

Features

βœ… Complete RDCP v1.0 Protocol Compliance
βœ… All 3 Security Levels - Basic (API Key), Standard (JWT), Enterprise (mTLS)
βœ… Multi-Framework Support - Express, Fastify, Koa, Next.js
βœ… Client & Server SDKs - Full bidirectional RDCP implementation
βœ… Multi-Tenancy Support - Organization, namespace, and process isolation
βœ… Zero Configuration - Works out of the box with sensible defaults
βœ… TypeScript Support - Full type definitions included

Protocol Compliance

Status: Level 2: Standard (RDCP v1.0)

  • βœ… All required endpoints implemented with correct response formats
  • βœ… 3 authentication security levels supported
  • βœ… Multi-tenancy with standard header support
  • βœ… Protocol-compliant error handling
  • βœ… Client & Server SDKs; Temporary controls (TTL) promoted to core (server + adapters + client)
  • βœ… Testing coverage: 201 passing tests across 25 test suites
  • ℹ️ Demo app includes examples for rate limiting and audit trail

Last updated: 2025-09-20
See PROTOCOL-COMPLIANCE-REPORT for detailed analysis.

Requirements

  • Node.js: 16.0.0 or higher
  • Frameworks: Express 4.18+, Fastify 4.0+, or Koa 2.0+

License

Apache License 2.0 β€” see LICENSE file for details.


How to contribute to the docs

  • Edit pages under wiki/ in this repository and open a PR
  • Keep examples copy/pasteable and tested against the demo app
  • Prefer linking to existing pages over duplicating content
  • For advanced protocol details, link to docs/rdcp-protocol-specification.md and docs/rdcp-implementation-guide.md

Next steps

Clone this wiki locally