Skip to content

Add runtime process I/O foundation (for cmd/shell MVP) #36

@synapticvoid

Description

@synapticvoid

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions