@rulvar/core 1.88.0 → 1.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -545,6 +545,15 @@ type ChatEvent = {
545
545
  } | {
546
546
  type: "error";
547
547
  error: WireError;
548
+ /**
549
+ * Provenance the adapter already holds when the stream dies (RV401,
550
+ * the eighth comparison experiment): a failed generation is still a
551
+ * billable provider call, and its response id is what joins the
552
+ * reconciliation record to the provider's own statement. Same
553
+ * namespaced shape as the finish event's; absent when the failure
554
+ * predates any provider response.
555
+ */
556
+ providerMetadata?: Record<string, unknown>;
548
557
  };
549
558
  /** Strictly 'adapterId:model', no query parameters. */
550
559
  type ModelRef = `${string}:${string}`;
@@ -962,13 +971,17 @@ type RunMeta = {
962
971
  * the args are not JCS-serializable (`argsProvided` still records
963
972
  * presence). The raw args are never journaled, but the digest is
964
973
  * sensitive-derived metadata, not an opaque token: it is deterministic
965
- * and unsalted, so it reveals when two runs (in this store or another)
966
- * were started with identical args, and low-entropy args (a boolean,
967
- * an approval flag, a role, a short id) are recoverable by hashing
968
- * candidate values. Protect meta, `inspect` output, and run listings
969
- * with the same access control as the journal and transcripts; the
970
- * digest confers no confidentiality on the args it binds. Stores must
971
- * round-trip the field (the conformance kit checks).
974
+ * and unsalted BY DEFAULT, so it reveals when two runs (in this store
975
+ * or another) were started with identical args, and low-entropy args
976
+ * (a boolean, an approval flag, a role, a short id) are recoverable by
977
+ * hashing candidate values. `createEngine security.argsHashSalt`
978
+ * switches the digest to HMAC-SHA256 under a deployment salt (RV-217),
979
+ * which removes both leaks at the cost of binding every resuming
980
+ * engine to the same salt. Protect meta, `inspect` output, and run
981
+ * listings with the same access control as the journal and
982
+ * transcripts; the digest confers no confidentiality on the args it
983
+ * binds. Stores must round-trip the field (the conformance kit
984
+ * checks).
972
985
  */
973
986
  argsHash?: string;
974
987
  /**
@@ -983,6 +996,24 @@ type RunMeta = {
983
996
  * Stores must round-trip the field (the conformance kit checks).
984
997
  */
985
998
  genesis?: string;
999
+ /**
1000
+ * Which isolated-executor idempotency key derivation this run uses
1001
+ * (RV403), for its WHOLE life: stamped at the fresh start by the
1002
+ * engine (current engines stamp 2, the incarnation-scoped derivation
1003
+ * that binds `genesis` into the key so a `deleteRun`-then-recreate of
1004
+ * the same explicit runId never reuses keys against a long-lived
1005
+ * external dedup store) and carried verbatim by every resume segment.
1006
+ * Absent on runs recorded before the field shipped: those derive the
1007
+ * original genesis-free version 1 keys forever, across resume and
1008
+ * upgrade, so external dedup state accumulated for them stays valid.
1009
+ * A recorded version this engine does not know is a typed resume
1010
+ * refusal when isolated executors are configured (resume with a newer
1011
+ * rulvar), never a silent fallback. Stores must round-trip the field
1012
+ * (the conformance kit checks); a store that drops it degrades a
1013
+ * resumed run's NEW dispatches to version 1 keys, which breaks the
1014
+ * at-least-once fold of a redispatched call for a version 2 run.
1015
+ */
1016
+ execKeyDerivation?: number;
986
1017
  };
987
1018
  type RunFilter = {
988
1019
  status?: string;
@@ -1918,11 +1949,18 @@ interface IsolatedExecContext {
1918
1949
  spanId: string;
1919
1950
  agentType: string;
1920
1951
  /**
1921
- * Stable identity of THIS logical tool call: identical
1922
- * (runId, tool, args) always derive the same key, so a provider whose
1923
- * work has external side effects can fold an at-least-once retry into
1924
- * effectively-once. A rerun of the same call after a mid-flight crash
1925
- * reuses the key; a different call never collides.
1952
+ * Stable identity of THIS logical tool call within THIS run
1953
+ * incarnation: a deterministic function of the run, the logical
1954
+ * invocation (the containing agent's journal seq plus the call's
1955
+ * ordinal in that agent's tool loop), the tool name, the canonical
1956
+ * arguments, and, for runs stamped with derivation 2
1957
+ * (RunMeta.execKeyDerivation; RV403), the run's generation token. A
1958
+ * rerun of the same call after a mid-flight crash reuses the key, so
1959
+ * a provider whose work has external side effects can fold an
1960
+ * at-least-once retry into effectively-once; a different call, even
1961
+ * with byte-identical arguments, never collides; and under
1962
+ * derivation 2 a deleteRun-then-recreate of the same runId never
1963
+ * reuses the deleted incarnation's keys.
1926
1964
  */
1927
1965
  idempotencyKey: string;
1928
1966
  /** Fires on cancellation, a budget ceiling, or UsageLimits expiry. */
@@ -4774,6 +4812,21 @@ declare function emptyToolset(): ResolvedToolset;
4774
4812
  */
4775
4813
  declare function resolveToolset(specs: ToolsOption | undefined, session: ToolSourceSession, toolsets?: Record<string, ToolsOption>, executors?: ReadonlySet<string>): Promise<ResolvedToolset>;
4776
4814
  //#endregion
4815
+ //#region src/runtime/executor.d.ts
4816
+ /**
4817
+ * Which exec idempotency key derivation a run uses (RV403), resolved at
4818
+ * engine boot from RunMeta.execKeyDerivation. Version 1 is the original
4819
+ * genesis-free five-part key, the only derivation runs recorded without
4820
+ * the meta field can ever use; version 2 additionally binds the run's
4821
+ * generation token, so it must carry it.
4822
+ */
4823
+ type ExecKeyDerivation = {
4824
+ version: 1;
4825
+ } | {
4826
+ version: 2;
4827
+ genesis: string;
4828
+ };
4829
+ //#endregion
4777
4830
  //#region src/journal/termination.d.ts
4778
4831
  /** The frozen limits vector written into termination.init. */
4779
4832
  interface TerminationLimits {
@@ -8401,6 +8454,14 @@ interface RunInternals {
8401
8454
  */
8402
8455
  executors?: ExecutorRegistry;
8403
8456
  /**
8457
+ * Which exec idempotency key derivation this run's isolated dispatches
8458
+ * use (RV403), resolved at engine boot from RunMeta.execKeyDerivation:
8459
+ * version 2 carries the run's generation token to scope keys to the
8460
+ * incarnation; absent behaves as version 1 (the genesis-free
8461
+ * derivation of runs recorded before the stamp shipped).
8462
+ */
8463
+ execKey?: ExecKeyDerivation;
8464
+ /**
8404
8465
  * The ModelKnowledge runtime handle (M10-T03): current()
8405
8466
  * only, commit physically absent. Present only when the engine was
8406
8467
  * given stores.modelKnowledge; absent means the feature is off and
@@ -10076,4 +10137,4 @@ interface SandboxBridge {
10076
10137
  declare const SANDBOX_AGENT_OPT_KEYS: readonly string[];
10077
10138
  declare function createSandboxBridge(ctx: Ctx<never>, options: SandboxBridgeOptions): SandboxBridge;
10078
10139
  //#endregion
10079
- export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, type AgentInvocationRow, AgentOpts, AgentProfile, AgentProfilePermissions, AgentProfileTemplateOptions, AgentResult, AgentResultMeta, AgentStatus, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildIdentityInput, ChildResultPage, type ClaimClass, type ClaimOp, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, type CoreEvents, CostAttribution, CostAttributionFacts, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_DEPTH, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DataKeyProvider, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EngineQuotaConfig, EngineQuotaRuntime, EntryKind, EntryRef, EntryStatus, EnvelopeEncryption, EnvelopeEncryptionOptions, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, EvidenceContract, type EvidenceRef, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishInfo, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, InvoiceExport, InvoiceReconciliation, InvoiceRow, type IsolatedExecContext, type IsolatedExecRequest, type IsolatedExecutorTag, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JOURNAL_ENVELOPE_MARKER, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, JournalSerializationContext, JournalSerializationHook, type JournalStore, type Json, JsonSchema, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, type KbProposal, type KbProposalTrigger, KeyDeriver, KeyRing, KeyedLimiter, KnowledgeCasError, type KnowledgeSnapshot, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LadderSpec, type LeasableStore, type Lease, LeaseHeldError, Ledger, LineageCounters, LineageIndex, LineageRef, LineageRelation, LineageStats, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, MemoryQuotaLimiter, type MetaLookupStore, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateAcceptance, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, type PhaseRow, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PreflightAdmissionRow, PreflightFinding, PreflightInput, PreflightOrchestratorSpec, PreflightReport, PreflightSpawnReport, PreflightSpawnSpec, PreflightToolCeiling, PriceTable, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, ProviderCallRecord, QUOTA_WINDOW_MS, QualityFloors, QuotaCounters, type QuotaDecision, type QuotaEstimate, type QuotaLimiter, type QuotaReservationRequest, QuotaRule, QuotaWindowSnapshot, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, RateLimitObservation, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, ResearchAgentProfileOptions, ResearchAgentProfileResult, ResearchEvidenceEntry, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunAuditVerdict, RunBudget, RunEventSink, RunExport, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStateAudit, RunStatus, RuntimeEventSink, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StepIdentityInput, StructuredOutputTier, SuspendedAppend, SuspensionState, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, type ToolBudgetSummary, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, type ToolExecutorProvider, ToolInit, type ToolRisk, ToolRuntime, type ToolSource, type ToolSourceSession, ToolsOption, TranscriptSerializationHook, type TranscriptStore, TriggerClass, TtlState, Usage, UsageLimits, UsageSlice, VerifiedRecommendation, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, WakeBudgetBlock, WakeDigest, WakeTrigger, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, atCompactionThreshold, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, finishContract, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotUsage, spawnDepthOf, stripFencedBlocks, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
10140
+ export { AWAIT_SCHEMA, AbandonAttempt, AbandonFold, AbandonPayload, AbandonedSpendView, AbortClass, type AdaptiveEvents, AdmissionController, AdmissionDecision, AdmissionRejectedError, AdmissionStatsBefore, AdmitLineage, AdmitRejectReason, AdmitSpec, AdmitVerdict, AgentCallError, AgentError, type AgentEvents, AgentIdentityInput, type AgentInvocationRow, AgentOpts, AgentProfile, AgentProfilePermissions, AgentProfileTemplateOptions, AgentResult, AgentResultMeta, AgentStatus, ApproachSignatureInputs, ApprovalDecision, ApprovalIdentityInput, Artifact, AttemptOutcomeClass, AuditCategory, AuditRecord, AuditRunsOptions, BUDGET_ABORT_REASON, BaseAppend, BriefOpts, BudgetAccountView, BudgetDefaults, BudgetExhaustedError, BudgetExhaustionDiagnostics, BudgetHooks, BudgetReserve, type Bytes, CANCEL_AGENT_SCHEMA, CHECKPOINT_FORMAT_V1, CLAIM_STATEMENT_MAX_CHARS, CLAIM_TTL_DAYS, COMPACTION_SUMMARY_PREFIX, CURRENT_HASH_VERSION, CacheHint, CacheTtl, CanUseTool, CanonicalId, CanonicalIdentity, CanonicalLadderSpec, CanonicalModelSpec, ChatEvent, ChatRequest, CheckpointState, ChildArtifactPage, ChildIdentityInput, ChildResultPage, type ClaimClass, type ClaimOp, type ClaimStatus, ClaimValidationOptions, CollectOpts, CollectedTurn, CompactionConfig, CompiledPermissionChain, CompiledWorkflow, ConfigError, type CoreEvents, CostAttribution, CostAttributionFacts, CostReport, CreateEngineOptions, type CriticalPath, Ctx, DEFAULT_CHILD_BUDGET_FRACTION, DEFAULT_CHILD_RESULT_PAGE_CHARS, DEFAULT_CITATION_PATTERN, DEFAULT_CITATION_SAMPLE, DEFAULT_COMPACTION_THRESHOLD, DEFAULT_ESCALATION_LIMITS, DEFAULT_EVIDENCE_CALLS_PER_ENTRY, DEFAULT_EVIDENCE_MIN_SHARE, DEFAULT_EVIDENCE_OVERHEAD_CALLS, DEFAULT_FINISH_MAX_REPAIRS, DEFAULT_FLAT_RESERVE_USD, DEFAULT_MAX_CHILDREN_PER_NODE, DEFAULT_MAX_DEPTH, DEFAULT_MAX_OSCILLATIONS_PER_KEY, DEFAULT_MAX_PINNED_WORKTREES, DEFAULT_MAX_REVISIONS_PER_RUN, DEFAULT_MAX_TOTAL_SPAWNS, DEFAULT_MAX_TURNS, DEFAULT_MODEL_RETRY_ATTEMPTS, DEFAULT_NO_PROGRESS_TURNS, DEFAULT_PER_RUN_CONCURRENCY, DEFAULT_RETRY_POLICY, DEFAULT_STREAM_IDLE_TIMEOUT_MS, DEFAULT_SYNTHESIS_MAX_TURNS, DEFAULT_SYNTHESIS_NOTE_MAX_TURNS, DataKeyProvider, DebitResult, DeclaredLadder, DedupIndex, DedupNote, DedupedClaims, DerivedKey, DeriverRegistry, type DeterminismConfig, DeterminismError, type DeterminismEvents, type DeterminismMode, DispositionRule, DispositionTable, DonorCandidate, DonorRef, DroppedItem, EMIT_RESULT_TOOL, EMPTY_SCHEMA_HASH, EMPTY_TOOLSET_HASH, ESCALATE_TOOL_NAME, ESCALATION_REPORT_SCHEMA, ESCALATION_REQUEST_SCHEMA, EVENT_SEGMENT_STRIDE, EffectiveUsageLimits, Effort, Engine, EngineDefaults, EngineQuotaConfig, EngineQuotaRuntime, EntryKind, EntryRef, EntryStatus, EnvelopeEncryption, EnvelopeEncryptionOptions, ErrorClass, ErrorCode, ErrorPolicy, EscalatedResult, EscalationDecision, EscalationDecisionAbortedError, EscalationDigest, EscalationKind, EscalationLimits, EscalationOptions, EscalationReport, EscalationRequest, EventBus, EvidenceContract, type EvidenceRef, type ExecKeyDerivation, type ExecutorRegistry, type ExplorationSummary, ExtensionAppendInput, ExtensionDispatchSpec, ExternalIdentityInput, ExternalRegistry, ExtractNecessityInput, FINALIZE_SYNTHESIS_INSTRUCTION, FINISH_SCHEMA, FINISH_TOOL_NAME, FailRunError, FailoverTarget, FailoverTrigger, FallbackField, FallbackTrigger, FencedCodeMode, FileModelKnowledgeStore, FileModelKnowledgeStoreOptions, FileTranscriptStore, FinishContract, FinishContractCitations, FinishContractGoldenReject, FinishContractManifest, FinishInfo, FinishSelfTestFailure, FinishSelfTestFixtures, FinishSelfTestReport, FinishValidationChild, FinishValidationInput, FinishValidationSpec, FinishValidationVerdict, FinishValidator, GET_CHILD_RESULT_SCHEMA, GET_CHILD_RESULT_TOOL_NAME, Gate, GateAudit, type GateRecord, GitWorktreeProvider, GitWorktreeProviderOptions, GraftBoot, HashVersion, HookVerdict, IMPLEMENTATION_PROFILE_LIMITS, INBOX_PROPOSAL_TTL_DAYS, IdentityInput, InMemoryStore, InMemoryTranscriptStore, InProcessRunner, IncrementalSynthesisResult, InvalidResolutionError, InvocationRole, type InvocationTable, InvoiceExport, InvoiceReconciliation, InvoiceRow, type IsolatedExecContext, type IsolatedExecRequest, type IsolatedExecutorTag, type IsolationProvider, type IsolationSpec, Issue$1 as Issue, JOURNAL_ENVELOPE_MARKER, JournalCompatSubCode, JournalCompatibilityError, JournalEntry, JournalMatcher, JournalMissError, JournalOperation, JournalOrderViolation, JournalSerializationContext, JournalSerializationHook, type JournalStore, type Json, JsonSchema, JsonlFileStore, KB_ACTIVE_CLAIMS_CAP, KB_CARD_RENDER_BUDGET_CHARS, type KbProposal, type KbProposalTrigger, KeyDeriver, KeyRing, KeyedLimiter, KnowledgeCasError, type KnowledgeSnapshot, LARGE_VALUE_WARN_BYTES, LEGACY_LTID_PREFIX, LEGACY_SIGNATURE_INPUTS, LINEAGE_SIG_VERSION, LadderSpec, type LeasableStore, type Lease, LeaseHeldError, Ledger, LineageCounters, LineageIndex, LineageRef, LineageRelation, LineageStats, LogicalTaskId, MASKED_SECRET, MAX_CHILD_RESULT_PAGE_CHARS, MAX_DEPTH_CEILING, MatchResult, McpConfig, McpToolSource, MechanicalGateProfile, MechanicalGateVerdict, MemoryQuotaLimiter, type MetaLookupStore, type ModelCaps, ModelChoice, type ModelClaim, ModelEpochInputs, type ModelKnowledgeHandle, type ModelKnowledgeStore, ModelListConstraint, ModelRef, ModelRetry, ModelSpec, Msg, NoProgressDetector, NodeId, NodeLinkValue, NonSerializableValueError, ORCHESTRATE_WORKFLOW_NAME, OnEscalation, OperationDisposition, OrchestrateAcceptance, OrchestrateOptions, OrchestrateSynthesis, OrchestrateSynthesisSkipReason, OrchestratorBudgetSpec, OrchestratorCapConfigError, OrchestratorExtension, OrchestratorExtensionIO, OrchestratorRuntime, Out, PARALLEL_AGENTS_SCHEMA, PROGRESS_REPORT_TOOL_NAME, ParallelSiteCounter, Part, PendingExternal, PendingToolTurn, PermissionConfig, PermissionGate, PermissionHook, PermissionPreset, PermissionRule, PermissionVerdict, type PhaseRow, PhaseTarget, PipelineCollected, PipelineOpts, PlanInvariantError, PreflightAdmissionRow, PreflightFinding, PreflightInput, PreflightOrchestratorSpec, PreflightReport, PreflightSpawnReport, PreflightSpawnSpec, PreflightToolCeiling, PriceTable, PricedUsage, type Pricing, type PricingTier, ProgressReport, type ProviderAdapter, ProviderCallRecord, QUOTA_WINDOW_MS, QualityFloors, QuotaCounters, type QuotaDecision, type QuotaEstimate, type QuotaLimiter, type QuotaReservationRequest, QuotaRule, QuotaWindowSnapshot, READ_CHILD_ARTIFACT_SCHEMA, READ_CHILD_ARTIFACT_TOOL_NAME, RESEARCH_PROFILE_LIMITS, REVIEW_PROFILE_LIMITS, ROLE_EFFORT_DEFAULTS, ROOT_ACCOUNT, ROOT_SCOPE, RUN_PROFILES, RUN_SETTLE_DECISION_TYPE, RandIdentityInput, RandPayload, RateLimitObservation, ReconcileOptions, ReconcileResult, RefEntryAppender, RefEntryClassification, RefusalInfo, RepeatedClaim, ReplayDisposition, ReplayMode, ReplayPlanHashMismatch, Replayer, RepositoryResearchToolset, RepositoryResearchToolsetOptions, ResearchAgentProfileOptions, ResearchAgentProfileResult, ResearchEvidenceEntry, ResolutionArbiter, ResolutionAttempt, ResolutionBy, ResolutionFold, ResolutionLayer, ResolutionOutcome, ResolutionPayload, ResolvedInvocation, ResolvedToolset, ResumeHandle, ResumeOptions, ResumePreview, ResumeReport, RetryClass, RetryPolicy, ReuseConfig, RiskRuleValue, Role, RulvarError, RulvarErrorCode, RunAgentOptions, RunAuditVerdict, RunBudget, RunEventSink, RunExport, type RunFilter, RunHandle, RunInternals, type RunMeta, RunOptions, RunOutcome, RunProfile, RunStateAudit, RunStatus, RuntimeEventSink, SANDBOX_AGENT_OPT_KEYS, SPAWN_AGENT_SCHEMA, SandboxBridge, SandboxBridgeOptions, SandboxError, SandboxHostToWorker, SandboxMethod, SandboxWorkerToHost, SchemaPair, SchemaSpec, SchemaValidationResult, ScopeSegment, ScriptRejected, ScriptRunner, ScrubNote, SecretMasker, SectionMatchMode, Semaphore, SerializationHook, Settled, SettlementError, ShellPatternRules, ShellSegment, ShellVerdict, SinglePhaseAppend, SpanMinter, SpanRegistry, SpawnAdmissionValue, SpawnAgentParams, SpawnKey, SpawnLineage, SpawnLineageOpt, SpawnOrigin, SpawnRecord, Spend, Stage, type StandardJSONSchemaV1, type StandardSchemaV1, StepIdentityInput, StructuredOutputTier, SuspendedAppend, SuspensionState, TOOL_NAME_PATTERN, type TaskClass, TaskDigest, TaskSpec, TerminalPatch, TerminationAccount, TerminationAccountSnapshot, TerminationDeniedValue, TerminationDeniedWriter, TerminationInitValue, TerminationLimits, TerminationResource, type ToolBudgetSummary, ToolCallRequest, ToolChoice, type ToolContext, ToolContextSeed, ToolContract, type ToolDef, type ToolEvents, type ToolExecutor, type ToolExecutorProvider, ToolInit, type ToolRisk, ToolRuntime, type ToolSource, type ToolSourceSession, ToolsOption, TranscriptSerializationHook, type TranscriptStore, TriggerClass, TtlState, Usage, UsageLimits, UsageSlice, VerifiedRecommendation, WAIT_FOR_EVENTS_SCHEMA, WAIT_FOR_EVENTS_TOOL_NAME, WAKE_SUMMARY_RENDER_BUDGET_CHARS, WakeBudgetBlock, WakeDigest, WakeTrigger, WireError, Workflow, WorkflowCallOpts, type WorkflowEvent, type WorkflowEventBody, WorkflowRegistry, admissionReserveUsd, affordableOutputTokens, agentErrorFromWire, agentErrorToWire, agentResultWire, agentScope, applyClaimOps, applyStructuredOutputTier, approachSigCoarse, approachSigOf, archiveDeprecatedModelOps, assertFencedWrites, atCompactionThreshold, auditRun, auditRuns, buildAbandonFold, buildAdapterRegistry, buildCostReport, buildDeriverRegistry, buildOrchestratorTools, buildTerminationInitValue, buildToolContext, canRideLoopTurn, canonicalIsolationTag, canonicalizeLadder, canonicalizeSchema, capIssues, capsHashOf, checkFloors, checkpointRefFor, childCoveragePrefix, claimExpired, claimExpiry, claimIssues, claimOpIssues, classifyAgentError, classifyAttemptOutcome, collectDeclaredLadders, compactMessages, compilePermissionChain, compilePermissionPreset, compileSecretMasker, compileVerifiedLayer, constantTimeEqual, costReportFromJournal, countsAgainstLimit, createCanonicalIdMinter, createCtx, createEngine, createEnvelopeEncryption, createSandboxBridge, currentOnlyKeyRing, decodeCheckpoint, dedupeRepeatedClaims, defineWorkflow, deriveContentKey, deriverV1, deriverV2, digestOf, dispatchProjectionReserveUsd, dispositionHook, emptyDigestBlocks, emptyToolset, encodeCheckpoint, entryUsageSlices, escalateTool, evaluatePermission, evaluateReuse, evidencePreservedValidator, executeWorkflow, exhaustionCodeOf, extractCandidate, failoverTriggerOf, fallbackTriggerOf, filterClaimsForRun, finalizeFires, finishContract, foldTermination, formatRePrompt, formatScopePath, hasFencedWrites, hasMetaLookup, hashRunArgs, hashRunOutput, hashWorkflowBody, hashWorkflowSource, headingStructureValidator, identityJcs, implementationAgentProfile, invoiceFromJournal, isEscalated, isSchemaPairSpec, isStandardSchemaSpec, isStrictCompatibleSchema, kMaxOf, knowledgeHash, ladderLengthOf, ladderRungChoice, lastRunSettle, latestProgressReport, lexShellCommand, liftRetainedParts, lineageWeightOf, localKeyProvider, makeOrchestratorWorkflow, maskSecrets, maskSecretsDeep, maskSecretsJson, matchArgvPattern, matchShellCommand, mcp, memoryQuotaLimiter, mergeQuotaDenial, mergeUsageLimits, metaMatchesFilter, minMatchesValidator, modelEpochOf, modelKnowledgeCard, modelSpecIdentity, needsSeparateExtract, nextFailover, nodeLinkKey, normalizeApproachTag, normalizeEntry, normalizeFallbacks, orchestrate, orchestratorAdmissionEstCostUsd, parallelScope, parseModelRef, parseScopePath, phiInitialOf, pipelineScope, planNodeScope, preflightEstimate, priceEntryUsage, priceUsdOf, profileCard, profileRegistrySnapshotHash, progressReportTool, projectHistory, projectIdentity, projectToJsonSchema, proposalStatement, providerOf, quotaActualTokens, quotaEstimateTokens, quotaRuleAdmission, quotaRuleMatches, readRunMeta, readTerminationInit, reconcileRunMeta, reduceAuditTrail, reduceCriticalPath, reduceInvocationTable, registryKeyRing, remeasureQueue, replayDisposition, repositoryResearchToolset, requiredFieldsValidator, requiredSectionsValidator, researchAgentProfile, resolveModelInvocation, resolvePricing, resolveToolset, retryClassOf, retryDelayMs, reviewAgentProfile, roleConfiguredInRouting, roundOneDisposition, runAgent, runProfile, sanitizeTerminalText, sanitizeTokenCount, sanitizeUsage, sanitizeUsageDelta, scanJournalCompatibility, schemaHash, schemaHashOfSpec, sectionCitationsValidator, selectStructuredOutputTier, selfTestFinishValidation, shouldCompact, snapshotUsage, spawnDepthOf, stripFencedBlocks, summarizeInstruction, summarizeOutput, terminationConfigDrift, tierWithinCaps, toApprovalDecision, toJournalValue, tool, toolContract, toolsetHash, ttlState, usageViolations, validateEditorialCommit, validateEngineQuotaConfig, validateEntryShape, validateEscalationLimits, validateEscalationReport, validateQuotaRules, validateRetryPolicy, validateSchemaSpec, validateTerminationLimits, validateUsageLimits, wordCountValidator, workflowScope, workflowSourceRef, wrapJournalStore, wrapTranscriptStore };
package/dist/index.js CHANGED
@@ -10205,6 +10205,7 @@ async function streamTurn(adapter, req, options) {
10205
10205
  break;
10206
10206
  case "error":
10207
10207
  wireError = event.error;
10208
+ if (event.providerMetadata !== void 0) providerMetadata = event.providerMetadata;
10208
10209
  break;
10209
10210
  }
10210
10211
  if (sawFinish || wireError !== void 0) break;
@@ -11466,6 +11467,7 @@ async function runAgent(options) {
11466
11467
  usage: accounted
11467
11468
  };
11468
11469
  if (typeof namespace?.responseId === "string") record.responseId = namespace.responseId;
11470
+ else if (typeof namespace?.response?.id === "string") record.responseId = namespace.response.id;
11469
11471
  if (outcome.usageApprox) record.usageApprox = true;
11470
11472
  if (outcome.aborted !== void 0) record.aborted = outcome.aborted;
11471
11473
  else if (outcome.wireError !== void 0) record.errorCode = outcome.wireError.code;
@@ -13498,10 +13500,11 @@ async function evaluatePermission(chain, tool, input, ctx) {
13498
13500
  * Public contract: https://docs.rulvar.com/guide/isolated-executor.
13499
13501
  */
13500
13502
  /**
13501
- * Derives the idempotency key for one isolated tool dispatch. The key is
13502
- * a pure function of the run, the LOGICAL INVOCATION (the seq of the
13503
- * containing agent's journal entry plus that call's ordinal within the
13504
- * agent's tool loop), the tool name, and the JCS-canonical arguments.
13503
+ * Derives the VERSION 1 idempotency key for one isolated tool dispatch.
13504
+ * The key is a pure function of the run, the LOGICAL INVOCATION (the seq
13505
+ * of the containing agent's journal entry plus that call's ordinal
13506
+ * within the agent's tool loop), the tool name, and the JCS-canonical
13507
+ * arguments.
13505
13508
  *
13506
13509
  * The logical-invocation component is what makes the key both stable and
13507
13510
  * distinguishing (v1.59.x review P0.4): the agent-entry seq and the
@@ -13514,6 +13517,13 @@ async function evaluatePermission(chain, tool, input, ctx) {
13514
13517
  * intended effects sharing arguments would fold into one under external
13515
13518
  * deduplication.
13516
13519
  *
13520
+ * Version 1 is NOT incarnation-scoped: a deleteRun-then-recreate of the
13521
+ * same explicit runId reproduces its keys, which is why fresh runs stamp
13522
+ * derivation 2 (below). Runs recorded without the stamp keep this
13523
+ * derivation forever, so external dedup state accumulated for them stays
13524
+ * valid across the upgrade; the derivation itself must therefore stay
13525
+ * byte-frozen.
13526
+ *
13517
13527
  * The key never enters run identity (it is absent from every content key
13518
13528
  * and toolset hash); it exists only for the provider's own side-effect
13519
13529
  * deduplication.
@@ -13528,6 +13538,31 @@ function deriveExecIdempotencyKey(runId, agentSeq, ordinal, tool, args) {
13528
13538
  });
13529
13539
  return createHash("sha256").update(canonical, "utf8").digest("hex");
13530
13540
  }
13541
+ /**
13542
+ * Derives the VERSION 2 idempotency key (RV403): the version 1 inputs
13543
+ * plus the run's generation token (RunMeta.genesis), which scopes the
13544
+ * key to the run INCARNATION. A deleteRun-then-recreate of the same
13545
+ * explicit runId mints a fresh genesis, so the recreated incarnation's
13546
+ * intended effects never collide with the deleted one's in a long-lived
13547
+ * external dedup store; within one incarnation the token is carried
13548
+ * verbatim by every segment, so the at-least-once fold of a crash-and-
13549
+ * resume redispatch is exactly as stable as under version 1. The
13550
+ * explicit derivation marker in the canonical form domain-separates the
13551
+ * versions: a version 2 key can never equal a version 1 key, even for
13552
+ * identical logical inputs.
13553
+ */
13554
+ function deriveExecIdempotencyKeyV2(runId, genesis, agentSeq, ordinal, tool, args) {
13555
+ const canonical = jcsSerialize({
13556
+ derivation: 2,
13557
+ runId,
13558
+ genesis,
13559
+ agentSeq,
13560
+ ordinal,
13561
+ tool,
13562
+ args
13563
+ });
13564
+ return createHash("sha256").update(canonical, "utf8").digest("hex");
13565
+ }
13531
13566
  //#endregion
13532
13567
  //#region src/engine/scheduler.ts
13533
13568
  /**
@@ -14414,6 +14449,7 @@ function createCtx(internals, rootWorkflow) {
14414
14449
  };
14415
14450
  if (internals.executors !== void 0) {
14416
14451
  const executors = internals.executors;
14452
+ const execKey = internals.execKey;
14417
14453
  const agentSeq = running.seq;
14418
14454
  toolRuntime.executeExternal = async (def, args, ordinal) => {
14419
14455
  const tag = def.executor;
@@ -14429,7 +14465,7 @@ function createCtx(internals, rootWorkflow) {
14429
14465
  runId: internals.runId,
14430
14466
  spanId: toolSpanId,
14431
14467
  agentType,
14432
- idempotencyKey: deriveExecIdempotencyKey(internals.runId, agentSeq, ordinal, def.name, args),
14468
+ idempotencyKey: execKey !== void 0 && execKey.version === 2 ? deriveExecIdempotencyKeyV2(internals.runId, execKey.genesis, agentSeq, ordinal, def.name, args) : deriveExecIdempotencyKey(internals.runId, agentSeq, ordinal, def.name, args),
14433
14469
  signal: toolSignal,
14434
14470
  log: (level, msg, data) => internals.events.emit(data === void 0 ? {
14435
14471
  type: "log",
@@ -18065,7 +18101,6 @@ function makeOrchestratorWorkflow(goal, opts) {
18065
18101
  const synthesized = await runtime.runInScope(synthesisState, () => ctx.agent(prompt, synthesisOpts));
18066
18102
  synthesisSchemaRejectedExchanges = synthesized.schemaRejectedTerminalExchanges ?? 0;
18067
18103
  synthesisSchemaRecoveredExchanges = synthesized.schemaRecoveredTerminalExchanges ?? 0;
18068
- if (validationTermination !== void 0) throw validationTermination;
18069
18104
  if (configuredReserveUsd > 0) {
18070
18105
  const reserveKey = "synthesis-reserve-lifecycle";
18071
18106
  const prior = internals.replayer.snapshot().find((entry) => entry.kind === "decision" && entry.scope === callingState.scope && entry.key === reserveKey);
@@ -18106,6 +18141,7 @@ function makeOrchestratorWorkflow(goal, opts) {
18106
18141
  data: { ...synthesisReserveLifecycle }
18107
18142
  }, callingState.spanId);
18108
18143
  }
18144
+ if (validationTermination !== void 0) throw validationTermination;
18109
18145
  if (synthesized.status === "ok") return synthesized.output;
18110
18146
  if (validationSpec !== void 0) throw new FailRunError(`the synthesis invocation terminated with status '${synthesized.status}'` + (synthesized.errorMessage === void 0 ? "" : `: ${synthesized.errorMessage}`) + "; finish validators are configured, so the unvalidated draft cannot stand", { data: {
18111
18147
  source: "orchestrator_synthesis",
@@ -20201,6 +20237,15 @@ function createEngine(options) {
20201
20237
  });
20202
20238
  const external = new ExternalRegistry(replayer, (body) => bus.emit(body, rootSpanId));
20203
20239
  let transcriptCounter = 0;
20240
+ const genesis = resumeCtx === void 0 ? mintRunId() : resumeCtx.genesis;
20241
+ const execKeyVersion = resumeCtx === void 0 ? 2 : resumeCtx.execKeyDerivation;
20242
+ let execKey;
20243
+ if (execKeyVersion === void 0 || execKeyVersion === 1) execKey = { version: 1 };
20244
+ else if (execKeyVersion === 2 && typeof genesis === "string") execKey = {
20245
+ version: 2,
20246
+ genesis
20247
+ };
20248
+ if (execKey === void 0 && options.executors !== void 0) throw new ConfigError(execKeyVersion === 2 ? `resume: run '${runId}' records exec idempotency key derivation 2 but its meta carries no genesis token; the journal store violated the RunMeta round-trip contract (https://docs.rulvar.com/guide/store-authors)` : `resume: run '${runId}' records exec idempotency key derivation ${String(execKeyVersion)}; this engine derives versions 1 and 2 only, so resuming it here would break the run's external effect deduplication; resume with a rulvar release that supports the recorded derivation`);
20204
20249
  const internals = {
20205
20250
  runId,
20206
20251
  replayer,
@@ -20252,6 +20297,7 @@ function createEngine(options) {
20252
20297
  runSignal: controller.signal,
20253
20298
  ...defaults.isolation === void 0 ? {} : { isolation: defaults.isolation },
20254
20299
  ...options.executors === void 0 ? {} : { executors: options.executors },
20300
+ ...execKey === void 0 ? {} : { execKey },
20255
20301
  ...options.onEscalation === void 0 ? {} : { onEscalation: options.onEscalation },
20256
20302
  external,
20257
20303
  mintTranscriptRef: () => `${runId}/t${transcriptCounter++}`,
@@ -20271,7 +20317,6 @@ function createEngine(options) {
20271
20317
  if (resumeCtx.argsProvided !== void 0) argsBinding.argsProvided = resumeCtx.argsProvided;
20272
20318
  if (resumeCtx.argsHash !== void 0) argsBinding.argsHash = resumeCtx.argsHash;
20273
20319
  }
20274
- const genesis = resumeCtx === void 0 ? mintRunId() : resumeCtx.genesis;
20275
20320
  const putMeta = (status) => resumeCtx?.strict === true ? Promise.resolve() : journal.putMeta({
20276
20321
  runId,
20277
20322
  status,
@@ -20283,6 +20328,7 @@ function createEngine(options) {
20283
20328
  ...argsBinding.argsProvided === void 0 ? {} : { argsProvided: argsBinding.argsProvided },
20284
20329
  ...argsBinding.argsHash === void 0 ? {} : { argsHash: argsBinding.argsHash },
20285
20330
  ...genesis === void 0 ? {} : { genesis },
20331
+ ...execKeyVersion === void 0 ? {} : { execKeyDerivation: execKeyVersion },
20286
20332
  workflowName: wf.name,
20287
20333
  workflowHash: compiled === void 0 ? hashWorkflowBody(wf) : hashWorkflowSource(compiled.source),
20288
20334
  ...compiled === void 0 ? {} : { workflowSourceRef: workflowSourceRef(runId) }
@@ -20580,6 +20626,7 @@ function createEngine(options) {
20580
20626
  ...typeof meta?.argsProvided === "boolean" ? { argsProvided: meta.argsProvided } : {},
20581
20627
  ...typeof meta?.argsHash === "string" ? { argsHash: meta.argsHash } : {},
20582
20628
  ...typeof meta?.genesis === "string" ? { genesis: meta.genesis } : {},
20629
+ ...typeof meta?.execKeyDerivation === "number" ? { execKeyDerivation: meta.execKeyDerivation } : {},
20583
20630
  previewResolve
20584
20631
  });
20585
20632
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rulvar/core",
3
- "version": "1.88.0",
3
+ "version": "1.90.0",
4
4
  "description": "Rulvar core: L0 contracts, journal kernel, ctx primitives, agent runtime, model router, tool system, dynamic orchestrator, InMemory and JSONL stores, event stream.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",