From 57e254470e11ab40b6bae31b2cbf62aebca27ce4 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 16 Nov 2026 23:24:29 -0300 Subject: Record every run's frames to a sessions database in xitdb Live play was recorded only after someone typed record N, into 16 fixed slots. Now every run is a session in one xitdb database per sketch, beside its state file (.xitdb): an append-only log of the frames live update was fed, one commit a second of session time, and keyframes of the State at start, every minute, on jumps, before and after reloads and at exit. A kill -9 loses at most the uncommitted second (test-kill). Whether a build records travels in the sketch: App.Options.record, null meaning Debug, reaching the host as Info.record. Scripted runs from fresh state record in memory, exports not at all. Each stretch of a session keeps its build, layout and Info.source: the repository revision (one jj or git call per build, build_info), zig version, backend and mode. Sessions.zig takes plain data (bytes, events, strings, a path, an Io), so a second host can drive it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- src/host/script.zig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/host/script.zig') diff --git a/src/host/script.zig b/src/host/script.zig index 7818c6b..12774b6 100644 --- a/src/host/script.zig +++ b/src/host/script.zig @@ -34,6 +34,7 @@ //! load LIBRARY swap in another build of the sketch //! reload load the watched library again //! await-reload SECONDS run frames until a build replaces the library +//! kill die by SIGKILL, as a crash would //! //! `{name}` is replaced by `--define name=value` from the command line. //! @@ -226,6 +227,10 @@ fn step(host: *Host, arena: std.mem.Allocator, command: []const u8, rest: []cons try std.Io.sleep(host.io, .fromMilliseconds(10), .awake); } return; + } else if (eq(u8, command, "kill")) { + // A crash, for tests of what survives one: SIGKILL, no cleanup. + _ = std.os.linux.kill(std.os.linux.getpid(), .KILL); + return; } else if (eq(u8, command, "quit")) { host.quit = true; return; -- cgit v1.3