Summary
Add a minimal runtime I/O/process layer so command execution can be implemented as fallible builtins and composed in scripts.
Why
#19 (shell call syntax) needs a stable execution substrate first.
Today runtime context is stdout-only and there is no process execution primitive.
Scope (MVP)
- Extend runtime context to support both stdout and stderr writers
- Add internal process execution primitive:
- input: program + argv
- output:
{ code: Int, stdout: String, stderr: String }
- fallible on spawn/wait failures
- Define minimal error enum for runtime I/O/process failures:
- e.g.
IoError { SpawnFailed, WaitFailed, NotFound, PermissionDenied }
- Expose builtins:
cmd(spec) -> IoError!RunResult
shell(script: String) -> IoError!RunResult (explicit unsafe shell mode)
Out of Scope
- Async/background jobs
- Streaming stdout/stderr
- Env/cwd overrides per command
- Pipeline DSL (
pipe/run/check) sugar
- File read/write builtins
Acceptance Criteria
- Running a known command returns exit code/stdout/stderr
- Unknown command returns an
IoError variant
- Non-zero process exit is represented in
RunResult.code (not a runtime crash)
cmd and shell are both type-checkable as fallible functions
- Basic tests cover success, failure-to-spawn, and non-zero exit
Summary
Add a minimal runtime I/O/process layer so command execution can be implemented as fallible builtins and composed in scripts.
Why
#19(shell call syntax) needs a stable execution substrate first.Today runtime context is stdout-only and there is no process execution primitive.
Scope (MVP)
{ code: Int, stdout: String, stderr: String }IoError { SpawnFailed, WaitFailed, NotFound, PermissionDenied }cmd(spec) -> IoError!RunResultshell(script: String) -> IoError!RunResult(explicit unsafe shell mode)Out of Scope
pipe/run/check) sugarAcceptance Criteria
IoErrorvariantRunResult.code(not a runtime crash)cmdandshellare both type-checkable as fallible functions