Skip to content

I1800 — The sandboxed engine a scripted capability runs in

Embed Rhai in the Rust executable as one engine constructor that every scripted capability runs under: eval disabled, no clock, limits on operations, call depth, expression depth and the sizes of strings, arrays and maps, and cancellation checked on every operation.

DONE wave 0 · p1 · implementation profile · parallel safe

Part of automation — Repository automation is scripted capabilities over typed Rust, not shell.

Objective

Embed Rhai in the Rust executable as one engine constructor that every scripted capability runs under: eval disabled, no clock, limits on operations, call depth, expression depth and the sizes of strings, arrays and maps, and cancellation checked on every operation.

Why

ADR 0069 decides that repository automation becomes scripted capabilities rather than shell. The declared exception to project.no-network-no-eval holds only if the interpreter is a sandbox and there is exactly one place that builds it, so the engine lands first and alone.

Current state

No interpreter is embedded; every orchestration is shell.

Desired state

apps/majordomus-cli/src/script builds the one engine; each guarantee it makes is proved by a unit test.

Scope

  • apps/majordomus-cli
  • .ai/repo/adrs

Out of scope

  • Binding the engine to a capability; that is I1801

Dependencies

None. This issue is a root of the graph.

What waits on this

Acceptance criteria

  • eval does not compile in a script
  • a script has no clock function
  • an endless loop ends with the operation limit, and a string cannot grow past its limit
  • a cancelled execution stops at its next operation
  • the engine is Send and Sync

Validation

  • cargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib script::

Evidence required

  • sandbox_engine_proved

Evidence

coverstypecommandresultat commit
sandbox_engine_provedtestcargo test --manifest-path apps/majordomus-cli/Cargo.toml --lib script::test result: ok. 9 passed; 0 failed; 0 ignored (script::tests: eval_is_not_a_function_a_script_can_call, there_is_no_hidden_clock, a_runaway_script_is_stopped_by_its_operation_limit, a_string_cannot_grow_past_its_limit, a_cancelled_execution_stops_at_its_next_operation, the_engine_is_send_and_sync_for_the_shared_server, +3) at 09c334079f5; delivered by 7ac2fde4a45 (#1162) in the grand top 11e53f5a45109c3340

Timeline

started
2026-10-16T16:43:09Z
verified
2026-10-16T16:43:13Z
completed
2026-10-16T16:43:20Z

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I1800.yaml. Read it back with majordomus plan show I1800.

Searches the titles and descriptions of every page this site publishes.