Skip to main content

Layer 8 · place

runtime

blocks/8-place/runtime.yaml

layer 8place
3entities
7commands
8events
3views
18refusals
3KPIs

What runs a workload. A runtime says which kinds of workload it runs and the least isolation it runs them under. A workload is a package by digest, a shape and the sandbox it runs in; an instance is one running copy, started, observed and stopped; a start while one is Pending or Running joins it. A Model workload serves one endpoint of agentic.model; its instance's state is the endpoint's phase (Pending starting, Running ready, Exited stopped), and its start may cost money, booked against a budget. A compute cloud and an agent runtime each play this block; neither is described here.

Depends on​

  • sandbox · layer 8 · 6 references
  • authority · layer 6 · 5 references
  • model · layer 2 · 5 references
  • shared · layer 0 · 7 references

Used by​

Entities​

Instance​

One running copy of a workload.

Identified by instance_id (InstanceId).

fieldtypemeaning
workload_idWorkloadId
exit_codeoptional integer
reasonoptional stringWhy the instance failed, as the runtime reports it.
budget_idoptional BudgetIdThe budget the start cost was booked against (agentic.authority RecordSpend) before the start. A booking refused over the limit (OverLimit) is a start refused at a cap. A start of a workload with an instance Pending or Running joins that instance (InstanceJoined) and starts none, so a joined start books nothing.

Relations:

  • workload references Workload (one, by workload_id)
  • budget references Budget of authority (one, by budget_id)

Lifecycle of Instance

ExitedFailedPendingRunningrunexit, stopfailfailstopExitedFailedPendingRunningrunexit, stopfailfailstop
Ends in Exited, Failed.

Runtime​

One place that runs workloads of the kinds it names.

Identified by runtime_id (RuntimeId).

fieldtype
nameName
kindslist of WorkloadKind
min_isolationIsolationLevel

Lifecycle: one state, Available; a recorded Runtime does not change.

Workload​

A package placed on one runtime, with its shape and its sandbox.

Identified by workload_id (WorkloadId).

fieldtypemeaning
runtime_idRuntimeId
kindWorkloadKind
packagePackageDigest
shapeShape
sandbox_idSandboxId
endpoint_idoptional EndpointIdThe endpoint a Model workload serves.
start_costoptional MoneyWhat one start of an instance costs before it does any work, as a rented model server does.

Relations:

  • runtime references Runtime (one, by runtime_id)
  • sandbox references Sandbox of sandbox (one, by sandbox_id)
  • endpoint references Endpoint of model (one, by endpoint_id)

Lifecycle: one state, Defined; a recorded Workload does not change.

Commands​

DefineWorkload​

Define a workload. Place a package on a runtime, with a shape and a sandbox.

Called by: Operator.

fieldtype
runtime_idRuntimeId
kindWorkloadKind
packagePackageDigest
shapeShape
sandbox_idSandboxId
endpoint_idoptional EndpointId
start_costoptional Money
outcomewhenresult
unknown-runtime refusedno Runtime for runtime_idUnknownRuntime: No runtime has this identity.
unknown-sandbox refusedno Sandbox for sandbox_idUnknownSandbox: No sandbox has this identity.
kind-not-run refusedthe Runtime of runtime_id has not (some k in kinds with k == input.kind)KindNotRun: The runtime does not run workloads of this kind.
sandbox-retired refusedthe Sandbox of sandbox_id has state == RetiredSandboxNotActive: The sandbox is retired; nothing is placed in it.
isolation-none-too-low refusedthe Sandbox of sandbox_id has isolation == NoneIsolationTooLow: The sandbox isolates less than the runtime's minimum.
isolation-process-too-low refusedthe Sandbox of sandbox_id has isolation == ProcessIsolationTooLow: The sandbox isolates less than the runtime's minimum.
isolation-container-too-low refusedthe Sandbox of sandbox_id has isolation == ContainerIsolationTooLow: The sandbox isolates less than the runtime's minimum.
isolation-userkernel-too-low refusedthe Sandbox of sandbox_id has isolation == UserKernelIsolationTooLow: The sandbox isolates less than the runtime's minimum.
definedotherwisecreates a Workload in Defined; emits WorkloadDefined

RegisterRuntime​

Register a runtime.

Called by: Operator.

fieldtype
nameName
kindslist of WorkloadKind
min_isolationIsolationLevel
outcomewhenresult
no-kinds refusedkinds.count == 0NoKinds: A runtime runs at least one kind of workload.
registeredotherwisecreates a Runtime in Available; emits RuntimeRegistered

ReportExited​

Report an instance exited.

Called by: Host.

fieldtype
instance_idInstanceId
exit_codeinteger
outcomewhenresult
unknown refusedno such InstanceUnknownInstance: No instance has this identity.
exitedotherwisemoves the Instance Running → Exited; emits InstanceExited
wrong-state refusedthe Instance is in a state that does not allow itInstanceStateConflict: The instance is not in a state this command acts from.

ReportFailed​

Report an instance failed.

Called by: Host.

fieldtype
instance_idInstanceId
reasonstring
outcomewhenresult
unknown refusedno such InstanceUnknownInstance: No instance has this identity.
failedotherwisemoves the Instance Pending, Running → Failed; emits InstanceFailed
wrong-state refusedthe Instance is in a state that does not allow itInstanceStateConflict: The instance is not in a state this command acts from.

ReportRunning​

Report an instance running.

Called by: Host.

fieldtype
instance_idInstanceId
outcomewhenresult
unknown refusedno such InstanceUnknownInstance: No instance has this identity.
runningotherwisemoves the Instance Pending → Running; emits InstanceRunning
wrong-state refusedthe Instance is in a state that does not allow itInstanceStateConflict: The instance is not in a state this command acts from.

StartInstance​

Start an instance. Start an instance of a workload, or join the one already Pending or Running: a workload has at most one instance that is not Exited or Failed.

Called by: Operator.

fieldtype
workload_idWorkloadId
budget_idoptional BudgetId
outcomewhenresult
unknown-workload refusedno Workload for workload_idUnknownWorkload: No workload has this identity.
joineda Instance with workload_id == input.workload_id and (state == Pending or state == Running)emits InstanceJoined
startedotherwisecreates a Instance in Pending; emits InstanceStarted

StopInstance​

Stop an instance.

Called by: Operator.

fieldtype
instance_idInstanceId
outcomewhenresult
unknown refusedno such InstanceUnknownInstance: No instance has this identity.
stoppedotherwisemoves the Instance Pending, Running → Exited; emits InstanceStopped
wrong-state refusedthe Instance is in a state that does not allow itInstanceStateConflict: The instance is not in a state this command acts from.

Events​

eventfieldsemitted by
InstanceExitedinstance_id InstanceId, exit_code integerReportExited
InstanceFailedinstance_id InstanceId, reason stringReportFailed
InstanceJoinedinstance_id InstanceId, workload_id WorkloadIdStartInstance
InstanceRunninginstance_id InstanceIdReportRunning
InstanceStartedinstance_id InstanceId, workload_id WorkloadId, budget_id optional BudgetIdStartInstance
InstanceStoppedinstance_id InstanceIdStopInstance
RuntimeRegisteredruntime_id RuntimeId, name Name, min_isolation IsolationLevelRegisterRuntime
WorkloadDefinedworkload_id WorkloadId, runtime_id RuntimeId, kind WorkloadKind, package PackageDigest, sandbox_id SandboxId, endpoint_id optional EndpointIdDefineWorkload

Views​

viewrowsfields
Instances
Instances
each Instanceinstance_id InstanceId, workload_id WorkloadId, exit_code optional integer, reason optional string, budget_id optional BudgetId, state State
Runtimes
Runtimes
each Runtimeruntime_id RuntimeId, name Name, kinds list of WorkloadKind, min_isolation IsolationLevel, state State
Workloads
Workloads
each Workloadworkload_id WorkloadId, runtime_id RuntimeId, kind WorkloadKind, package PackageDigest, shape Shape, sandbox_id SandboxId, endpoint_id optional EndpointId, start_cost optional Money, state State

Types​

typeisvalues or fields
PackageDigest
The content digest of the package a workload runs.
an identifier or valuestring
Shapea recordcpu_millis integer, memory_mib integer
WorkloadKindone ofAgent, Service, Job, Model, Snippet

KPIs​

3 KPIs from the KPI catalogue. A gate must be zero for a variant of an architecture to count.

Quality​

KPIunitbettergatestatus
instance_failed_share
Share of started instances that failed.
How: InstanceFailed events divided by InstanceStarted events, per workload.
sharelower–planned
source: design
instance_start_p90_seconds
90th percentile of the time from start to running.
How: Seconds between InstanceStarted and InstanceRunning of one instance, 90th percentile per workload.
secondslower–planned
source: design
worker_busy_share
Share of instance time spent doing work.
How: Busy seconds of instances divided by instance seconds between InstanceRunning and exit. Low means idle workers, whatever the cause.
sharehigher–simulated
source: design

Settings​

The settings a part of this block carries in an architecture document. agenticspec sim check refuses any other setting (setting_unknown) and a value outside its type (setting_invalid), and a part that lacks a setting marked required in the default column; the contract copies a setting into the ports it narrows. The last rows of each table are the settings every part takes. What no setting here types (a file, a path, an audience, the use of a model) goes into the part's notes, a map with free keys and values that the check takes as written and nothing reads.

A part runtime:

settingtypeunitdefaultcontractwhat
kindstringevery portWhat kind of runtime the part is.
rolestringThe role of the behaviour profile the runtime's runs play.
durable_statebooleanfalseWhether the runtime keeps durable state of its own, records it writes and reads back after a restart; in a deployment bundle its unit claims an exclusive volume for it, <part>-state.
state_writersstring listThe programs outside the runtime that also write its durable state, by name; only beside durable_state: true. The state stays the runtime's one volume, with no workspace lease or proposal port, and the bundle's claim of it names these writers.
state_readersstring listThe programs outside the runtime that read its durable state, by name; only beside durable_state: true. The bundle's claim of the state volume names these readers and grants them nothing.
model_sharesharesThe share of the runtime's model calls each model part it reaches gets; without it, equal shares.
per_day_usdnumber of at least 0USDThe spend cap of the runtime's runs per calendar day; without it, no cap.
per_month_usdnumber of at least 0USDThe spend cap of the runtime's runs per calendar month; without it, no cap.
per_run_usdnumber of at least 0USDThe spend cap of one run the runtime executes: a run that has spent it makes no further model call and ends; without it, no cap.
routeenum: stop, ask, notifystopWhat happens at a spend cap: further spending stops (stop), a question goes to the principal the runtime acts for (ask), or spending goes on and a notification is sent (notify).
processpartThe process part whose program the runtime's runs follow: a run takes the process's steps, of the kinds its agent_steps and person_steps name, with the process's role when it names one, else the runtime's.
countinteger of at least 11How many copies of the part run.
perpartOne copy of the part for each copy of the named part.
notesnotesFree notes on the part, a map with keys and values of any kind: what no setting of its block types. The check takes any map; the simulator, the search and the contract never read it.