Repository navigation
arisrv: clients' DSL programs, (room-run ...), on a relay whose document opts in (S3) - #1273
Merged
Merged
Conversation
…ent opts in (S3)
A client can send its relay a DSL program to run there as its own
(ARIADNE_SCRIPTING_HOSTS.md §6.3, tier 2). The server document opts in
with server: client_programs:, either on or {steps, time, memory_mb} caps,
which only lower the action lane's.
- The call. (room-run "source" arg ...), room-run-async and room-run-opts
ride room-call's path. The request carries "program" in place of "fn",
and the reply comes back the same way, as typed CBOR.
- Where it runs. ServerDocument::run_client_program runs it as one of the
document's actions (Runtime::start_process), chrooted to the sender's
participant, conf.rooms.<room>.participants.<pid>. It runs in stock
arisrv as in arisrvx, never in Python.
- What it may do. Its environment is default-deny (the new
LaneProcess::allow). It holds the read lane's builtins (now
read_lane_builtins()) and five writers: state-set, state-data-set,
state-incr, state-cas and state-swap. room_write_gate::may_write checks
each write, so the relay's keys there (pose, device, ...) stay the
relay's. args is the list of the arguments. It has no spawn, messages,
watches, locks, sleep, files, network or quit.
- One program per client at a time. The error codes are unavailable,
invalid, rate_limited, failed and resource_exhausted.
- arisrv refuses a document with client_programs: under --bind-writes off.
Tests:
- ServerBlockTest.ClientProgramsTakeOnOffOrCaps.
- Four ServerDocumentTest cases: the chroot and the value, the relay's
keys, no way out, refusals and caps.
- RoomCallsTest.ParseCall.
- arisrv_room_call_program: stock arisrv and ari over gRPC.
- arisrv_room_call_unavailable now also checks that a relay with no --doc
refuses a program.
Docs: ARIADNE.md §9.7.1, and the roadmap's §6.3 and S3 row.
transfix
enabled auto-merge (squash)
November 15, 2026 08:31
transfix
added a commit
that referenced
this pull request
Nov 16, 2026
…#1253, #1255, #1256, #1264, #1268, #1271, #1273, #1277) - ci.yml: the sanitizer list keeps this branch's tests (stream_test, net_ws_client_test, ariadne_host_test) and master's segmentation_intrinsics_test. - STATE_EXEC_THREADED.md: the room-call verbs (room-run is #1273's) and #1252's segment.seeded provider in the provider table, both registered without a kind. room-call's async functions stay on the app's host: a reply settles on the relay client's reader thread through host.finish, so moving them to *ictx.host needs a finisher first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
S3 of the scripting-hosts roadmap (§6.3, tier 2): a client can send its relay a DSL program to run there as the client's own. It runs in stock arisrv, and in arisrvx the same way, never in Python.
The call
(room-run "source" arg ...)parks the program until the value of the source's last form comes back. It also hasroom-run-asyncand(room-run-opts (dict "timeout" S) ...).room-call's path (room_calls.h): the request carries"program"in place of"fn", and the reply comes back the same way, as typed CBOR.argsis the list of the arguments.How the relay runs it (
ServerDocument::run_client_program)server: client_programs:: eitheron, or caps (steps,time,memory_mb) that only lowerariadne.limits.action_max_*. arisrv refuses a document with it under--bind-writes off.Runtime::start_process), on the relay's loop.run_programdidn't fit: it has no chroot, no narrowed environment and no result value.conf.rooms.<room>.participants.<pid>. The program reads and writes only there. It gets noroomview, no published namespaces, and none of the document's state or functions.state-set,state-data-set,state-incr,state-casandstate-swap. Each checks its path withroom_write_gate::may_write, the rule the transport applies to the client's own writes. So the relay's keys inside the participant (pose,device,net.relay, a stream'sready) stay the relay's, and so does a padded path the tree would trim onto one. Any other write raisesPermissionError.LaneProcess::allow: a scope with no parent, as the read lane's evaluator is made.args. The read lane's list moved unchanged fromReactiveEnginetoread_lane_builtins(), so both share it.(quit).eval,root...) can't reach past the environment.unavailable: noclient_programs:, or the document hasn't loaded.invalid: the source doesn't parse on its own (so it can't close the wrapper), or is over 64 KiB.rate_limited.failed: it raised; the message is its report.resource_exhausted: a cap stopped it.too_largeandinternal, from the reply as forroom-call.Not in it (design choices to revisit)
to_stringisn't a printer that reads back, so the program is its source text.functions:.Tests
ServerBlockTest.ClientProgramsTakeOnOffOrCaps.ServerDocumentTestcases: the chroot and the value; the relay's keys, including a trimmed path; no way out (spawn,quit,msg-send,state-watch,state-delete,sleep); and the refusals and caps (opt-out, not loaded, unparseable, a source that tries to close the wrapper, over 64 KiB,rate_limited, the step cap).RoomCallsTest.ParseCallgains the program field.arisrv_room_call_programruns stock arisrv with a--docand anari testclient over gRPC, in six cases.arisrv_room_call_unavailablenow also checks that a relay with no--docrefuses a program.arisrv*test, the script lane);^Ariadnesuite passes, 814 of 814. It covers the read lane, whose list moved.-fsyntax-onlyfinds nothing in the two changed sources. clang-format 18.1.8 is clean on the changed lines.