API Reference · public documentation
Runtime API Reference
Runtime lifecycle, identity, initial/live/recovery claim plans, observation claims, reconciliation, and trace contracts.
Package-root boundary
ESM · Node >=22
import * as AnswerUp from '@answerup/runtime';Documentation is public and this import is illustrative. Packages are not yet generally available; use it with the exact archives supplied through your trusted preview handoff.
Outcome-aware claim plans
const propositions = {
COMMITTED: { propositionRef: 'effect:committed' },
DISPROVED: { propositionRef: 'effect:did-not-occur' },
UNKNOWN: { propositionRef: 'observation:unresolved' },
};InitialExecutionClaimPlan, LiveReconciliationClaimPlan, and RecoveryClaimPlan are distinct boundaries. Their three entries are mutually exclusive alternatives. Authoritative truth is established first; only the matching proposition is selected for Core evaluation. Plan-based UNKNOWN authority appears through observationClaims with one of the exact historical scopes RELATED_INITIAL_VERIFICATION_OBSERVATION_ONLY, RELATED_LIVE_RECONCILIATION_OBSERVATION_ONLY, or RELATED_RECOVERY_OBSERVATION_ONLY.
Raw versioned declarations
These public static resources are the versioned declarations for @answerup/runtime@0.2.0-preview.5. They contain no package implementation JavaScript.
curl -fsS https://build.answerup.ai/declarations/runtime/0.2.0-preview.5/index.d.ts -o runtime-0.2.0-preview.5.d.tsPublic package exports
Governed initial execution, one-shot live reconciliation, host-authorized durable recovery, and exact proposition evaluation. Every export has a stable URL fragment; the versioned declarations define these signatures.
Constants and values
CORE_SURFACE_VERSIONconstant
export declare const CORE_SURFACE_VERSION: string;RUNTIME_ARTIFACTS_CONTRACTconstant
export declare const RUNTIME_ARTIFACTS_CONTRACT: "answerup-runtime-artifacts/1";RUNTIME_VERSIONconstant
export declare const RUNTIME_VERSION: "0.2.0-preview.5";SUPPORTED_CORE_SURFACEconstant
export declare const SUPPORTED_CORE_SURFACE: "1.0.0-rc.1";Functions
createActionRuntimefunction
export declare function createActionRuntime(options?: unknown): ActionRuntime;defineActionfunction
export declare function defineAction(definition: ActionDefinition): ActionDefinition;Interfaces
ActionDefinitionBaseinterface
export interface ActionDefinitionBase { readonly name: string; readonly version: string; readonly ground: Function; readonly authorize: Function; readonly adapter: { readonly dispatch: Function }; readonly verifier: { readonly verify: Function }; readonly recoveryVerifier?: StableRecoveryVerifierDefinition; readonly [key: string]: unknown; }ActionRuntimeinterface
export interface ActionRuntime { register(definition: ActionDefinition): Readonly<{ name: string; version: string }>; execute(name: string, input: unknown, context?: unknown): Promise<RuntimeExecutionResult>; /** Legacy/outcome-specific live reconciliation. */ reconcile(resultOrHandle: RuntimeExecutionResult | LiveReconciliationHandle): Promise<RuntimeExecutionResult>; reconcile(resultOrHandle: RuntimeExecutionResult | LiveReconciliationHandle, options: Readonly<{ claimPlan: LiveReconciliationClaimPlan }>): Promise<RuntimeExecutionResult>; exportRecoveryRecord(result: RuntimeExecutionResult, metadata: Readonly<{ durableRevision: number; durableSequence: number; acceptedLedgerRef: string; configurationDigest: string }>): DurableRecoveryRecord; /** Legacy/outcome-specific recovery overload. */ rehydrateRecovery(input: Readonly<{ record: DurableRecoveryRecordV1; authority: RecoveryAuthority; verifier: RecoveryVerifierRegistration; claim: RecoveryClaimProposal }>): Promise<VerifierOnlyRecovery>; /** Legacy/outcome-specific recovery overload. */ rehydrateRecovery(input: Readonly<{ record: DurableRecoveryRecordV2; authority: RecoveryAuthority; claim: RecoveryClaimProposal }>): Promise<VerifierOnlyRecovery>; rehydrateRecovery(input: Readonly<{ record: DurableRecoveryRecordV1; authority: RecoveryAuthority; verifier: RecoveryVerifierRegistration; claimPlan: RecoveryClaimPlan }>): Promise<VerifierOnlyRecovery>; rehydrateRecovery(input: Readonly<{ record: DurableRecoveryRecordV2; authority: RecoveryAuthority; claimPlan: RecoveryClaimPlan }>): Promise<VerifierOnlyRecovery>; project(result: RuntimeExecutionResult): RuntimeProjectionResult; claims(result: RuntimeExecutionResult): unknown; trace(result: RuntimeExecutionResult): unknown; conformance(action?: string | ActionDefinition): unknown; [key: string]: unknown; }DurableRecoveryProofinterface
export interface DurableRecoveryProof { readonly accepted: true; readonly durableRevision: number; readonly durableSequence: number; readonly acceptedLedgerRef: string; readonly proofDigest: string; }DurableRecoveryProofV2interface
export interface DurableRecoveryProofV2 extends DurableRecoveryProof { readonly sourceRecordDigest: string; }DurableRecoveryRecordV1interface
export interface DurableRecoveryRecordV1 {
readonly contract: "answerup-runtime-recovery/1";
readonly runtimeVersion: string;
readonly coreSurfaceVersion: "1.0.0-rc.1";
readonly recoveryRequestIdentity: string;
readonly tenantScope: string;
readonly actionName: string;
readonly actionVersion: string;
readonly operationIdentity: string;
readonly executionIdentity: string;
readonly effectIdentity: string;
readonly attemptIdentity: string;
readonly candidateBindingDigest: string;
readonly subjectDigest: string;
readonly effectAttributesDigest: string;
readonly authorization: Readonly<{ decision: "PERMIT"; scopeRef: string; policyRevision: string; authorityIdentity: string }>;
readonly provider: Readonly<{ adapterIdentity: string; capability: Readonly<{ capabilityId: string; majorVersion: number }>; providerReference: string | null; providerIdempotencyReference: string | null }>;
readonly verifier: Readonly<{ verifierIdentity: string; capability: Readonly<{ capabilityId: string; majorVersion: number }> }>;
readonly dispatchBoundary: RecoveryDispatchBoundary;
readonly attemptOutcome: RecoveryAttemptOutcome;
readonly effectStatus: "UNKNOWN";
readonly lastObservation: Readonly<{ observationRef: string | null; observationVersion: string | null; stateDigest: string | null; finalityRef: string | null }>;
readonly claim: Readonly<{ claimType: "EFFECT_UNKNOWN"; attributesDigest: string }>;
readonly reconciliation: Readonly<{ revision: number; sequence: number; state: "PENDING" | "IN_PROGRESS"; verificationCount: number; lastVerificationAttemptIdentity: string | null }>;
readonly acceptedLedgerRef: string;
readonly configurationDigest: string;
readonly canonicalizationVersion: string;
readonly recordDigest: string;
}DurableRecoveryRecordV2interface
export interface DurableRecoveryRecordV2 extends Omit<DurableRecoveryRecordV1, "contract" | "runtimeVersion" | "canonicalizationVersion"> {
readonly contract: "answerup-runtime-recovery/2";
readonly runtimeVersion: "0.2.0-preview.3" | "0.2.0-preview.4" | "0.2.0-preview.5";
readonly stableRecoveryVerifier: StableRecoveryVerifierBinding;
readonly executionBindingNonce: string;
readonly canonicalizationVersion: "answerup-runtime-recovery-canonical/v2";
}InitialExecutionClaimPlaninterface
export interface InitialExecutionClaimPlan {
readonly propositions: Readonly<{
readonly COMMITTED: InitialExecutionClaimPlanProposition;
readonly DISPROVED: InitialExecutionClaimPlanProposition;
readonly UNKNOWN: InitialExecutionClaimPlanProposition;
}>;
}
/** Historical authority for the exact initial verification observation; never current-state, terminal, retry, redispatch, or recovery authority. */InitialExecutionClaimPlanPropositioninterface
export interface InitialExecutionClaimPlanProposition { readonly propositionRef: string; }
/** Complete registration-owned, data-only plan. Runtime selects exactly one proposition after initial authoritative truth is established. */InitialVerificationObservationClaiminterface
export interface InitialVerificationObservationClaim { readonly claimType: "EFFECT_UNKNOWN"; readonly authorityScope: "RELATED_INITIAL_VERIFICATION_OBSERVATION_ONLY"; readonly bindingDigest: string; }LiveReconciliationClaimPlaninterface
export interface LiveReconciliationClaimPlan {
readonly propositions: Readonly<{
readonly COMMITTED: LiveReconciliationClaimPlanProposition;
readonly DISPROVED: LiveReconciliationClaimPlanProposition;
readonly UNKNOWN: LiveReconciliationClaimPlanProposition;
}>;
}
/** Historical authority for one exact related live observation; never current-state, terminal, retry, or redispatch authority. */LiveReconciliationClaimPlanPropositioninterface
export interface LiveReconciliationClaimPlanProposition { readonly propositionRef: string; }
/** Complete data-only plan supplied at live reconciliation request time. */LiveReconciliationHandleinterface
export interface LiveReconciliationHandle { readonly __answerupLiveReconciliationHandle: unique symbol; }LiveReconciliationObservationClaiminterface
export interface LiveReconciliationObservationClaim { readonly claimType: "EFFECT_UNKNOWN"; readonly authorityScope: "RELATED_LIVE_RECONCILIATION_OBSERVATION_ONLY"; readonly bindingDigest: string; }RecoveryAuthorityinterface
export interface RecoveryAuthority {
readonly acquire: (record: DurableRecoveryRecord) => Promise<DurableRecoveryAuthorityProof | null>;
readonly commit: (record: DurableRecoveryRecord, proof: DurableRecoveryAuthorityProof, patch: RecoveryCommitPatch) => Promise<boolean>;
readonly release: (record: DurableRecoveryRecord, proof: DurableRecoveryAuthorityProof) => Promise<void>;
}RecoveryClaimPlaninterface
export interface RecoveryClaimPlan {
readonly subjectRef: string;
readonly attributes: Readonly<Record<string, string | number | boolean | null>>;
readonly propositions: Readonly<{
readonly COMMITTED: RecoveryClaimPlanProposition;
readonly DISPROVED: RecoveryClaimPlanProposition;
readonly UNKNOWN: RecoveryClaimPlanProposition;
}>;
}RecoveryClaimPlanPropositioninterface
export interface RecoveryClaimPlanProposition { readonly propositionRef: string; }
/** Complete data-only plan. Runtime selects exactly one proposition after recovered truth is established. */RecoveryClaimProposalinterface
export interface RecoveryClaimProposal { readonly claimType: "EFFECT_COMMITTED" | "EFFECT_DISPROVED" | "EFFECT_UNKNOWN"; readonly effectIdentity: string; readonly executionIdentity: string; readonly subjectRef: string; readonly propositionRef?: string | null; readonly polarity: "positive" | "negative"; readonly scope: "historical_effect"; readonly attributes: Readonly<Record<string, string | number | boolean | null>>; }RecoveryCommitPatchinterface
export interface RecoveryCommitPatch extends Readonly<Record<string, unknown>> {
readonly status: "COMMITTED" | "DISPROVED" | "UNKNOWN";
readonly sourceRecordDigest?: string;
readonly nextSourceRecordDigest?: string | null;
readonly recoveryRecord?: DurableRecoveryRecord;
}RecoveryObservationBindinginterface
export interface RecoveryObservationBinding { readonly recoveryRecordIdentity: string; readonly durableRevision: number; readonly durableSequence: number; readonly sourceRecordDigest: string; readonly relatedResultIdentity: string; }
/** Historical authority for one exact accepted recovery observation. It is not current-state or terminal authority. */RecoveryObservationClaiminterface
export interface RecoveryObservationClaim { readonly claimType: "EFFECT_UNKNOWN"; readonly authorityScope: "RELATED_RECOVERY_OBSERVATION_ONLY"; readonly bindingDigest: string; readonly relatedResult: RecoveryObservationBinding; }RecoveryVerifierRegistrationinterface
export interface RecoveryVerifierRegistration {
readonly actionName: string;
readonly actionVersion: string;
readonly verifierIdentity: string;
readonly capability: Readonly<{ capabilityId: string; majorVersion: number }>;
readonly timeoutMs?: number;
readonly verify: (request: RecoveryVerifierRequest) => Promise<RecoveryVerifierResult>;
}
/** Legacy/outcome-specific: the caller preselects one outcome and Core fails closed on mismatch. */RecoveryVerifierRequestinterface
export interface RecoveryVerifierRequest {
readonly contract: "answerup-runtime-recovery-verifier/1";
readonly tenantScope: string;
readonly actionName: string;
readonly actionVersion: string;
readonly operationIdentity: string;
readonly executionIdentity: string;
readonly effectIdentity: string;
readonly attemptIdentity: string;
readonly candidateBindingDigest: string;
readonly effectAttributesDigest: string;
readonly providerReference: string | null;
readonly observationRevision: number;
readonly signal: AbortSignal;
}RuntimeArtifactProjectioninterface
export interface RuntimeArtifactProjection { readonly contract: ContractVersion; readonly projectionKind: "NORMAL"; readonly projectionVersion: ProjectionVersion; readonly projectionIntegrity: "VALID" | "TRUNCATED"; readonly identities: RuntimeIdentityProjection; readonly effect: RuntimeEffectProjection; readonly claimDecision: ArtifactSlot<ClaimDecision>; readonly authorization: ArtifactSlot<Readonly<{ readonly decision: "PERMIT" | "DENY" | "INDETERMINATE" }>>; readonly grounding: ArtifactSlot<Readonly<{ readonly status: "GROUNDED" | "AMBIGUOUS" | "UNRESOLVED" | "INVALID" }>>; readonly claimPermission: RuntimeClaimProjection; readonly trace: RuntimeTraceProjection; readonly reconciliation: ArtifactSlot<"PENDING" | "RESOLVED">; }RuntimeClaimProjectioninterface
export interface RuntimeClaimProjection { readonly decision: ArtifactSlot<ClaimDecision>; readonly claimType: ArtifactSlot<"EFFECT_COMMITTED" | "EFFECT_DISPROVED" | "EFFECT_UNKNOWN" | "EXECUTION_ATTEMPTED">; readonly binding: ArtifactSlot<Readonly<{ readonly effectIdentity: string; readonly executionIdentity: string }>>; }RuntimeEffectProjectioninterface
export interface RuntimeEffectProjection { readonly dispatchBoundary: DispatchBoundary; readonly truth: EffectTruth; readonly resolution: ArtifactSlot<{ readonly state: EffectResolutionState; readonly observationRef?: string; readonly finalityRef?: string }>; readonly providerReference: ArtifactSlot<string>; readonly providerIdempotencyReference: ArtifactSlot<string>; }RuntimeExecutionResultinterface
export interface RuntimeExecutionResult { readonly __answerupRuntimeOwnedResult: unique symbol; readonly contract: ContractVersion; readonly status: EffectTruth | "CLARIFICATION_REQUIRED" | "READY"; readonly operationIdentity?: string; readonly effectIdentity?: string; readonly executionIdentity?: string; readonly attemptIdentity?: string | null; readonly adapterResult?: string; readonly effectResolution?: unknown; readonly claimPermission?: unknown; readonly safeClaims?: readonly unknown[]; readonly observationClaims?: readonly (RecoveryObservationClaim | LiveReconciliationObservationClaim | InitialVerificationObservationClaim)[]; readonly needsClarification?: boolean; readonly needsReconciliation?: boolean; readonly reconciliation?: LiveReconciliationHandle; readonly recoveryRecord?: DurableRecoveryRecord; readonly handle?: object; readonly trace?: readonly unknown[]; }RuntimeIdentityProjectioninterface
export interface RuntimeIdentityProjection { readonly operationIdentity: ArtifactSlot<string>; readonly effectIdentity: ArtifactSlot<string>; readonly executionIdentity: ArtifactSlot<string>; readonly attemptIdentity: ArtifactSlot<string>; }RuntimeProjectionFailureinterface
export interface RuntimeProjectionFailure { readonly contract: ContractVersion; readonly projectionKind: "PROJECTION_FAILURE"; readonly projectionVersion: ProjectionVersion; readonly reason: "SIZE_LIMIT"; readonly effectTruth: EffectTruth; readonly dispatchBoundary: DispatchBoundary; readonly projectionIntegrity: "FAILED"; }RuntimeProjectionResultinterface
export interface RuntimeProjectionResult { readonly status: "PROJECTED" | "PROJECTION_UNAVAILABLE" | "MALFORMED_INPUT"; readonly effectTruth: EffectTruth | "UNAVAILABLE"; readonly projection: ArtifactSlot<RuntimeProjectionValue>; }RuntimeTraceProjectioninterface
export interface RuntimeTraceProjection { readonly records: readonly RuntimeTraceRecord[]; readonly truncated: boolean; readonly omittedRecordCount: number; }StableRecoveryVerifierBindinginterface
export interface StableRecoveryVerifierBinding {
readonly verifierIdentity: string;
readonly capability: Readonly<{ readonly capabilityId: string; readonly majorVersion: number }>;
readonly configurationDigest: string;
}StableRecoveryVerifierDefinitioninterface
export interface StableRecoveryVerifierDefinition extends StableRecoveryVerifierBinding {
readonly timeoutMs?: number;
readonly verify: (request: RecoveryVerifierRequest) => Promise<RecoveryVerifierResult> | RecoveryVerifierResult;
}VerifierOnlyRecoveryinterface
export interface VerifierOnlyRecovery { readonly kind: "VERIFIER_ONLY_RECOVERY"; readonly operationIdentity: string; readonly executionIdentity: string; readonly effectIdentity: string; readonly attemptIdentity: string; readonly reconcile: () => Promise<RuntimeExecutionResult>; }Types
ActionDefinitiontype
export type ActionDefinition = ActionDefinitionBase & ActionDefinitionInitialClaims;ActionDefinitionInitialClaimstype
export type ActionDefinitionInitialClaims = { readonly initialExecutionClaimPlan?: InitialExecutionClaimPlan; readonly claims?: never } | { readonly initialExecutionClaimPlan?: never; readonly claims?: Function };ArtifactSlottype
export type ArtifactSlot<T> =
| { readonly state: "available"; readonly value: T }
| { readonly state: "unavailable"; readonly reason: UnavailableReason }
| { readonly state: "omitted"; readonly reason: OmittedReason };ClaimDecisiontype
export type ClaimDecision = "PERMITTED" | "BLOCKED" | "INDETERMINATE";ContractVersiontype
export type ContractVersion = "answerup-runtime-artifacts/1";DispatchBoundarytype
export type DispatchBoundary = "NOT_INVOKED" | "POSSIBLY_INVOKED" | "CROSSED";DurableRecoveryAuthorityProoftype
export type DurableRecoveryAuthorityProof = DurableRecoveryProof | DurableRecoveryProofV2;DurableRecoveryRecordtype
export type DurableRecoveryRecord = DurableRecoveryRecordV1 | DurableRecoveryRecordV2;EffectResolutionStatetype
export type EffectResolutionState = "PRESENT" | "ABSENT_FINAL" | "INDETERMINATE";EffectTruthtype
export type EffectTruth = "COMMITTED" | "DISPROVED" | "UNKNOWN" | "NOT_DISPATCHED";OmittedReasontype
export type OmittedReason = "SENSITIVE" | "UNBOUNDED" | "NO_CORE_AUTHORITY" | "UNSUPPORTED";RecoveryAttemptOutcometype
export type RecoveryAttemptOutcome = "ACKNOWLEDGED" | "UNKNOWN";RecoveryDispatchBoundarytype
export type RecoveryDispatchBoundary = "CROSSED" | "POSSIBLY_CROSSED";RecoveryRecordVersiontype
export type RecoveryRecordVersion = "answerup-runtime-recovery/1" | "answerup-runtime-recovery/2";RecoveryVerifierResulttype
export type RecoveryVerifierResult =
| { readonly status: "PRESENT"; readonly observationRef: string; readonly observationVersion?: string | null; readonly stateDigest?: string | null }
| { readonly status: "ABSENT_FINAL"; readonly observationRef: string; readonly finalityRef: string; readonly observationVersion?: string | null; readonly stateDigest?: string | null }
| { readonly status: "INDETERMINATE"; readonly observationRef?: string | null; readonly observationVersion?: string | null; readonly stateDigest?: string | null; readonly reason?: string };RuntimeProjectionValuetype
export type RuntimeProjectionValue = RuntimeArtifactProjection | RuntimeProjectionFailure;RuntimeTraceRecordtype
export type RuntimeTraceRecord =
| { readonly event: "GROUNDING_EVALUATED"; readonly sequence: number; readonly status: "GROUNDED" | "AMBIGUOUS" | "UNRESOLVED" | "INVALID"; readonly operationIdentity: ArtifactSlot<string>; readonly attributes: TraceAttributes }
| { readonly event: "AUTHORIZATION_EVALUATED"; readonly sequence: number; readonly decision: "PERMIT" | "DENY" | "INDETERMINATE"; readonly operationIdentity: ArtifactSlot<string>; readonly attributes: TraceAttributes }
| { readonly event: "EXECUTION_PREPARED"; readonly sequence: number; readonly operationIdentity: ArtifactSlot<string>; readonly effectIdentity: ArtifactSlot<string>; readonly executionIdentity: ArtifactSlot<string>; readonly attributes: TraceAttributes }
| { readonly event: "DISPATCH_BOUNDARY_CROSSED" | "EXECUTION_ATTEMPTED"; readonly sequence: number; readonly operationIdentity: ArtifactSlot<string>; readonly effectIdentity: ArtifactSlot<string>; readonly executionIdentity: ArtifactSlot<string>; readonly attemptIdentity: ArtifactSlot<string>; readonly attributes: TraceAttributes }
| { readonly event: "EFFECT_VERIFICATION_REQUESTED" | "EFFECT_PRESENT" | "EFFECT_ABSENT_FINAL" | "EFFECT_INDETERMINATE"; readonly sequence: number; readonly operationIdentity: ArtifactSlot<string>; readonly effectIdentity: ArtifactSlot<string>; readonly executionIdentity: ArtifactSlot<string>; readonly attemptIdentity: ArtifactSlot<string>; readonly observationRef: ArtifactSlot<string>; readonly attributes: TraceAttributes }
| { readonly event: "CLAIM_EVALUATED" | "CLAIM_PERMITTED" | "CLAIM_BLOCKED" | "CLAIM_INDETERMINATE"; readonly sequence: number; readonly operationIdentity: ArtifactSlot<string>; readonly effectIdentity: ArtifactSlot<string>; readonly executionIdentity: ArtifactSlot<string>; readonly attributes: TraceAttributes }
| { readonly event: "RECONCILIATION_PROJECTED"; readonly sequence: number; readonly operationIdentity: ArtifactSlot<string>; readonly effectIdentity: ArtifactSlot<string>; readonly executionIdentity: ArtifactSlot<string>; readonly attemptIdentity: ArtifactSlot<string>; readonly attributes: TraceAttributes };TraceAttributestype
export type TraceAttributes = Readonly<Record<string, TraceScalar>>;Examples and deeper guidance
Executable package pages show a package-specific, non-executing import example. Use the exact declaration surface for signatures and types; no credentials or external execution are provided here.
Read the related lifecycle guidance for the package’s documented role.