cancho-tools

run 0.1.0

Start one program from the deployer's programs directory with exact arguments, no shell, a fixed environment, a deadline and an output cap; answers its exit status and output. Opt-in: it can run whatever the directory holds, and it does not sandbox it.

run [--root DIR] [--timeout-ms N] [--max-output N] [--stdin] [--max-stdin N] [--format json|text] -- PROGRAM [ARG...]
output
one JSON document
schema
run.v1
reversibility
irreversible-consequential
guarantees
bounded_memory
concurrency
none: it takes no lock and cannot see what the program it starts then does
confinement
beneath: with --root, paths are checked lexically against it and then opened beneath it one component at a time, following no symbolic link (path.symlink), so nothing outside the root is reachable through one; without it, a reader opens the path as given, links and all, and a writer still follows no link in the file's own name
reads the environment
no
reads the clock
no
compiler
de4e52fd8180
for an agent
SKILL.md (run skill)

Authority

Derived by cancho authority from the source, embedded in the binary, and checked against tools.toml's ceiling in CI. Every label is bounded.

What the row cannot say:

Operands

OperandRoleHow manyMeaning
PROGRAMname1a program name in the programs directory, never a path
ARG...text0 or morethe program's arguments, passed byte for byte

Flags

FlagKindRoleDefaultMeaning
--rootpathrootstart the program in this directory (default: the working directory) and refuse a directory outside it
--timeout-msnatnone30000the longest the program may run, in milliseconds, after which it is killed (1 to 600000)
--max-outputnatnone1048576the most bytes kept from each of standard output and standard error, and the program is killed at the first byte past it (ceiling 67108864)
--stdinboolnonegive the program this tool's standard input as its standard input (default: nothing)
--max-stdinnatnone1048576the most standard input accepted with --stdin (ceiling 67108864)
--formatchoice:json/textnonejsonjson for a program, text writes the program's standard output to standard output and its standard error to standard error

Limits

LimitDefaultCeiling
timeout-ms30,000600,000
max-output1,048,57667,108,864
max-stdin1,048,57667,108,864

Exit codes

CodeNameMeaning
0SUCCESSwhat was asked was done; zero matches is success
2INVALID_ARGSthe invocation is malformed or names something of the wrong kind; nothing was read
3NOT_FOUNDa named input does not exist
4PERMISSION_DENIEDthe operating system refused, or the tool's own confinement did
8PRECONDITION_FAILEDthe answer is no, or a limit was reached

Rules (21)

Match on rule, not on the message. A retry repair is an argv that can be run as it stands, and never widens what the tool may touch.

RuleExitRepairWhen
args.unknown-flag2sometimesa flag that is not in the tool's table
args.missing-value2nevera flag that takes a value was given none
args.bad-value2nevera flag's value is not of the flag's kind
args.unexpected-value2nevera flag that takes no value was given one
args.duplicate-flag2neverthe same flag was given twice
args.missing-operand2neveran operand the tool needs was not given
path.empty2neveran empty path
path.dotdot2sometimesa path with a `..` component
path.absolute2alwaysan absolute path where one relative to --root is wanted
path.outside-root4neveran absolute path that is not under --root
path.too-long2nevera path longer than 4096 bytes
path.symlink4nevera path that runs through a symbolic link, which the tool does not follow
io.not-found3nevera named input does not exist
io.not-a-directory3nevera path runs through something that is not a directory
io.permission-denied4neverthe operating system refused access
limit.input-too-large8sometimesan input longer than --max-bytes
run.program-name2neverthe program is not one plain name (it is empty, `.`, `..` or has a `/`)
run.program-not-found3neverthe programs directory holds no program of that name
run.spawn-failed8neverthe operating system could not start the program or its channels
limit.timeout8neverthe program ran past --timeout-ms and was killed
limit.output-too-large8neverthe program wrote more than --max-output to one stream and was killed

Evidence

each gate is a test in cancho-tools/tests/conformance, run by CI on the commit this binary was built from:

Agent in the loop: not run: no claim that this tool is more agent-friendly than the incumbents is made (cancho docs/agent-toolbox.md section 7.2).