Skip to main content

Runtime SDK

Supported package:

@proof-computer/liskov-runtime
github:proof-computer/liskov-runtime-js#v0.3.38

The main export keeps the compatibility name bootstrapSlipwayRuntime. bootstrapLiskovRuntime is an alias in this release. Use the documented high-level handle rather than low-level protocol modules. Use v0.3.38. It includes the V5 JavaScript signed runtime-env fallback and current secret installation. Releases before v0.3.28 cannot bootstrap against the current platform and are not supported. v0.3.34 is the first release that decrypts a secret grant on a processor with a secp256k1 encryption key (see Processor key kinds).

Minimal call​

const runtime = await bootstrapSlipwayRuntime({
component: "worker",
revision: "release-2026-07-28"
});

Handle​

MemberContract
homeResolved SDK state directory.
env.get(name)Return a final runtime value or undefined.
env.require(name)Return a final runtime value or throw when absent.
contextRead-only cached LiskovRuntimeContext or undefined when no valid context was supplied. Release-gated v1.
refreshRuntimeContext()One explicit signed request returning Promise<LiskovRuntimeContext>; replace the cache on success only. Release-gated v1.
status()Return current identity, blockers, and capability states.
whenReady()Resolve immediately when required capabilities are ready; otherwise throw SlipwayRuntimeNotReadyError.
log(event, details?, options?)Emit a structured Liskov log record.
flush()Bounded log flush returning counts and state.
refreshNow()Refresh runtime env, make one eligible background-secret attempt, then refresh logging.
diagnostics.report(...)Send an ordinary bounded signed diagnostic.
diagnostics.fatal(...)First-call-wins terminal boundary; close health/logging and make one bounded signed attempt.
stop()Synchronously and idempotently stop SDK timers/retries.

stop() does not stop the Acurast job.

Job runtime context​

Release-gated v1: SDK v0.3.38 exports this API, but public availability waits for the diagnostic readback. See Capabilities and limits.

LiskovRuntimeContext is a read-only snapshot from signed bootstrap or an explicit refresh. All fields below are present in a valid snapshot. null means that fact was not available, not an empty string or zero; the SDK preserves legitimate empty strings and zero timestamps. runtime.context itself is undefined if bootstrap omitted context or supplied an invalid optional block. All *Ms timestamps are milliseconds since the Unix epoch.

FieldTypeMeaning / null semantics
schema"proof.liskov.runtime-context.v1"Context schema identifier.
serverTimeMsnumberServer time when this snapshot was built.
application.uidstringStable Application key (app-…); use this for durable logic.
application.namestringSlug label; may change.
application.displayNamestring | nullDisplay label; null when not available. May change.
deployment.liskovDeploymentIdstringBound Liskov deployment identity.
deployment.acurastDeploymentIdstring | nullAcurast deployment identity; null when not recorded on the binding.
job.idstringThis job's identity.
job.scheduleEndsAtMsnumber | nullScheduled end; null when not recorded.
processor.idstringProcessor running this job.
policy.digeststringBound policy digest.
policy.versionIdstring | nullBound policy version; null when not available.
artifact.cidstring | nullArtifact CID from the policy; null when absent there.
artifact.digeststring | nullArtifact digest from the policy; null when absent there.
capabilities.runtimeEnvbooleanWhether this launch uses managed runtime configuration.
capabilities.secretsbooleanWhether this launch declares secrets.
capabilities.loggingbooleanWhether logging is enabled in the bound policy.
capabilities.ingressbooleanCurrently false; no public ingress capability is supplied by bootstrap.
network.observedWanIpstring | nullPublic IP observed on this job's request; null when no IP was observed.
network.observedAtMsnumber | nullIP observation time; null when no IP was observed.
network.geolocation.status"ready" | "pending" | "stale" | "disabled" | "unavailable" | "not_observed"Whether the approximate place may be treated as current.
network.geolocation.countryCodestring | nullApproximate country code; null when unavailable.
network.geolocation.countryNamestring | nullApproximate country name; null when unavailable.
network.geolocation.regionstring | nullApproximate region; null when unavailable.
network.geolocation.citystring | nullApproximate city; null when unavailable.
network.geolocation.asOfMsnumber | nullGeography resolution time; null when not recorded.
network.geolocation.accuracy"ip-derived"Geography is derived from the observed IP.

Only ready means current geography for the observed IP. Even then, some place fields can be null. pending can retain geography for an older IP; stale can retain an expired observation. Neither is current. disabled means the provider is switched off, unavailable means the observation could not be read, and not_observed means no WAN IP was seen on this request. These states do not fail bootstrap or managed configuration delivery.

The capability flags describe launch facts, not current readiness or new permissions. The snapshot is introspection, not a portable attestation. See Read what Liskov knows about this job for the identity and IP caveats.

Runtime context refresh errors​

await runtime.refreshRuntimeContext() sends one signed POST /api/jobs/runtime-context using the bootstrap job and processor binding. Each call signs a fresh nonce. There is no automatic retry, backoff, logging or polling for runtime context. A success updates runtime.context; a failure leaves the previous snapshot intact. refreshNow() refreshes configuration, secrets and logging, not runtime context.

A refused HTTP response throws LiskovRuntimeContextRefusedError with code: string, status: number (the HTTP status) and retryable: boolean. The SDK marks only HTTP 429 and 503 retryable; it still performs no retry. Common refusal codes are:

CodeHTTP statusCustomer action
runtime_context_request_invalid400Check the pinned SDK and signed bootstrap path; do not handcraft the request.
runtime_context_job_unbound409Verify the job still has its bootstrap binding; keep optional introspection disabled if it does not.
runtime_context_expiry_invalid400Check the job clock and SDK version; do not resend the same request.
runtime_context_request_stale403Check the job clock; a later explicit call creates a fresh request.
runtime_context_signature_invalid403Check signed bootstrap and the job identity; do not substitute another identity.
runtime_context_nonce_replayed409The nonce was already used; never retry that signed request.
runtime_context_rate_limited429Wait before making a new explicit call.
runtime_context_store_unavailable503Keep the last snapshot and try a new explicit call later if needed.
runtime_context_request_refusedResponse statusFallback when no recognized runtime-context code is returned; inspect the HTTP status.

Without a signed bootstrap binding, refresh throws SlipwayRuntimeNotReadyError. Malformed JSON, an invalid context schema or mismatched response bindings throw an ordinary Error; do not use the rejected response as a snapshot. If absence or refusal prevents your job from running, handle it explicitly in application code rather than polling.

Capability states​

runtimeEnv, secrets, logging, diagnostics, and the optional ingress adapter use:

StateMeaning
offIntentionally disabled.
pendingWork has not reached a conclusion.
readyCurrent capability is usable.
degradedPartially available; inspect code/message.
failedAttempt failed.
blockedPrerequisite or trust condition prevents progress.

Each capability also states whether it is required. status.ready is true only when all required capabilities are ready.

Common bootstrap options​

OptionValues/default
appId, component, revisionOptional diagnostic/log metadata. The SDK never derives Application UID from the slug.
homeExplicit state root; otherwise compatibility env, user home, then /tmp/slipway.
secrets.moderequired, background, or off; required when signed bootstrap says secrets are required.
secrets.retryDefaults: initial 0 ms, interval 5,000 ms, max elapsed 60,000 ms, max attempts 12.
logging.modebackground by default; also required or off.
logging.earlyBufferMaxRecordsDefault 100 in-memory early records.
logging.spoolModeauto, disk, or memory.
runtimeHealthOptional interval, initial delay, and send-timeout overrides.
diagnosticsLocal callback for redacted SDK events.

Transport, clock, environment, identity, randomness, and timer injection options are test hooks; production code normally leaves them unset.

Lookup and bootstrap order​

Initial values are read from process environment, then Acurast _STD_.env, then Acurast environment(name). Signed Liskov bootstrap is authoritative for the current job, installs runtime-env values, obtains required secret grants, and then attaches logging. Application code should read through runtime.env only after bootstrap.

Reserved compact environment values are compatibility wire contracts supplied by Liskov. Customers should not create, expose, or copy them manually.

Logging types​

Severity is debug, info, warn, or error. Labels are string pairs. flush() returns {ok, state, flushed, pending, dropped, message?}. Application log details must be JSON-safe and non-secret.

See Use the Liskov runtime SDK for a guided entrypoint.