zara-shell: constrained local command execution tools #5

Open
opened 2026-08-31 18:42:17 +00:00 by lost-rob0t · 3 comments
lost-rob0t commented 2026-08-31 18:42:17 +00:00 (Migrated from github.com)

Plugin

zara-shell

Goal

Provide a deliberately constrained local command/tool execution surface for Zara without making unrestricted shell access the default interface for every plugin.

Capabilities

  • execute explicitly allowed commands/programs;
  • set bounded cwd/env/input/output/runtime;
  • structured exit status/stdout/stderr results;
  • configurable command allow/deny policy;
  • dry-run/describe mode for commands where useful;
  • cancellation and timeout support;
  • optional per-command schemas instead of free-form strings.

Boundaries

This is the generic execution primitive. Higher-level system reasoning belongs in zara-sysadmin, coding workflow in zara-coding, and desktop actions in zara-desktop.

Safety

  • no implicit shell=True style execution;
  • argv-based execution by default;
  • bounded output and runtime;
  • explicit filesystem/cwd policy;
  • secrets are not echoed/logged;
  • destructive command classes can require stronger policy/confirmation hooks.

Acceptance criteria

  • argv-based bounded command runner exists
  • allow/deny policy is configurable and tested
  • cwd/env/input/output limits are enforced
  • timeout/cancel paths are deterministic
  • structured results are suitable for expert-system assertions
  • README documents threat model and intended use
  • registry validation, plugin tests and nix flake check pass
## Plugin `zara-shell` ## Goal Provide a deliberately constrained local command/tool execution surface for Zara without making unrestricted shell access the default interface for every plugin. ## Capabilities - execute explicitly allowed commands/programs; - set bounded cwd/env/input/output/runtime; - structured exit status/stdout/stderr results; - configurable command allow/deny policy; - dry-run/describe mode for commands where useful; - cancellation and timeout support; - optional per-command schemas instead of free-form strings. ## Boundaries This is the generic execution primitive. Higher-level system reasoning belongs in `zara-sysadmin`, coding workflow in `zara-coding`, and desktop actions in `zara-desktop`. ## Safety - no implicit `shell=True` style execution; - argv-based execution by default; - bounded output and runtime; - explicit filesystem/cwd policy; - secrets are not echoed/logged; - destructive command classes can require stronger policy/confirmation hooks. ## Acceptance criteria - [ ] argv-based bounded command runner exists - [ ] allow/deny policy is configurable and tested - [ ] cwd/env/input/output limits are enforced - [ ] timeout/cancel paths are deterministic - [ ] structured results are suitable for expert-system assertions - [ ] README documents threat model and intended use - [ ] registry validation, plugin tests and `nix flake check` pass
Owner

Auto-RAGE update after #83 merged at f17eadc88b36c61502fb564b5f03bea149a3bd17.

Landed and verified: argv-only execution; default-deny explicit allowlist; root-confined cwd; explicit bounded environment/stdin/output/runtime; structured exit/stdout/stderr/timeout/truncation evidence; canonical zara_requires_approval=true on shell.run; fail-closed unconfigured service state; registry/Nix publication; and timeout process-group termination so descendants cannot escape the runtime bound. Exact PR head passed compatibility gates, the full registry/plugin suite, and all generated package builds before expected-head merge.

Leaving #5 open: the acceptance criteria also call for an explicit cancellation path distinct from timeout. The current synchronous tool contract has deterministic timeout but does not yet expose a safe cancellable invocation handle. I will not fake cancellation by claiming Popen.kill() after timeout satisfies that separate contract.

Auto-RAGE update after #83 merged at `f17eadc88b36c61502fb564b5f03bea149a3bd17`. Landed and verified: argv-only execution; default-deny explicit allowlist; root-confined cwd; explicit bounded environment/stdin/output/runtime; structured exit/stdout/stderr/timeout/truncation evidence; canonical `zara_requires_approval=true` on `shell.run`; fail-closed unconfigured service state; registry/Nix publication; and timeout process-group termination so descendants cannot escape the runtime bound. Exact PR head passed compatibility gates, the full registry/plugin suite, and all generated package builds before expected-head merge. Leaving #5 open: the acceptance criteria also call for an explicit cancellation path distinct from timeout. The current synchronous tool contract has deterministic timeout but does not yet expose a safe cancellable invocation handle. I will not fake cancellation by claiming `Popen.kill()` after timeout satisfies that separate contract.
Owner

Cancellation compatibility handoff filed upstream as lost-rob0t/zara#388. Until Core supplies an invocation-scoped cancellation signal to running service tools, zara-shell will keep timeout teardown correct and will not add a plugin-private cancellation/control plane.

Cancellation compatibility handoff filed upstream as lost-rob0t/zara#388. Until Core supplies an invocation-scoped cancellation signal to running service tools, `zara-shell` will keep timeout teardown correct and will not add a plugin-private cancellation/control plane.
Owner

Auto-RAGE dependency refresh (2026-09-05): Zara Core #388 is still unresolved. The latest r9 recovery PR #446 is now closed unmerged after the prior cancellation transport designs were falsified. zara-shell remains intentionally unchanged: timeout/process-group teardown is real, but explicit invocation cancellation will not be claimed until Core lands a canonical exact-invocation signal. No plugin-private shell.cancel side channel will be added.

Auto-RAGE dependency refresh (2026-09-05): Zara Core #388 is still unresolved. The latest r9 recovery PR #446 is now closed unmerged after the prior cancellation transport designs were falsified. `zara-shell` remains intentionally unchanged: timeout/process-group teardown is real, but explicit invocation cancellation will not be claimed until Core lands a canonical exact-invocation signal. No plugin-private `shell.cancel` side channel will be added.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/zara-plugins#5
No description provided.