@rubric-app/core exports four classes that compose into a complete adapter: TokenStore, BundlePoller, Evaluator, and AuditSink. Each runs independently; you wire them together at boot.
If you’re using Claude Code, the Claude Code adapter wires these for you and you don’t need this page.
TokenStore
JWT-SVID identity store. Exchanges your enrollment token for a 60-minute signed identity at boot and refreshes it before expiry.
bootstrapTokenStore performs the initial enrollment and starts the refresh loop. Call tokenStore.stop() on shutdown.
BundlePoller
Pulls your policy bundle from Rubric every 30 seconds (configurable). Calls onUpdate(bundle) whenever the content hash changes.
bundleVersion is lower than the cached one or whose builtAt is meaningfully older than the cached builtAt. Inspect poller.lastPullAt and poller.lastBundleChangeAt to detect stuck or rolled-back states.
Evaluator
Synchronous, in-process policy evaluator. Takes an EvaluationRequest and returns an EvaluationResult in well under 1ms.
AuditSink
Batched, retried shipper for audit events. enqueue() is synchronous and never blocks; a background flush task ships events to Rubric.
droppedQueueFull increments. Wire this to your monitoring so you can alarm on silent drops.
Call audit.stop(drainTimeoutMs) on shutdown to flush remaining events synchronously up to the deadline.