pub fn resolve_os_call(
call: OsFunctionCall,
environ: &BTreeMap<String, String>,
system_clock: bool,
mounts: &mut MountTable,
) -> ExtFunctionResultAvailable on crate features
code and embedded-python only.Expand description
Service one Monty OS call against a host-authored policy: an explicit
environment map, a clock grant, and a MountTable for filesystem
operations.
This is the shared servicing kernel used by every Monty integration in the
workspace (the executors here and adk-codeact-monty’s MontyRuntime):
os.getenv(name)/os.environreadenvirononly — the host process environment is never consulted;date.today()/datetime.now()read the host clock whensystem_clockistrue, and otherwise raise a catchableOSError;- everything else is a filesystem operation routed through
mounts. When no mount covers the path, existence checks returnFalse(CPython semantics) and any other access raisesPermissionError.
The call is consumed: MountTable::handle_os_call moves a covered
write’s payload into the backend without a copy, and hands the call back
(MountCallOutcome::NotHandled) when no mount covers it so the fallback
can render it.