Skip to content

rulvar API reference


rulvar API reference / @rulvar/core

@rulvar/core

Namespaces

NamespaceDescription
StandardJSONSchemaV1-
StandardSchemaV1-

Classes

ClassDescription
AdmissionController-
AdmissionRejectedErrorA structural admission rejection (maxDepth, maxChildrenPerNode, maxTotalSpawns) from the AdmissionController (M6-T06). The rejection verdict is embedded in the carrying spawn-admission decision entry and replays identically; the error surfaces the embedded AdmitRejectReason in data to the caller (a typed tool error for orchestrators) and MUST NOT tear down the run. Budget-code rejections throw BudgetExhaustedError instead, keeping the budget exhaustion semantics (https://docs.rulvar.com/guide/budgets).
AgentCallErrorThe rejection carrier of ctx.agent value-form calls: a real Error that structurally satisfies the typed AgentError and carries the full AgentResult for Settled mapping. Deliberately not a RulvarError: AgentError is not in the closed code registry.
BudgetExhaustedErrorThe run budget ceiling blocked further work. The budget guard denial is a decision entry; ctx primitives throw this as AgentError kind 'budget'; the run reports outcome 'exhausted', overriding 'error'.
ConfigErrorConstruction- and definition-time misconfiguration: duplicate adapterId, non-git host for worktree isolation, worker over a non-leasable store, failed schema projection. Never journaled; raised before any run effect.
DedupIndexThe DedupIndex: a pure fold over spawn roots, severing abandons, and node.link entries. Prices fold from journal facts (servedBy, usage) through the injected price function; on replay the embedded verdict values are authoritative and this fold serves integrity only.
EventBusThe per-run event bus. seq is strictly increasing in emission order; iterate() yields events from subscription onward; on() is the callback form over the same stream and the same seq values.
ExternalRegistryPer-run registry of open external suspensions plus the run's activity counter: when every in-flight branch is blocked on suspensions (activity zero, waiters open), the run quiesces into outcome 'suspended'.
FileModelKnowledgeStoreThe SPI seam. commit performs CAS on the monotonic snapshot version, mirroring the fencing-epoch discipline of LeasableStore; concurrent maintenance commits serialize through CAS rejection and rebase. commit is UNREACHABLE from the runtime: runs hold ModelKnowledgeHandle.
FileTranscriptStoreFile-backed TranscriptStore (M6-T02): blobs (transcripts, checkpoints, persisted CompiledWorkflow sources) as one file per ref under dir, so compiled runs resume across processes. Refs follow the <runId>/<name> convention; each path segment is checked filesystem-safe and nested segments become directories.
GitWorktreeProviderThe shipped git worktree lifecycle. A non-git host is a typed ConfigError at acquire.
InMemoryStore-
InMemoryTranscriptStoreIn-memory TranscriptStore. Refs follow the <runId>/<name> convention so list(runId) can filter without a side index.
InProcessRunnerThe mode (a) runner for human-authored closures. Determinism is enforced by convention, lint, and the ctx shims, NOT by a VM: only the sequence of keys must be stable. Dev mode (NODE_ENV !== 'production') patches Date.now and Math.random for the duration of execute to emit one warning per run pointing at ctx.now()/ctx.random(); the patch preserves behavior and restores the prior functions on exit (nesting-safe by capturing the prior value; concurrent runs may lose the warning, never correctness).
InvalidResolutionErrorA resolution attempt against an already-closed suspension, rejected under the first-closing-wins fold; appends no entry (producers ship in M2).
JournalCompatibilityErrorRefusal to open a journal whose hashVersion falls outside the engine's support window (producers ship in M2). The registry code is 'journal_compat'; the sub-codes live on subCode and in data.
JournalMatcherThe matching engine over a loaded journal. Consumption is per logical operation (running/terminal pairs count once); candidates are consumed in journal order, first unconsumed match wins (this also resolves cross-version double matches deterministically).
JournalMissErrorA replay-strict run encountered a call that would go live (@rulvar/testing; producers ship in M2).
JournalOrderViolationA breach of the total per-run append order: an unfenced concurrent writer or a store violating contract A2 (https://docs.rulvar.com/guide/stores).
JsonlFileStore-
KeyedLimiter-
KnowledgeCasErrorcommit() on a ModelKnowledgeStore against a snapshot version that is no longer current. Retryable by contract: re-read current(), rebase the ops, commit again, mirroring the lease fencing discipline.
LeaseHeldErroracquire() on a currently held lease. Retryable by contract: retry after the lease ttl elapses or the holder releases.
LineageIndexThe incremental lineage fold: attempts, escalation debits, stall streaks, single-live-attempt, and legacy canonization, computed from journal entries only. absorb is idempotent by seq cursor; every read accepts an optional uptoSeq pin so renders stay snapshot-stable.
ModelRetry-
NonSerializableValueErrorA value failed the journal append JSON-serializability check. Never journaled; thrown at the call site whose value failed the check.
NoProgressDetectorCounts consecutive progress-free turns. A turn with at least one tool call (or, later, an artifact delta) resets the streak; a turn with neither lengthens it; the detector trips when the streak reaches the threshold AND the loop would otherwise continue.
OrchestratorCapConfigErrorInvalid orchestrator cap and finalize-reserve configuration, thrown before the first LLM call (DEF-7; producers ship in M6/M7).
ParallelSiteCounterAllocates parallel site numbers per enclosing scope: a monotonic counter in execution order, not source position. Because every scope body is sequential by construction (I3), allocation order is deterministic and identical on every replay.
PlanInvariantErrorPlanRunner plan-invariant rejection (producers ship in M7).
ReplayerPer-run journal kernel front end. Everything is per instance: no module state anywhere.
ReplayPlanHashMismatchRaised at resume when the refolded plan state disagrees with the journaled planHash chain (producers ship in M7).
ResolutionArbiterPer-run, per-target FIFO serializer of resolution/abandon attempts: classification against the in-memory fold -> durable append -> settle exactly once; losing attempts are ALSO appended and become journaled noops by fold classification. Winner effects run strictly after the critical section (the caller's job). Cross-process protection remains the LeasableStore fencing epoch.
ResolutionFoldThe first-closing-wins fold over a loaded journal: one pass by seq, bit-identical on every store returning the same entries. Resolution values are validated at consumption against the schema pinned INSIDE the suspended entry payload (canonical bare JSON Schema); a schema-invalid offline resolution classifies invalid and does NOT close the target. Abandon coverage is the target seq plus the transitive child scope-prefix; the AbandonFold consumed by the replay predicate is a projection of THIS fold (not a separate pass).
RulvarErrorBase class for all engine-raised errors. "Retryable" means the engine's own retry machinery (RetryPolicy under the journal) MAY retry; it never means a provider SDK autoretry, which is disabled.
RunBudgetThe per-run budget account tree. All spend accounting is per instance; the journal remains the durable source (the root is seeded by the ledger fold on resume, M2; sub-account reserves are recovered from spawn-admission decision entries, M6).
SandboxErrorA WorkerSandboxRunner resource-limit breach (M6-T02): crossing timeoutMs or memoryMb terminates the worker and the run completes with outcome 'error' carrying this error's WireError projection; data records { reason: 'timeout'
ScriptRejectedcompileScript rejected planner-generated source. Never journaled as its own entry; surfaced as diagnostics to the plan() self-repair loop (producers ship in M6).
Semaphore-
SpanRegistrySpans form a tree per run; spanId values are engine-minted opaque strings, unique per run, pure telemetry, never identity.
TerminationAccountThe single per-run TerminationAccount: debit ONLY. No credit operation exists by construction; reclaim never replenishes anything (DEF-5 interaction). Live: the engine debits the in-memory account, writes the carrying entry with the balance-after, then applies effects. Resume state is rebuilt by TerminationFold from the journal, never from live config.

Interfaces

InterfaceDescription
AbandonedSpendViewThe abandoned-spend ledger fold.
AbandonFold-
AdmissionDecisionThe full admission decision embedded in the carrying entry.
AdmissionStatsBeforeLive pre-append snapshot embedded in the decision entry (DEF-2/DEF-3).
AdmitLineageThe lineage block every non-reject verdict carries (DEF-3).
AdmitSpecWhat the admission point needs to know about one spawn.
AgentIdentityInputSpawn entries: ctx.agent and orchestrator spawn tools (kind 'agent').
AgentOptsPer-spawn options. The identity split is normative: agentType, model/routing/effort (the requested modelSpec), schema (schemaHash), and key enter the content key; everything else is policy or telemetry and never re-keys entries. Fields whose machinery lands later (tools, isolation, escalation, lineage, ladder, retry) arrive with their milestones.
AgentProfileThe canonical, complete AgentProfile shape; M1 honors description, model, routing, effort, limits, and estCost. A profile never carries a prompt or a schema.
AgentProfilePermissionsProfile-level permissions. inheritPermissions governs SUBAGENT inheritance (mode c orchestrators, M6+): children get their own config only unless explicitly opted in. It is carried as data here and consumed by the spawning layers.
AgentResult-
AgentResultMetaThe consumer-facing reuse mark on results.
ApproachSignatureInputsThe identity inputs of the coarse signature (prompt prose excluded).
ApprovalDecisionThe resolution value shape of a tool-approval suspension (M3-T03).
ApprovalIdentityInputTool-approval suspensions (kind 'approval').
ArtifactArtifact: the normative shape of AgentResult.artifacts entries.
BriefOptsOptions of ctx.brief (concrete shape fixed in M6-T10): the content to distill plus an optional instruction; the invocation resolves role 'summarize', so it needs defaults.routing.summarize, a profile, or the explicit model.
BudgetAccountViewRead-only projection of one account.
BudgetDefaults-
BudgetHooksBudget hooks bound by the three-layer budget.
BudgetReserveLayer-1 reservation embedded in the carrying decision entry.
CacheHintProvider-neutral declaration of intended prompt-cache boundaries. Transport-level cost optimization only: MUST NOT enter IdentityInput and MUST NOT change response semantics.
CanonicalLadderSpecLadderSpec after canonicalization: every rung's effort resolved to an explicit value.
ChatRequestThe provider-neutral chat request. Sampling parameters (temperature, top_p, top_k) are deliberately absent from the first-class surface: both first-class providers reject them on current reasoning models; where a target legitimately supports them they travel through the adapter's providerOptions namespace, subject to caps scrubbing.
CheckpointStateThe canonical-history snapshot at a turn boundary.
ChildIdentityInputNested workflow spawns: ctx.workflow (kind 'child').
ClaimValidationOptions-
CollectedTurnOne collected model turn, assembled from the stream by the agent loop.
CollectOpts-
CompactionConfigPer-profile compaction config (AgentProfile).
CompiledPermissionChain-
CompiledWorkflowSource-backed workflow admissible to the worker sandbox; produced by compileScript (M6). Declared now so the ScriptRunner seam is shaped once; feeding a closure to the sandbox stays impossible by types.
CostAttributionPer-run cost attribution buckets consumed by CostReport (M1-T10/T11).
CostReportFull contract: https://docs.rulvar.com/guide/observability.
CreateEngineOptions-
CtxThe canonical Ctx interface, M1 members.
DeclaredLadderOne declared ladder of the run, named by its agentType.
DedupNoteTelemetry for a SpawnKey match admitted fresh.
DonorCandidateOne donor candidate surfaced by the DedupIndex fold.
DonorRefThe rich donor descriptor embedded in reuse verdicts.
DroppedItemOne dropped result: its source, scope, entry ref, and wire error.
EffectiveUsageLimits-
Engine-
EngineDefaults-
EscalationDigestThe escalation block of a digest.
EscalationLimitsLineage limits, monotonically consumed and never replenished (DEF-3).
EscalationOptions-
EscalationReport-
EscalationRequestThe model-facing request: the report minus the runtime-filled fields.
ExtensionAppendInputOne append into an extension-owned sequential scope.
ExtensionDispatchSpecA child dispatch under an explicit scope (plan/NodeId).
ExternalIdentityInputExternal inputs: ctx.awaitExternal (kind 'external').
ExtractNecessityInputThe inputs of the extract-necessity rule.
FailoverTargetOne resolved failover target (rich form).
FallbackFieldThe degenerate fallback field: one agent-level second attempt.
FileModelKnowledgeStoreOptions-
GateAuditThe ctx-side verdict for one dispatch, produced by the permission chain (M3-T03). For 'ask' the loop writes the turn checkpoint with the pending state FIRST, then suspend() journals the approval entry (or re-matches an existing one) and parks until a resolution closes it.
GitWorktreeProviderOptions-
GraftBootGraft bootstrap payload.
IsolationProvider-
JournalOperationOne logical journaled operation: its dispatch entry plus its terminal, when present.
JournalSerializationHook-
JournalStore-
KbProposalOne orchestrator model-knowledge proposal (phase 3). A proposal is a run-ledger record, NOT a claim: it lives ONLY in the RunLedger section modelObservations, is never rendered into any prompt of any run before the human gate (absolute quarantine, the note included), and reaches the gate exclusively through LedgerExport. The engine assembles it from the tier-relative kb_propose payload: the subject model is resolved by the engine from the referenced lineage's declared ladder, never named by the orchestrator; evidence must resolve into the proposing run's own decision entries.
KeyDeriver-
KeyRing-
KnowledgeSnapshot-
LadderSpecThe author-facing ladder declaration. This is the SINGLE declaration of the ladder family: other layers reference it and never redeclare (runtime semantics land in M7).
LeasableStoreLease capability: acquire on a held lease MUST reject with a typed LeaseHeldError; renew MUST run at an interval of at most ttl/3; an append carrying a stale epoch MUST be rejected and never appear in load.
Ledger-
LineageCounters-
LineageRefThe computed lineage record of one spawn-authorizing decision entry.
LineageStatsThe pure lineage fold rendered in plan_view and WakeDigest, always pinned to a snapshot (uptoSeq), never a live read inside a turn. approaches groups settled history by approachSig; a group whose attempts have not settled yet is omitted (there is no outcome to learn from), while attemptsUsed still counts every authorized attempt.
McpConfig-
MechanicalGateVerdictThe verdict of one mechanical acceptance gate evaluation.
ModelChoice-
ModelClaim-
ModelEpochInputs-
ModelKnowledgeStoreThe SPI seam. commit performs CAS on the monotonic snapshot version, mirroring the fencing-epoch discipline of LeasableStore; concurrent maintenance commits serialize through CAS rejection and rebase. commit is UNREACHABLE from the runtime: runs hold ModelKnowledgeHandle.
Msg-
NodeLinkValueThe node.link entry value: an ordinary content-keyed effect entry.
OrchestrateOptionsOptions for orchestrate(engine, goal, o?).
OrchestratorBudgetSpecBudget contract: https://docs.rulvar.com/guide/budgets; the cap machinery (reserves, freeze) completes in M7 (DEF-7).
OrchestratorExtensionThe extension contract. PlanRunner implements it in @rulvar/plan; the mode (c) orchestrator hosts it. Everything is optional except the toolset: an extension that adds no tools has no reason to exist.
OrchestratorExtensionIOThe per-run IO the extension closes over (engine-owned effects).
OrchestratorRuntimeThe engine seam the spawn tools close over (never on ToolContext).
PendingExternalSuspensions still open at settle time; producers arrive with M2.
PendingToolTurnMid-turn suspension state (M3-T03): the turn's already-executed tool results plus the call awaiting an approval resolution, so resume continues the SAME turn without re-running executed tools.
PermissionConfigHost-side permission configuration (engine defaults.permissions).
PhaseTargetOne serving target of a phase: the primary or a failover fallback.
PipelineCollectedPipeline results plus the dropped evidence, returned by onItemError: 'collect'.
PipelineOpts-
PriceTable-
PricingPer-model pricing in USD per million tokens. The registry's versioned price table wins over adapter- reported caps.pricing, which is a fallback only.
ProviderAdapter-
QualityFloors-
RandIdentityInputDeterministic shims: ctx.now / ctx.random / ctx.uuid (kind 'rand').
RefEntryAppenderThe append surface the arbiter drives (implemented by the Replayer).
RefusalInfo-
ResolutionLayerOne layer's contribution to the resolution merge.
ResolvedInvocationThe resolved, scrubbed result of one invocation's resolution.
ResolvedToolsetThe spawn's frozen toolset snapshot plus its identity hash.
ResumeHandle-
ResumeOptions-
ResumePreviewResume-time hit/miss/orphan accounting.
ResumeReport-
RetryPolicy-
ReuseConfigThe reuse block of AdmissionConfig.
RunAgentOptions-
RunEventSinkSpan-aware event sink: bodies are stamped into the WorkflowEvent envelope by the per-run EventBus (M1-T10); spanId defaults to the run root span when omitted.
RunHandle-
RunInternalsEverything one run's ctx needs; created per run by the engine (M1-T11).
RunOptions-
RunProfile-
RuntimeEventSinkMinimal internal event sink; the typed WorkflowEvent envelope wraps it in M1-T10.
SandboxBridge-
SandboxBridgeOptions-
ScriptRunner-
ScrubNoteA scrub performed by the router; surfaced as a warning-level event by the engine.
SerializationHookcreateEngine({ serialization }): absent means identity, no wrapping.
ShellPatternRules-
ShellSegmentArgv-parsing shell matcher (M5-T06): shell allow/ask/deny is matched through a real argv parser, never a string prefix. The composition rule is the entire point: for a compound command the verdict is the strictest across segments, and any unmatched segment yields ask, never a silent allow: npm test; rm -rf / MUST yield ask (or deny when rm patterns are denied) even when npm test is allow-listed.
SinglePhaseAppend-
SpanMinterMints span ids in the run > phase > agent > tool > child hierarchy.
SpawnAdmissionValueThe journaled spawn-admission payload the runtime writes and recovers.
SpawnAgentParamsThe spawn parameters as validated JSON (a TaskSpec subset).
SpawnLineageThe value-part lineage block embedded in decision entries: the computed LineageRef plus the normalized tag (the request part holds the RAW proposal; the value part holds what was COMPUTED and is reused byte-exact on replay).
SpawnLineageOptThe spawn-options lineage block (ctx.agent, ctx.workflow, spawn_agent, add_task).
SpawnRecordOne spawned child tracked by the orchestrator runtime.
StandardJSONSchemaV1The Standard JSON Schema interface.
StandardSchemaV1The Standard Schema interface.
StepIdentityInputJournaled effectful steps: ctx.step (kind 'step').
SuspendedAppend-
TaskDigestThe per-child digest handed to the orchestrator.
TerminalPatch-
TerminationAccountSnapshot-
TerminationDeniedValueThe value payload of a termination.denied entry.
TerminationInitValueThe value payload of a termination.init entry.
TerminationLimitsThe frozen limits vector written into termination.init.
ToolCallRequestOne model-issued tool call as the loop dispatches it.
ToolContextThe context handed to execute (and to permission hooks and canUseTool). Deliberately exposes NO spawn primitives: tools are leaves of the call-and-return tree (invariant I3); all spawning flows through Ctx primitives.
ToolContextSeed-
ToolContractThe identity-bearing tool contract: exactly what the model sees and exactly what toolsetHash hashes. Never contains execute or any closure.
ToolDefA defined tool. The identity projection is the ToolContract { name, description, parameters, version }: exactly what the model sees and exactly what toolsetHash hashes; execute and every other non-contract field are excluded by construction.
ToolInit-
ToolRuntimeThe spawn's frozen toolset plus the per-call context factory, prepared by the ctx layer (M3-T01). The contracts are the canonical identity projection already hashed into the spawn's content key; the loop sends exactly them to the model.
ToolSourceThe ToolSource seam: tools() yields the source's current ToolDefs. The toolset snapshot for a given agent spawn is captured at spawn time and hashed into the spawn's identity via toolsetHash; a mid-run change MUST NOT mutate an in-flight agent's toolset.
ToolSourceSessionSession handle passed to ToolSource.tools (minimal in v1; audited at M9).
TranscriptSerializationHook-
TranscriptStore-
UsageLimitsUsageLimits (M1-T06): normative limit vocabulary and the per-spawn merge.
VerifiedRecommendationOne compiled start-tier recommendation of the verified layer.
WakeBudgetBlockPassive budget visibility in every digest (DEF-7).
WakeDigestThe FINAL normative WakeDigest: one coordinated schema change inside the hashVersion-2 profile (XF-12). The digest render enters the content key of orchestrator turns. In runs without the PlanRunner extension the termination, budget, and reuse blocks are all-zero and planHash is empty, mirroring the CostReport convention.
WorkflowClosure-form workflow value; in-process only.
WorkflowCallOptsOptions of ctx.workflow; key replaces args in the child identity.

Type Aliases

Type AliasDescription
AbandonAttempt-
AbandonPayloadPayload of abandon ref-entries (DEF-4/DEF-5).
AbortClassThe consumer-visible dedicated class marker (FR-424).
AdaptiveEventsAdaptive orchestration, resolutions, and accounting: emitted only by runs where the corresponding machinery is active (applicability per mode: https://docs.rulvar.com/guide/adaptive-orchestration). The types land as one closed catalog with M7-T03; emitters arrive with their tasks.
AdmitRejectReasonThe merged reject-code set.
AdmitVerdictThe unified admission verdict (XF-11). One union, closed now; every debit is atomic with its carrying decision entry and embeds the balance-after (DEF-2).
AgentErrorThe structured error value carried on AgentResult.error and journaled inside the agent terminal entry. Deliberately NOT a RulvarError subclass.
AgentEventsAgent lifecycle.
AgentStatus-
AttemptOutcomeClassAttempt outcome classes entering LineageStats.
BytesL0 byte-blob alias consumed by TranscriptStore and IsolationProvider.
CacheTtl-
CanonicalIdEngine-minted ULID identifying a tool call across providers. The library, not the provider, mints tool-call ids; each adapter keeps a bijective map between canonical ids and wire ids (toolu_* / call_*) in both directions.
CanonicalIdentityThe projected, JCS-serializable identity under one profile.
CanonicalModelSpecIdentity-facing canonical form of a RESOLVED model request; the value that enters AgentIdentityInput.modelSpec. providerOptions and fallbacks NEVER enter this form: they are delivery options, excluded from identity exactly like label, phase, onError, retry, and replay. effort is absent exactly when no layer of the chain and no role effort default resolves one.
CanUseTool-
ChatEventThe single canonical stream-event vocabulary yielded by ProviderAdapter.stream. Adapters MUST emit exactly one terminal event per stream (finish or error).
ClaimClass-
ClaimOp-
ClaimStatus-
CoreEventsRun lifecycle and core telemetry (M1 subset).
DebitResult-
DerivedKeyA derived key, or the guaranteed non-match marker.
DeriverRegistry-
DispositionRulePer-effective-status disposition rules; DATA on the profile, consumed only by the single canonical replayDisposition function (there is NO replayAction method).
DispositionTable-
EffortCanonical effort: exactly five levels, a string-literal union, never a TS enum. OpenAI 'none' has no canonical equivalent and is reachable only via providerOptions.
EntryKindThe single kinds registry v2. Readers MUST tolerate unknown kinds; stores pass them through byte-for-byte (obligation A4).
EntryRefThe canonical EntryRef between entries is seq.
EntryStatusThe stored status vocabulary, exactly. 'skipped' is DELIBERATELY absent: it is a derived fold status, never persisted.
ErrorClass-
ErrorCodeThe closed error-code registry. 'agent' is carried by the AgentError value projection, not by a RulvarError subclass.
ErrorPolicy-
EscalatedResult-
EscalationDecision-
EscalationKindClosed in v1.
EvidenceRefentryRef is the journal entry seq (canonical EntryRef; XF ruling).
FailoverTriggerTransport-level failover triggers; budget is explicitly excluded.
FallbackTriggerThe degenerate fallback triggers.
FinishInfoTyped finish outcomes. A refusal MUST surface as a typed finish outcome carrying the provider stop details; it MUST NOT be projected to a null output silently.
GateLadder acceptance gates. Spot-check sibling selection is strictly via ctx.random, never Math.random.
GateRecordThe write gate. The human variant carries the MANDATORY attribution attestation (ruledOut over the checklist prompt, tools, difficulty, transient-provider; recommended contrast evidence): rubber-stamping "evidence exists" is constructively impossible. The eval-confirmed variant is reserved for v2, outside the committed roadmap.
HashVersionVersions the ENTIRE identity and replay pipeline as one unit: canonical JSON algorithm, identity field sets, hash function, schema/toolset hash derivation, scope grammar and ordinal rules, replay predicate, fold defaults, and the kind/status vocabularies.
HookVerdict-
IdentityInput-
InvocationRole-
IsolationSpecThe canonical identity encoding of spawn isolation: this exact value domain enters spawn identity. 'readonly' is a determinism and blast-radius declaration, not containment.
IssueThe vendored Standard Schema issue shape: validation issues carried on AgentError and surfaced to the model during bounded schema re-prompts.
JournalCompatSubCodeSub-code detail of JournalCompatibilityError.
JournalEntryFinal entry form (hashVersion 2). All journaled values MUST be JSON-serializable; a violation raises a typed NonSerializableValueError at the call site. append is serialized by a per-run queue.
JsonL0 JSON value domain.
JsonSchemaA JSON Schema document (draft 2020-12) as plain JSON data. Canonical serialization and hashing rules live with the KeyDeriver.
KbProposalTriggerThe closed trigger vocabulary of kb_propose (phase 3).
LeaseLease token for queue-mode ownership; epoch is the fencing token.
LineageRelationThe closed relation vocabulary of the minting and inheritance table.
LogicalTaskIdLogical-task identity across rebirths (DEF-3); engine-minted ULID.
MatchResult-
MechanicalGateProfileA mechanical acceptance gate: an engine-registered NAMED pure function over AgentResult.artifacts. The registry is per engine like every other registry; the ladder driver journals each evaluation as a decision entry, so the ladder fold consumes only journaled verdicts, never live re-evaluation.
ModelCapsCapability facts the router consumes for tier selection and scrubbing.
ModelKnowledgeHandleThe runtime handle: with propose() deleted from the design and commit absent from this shape, a run has no write path into the cross-run medium at all.
ModelListConstraintAn explicit allowlist and denylist; deny wins over allow.
ModelRefStrictly 'adapterId:model', no query parameters.
ModelSpecWhat authors write wherever a model is configurable: a call override, an agent profile, a workflow default, or an engine default.
NodeIdPlan-node identity; engine-minted ULID.
OnEscalationEscalation hook: decides for value-form calls.
OperationDisposition-
OutInferred output type per form: the Standard Schema output type; the type-guard target of validate(); unknown for a bare JSON Schema.
PartThe canonical part union. provider-raw parts carry opaque provider blocks that must survive round trips (thinking blocks with signatures, reasoning items including encrypted_content). Retention is unconditional; dropping happens only in projection, never in retention.
PermissionGate-
PermissionHook-
PermissionPreset-
PermissionRule-
PermissionVerdict-
RandPayloadRand-entry payload.
RefEntryClassificationFold classification of one ref-entry; NEVER persisted.
ReplayDisposition-
ReplayMode-
ResolutionAttempt-
ResolutionByThe journaled by-source of a resolution.
ResolutionOutcome-
ResolutionPayloadPayload of resolution ref-entries (DEF-4).
RetryClass-
RiskRuleValueDeclarative rule tables (no closures). 'undeclared' in risk position matches every tool WITHOUT declared risk: presets treat the undeclared state conservatively. Argv rules match through the real shell matcher; domain rules are ADVISORY outside the first-party fetch tool: they never change a verdict in M5, and matches surface in audit events.
Role-
RulvarErrorCodeAn alias for the registry type; both names are public.
RunFilter-
RunMetaRun-level metadata written by the ENGINE via putMeta as a separate record, so listRuns never parses payloads. The hashVersion range fields are advisory only; the journal is authoritative.
RunOutcome-
RunStatusAdds 'running' for in-flight inspection.
SandboxHostToWorkerHost-to-worker protocol messages (JSON only).
SandboxMethodMethods a sandbox script may proxy to the host ctx.
SandboxWorkerToHostWorker-to-host protocol messages (JSON only).
SchemaPairForm 2 of SchemaSpec: an explicit JSON Schema plus a runtime type guard.
SchemaSpecThe L0 schema contract with exactly three accepted forms: a Standard Schema (Zod, ArkType, Valibot, ...), a { jsonSchema, validate } pair, or a bare JSON Schema literal.
SchemaValidationResultResult of validating a value against a SchemaSpec.
ScopeSegmentA parsed scope-path segment.
SettledThe discriminated union over AgentStatus carrying the underlying AgentResult where one exists.
ShellVerdict-
SpawnKeyKernel contentHash of a spawn root entry.
SpawnOriginEvery spawn origin routed through the single admission point.
Spend-
Stage-
StructuredOutputTier-
SuspensionState-
TaskClassTask-class vocabulary aligned with the role quality floors vocabulary (https://docs.rulvar.com/guide/model-routing). Scopeless global statements are inexpressible: every claim binds a taskClass.
TaskSpecMinimal TaskSpec stand-in: the full typed TaskSpec is owned by the PlanRunner surface and ships with M7; script modes carry proposals opaquely until then.
TerminationDeniedWriterInjected appender for termination.denied entries (engine-owned I/O).
TerminationResourceThe countable resource vocabulary.
ToolChoice-
ToolEventsTool lifecycle (emitters arrive with the tool system, M3).
ToolExecutorWhere execute runs. A declared capability consumed by dispatch and policy; only 'inprocess' is enforced in v1, subprocess/container remain declared capability while the executor design stays an open question.
ToolRiskDeclarative risk metadata on the tool contract. Policy input, not identity: it does NOT enter toolsetHash.
ToolsOptionThe per-spawn tools option value domain.
TriggerClass-
TtlStateThe TTL state a maintenance view renders per claim.
UsageUsage under the Usage invariant: inputTokens is the FULL prompt size including cache reads and cache writes. Adapters MUST normalize provider-reported usage to satisfy this invariant, and the core verifies it at the adapter boundary.
WakeTriggerThe closed v1 trigger vocabulary.
WireErrorJSON-serializable error projection stored in journal entries (JournalEntry.error) and sent across process boundaries (worker sandbox RPC, HTTP server). Raw Error objects never enter the journal.
WorkflowEventThe envelope: seq is an independent per-run telemetry counter, strictly increasing in emission order and DISTINCT from JournalEntry.seq (never compare or join the two; entryRef fields carry journal seqs explicitly). ts is wall clock, telemetry only. replayed is true only on re-emitted journal-backed lifecycle events; stream deltas are never re-emitted.
WorkflowEventBody-
WorkflowRegistryThe per-engine workflow registry (M5-T01): an explicit, first-class value; no module-level registry exists. Shells resolve by-name runs against it; ctx.workflow's string form (M6) and the queue worker (M8) resolve against it too. CompiledWorkflow values join the union when they first exist (M6).

Variables

VariableDescription
AWAIT_SCHEMAawait_any and await_all share one parameter shape.
BUDGET_ABORT_REASONReason marker distinguishing a budget-ceiling abort from host cancellation.
CANCEL_AGENT_SCHEMAThe cancel_agent parameter schema.
CHECKPOINT_FORMAT_V1Leading format byte of the v1 checkpoint blob.
CLAIM_STATEMENT_MAX_CHARSThe committed data model bound: statement <= 200 chars.
CLAIM_TTL_DAYSThe asymmetric TTL table: a false negative is costlier through lock-in, so weaknesses expire sooner than strengths.
COMPACTION_SUMMARY_PREFIXDeterministic marker opening every compaction summary message.
CURRENT_HASH_VERSION1 = round 1; 2 = current.
DEFAULT_CHILD_BUDGET_FRACTION-
DEFAULT_COMPACTION_THRESHOLDCompaction threshold default, 0.8 of contextWindow.
DEFAULT_ESCALATION_LIMITS-
DEFAULT_FLAT_RESERVE_USDLast resort of the admission reserve formula.
DEFAULT_MAX_CHILDREN_PER_NODE-
DEFAULT_MAX_DEPTH-
DEFAULT_MAX_OSCILLATIONS_PER_KEY-
DEFAULT_MAX_PINNED_WORKTREESAppendix A: the shared pin cap (park/unpark and retainWorktree).
DEFAULT_MAX_REVISIONS_PER_RUNAppendix A committed defaults for the countable resources.
DEFAULT_MAX_TOTAL_SPAWNS-
DEFAULT_MAX_TURNS-
DEFAULT_MODEL_RETRY_ATTEMPTSBounded semantic retries per tool call chain.
DEFAULT_NO_PROGRESS_TURNSThe committed no-progress detector N.
DEFAULT_PER_RUN_CONCURRENCYFIFO semaphore; default per-run width is 12.
DEFAULT_RETRY_POLICYAppendix A committed defaults (M4 entry gate, PR #26).
DEFAULT_STREAM_IDLE_TIMEOUT_MS-
deriverV1The frozen v1 (round 1) profile: the projection removes effort from the requested modelSpec (the v1 predicate is effort-insensitive by construction); features outside the v1 domain are incomparable.
deriverV2The current (hashVersion 2) frozen profile.
EMIT_RESULT_TOOLThe synthesized forced-tool contract name.
EMPTY_SCHEMA_HASHThe schemaHash used when no structured-output schema is declared: the hash of the canonical true schema.
EMPTY_TOOLSET_HASHThe toolsetHash of an empty toolset: the hash of the canonical empty contract array.
ESCALATE_TOOL_NAME-
ESCALATION_REPORT_SCHEMAThe full-report schema applied BEFORE append.
ESCALATION_REQUEST_SCHEMAThe escalate tool's exact request schema. costToDate and salvage MUST NOT appear here: additionalProperties false rejects model-authored values for them at argument validation.
FINISH_SCHEMAfinish; result validates against the declared output schema.
FINISH_TOOL_NAME-
INBOX_PROPOSAL_TTL_DAYSInbox proposals expire after 14 days (reserved for M12 phase 3).
KB_ACTIVE_CLAIMS_CAPAppendix A: KB active-claims cap, default 8 per (model, taskClass).
KB_CARD_RENDER_BUDGET_CHARSThe KB card render budget (characters).
LARGE_VALUE_WARN_BYTESLarge-value soft warn threshold (committed for M2).
LEGACY_LTID_PREFIXDeterministic LTIDs canonized onto legacy journals.
LEGACY_SIGNATURE_INPUTSThe deterministic signature inputs assigned to legacy spawns (journals written before lineage existed) and to attempts whose producers did not record signature inputs: stable constants, never wall-clock, so replay canonizes identically on every engine.
LINEAGE_SIG_VERSIONapproachSig/approachSigCoarse derivation version.
MASKED_SECRETThe replacement marker; deterministic and greppable.
MAX_DEPTH_CEILING-
ORCHESTRATE_WORKFLOW_NAME-
PARALLEL_AGENTS_SCHEMAparallel_agents wraps the spawn_agent params.
ROLE_EFFORT_DEFAULTSRole effort defaults: orchestrate and plan default to high; summarize and extract default to low. loop and finalize have NO role default: when the chain resolves nothing, the wire omits effort and identity records the spec with the effort member absent.
ROOT_ACCOUNTThe run-root account scope.
ROOT_SCOPEThe root sequential body of the run is the empty path.
RUN_PROFILESThe shipped presets (fast / standard / deep / ultra "and similar"). Data only; a review-time assertion checks the engine has zero behavioral branches keyed on these names.
SPAWN_AGENT_SCHEMAThe spawn_agent parameter schema (normative).
TOOL_NAME_PATTERNFirst-party provider tool-name constraint intersection.
WAIT_FOR_EVENTS_SCHEMAThe wait_for_events parameter schema (normative).
WAIT_FOR_EVENTS_TOOL_NAME-
WAKE_SUMMARY_RENDER_BUDGET_CHARSThe committed WakeDigest render budget (Appendix A: 400 chars per outputSummary row, the character measure; committed at M10 entry by adopting the implemented distillation cap unchanged, the value frozen into every cassette since M6). One value serves both stages: the deterministic distillation cap here and the digest render default in orchestrate (renderBudgetChars).

Functions

FunctionDescription
admissionReserveUsdThe admission reserve for a spawn: opts.estCost, else profile.estCost, else price(countTokens(input) + caps.maxOutputTokens), else the engine flat default.
agentErrorFromWireReads an AgentError back from its WireError projection. Throws a ConfigError when the wire code is not 'agent'.
agentErrorToWireProjects an AgentError to its WireError form: code 'agent', with kind, retryAfterMs, and issues carried in data. Issue paths are flattened to JSON-safe segments.
agentScopeOrchestrator handle spawns nest under the orchestrator's own spawn entry: agent:<seq>.
applyClaimOpsApplies one op batch to a claims array, mechanically (M10-T01). The editorial validators (attestation, caps, statement bounds) layer on top in M10-T02; referential integrity is enforced here because a dangling supersede or archive would corrupt the append-only chain.
applyStructuredOutputTierApplies the selected tier to an outgoing request. Native rides ChatRequest.schema; forced-tool synthesizes a single emit_result tool with toolChoice pinned to it; prompt injects the schema into the last user message.
approachSigCoarseapproachSigCoarse = sha256(JCS({ sigVersion, agentType, toolsetHash, schemaHash, isolation })). Feeds the stall detector and the oscillation guard, which keys ACROSS LTID boundaries.
approachSigOfapproachSig = sha256(JCS({ sigVersion, coarse, approachTag })); keys lessons.
archiveDeprecatedModelOpsDeprecation maintenance (deprecations archive claims, never delete them, so historical runs keep their audit trail): archive ops for every non-terminal claim of the deprecated models. The caller commits them under its own gate-free archive ops.
atCompactionThresholdThe summarize trigger: the compaction threshold on the context window (default 0.8). Pure predicate; the compaction pipeline that acts on it is M4-T03.
buildAbandonFoldBuilds the AbandonFold in ONE pass at load, in append order, pinned for the entire resume (DEF-1 ordering rule 4). Coverage is the target seq itself plus, transitively, every entry under the target's child scope-prefix. Repeated abandons over an already-covered target fold to noop.
buildAdapterRegistryPer-engine adapter registry: strictly per engine, no global mutable registry exists. A duplicate adapterId is a typed ConfigError.
buildCostReportFolds the per-run attribution buckets into the normative CostReport.
buildDeriverRegistryBuilds the per-engine deriver registry: the shipped v1/v2 profiles plus EngineOptions.extraDerivers, the ONLY window extender. A malformed extra deriver is a ConfigError before any run effect.
buildOrchestratorToolsBuilds the mode (c) toolset over the per-call runtime. profileCardText rides the spawn tools' descriptions so both modes speak one agent vocabulary (M6-T04).
buildTerminationInitValueBuilds the termination.init value payload.
buildToolContextBuilds the per-call ToolContext; one fresh span per tool call.
canonicalIsolationTagThe isolation string entering approachSigCoarse.
canonicalizeLadderCanonicalizes a declared LadderSpec: validates the shape once (FR-119 judge declaration included) and resolves every rung's effort to an explicit value. chainEffort is the effort the resolution chain would contribute at the declaring layer; a rung that resolves no effort at all is a ConfigError (the canonical form has no absent-effort member by declaration).
canonicalizeSchemaCanonical schema derivation: local fragment-only $ref inlined (recursion is a ConfigError), remote and dynamic references forbidden, annotation keywords stripped (format retained), reference infrastructure ($defs, definitions, $anchor) removed once inlined. The result feeds JCS serialization and sha256.
canRideLoopTurnTrue when the given structured-output tier can ride the last loop turn. native and prompt coexist with tool availability; forced-tool pins toolChoice to the synthesized emit_result contract and therefore cannot ride while the agent's tools must remain available. For an agent with no tools every tier rides (the M1 behavior, unchanged).
capIssuesThe commit-time cap (Appendix A): active claims per (model, taskClass) after the batch applies. Supersede chains keep only the head active by construction (applyClaimOps flips the prior to 'superseded'), so a supersede never grows the count.
capsHashOfDeterministic hash of a caps declaration (JCS + sha256).
checkFloorsEnforces the floors for one resolved invocation. taskClass is the profile-declared class; when absent (unclassified) only byRole floors apply. Throws a typed ConfigError on violation.
checkpointRefForDeterministic checkpoint blob ref for an agent dispatch (running seq).
childCoveragePrefixThe child scope-prefix an abandon over target covers transitively. Agent spawns nest under agent:<seq>; a child workflow's subtree runs under the wf:<name>:<ordinal> scope recorded in its dispatch payload (M6-T06). A child entry without the payload (foreign journals) degrades to the agent:<seq> convention, which covers nothing real and keeps the fold total.
claimExpiredTrue when the claim steers nothing at at (the read-path filter).
claimExpiryThe asymmetric TTL applied to an observedAt ISO date.
claimIssuesIssues of one claim record (empty = valid).
claimOpIssuesIssues of one op (empty = valid). GATE-DRIVEN (M11-T01): the gate on the op decides which claim rules apply, so the identity is enforced by shape alone. Referential integrity stays with apply.
classifyAgentErrortask-class: schema-mismatch, terminal, non-retryable tool. transport, rate-limit, and budget are never memoized.
classifyAttemptOutcomeClassifies one settled root terminal into its attempt outcome class.
collectDeclaredLaddersThe ladders a run declares: every advertised profile whose model spec is a ladder. The card is tier-relative to exactly these.
compactMessagesApplies a produced summary: everything after the first message (the spawn prompt) is replaced by ONE user-role summary message. Compaction fires at tool turn boundaries only, so the replaced span never splits a tool-call/tool-result pair.
compilePermissionChainMerges the engine-wide config and the profile config into one chain. Layers concatenate engine-first; since rules only deny or ask, ordering within a layer cannot change the verdict. The profile's canUseTool wins over the engine's (a single slot by construction). A declared preset compiles INTO the same layers, after the host-authored rules, never as a fifth layer (M5-T05).
compilePermissionPreset-
compileVerifiedLayerThe verified-layer compiler (M11-T06): start-tier recommendations per (ladder, taskClass) compiled EXCLUSIVELY from eval-measured claims. A strength on a rung below the default votes down (start cheaper); a weakness on the default rung or below votes up. The net sign shifts EXACTLY one rung, bounded to the ladder (the clamp: the price of any false belief is one rung); ties hold the default and compile nothing. Editorial claims NEVER compile. Floors and ModelCaps stay hard router constraints; budget is touched only through the existing admission path. A deterministic pure function: the M12 consumers read THIS, never the card text.
costReportFromJournalThe pure journal fold: byModel and totals from terminal entries, the same summation the kernel ledger uses (terminal usage exactly once, priced per servedBy, abandoned subtrees contribute zero).
countsAgainstLimitcountsAgainstLimit derivation (XF-06): true iff scope_bigger; scope_different and blocked_with_evidence are exempt and never debit the escalation counter.
createCanonicalIdMinterReturns a per-engine minter of CanonicalId values. Monotonic within the factory instance; never a module-level singleton (no module state).
createCtxCreates the per-run Ctx bound to internals. The current scope travels through AsyncLocalStorage so parallel branches and pipeline stages keep one ctx object while journaling under their own scope paths (I3: structure from call-and-return only).
createEngine-
createSandboxBridge-
currentOnlyKeyRing-
decodeCheckpointDecodes a checkpoint blob. Returns undefined for an empty blob or an unknown format byte: a resume never trusts a checkpoint it cannot parse; the dangling dispatch reruns from the top instead (at-least-once is the documented floor).
defineWorkflow-
deriveContentKeykey = sha256(JCS(IdentityInput)).
digestOfFolds one settled child into its digest (spawn-ordinal ordering is the caller's).
dispositionHookAdapts the predicate to the matcher's disposition hook: two-phase operations dispatch on their terminal, single-phase on themselves.
emptyDigestBlocksThe all-zero blocks of runs without the PlanRunner extension.
emptyToolsetThe empty toolset (no tools declared anywhere).
encodeCheckpointSerializes a checkpoint to its blob: format byte then UTF-8 JSON.
escalateToolThe engine opt-in tool: registered through the same path as any tool under escalation opt-in of EITHER flavor (the worker's only authoring channel for a report), never available without opt-in, and dispatched through the same permission chain. The loop intercepts accepted calls; execute is unreachable by construction.
evaluatePermissionEvaluates the chain for one dispatch, or OFFLINE against a hypothetical call by tool name (the dry-run API: nothing executes; shells and tests read the verdict, the deciding layer, and the matched rule). Hooks run in deterministic registration order; { modifiedInput } substitutes the input and continues; the first decisive verdict wins. The returned input is what execute receives and what the approval identity hashes (post hook modification). Advisory domain-rule matches ride every verdict for the audit payload.
evaluateReuseThe four-outcome verdict evaluation on a SpawnKey match, computed once live at the fold head and embedded into the deciding entry; replay never re-evaluates.
executeWorkflowRuns a workflow body against a fresh ctx: the engine core that engine.run wraps with RunHandle, events, and outcome assembly (M1-T11). Validates args against the declared schema, then executes single-pass.
exhaustionCodeOfThe typed error code surfaced after a denied debit.
extractCandidateExtracts the structured-output candidate from a collected turn per tier. Returns undefined when the turn carries no candidate (for example the model answered prose without the forced tool call).
failoverTriggerOfMaps a retry class to its failover trigger once retries exhaust. Overloaded (529) is transport-class for failover purposes; a non-retryable error never fails over.
fallbackTriggerOfClassifies a terminal agent outcome for the degenerate fallback: schema-mismatch errors are 'schema-exhausted'; any other error is 'error'; limit terminals (the no-progress abort included) are 'limit'; cancelled, escalated, and skipped never trigger.
filterClaimsForRunThe admission filter: status active, unexpired at now, and the subject reachable through the run's declared ladders after the role-floor filter.
finalizeFiresThe finalize firing rule: only if configured in routing, and only after tools stop, which presupposes a non-empty toolset. A no-tools agent's single loop turn is already its synthesis (as amended in M4-T01). The caller additionally gates on the loop having ended without an abort: a limit/error/cancelled/escalated loop never reaches synthesis.
foldTerminationThe replay fold: rebuilds the account from termination.init and the debiting decision entries, asserting every embedded balance-after against the recomputation. A divergence raises the typed journal-integrity error at exactly the diverging entry; denials are re-issued from termination.denied with zero live calls.
formatRePromptThe bounded re-prompt message sent back to the model on a validation miss.
formatScopePathSerializes parsed segments back to the canonical path (round-trip).
hashWorkflowBodyContent hash of an in-process workflow body (run-to-definition binding).
hashWorkflowSourceContent hash of a compiled workflow source (run-to-definition binding).
identityJcsThe JCS form of an IdentityInput under the hashVersion 2 profile.
isEscalated-
isSchemaPairSpecForm-2 guard: an explicit { jsonSchema, validate } pair.
isStandardSchemaSpecForm-1 guard: the value implements the Standard Schema interface. Some libraries expose callable schemas (ArkType types are functions), so both object- and function-typed values qualify.
isStrictCompatibleSchemaStrict-schema compatibility as both first-class providers define it: every object node declares additionalProperties: false and lists every property in required. Boolean schemas and non-object shapes are trivially compatible.
kMaxOfkMax: the maximum declared ladder length across the registry snapshot.
knowledgeHashDeterministic content hash of the claims array (JCS + sha256).
ladderLengthOfReads the declared ladder length of one agent profile. Ladders are declared through the profile's ModelSpec (model: { ladder }, or the loop-role routing entry). The reader is defensive so the snapshot is total over every registry shape (an undeclared ladder has length 1: the single implicit rung).
ladderRungChoiceThe concrete ModelChoice of one rung attempt: each attempt is an ordinary agent scope whose CanonicalModelSpec is that rung's { kind: 'model' } form.
lexShellCommandLexes a command into segments per the matching algorithm above. Quotes and escapes are honored; nothing is expanded; $(, backticks, <(, >(, and << (outside single quotes) poison their segment.
liftRetainedPartsLifts the adapter-shipped retention payload of one finished turn into provider-raw parts (the retention transport). Reads providerMetadata[<adapter id>].retainedParts and tags each block with the adapter's provider family. Returns [] when the adapter shipped nothing.
lineageWeightOfC = E0 + kMax: the per-spawn weight of the variant function.
makeOrchestratorWorkflowBuilds the orchestrator workflow: ONE implementation behind both surfaces. The body wires the spawn tools over the per-call runtime, recovers spawn records from the journal on resume, and runs the orchestrator agent with the finish terminal tool.
maskSecretsMasks credential-shaped substrings in one string.
maskSecretsDeepDeep-masks every string value in a JSON tree; non-strings pass through. Returns the input identity when nothing matched, so the default-on policy costs no allocation on clean events.
maskSecretsJsonConvenience for hosts: masks a Json value (alias of the deep walk).
matchArgvPatternPattern grammar (5.1): literal words match one identical token; * matches exactly one token; ** matches zero or more remaining tokens and may appear only as the final word. A pattern matches only if it consumes the segment's ENTIRE argv.
matchShellCommandThe strictest-across-segments composition (5.3): deny if ANY segment denies; otherwise ask if ANY segment asks or fails to match an allow pattern; otherwise allow.
mcpImports MCP tools as a ToolSource. The client connects lazily on the first tools() call; tools/list is fetched with cursor pagination until exhaustion and cached per session; a listChanged notification invalidates the cache, affecting subsequently spawned agents only (a spawn's toolset snapshot is immutable by construction).
mergeUsageLimitsLimits merge per spawn: AgentOpts.limits over profile limits over engine defaults.limits.
modelEpochOfBuilds the optional modelEpoch block; empty inputs give undefined.
modelKnowledgeCardThe deterministic card render. Pure: same filtered claims and ladders give byte-identical text. The render budget is 4096 chars; over it, the OLDEST-observed notes withhold first behind an explicit marker.
modelSpecIdentityThe identity projection of a CanonicalModelSpec. For the plain-model kind the projection is { model, effort? } WITHOUT the kind discriminant, exactly as frozen by the hashVersion 2 profile; effort is omitted when unresolved. The ladder embedding lands with ladder execution (M7).
needsSeparateExtractThe completed extract-necessity rule: a separate final structured-output invocation fires only when a schema is set AND (routing directs extract to a different model OR the loop model's caps cannot serve the required tier OR finalize is routed, in which case the schema never rides a loop or synthesis turn). Otherwise the schema rides the last loop turn with no extra call (as amended in M4-T01).
nextFailoverThe next target index past from that serves trigger, or undefined when the chain is exhausted. Index 0 is the primary; the chain never moves backwards (sticky failover).
nodeLinkKeynode.link identity: sha256 of {kind, spawnKey, donorScope, targetNodeId}; targetNodeId is deterministic on replay because NodeIds are assigned inside plan.revision.
normalizeApproachTagApproach-tag normalization: NFC, lowercase, runs of non-alphanumerics collapse into a hyphen, truncate to 32 characters; an empty value canonicalizes to 'default'. Prompt prose never enters any signature: rephrasings collide by construction, not by heuristic.
normalizeEntryRound-1 normalization: hashVersion is taken from hashVersion, else from the legacy v field, else 1. Stores are never rewritten; normalization happens at read.
normalizeFallbacksNormalizes the author-facing ModelChoice.fallbacks list.
orchestrateTop-level surface: creates a run.
parallelScopeBranch branch of parallel site site: par:<site>:<branch>.
parseModelRefModelRef is strictly 'adapterId:model', no query parameters. The wire model id may itself contain colons (for example ollama tags), so only the FIRST colon splits.
parseScopePathParses a scope path against the frozen grammar (M2-T04):
phiInitialOfPhi0 = V0 + C * S0, finite and fixed in termination.init.
pipelineScopeStage stage processing source item item: pipe:<stage>:<item>.
planNodeScopePlanRunner node scopes: plan/<NodeId> (NodeIds are engine-minted ULIDs).
priceUsdOfDollars from normalized usage against one pricing row (the adapter normalized the usage; inputTokens is the full prompt). Cache writes price at the 5m premium rate; the 1h rate applies where a provider distinguishes it in usage, which the canonical Usage does not yet carry.
profileCardRenders the registry into the shared agent vocabulary card. Sorted, deterministic, byte-stable; an empty registry renders explicitly so the planner never guesses at unregistered agentTypes.
profileRegistrySnapshotHashThe deterministic profile-registry snapshot hash frozen inside termination.init: profile names mapped to their declared ladder lengths, canonical JSON, sha256.
projectHistoryProjects the canonical history into the target provider's view: provider-raw parts of a DIFFERENT provider are omitted; everything else (text, images, tool calls, tool results, compaction content) passes through untouched. Messages whose parts all belong to another provider vanish entirely rather than ride as empty messages.
projectIdentityThe canonical identity object of an IdentityInput under the hashVersion 2 profile: what JCS serializes and sha256 hashes. The agent kind projects modelSpec through modelSpecIdentity; every other kind serializes its fields verbatim. Fields not listed for a kind are never included (the types make them unrepresentable).
projectToJsonSchemaDerives the JSON Schema of a SchemaSpec. Form 1 projects via the StandardJSONSchemaV1 input() converter, target draft 2020-12 with draft-07 fallback; a library without the projection is a typed ConfigError at definition time, never at first call. Transforming schemas therefore project their INPUT type. Forms 2 and 3 are taken verbatim.
proposalStatementThe typed statement template for a proposal-born claim (phase 3): assembled over the closed enum vocabulary ONLY, so tool-output text is unquotable into persistence, and model-free, because a claim statement renders into the knowledge card's notes layer, which never leaks model names to the orchestrator.
providerOfThe provider family of an adapter: provider when set, else id.
readTerminationInitReads a termination.init entry's payload; undefined when malformed.
registryKeyRingKeyRing over the registry: the live call is projected DOWN into the profile of the stored entry; there is no upward canonization.
remeasureQueueThe re-measurement queue: expired eval-measured claims that are still ACTIVE. Just a status filter: the next sweep re-measures these subjects; nothing archives them (archiving would empty the queue and hide the decay).
replayDispositionThe single canonical predicate, dispatched on the entry's own hashVersion (compatibility lemma: on the v1 domain the tables coincide). Suspended entries are outside the table (the DEF-4 fold consumes them); the alias column (DEF-5) activates with node.link producers in M7: a skipped entry WITHOUT an incoming alias is always skipped.
resolveModelInvocationResolution runs on every model invocation, not once per agent: a layered merge of { model, effort, providerOptions, fallbacks } in the order call override > agent profile > workflow defaults > engine defaults, with the invocation role attached as a tag. After resolution the router reads ModelCaps and scrubs illegal parameters visibly: unsupported effort is removed from the wire but kept in identity; sampling params rejected by the model are removed from the adapter's namespace, never silently sent.
resolvePricingResolves the pricing for a model: the versioned table wins; the adapter-reported caps.pricing is the fallback; undefined means unpriced (the CostReport surfaces it, never a silent zero).
resolveToolsetExpands sources, validates every tool name and duplicate names across the whole toolset (ConfigError at spawn time), and computes the toolsetHash over contracts sorted by name.
retryClassOfClassifies a WireError for the retry engine. Task-class failures are never retryable by construction: adapters mark them retryable: false and this returns undefined. The kind travels in WireError.data.kind; anything retryable without a specific kind is transport.
retryDelayMsThe delay before retry number retryIndex (0-based: the delay after the first failed attempt has index 0). A provider-supplied retryAfterMs REPLACES the computed delay (Appendix A). Jitter is equal-jitter: half the backoff is deterministic, half random, so a jittered delay never collapses to zero.
roleConfiguredInRoutingTrue when any resolution layer configures the given role in its routing map. This is the finalize TRIGGER: firing is decided by the presence of a routing entry at any layer; the model it fires ON still resolves through the full chain (a higher layer's all-roles model may override the routed choice).
roundOneDispositionThe round-1 interim disposition; replaced by replayDisposition (M2-T06).
runAgentRuns one agent to a typed AgentResult. Never throws past policy: every failure mode becomes a typed status on the result.
runProfileLooks up a shipped RunProfile by name; undefined for unknown names.
scanJournalCompatibilityThe one compatibility scan: immediately after load, strictly BEFORE any live call, any append, and any admission reserve; repeated at lease acquire in queue mode. Side-effect free.
schemaHashschemaHash = sha256(JCS(canonicalize(schema))). Accepts the derived JSON Schema (or a boolean schema); pass undefined for "no schema declared".
schemaHashOfSpecDerives and hashes a SchemaSpec in one step (identity path for spawns).
selectStructuredOutputTierTier selection: the model's declared ceiling bounds the tier; the native tier additionally requires a strict-compatible canonical schema (relying on silent server-side fallback is forbidden), degrading to forced-tool. Prefill is not a tier.
shouldCompactThe threshold check (M4-T03 committed semantics): the context estimate is the last loop turn's inputTokens + outputTokens; the Usage invariant makes inputTokens the full prompt, and the turn's output joins the next prompt.
spawnDepthOfNesting depth of a child scope: its workflow, agent, and plan-node segments.
summarizeInstructionThe instruction message appended to the projected transcript for the summarize invocation. Deterministic wording; the response text becomes the summary message body.
summarizeOutputThe M6 outputSummary: a deterministic truncation of the child's output (or error message), identical live and on replay (distillation lives with the child, ordered by spawn ordinal; the LLM distillation upgrade is M7 territory).
terminationConfigDriftConfig-drift detection at resume: the journaled vector always wins; every differing field is reported for the termination:config-drift event. Dynamic budget top-up via restart is excluded by construction.
tierWithinCapsTrue when tier is at or below the model's declared ceiling.
toApprovalDecisionNormalizes a resolution value into an ApprovalDecision. Anything that is not an explicit allow is a deny: an approval never fails open.
toJournalValueValidates and snapshots a value for the journal: the returned value is a JSON round-trip clone, decoupled from later caller mutations, with undefined object members dropped.
toolDefines a tool. Definition-time failures are typed ConfigErrors, never first-call surprises: an illegal name, a Standard Schema without the JSON Schema projection, a recursive local $ref, or a remote/dynamic reference all fail here.
toolContractThe identity projection: the contract tuple that enters toolsetHash. parameters is the canonicalized derived JSON Schema.
toolsetHashtoolsetHash = sha256 over the JCS-canonical JSON array of per-tool contract tuples (name, description, canonical parameters, version) sorted by name. Tool description IS part of the contract; schema annotations inside parameters are not. An absent version participates as absent.
ttlState-
validateEditorialCommitThe commit-batch validation: op shapes and gates first (GATE-DRIVEN since M11-T01: the human gate carries editorial claims, the eval-committer gate carries eval-measured claims with metrics), the post-apply cap second. Throws one ConfigError carrying every issue, so a maintenance caller fixes the batch in one round trip.
validateEntryShapeValidates the shape the engine is about to append. Returns issues; empty means valid. Unknown kinds are rejected here (the engine never writes them); stores still pass them through on read.
validateEscalationLimitsValidates a lineage-limits config record. The pre-rename knob name is rejected with a migration hint (XF-10): silently honoring it would change semantics (per logical task, not per node).
validateEscalationReportValidates the runtime-completed report BEFORE append; returns issues.
validateSchemaSpecRuntime validation per form: form 1 via the Standard Schema's own validate, form 2 via the pair's type guard, form 3 via the vendored draft 2020-12 validator. The same machinery backs the structured-output tiers of the Agent Runtime.
validateTerminationLimitsValidates a raw limits record into the frozen vector. The pre-rename escalation knob is rejected with a migration hint (XF-10); counters must be non-negative integers; kMax at least 1.
workflowScopectx.workflow child scope: wf:<name>:<ordinal> (ordinal counts invocations of that name).
workflowSourceRefTranscriptStore ref of the persisted CompiledWorkflow source blob.
wrapJournalStoreWraps a journal store with the hook; lease capability is preserved.
wrapTranscriptStoreWraps a transcript store with the hook.