From f759f149377942c4e04802c45162cda1c9bfb2b3 Mon Sep 17 00:00:00 2001 From: t Date: Sat, 4 Jul 2026 09:50:12 -0600 Subject: big cli/tui gaps project --- src/lua_runtime.zig | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/lua_runtime.zig') diff --git a/src/lua_runtime.zig b/src/lua_runtime.zig index e2b7ec8..7363281 100644 --- a/src/lua_runtime.zig +++ b/src/lua_runtime.zig @@ -1,11 +1,14 @@ -//! Long-lived Lua runtime, registered with libpanto as a single +//! Session-lived Lua runtime, registered with libpanto as a single //! `ToolSource`. //! //! This replaces the per-call `lua_State` model of phase 3 (LuaTool + -//! LuaStatePool). The CLI maintains exactly one `lua_State` for its -//! entire lifetime. Every extension is loaded into it once; extension -//! top-level code runs exactly once at startup. Tool handlers are -//! stored in the Lua registry and looked up by tool name on each call. +//! LuaStatePool). The CLI maintains exactly one `lua_State` per SESSION: +//! the runtime's lifetime IS the session's, and `/new`//`/resume` tear it +//! down and boot a fresh one through the startup path (see the lifetime +//! contract in `extension_loader.zig`). Every extension is loaded into it +//! once; extension top-level code runs exactly once at session start. Tool +//! handlers are stored in the Lua registry and looked up by tool name on +//! each call. //! //! libpanto delivers all tool calls targeting Lua-defined tools in one //! `invoke_batch` per turn, on a single thread (see -- cgit v1.3