Skip to main content

Pack · shell

shell.toolset

packs/shell/blocks/toolset.yaml

packshell
1entity
4commands
2events
1view
14refusals
3KPIs

The conceptual tool run_command: run one command line in a workspace (agentic.workspace) under a live lease of it, with a time limit. A command run starts, then ends once: it exits with a code and the digest of its output, runs out of time, or is killed. It may change any file of the workspace; which files it changed is not known before it ran, so the file tools (agentic.files) record what a harness observes afterwards. A run may name the tool call of a harness session (agentic.harness) and the work run (agentic.work) it belongs to. Which shell plays the tool is a binding, not this block.

Depends on​

  • workspace · layer 8 · 10 references
  • work · layer 5 · 6 references
  • harness · layer 4 · 6 references
  • shared · layer 0 · 6 references

Used by​

No block depends on this one.

Entities​

CommandRun​

One run of one command line in one workspace.

Identified by command_run_id (CommandRunId).

fieldtypemeaning
workspace_idWorkspaceId
lease_idLeaseId
commandContentThe digest of the command line, never the text.
directoryPathThe working directory, inside the workspace.
time_limit_secondsinteger
tool_call_idoptional ToolCallId
run_idoptional RunId
started_attimestamp
exit_codeoptional integer
outputoptional ContentThe digest of what the command wrote, standard output and error together.
ended_atoptional timestamp

Relations:

  • workspace references Workspace of workspace (one, by workspace_id)
  • lease references Lease of workspace (one, by lease_id)
  • tool_call references ToolCall of harness (one, by tool_call_id)
  • run references Run of work (one, by run_id)

Always holds: time_limit_seconds >= 1.

Lifecycle of CommandRun

ExitedKilledRunningTimedOutexittime_outkillExitedKilledRunningTimedOutexittime_outkill
Ends in Exited, Killed, TimedOut.

Commands​

KillCommand​

Kill a running command.

Called by: Shell tool.

fieldtype
command_run_idCommandRunId
attimestamp
outcomewhenresult
no-such-run refusedno such CommandRunCommandRunNotFound: No command run of this identity exists.
killedotherwisemoves the CommandRun Running → Killed; emits CommandEnded
wrong-state refusedthe CommandRun is in a state that does not allow itCommandRunStateConflict: The command run has already ended.

ReportExit​

Report that a command exited.

Called by: Shell tool.

fieldtype
command_run_idCommandRunId
exit_codeinteger
outputContent
attimestamp
outcomewhenresult
no-such-run refusedno such CommandRunCommandRunNotFound: No command run of this identity exists.
exitedotherwisemoves the CommandRun Running → Exited; emits CommandEnded
wrong-state refusedthe CommandRun is in a state that does not allow itCommandRunStateConflict: The command run has already ended.

ReportTimeout​

Report that a command ran out of time.

Called by: Shell tool.

fieldtype
command_run_idCommandRunId
outputContent
attimestamp
outcomewhenresult
no-such-run refusedno such CommandRunCommandRunNotFound: No command run of this identity exists.
timed-outotherwisemoves the CommandRun Running → TimedOut; emits CommandEnded
wrong-state refusedthe CommandRun is in a state that does not allow itCommandRunStateConflict: The command run has already ended.

RunCommand​

run_command. Starts one command line. Input: workspace, lease, the command's digest, working directory, time limit, and optionally the tool call and work run it serves. Effect: a Running CommandRun; the files it changes are reported by the file tools.

Called by: Shell tool.

fieldtype
command_run_idCommandRunId
workspace_idWorkspaceId
lease_idLeaseId
commandContent
directoryPath
time_limit_secondsinteger
tool_call_idoptional ToolCallId
run_idoptional RunId
attimestamp
outcomewhenresult
invalid-time-limit refusedtime_limit_seconds < 1InvalidTimeLimit: A time limit is at least one second.
exists refusedthe CommandRun exists alreadyCommandRunExists: A command run of this identity exists.
unknown-workspace refusedno Workspace for workspace_idUnknownWorkspace: No workspace of this identity exists.
unknown-lease refusedno Lease for lease_idUnknownLease: No lease of this identity exists.
unknown-tool-call refusedno ToolCall for tool_call_idUnknownToolCall: No tool call of this identity was requested.
unknown-run refusedno Run for run_idUnknownRun: No work run of this identity exists.
lease-not-live refusedthe Lease of lease_id has state != LiveLeaseNotLive: The lease is requested, released or expired; nothing runs under it.
lease-of-other-workspace refusedthe Lease of lease_id has workspace_id != input.workspace_idLeaseOfOtherWorkspace: The lease is a lease of another workspace.
startedotherwisecreates a CommandRun in Running; emits CommandStarted

Events​

eventfieldsemitted by
CommandEndedcommand_run_id CommandRunId, end CommandEnd, exit_code optional integer, at timestampKillCommand, ReportExit, ReportTimeout
CommandStartedcommand_run_id CommandRunId, workspace_id WorkspaceId, lease_id LeaseId, command Content, time_limit_seconds integer, tool_call_id optional ToolCallId, run_id optional RunId, at timestampRunCommand

Views​

viewrowsfields
CommandRuns
Command runs
each CommandRuncommand_run_id CommandRunId, workspace_id WorkspaceId, lease_id LeaseId, command Content, directory Path, time_limit_seconds integer, tool_call_id optional ToolCallId, run_id optional RunId, started_at timestamp, exit_code optional integer, output optional Content, ended_at optional timestamp, state State

Types​

typeisvalues or fields
CommandEnd
Exited means the command ended by itself with an exit code. TimedOut means it ran past its time limit and was stopped. Killed means a principal or the runtime stopped it.
one ofExited, TimedOut, Killed
CommandRunIdan identifier or valueuuid

KPIs​

3 KPIs from the pack's catalogue, packs/shell/kpis.yaml. A gate must be zero for a variant of an architecture to count.

Completeness​

KPIunitbettergatestatus
command_attributed_share
Share of started commands tied to the tool call and run that asked for them.
How: CommandStarted events with both tool_call_id and run_id set, divided by all CommandStarted events. A command without them cannot be traced to the agent decision that ran it.
sharehigher–planned
source: design

Quality​

KPIunitbettergatestatus
command_timeout_share
Share of started commands that ran into their time limit.
How: CommandEnded events with end TimedOut divided by CommandStarted events.
sharelower–planned
source: design
command_failure_share
Share of commands that exited with a code other than 0.
How: CommandEnded events with end Exited and an exit code other than 0, divided by CommandEnded events with end Exited.
sharelower–planned
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 shell.toolset:

settingtypeunitdefaultcontractwhat
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.