Skip to content

rulvar API reference


rulvar API reference / @rulvar/rulvar / AdmissionController

Class: AdmissionController

Defined in: packages/core/dist/index.d.ts

Constructors

Constructor

ts
new AdmissionController(options): AdmissionController;

Defined in: packages/core/dist/index.d.ts

Parameters

ParameterTypeDescription
options{ budget: RunBudget; childBudgetFraction?: number; flatReserveUsd?: number; lineage?: { journalView: () => readonly JournalEntry[]; limits?: | Record<string, unknown> | Partial<EscalationLimits>; }; maxChildrenPerNode?: number; maxDepth?: number; maxTotalSpawns?: number; mintId?: () => string; }-
options.budgetRunBudget-
options.childBudgetFraction?number-
options.flatReserveUsd?number-
options.lineage?{ journalView: () => readonly JournalEntry[]; limits?: | Record<string, unknown> | Partial<EscalationLimits>; }The lineage binding (DEF-3): a journal view for the pure counter folds plus the configured limits. Without it the controller mints and embeds lineage but enforces no lineage limits (unit contexts).
options.lineage.journalView() => readonly JournalEntry[]-
options.lineage.limits?| Record<string, unknown> | Partial<EscalationLimits>-
options.maxChildrenPerNode?number-
options.maxDepth?number-
options.maxTotalSpawns?number-
options.mintId?() => string-

Returns

AdmissionController

Accessors

escalationLimits

Get Signature

ts
get escalationLimits(): EscalationLimits;

Defined in: packages/core/dist/index.d.ts

The validated lineage limits this controller enforces (DEF-3).

Returns

EscalationLimits


termination

Get Signature

ts
get termination(): 
  | TerminationAccount
  | undefined;

Defined in: packages/core/dist/index.d.ts

The bound account, when this is a PlanRunner run (DEF-2).

Returns

| TerminationAccount | undefined

Methods

admit()

ts
admit(spec, options?): AdmissionDecision;

Defined in: packages/core/dist/index.d.ts

Evaluates one spawn live, strictly BEFORE its decision entry is appended. On admit the reserve is committed on the whole ancestor account chain atomically with the evaluation; the caller journals the returned decision and only then produces effects (child account, dispatch). On reject nothing is committed and the reject verdict is journaled by the caller so replay re-delivers it without re-evaluation.

Parameters

ParameterType
specAdmitSpec
options?{ commitReserve?: boolean; }
options.commitReserve?boolean

Returns

AdmissionDecision


bindTermination()

ts
bindTermination(account): void;

Defined in: packages/core/dist/index.d.ts

Binds the run's TerminationAccount (DEF-2; PlanRunner runs only): from bind time on, every admitted spawn of any origin debits one spawnUnit atomically with its decision entry, and a declared ladder longer than the frozen kMax rejects with ladder_exceeds_frozen. Non-PlanRunner runs never bind an account and keep the engine lifetime cap semantics unchanged.

Parameters

ParameterType
accountTerminationAccount

Returns

void


evaluateLineage()

ts
evaluateLineage(spec): {
  decision:   | {
     kind: "ok";
     lineage: SpawnLineage;
   }
     | {
     kind: "reject";
     reason: {
        code: "lineage_busy" | "lineage_exhausted";
     };
   };
  statsBefore?: LineageStats;
};

Defined in: packages/core/dist/index.d.ts

The lineage half of admission (DEF-3): folds are computed live STRICTLY BEFORE the carrying decision entry is appended; the caller embeds the returned block in the entry and replay reads it back byte-exact. Enforces the single-live-attempt invariant (lineage_busy) and monotonic attempt consumption (lineage_exhausted); never touches budget or structural limits.

Parameters

ParameterType
spec{ ancestry?: string[]; approach?: string; lineage?: SpawnLineageOpt; name: string; signature?: Partial<ApproachSignatureInputs>; }
spec.ancestry?string[]
spec.approach?string
spec.lineage?SpawnLineageOpt
spec.namestring
spec.signature?Partial<ApproachSignatureInputs>

Returns

ts
{
  decision:   | {
     kind: "ok";
     lineage: SpawnLineage;
   }
     | {
     kind: "reject";
     reason: {
        code: "lineage_busy" | "lineage_exhausted";
     };
   };
  statsBefore?: LineageStats;
}
NameTypeDefined in
decision| { kind: "ok"; lineage: SpawnLineage; } | { kind: "reject"; reason: { code: "lineage_busy" | "lineage_exhausted"; }; }packages/core/dist/index.d.ts
statsBefore?LineageStatspackages/core/dist/index.d.ts

lineage()

ts
lineage(): 
  | LineageIndex
  | undefined;

Defined in: packages/core/dist/index.d.ts

The lineage counter folds over the run journal (absorbed lazily).

Returns

| LineageIndex | undefined


recoverChild()

ts
recoverChild(nodeKey): void;

Defined in: packages/core/dist/index.d.ts

Resume roll-forward for an orchestrator child (M6-T07): restores the children-quota counter only. The budget seed already counts settled agent dispatches, and an in-flight child re-commits its reserve through the ctx.agent dispatch path.

Parameters

ParameterType
nodeKeystring

Returns

void


recoverInFlight()

ts
recoverInFlight(parentAccountScope, verdict): void;

Defined in: packages/core/dist/index.d.ts

Resume roll-forward for an admission whose decision entry exists but whose child has NOT settled: re-applies the recorded reserve and counters without re-evaluating any limit (replay never re-evaluates admission; reserves are recovered, never re-estimated).

Parameters

ParameterType
parentAccountScopestring
verdictAdmitVerdict

Returns

void


recoverSettled()

ts
recoverSettled(parentAccountScope): void;

Defined in: packages/core/dist/index.d.ts

Resume roll-forward for a child that already SETTLED before the resume: re-registers the counters (maxChildrenPerNode, the lifetime cap, statsBefore fidelity) without committing any reserve; the spend itself sits in the root ledger seed.

Parameters

ParameterType
parentAccountScopestring

Returns

void


registerLineageAdmit()

ts
registerLineageAdmit(logicalTaskId): void;

Defined in: packages/core/dist/index.d.ts

Registers a live lineage admit the moment its caller commits to appending the decision entry, closing the single-live-attempt window until the journal absorbs the entry (DEF-3).

Parameters

ParameterType
logicalTaskIdstring

Returns

void