Pack · shell
shell.toolset
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).
| field | type | meaning |
|---|---|---|
workspace_id | WorkspaceId | |
lease_id | LeaseId | |
command | Content | The digest of the command line, never the text. |
directory | Path | The working directory, inside the workspace. |
time_limit_seconds | integer | |
tool_call_id | optional ToolCallId | |
run_id | optional RunId | |
started_at | timestamp | |
exit_code | optional integer | |
output | optional Content | The digest of what the command wrote, standard output and error together. |
ended_at | optional timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Relations:
workspacereferences Workspace of workspace (one, byworkspace_id)leasereferences Lease of workspace (one, bylease_id)tool_callreferences ToolCall of harness (one, bytool_call_id)runreferences Run of work (one, byrun_id)
Always holds: time_limit_seconds >= 1.
Lifecycle of CommandRun
Exited, Killed, TimedOut.Commands
KillCommand
Kill a running command.
Called by: Shell tool.
| field | type |
|---|---|
command_run_id | CommandRunId |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-run refused | no such CommandRun | Command: No command run of this identity exists. |
killed | otherwise | moves the CommandRun Running → Killed; emits Command |
wrong-state refused | the CommandRun is in a state that does not allow it | Command: The command run has already ended. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
ReportExit
Report that a command exited.
Called by: Shell tool.
| field | type |
|---|---|
command_run_id | CommandRunId |
exit_code | integer |
output | Content |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-run refused | no such CommandRun | Command: No command run of this identity exists. |
exited | otherwise | moves the CommandRun Running → Exited; emits Command |
wrong-state refused | the CommandRun is in a state that does not allow it | Command: The command run has already ended. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
ReportTimeout
Report that a command ran out of time.
Called by: Shell tool.
| field | type |
|---|---|
command_run_id | CommandRunId |
output | Content |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
no-such-run refused | no such CommandRun | Command: No command run of this identity exists. |
timed-out | otherwise | moves the CommandRun Running → Timed; emits Command |
wrong-state refused | the CommandRun is in a state that does not allow it | Command: The command run has already ended. |
More columns: swipe horizontally, or focus the table and use the arrow keys.
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.
| field | type |
|---|---|
command_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 |
at | timestamp |
More columns: swipe horizontally, or focus the table and use the arrow keys.
| outcome | when | result |
|---|---|---|
invalid-time-limit refused | time_ | Invalid: A time limit is at least one second. |
exists refused | the CommandRun exists already | Command: A command run of this identity exists. |
unknown-workspace refused | no Workspace for workspace_ | Unknown: No workspace of this identity exists. |
unknown-lease refused | no Lease for lease_ | Unknown: No lease of this identity exists. |
unknown-tool-call refused | no ToolCall for tool_ | Unknown: No tool call of this identity was requested. |
unknown-run refused | no Run for run_ | Unknown: No work run of this identity exists. |
lease-not-live refused | the Lease of lease_ has state != Live | Lease: The lease is requested, released or expired; nothing runs under it. |
lease-of-other-workspace refused | the Lease of lease_ has workspace_ | Lease: The lease is a lease of another workspace. |
started | otherwise | creates a CommandRun in Running; emits Command |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Events
| event | fields | emitted by |
|---|---|---|
CommandEnded | command_ CommandRunId, end CommandEnd, exit_ optional integer, at timestamp | Kill, Report, Report |
CommandStarted | command_ CommandRunId, workspace_ WorkspaceId, lease_ LeaseId, command Content, time_ integer, tool_ optional ToolCallId, run_ optional RunId, at timestamp | Run |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Views
| view | rows | fields |
|---|---|---|
CommandRunsCommand runs | each CommandRun | command_ CommandRunId, workspace_ WorkspaceId, lease_ LeaseId, command Content, directory Path, time_ integer, tool_ optional ToolCallId, run_ optional RunId, started_ timestamp, exit_ optional integer, output optional Content, ended_ optional timestamp, state State |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Types
| type | is | values or fields |
|---|---|---|
CommandEndExited 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 of | Exited, Timed, Killed |
CommandRunId | an identifier or value | uuid |
More columns: swipe horizontally, or focus the table and use the arrow keys.
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
| KPI | unit | better | gate | status |
|---|---|---|---|---|
command_attributed_shareShare 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. | share | higher | – | planned source: design |
More columns: swipe horizontally, or focus the table and use the arrow keys.
Quality
| KPI | unit | better | gate | status |
|---|---|---|---|---|
command_timeout_shareShare of started commands that ran into their time limit. How: CommandEnded events with end TimedOut divided by CommandStarted events. | share | lower | – | planned source: design |
command_failure_shareShare 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. | share | lower | – | planned source: design |
More columns: swipe horizontally, or focus the table and use the arrow keys.
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:
| setting | type | unit | default | contract | what |
|---|---|---|---|---|---|
count | integer of at least 1 | 1 | How many copies of the part run. | ||
per | part | One copy of the part for each copy of the named part. | |||
notes | notes | Free 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. |
More columns: swipe horizontally, or focus the table and use the arrow keys.