From b81586ee4a0543a5f9866586c78dccdd6328934a Mon Sep 17 00:00:00 2001 From: Marcos Magueta Date: Mon, 22 Jun 2026 22:55:27 -0300 Subject: RNT ephemeral relations representation --- lib/sublanguage_context.ml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/sublanguage_context.ml') 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//ephemeral/. *) } +(** 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 -- cgit v1.2.3