terminal/snapshot: kaitai verification

Describe the complete version 1 snapshot format with a Kaitai schema and make every golden fixture self-describing for automatic discovery. Add a verifier that compiles the schema, parses all fixtures, and checks record checksums, checkpoint digests, and cross-record invariants.

Preserve Kaitai metadata when generating fixture candidates and provide the compiler and Python runtime dependencies through the development shell. Keep the mode registry portable to Kaitai JavaScript targets so the complete fixture also works in the web IDE.
This commit is contained in:
Mitchell Hashimoto
2026-07-30 21:02:19 -07:00
parent 13bc78b7f3
commit 38d92c50c9
25 changed files with 1553 additions and 51 deletions

View File

@@ -59,6 +59,7 @@
zlib,
alejandra,
jq,
kaitai-struct-compiler,
minisign,
pandoc,
pinact,
@@ -85,6 +86,11 @@
gi_typelib_path = import ./build-support/gi-typelib-path.nix {
inherit pkgs lib stdenv;
};
python = python3.withPackages (python-pkgs: [
python-pkgs.blake3
python-pkgs.kaitaistruct
python-pkgs.ucs-detect
]);
in
mkShell {
name = "ghostty";
@@ -116,9 +122,10 @@ in
# Testing
parallel
python3
python
vttest
hyperfine
kaitai-struct-compiler
# wasm
wabt
@@ -138,11 +145,6 @@ in
blueprint-compiler
libadwaita
gtk4
# Python packages
(python3.withPackages (python-pkgs: [
python-pkgs.ucs-detect
]))
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# My nix shell environment installs the non-interactive version
@@ -242,6 +244,6 @@ in
# We need to remove "xcrun" from the PATH. It is injected by
# some dependency but we need to rely on system Xcode tools
export PATH=$(echo "$PATH" | awk -v RS=: -v ORS=: '$0 !~ /xcrun/ || $0 == "/usr/bin" {print}' | sed 's/:$//')
export PATH="/opt/homebrew/opt/llvm/bin:/opt/homebrew/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
export PATH="${python}/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
'');
}