aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sublanguage_context.ml
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-06-22 22:55:27 -0300
committerGitHub <noreply@github.com>2026-06-22 22:55:27 -0300
commitb81586ee4a0543a5f9866586c78dccdd6328934a (patch)
tree4cd2f26e8e57e7e8d852fb7deddd0818c482dc8b /lib/sublanguage_context.ml
parent57b55b51ee6a1d4678ba37e4631d61a248411ff2 (diff)
downloadSakura-b81586ee4a0543a5f9866586c78dccdd6328934a.tar.gz
Sakura-b81586ee4a0543a5f9866586c78dccdd6328934a.zip
RNT ephemeral relations representation
Diffstat (limited to 'lib/sublanguage_context.ml')
-rw-r--r--lib/sublanguage_context.ml11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/sublanguage_context.ml b/lib/sublanguage_context.ml
index 39e6dd3..40aa543 100644
--- a/lib/sublanguage_context.ml
+++ b/lib/sublanguage_context.ml
@@ -36,8 +36,18 @@ type t = {
resolve : ?branch:string -> Qualified_name.t -> string;
switch_branch : string ->
(Sublanguage_types.transition_delta, Condition.t) result;
+ session_hash : string;
+ (** RNT session hash owning this connection. Session-scoped ephemeral
+ relations (with DML [Define]) register under
+ /system/sessions/<session_hash>/ephemeral/<name>. *)
}
+(** Absolute RNT path of a session-scoped ephemeral relation. An unqualified
+ name in a DRL [Base] resolves here: named bindings shadow nothing since
+ stored relations always carry an [mg:] qualifier. *)
+let ephemeral_path (ctx : t) (name : string) : string =
+ "/system/sessions/" ^ ctx.session_hash ^ "/ephemeral/" ^ name
+
module Make (NT : Nt.S) = struct
module Session = Session.Make (NT)
module Branch = Branch.Make (NT)
@@ -51,6 +61,7 @@ module Make (NT : Nt.S) = struct
write_handle = br#branch_handle;
branch = (br :> branch_view);
resolve = br#path;
+ session_hash = session#id;
switch_branch = fun name ->
match br#close () with
| Error e -> Error e