Building 70 Projects ranging from beginner to advanced so anyone can — learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company 👇
Go aicertificationcloud-engineeringcybercybersecuritycybersecurity-analystcybersecurity-certificationcybersecurity-certificationscybersecurity-educationcybersecurity-jobscybersecurity-portfoliocybersecurity-projectscybersecurity-toolsgrchackinglearningpentestingproject-repositoryprojetcspython
feat(lisdex): M9 TUI - the view links only the model, and the model owns every sentence
CarterPerez-dev0ecb0b08394b
diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lock b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lockindex 66c1eefe..2090609f 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lock+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lock@@ -29,6 +29,12 @@ dependencies = ["memchr",]+[[package]]+name = "allocator-api2"+version = "0.2.21"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"+[[package]]name = "android_system_properties"version = "0.1.6"@@ -88,6 +94,30 @@ dependencies = ["windows-sys 0.61.2",]+[[package]]+name = "anyhow"+version = "1.0.104"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"++[[package]]+name = "approx"+version = "0.5.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6"+dependencies = [+ "num-traits",+]++[[package]]+name = "atomic"+version = "0.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340"+dependencies = [+ "bytemuck",+]+[[package]]name = "autocfg"version = "1.5.1"@@ -100,6 +130,27 @@ version = "0.22.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"+[[package]]+name = "bit-set"+version = "0.5.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"+dependencies = [+ "bit-vec",+]++[[package]]+name = "bit-vec"+version = "0.6.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"++[[package]]+name = "bitflags"+version = "1.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"+[[package]]name = "bitflags"version = "2.13.1"@@ -121,12 +172,33 @@ version = "3.20.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"+[[package]]+name = "by_address"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "64fa3c856b712db6612c019f14756e64e4bcea13337a6b33b696333a9eaa2d06"++[[package]]+name = "bytemuck"+version = "1.25.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"+[[package]]name = "bytes"version = "1.12.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"+[[package]]+name = "castaway"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a"+dependencies = [+ "rustversion",+]+[[package]]name = "cc"version = "1.4.0"@@ -143,6 +215,12 @@ version = "1.0.4"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801"+[[package]]+name = "cfg_aliases"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"+[[package]]name = "chrono"version = "0.4.45"@@ -223,6 +301,29 @@ version = "1.0.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"+[[package]]+name = "compact_str"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab"+dependencies = [+ "castaway",+ "cfg-if",+ "itoa",+ "rustversion",+ "ryu",+ "static_assertions",+]++[[package]]+name = "convert_case"+version = "0.10.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9"+dependencies = [+ "unicode-segmentation",+]+[[package]]name = "cookie"version = "0.18.1"@@ -276,6 +377,39 @@ dependencies = ["cfg-if",]+[[package]]+name = "critical-section"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b"++[[package]]+name = "crossterm"+version = "0.29.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d8b9f2e4c67f833b660cdb0a3523065869fb35570177239812ed4c905aeff87b"+dependencies = [+ "bitflags 2.13.1",+ "crossterm_winapi",+ "derive_more",+ "document-features",+ "mio",+ "parking_lot",+ "rustix",+ "signal-hook",+ "signal-hook-mio",+ "winapi",+]++[[package]]+name = "crossterm_winapi"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "acdd7c62a3665c7f6830a51635d9ac9b23ed385797f70a83bb8bafe9c572ab2b"+dependencies = [+ "winapi",+]+[[package]]name = "crypto-common"version = "0.1.7"@@ -286,12 +420,84 @@ dependencies = ["typenum",]+[[package]]+name = "csscolorparser"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "eb2a7d3066da2de787b7f032c736763eb7ae5d355f81a68bab2675a96008b0bf"+dependencies = [+ "lab",+ "phf",+]++[[package]]+name = "darling"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "88490bf1b990d87eaaa7ac8aa887f629a08e7359765b4911faf63c3763347d23"+dependencies = [+ "darling_core",+ "darling_macro",+]++[[package]]+name = "darling_core"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "084e274f91c482280130e1e34e0b8d6e66776a060d7b6de7b84289ca778868c4"+dependencies = [+ "ident_case",+ "proc-macro2",+ "quote",+ "strsim",+ "syn 3.0.3",+]++[[package]]+name = "darling_macro"+version = "0.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "68f5792fa0d41cd2325ce0ffa64f0a340eaebd4971a3a0c5e1ffd2cc488a355e"+dependencies = [+ "darling_core",+ "quote",+ "syn 3.0.3",+]++[[package]]+name = "deltae"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5729f5117e208430e437df2f4843f5e5952997175992d1414f94c57d61e270b4"+[[package]]name = "deranged"version = "0.5.8"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c"+[[package]]+name = "derive_more"+version = "2.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134"+dependencies = [+ "derive_more-impl",+]++[[package]]+name = "derive_more-impl"+version = "2.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb"+dependencies = [+ "convert_case",+ "proc-macro2",+ "quote",+ "rustc_version",+ "syn 2.0.119",+]+[[package]]name = "digest"version = "0.10.7"@@ -322,12 +528,37 @@ dependencies = ["litrs",]+[[package]]+name = "either"+version = "1.17.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d"+[[package]]name = "equivalent"version = "1.0.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"+[[package]]+name = "errno"+version = "0.3.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"+dependencies = [+ "libc",+ "windows-sys 0.61.2",+]++[[package]]+name = "euclid"+version = "0.22.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"+dependencies = [+ "num-traits",+]+[[package]]name = "fallible-iterator"version = "0.3.0"@@ -340,12 +571,45 @@ version = "0.1.9"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"+[[package]]+name = "fancy-regex"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2"+dependencies = [+ "bit-set",+ "regex",+]++[[package]]+name = "filedescriptor"+version = "0.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e40758ed24c9b2eeb76c35fb0aebc66c626084edd827e07e1552279814c6682d"+dependencies = [+ "libc",+ "thiserror 1.0.69",+ "winapi",+]+[[package]]name = "find-msvc-tools"version = "0.1.9"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"+[[package]]+name = "finl_unicode"+version = "1.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9844ddc3a6e533d62bba727eb6c28b5d360921d5175e9ff0f1e621a5c590a4d5"++[[package]]+name = "fixedbitset"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"+[[package]]name = "flate2"version = "1.1.9"@@ -356,6 +620,18 @@ dependencies = ["miniz_oxide",]+[[package]]+name = "fnv"+version = "1.0.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"++[[package]]+name = "foldhash"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"+[[package]]name = "form_urlencoded"version = "1.2.2"@@ -420,6 +696,29 @@ dependencies = ["wasi",]+[[package]]+name = "getrandom"+version = "0.3.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd"+dependencies = [+ "cfg-if",+ "libc",+ "r-efi 5.3.0",+ "wasip2",+]++[[package]]+name = "getrandom"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099"+dependencies = [+ "cfg-if",+ "libc",+ "r-efi 6.0.0",+]+[[package]]name = "glob"version = "0.3.4"@@ -435,11 +734,27 @@ dependencies = ["ahash",]+[[package]]+name = "hashbrown"+version = "0.16.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"+dependencies = [+ "allocator-api2",+ "equivalent",+ "foldhash",+]+[[package]]name = "hashbrown"version = "0.17.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"+dependencies = [+ "allocator-api2",+ "equivalent",+ "foldhash",+][[package]]name = "hashlink"@@ -456,6 +771,12 @@ version = "0.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"+[[package]]+name = "hex"+version = "0.4.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"+[[package]]name = "http"version = "1.5.0"@@ -578,6 +899,12 @@ dependencies = ["zerovec",]+[[package]]+name = "ident_case"+version = "1.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"+[[package]]name = "idna"version = "1.1.0"@@ -609,12 +936,43 @@ dependencies = ["hashbrown 0.17.1",]+[[package]]+name = "indoc"+version = "2.0.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706"+dependencies = [+ "rustversion",+]++[[package]]+name = "instability"+version = "0.3.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2bf84e73fa6f27f299dec58e13223cf70db80da872eb921d4f6138342a0eabc8"+dependencies = [+ "darling",+ "indoc",+ "proc-macro2",+ "quote",+ "syn 3.0.3",+]+[[package]]name = "is_terminal_polyfill"version = "1.70.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695"+[[package]]+name = "itertools"+version = "0.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285"+dependencies = [+ "either",+]+[[package]]name = "itoa"version = "1.0.18"@@ -632,12 +990,35 @@ dependencies = ["wasm-bindgen",]+[[package]]+name = "kasuari"+version = "0.4.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bde5057d6143cc94e861d90f591b9303d6716c6b9602309150bd068853c10899"+dependencies = [+ "hashbrown 0.16.1",+ "portable-atomic",+ "thiserror 2.0.19",+]+[[package]]name = "kodama"version = "0.3.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f868feceed4703c842925c14232667c5f29c8059d0354154b2d06ec3bf9daf82"+[[package]]+name = "lab"+version = "0.11.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf36173d4167ed999940f804952e6b08197cae5ad5d572eb4db150ce8ad5d58f"++[[package]]+name = "lazy_static"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"+[[package]]name = "libc"version = "0.2.189"@@ -654,7 +1035,7 @@ dependencies = ["gdb-command","kodama","regex",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -667,6 +1048,12 @@ dependencies = ["windows-link",]+[[package]]+name = "libm"+version = "0.2.16"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981"+[[package]]name = "libsqlite3-sys"version = "0.30.1"@@ -678,6 +1065,21 @@ dependencies = ["vcpkg",]+[[package]]+name = "line-clipping"+version = "0.3.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e752191d037c44ad111a8caa762921926658402f01cc1253f7bef2020ece4f5e"+dependencies = [+ "bitflags 2.13.1",+]++[[package]]+name = "linux-raw-sys"+version = "0.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"+[[package]]name = "lisdex"version = "0.0.0"@@ -689,9 +1091,11 @@ dependencies = ["lisdex-harness","lisdex-ingest","lisdex-llm",+ "lisdex-monitor","lisdex-report","lisdex-surface","lisdex-triage",+ "lisdex-tui","serde_json",]@@ -703,7 +1107,7 @@ dependencies = ["lisdex-ingest","serde","serde_json",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -712,7 +1116,7 @@ version = "0.0.0"dependencies = ["rusqlite","sha2",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -720,7 +1124,7 @@ name = "lisdex-fuzz"version = "0.0.0"dependencies = ["lisdex-core",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -730,7 +1134,7 @@ dependencies = ["lisdex-core","lisdex-surface","serde",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -738,7 +1142,7 @@ name = "lisdex-ingest"version = "0.0.0"dependencies = ["lisdex-core",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -748,10 +1152,20 @@ dependencies = ["lisdex-core","serde","serde_json",- "thiserror",+ "thiserror 2.0.19","ureq",]+[[package]]+name = "lisdex-monitor"+version = "0.0.0"+dependencies = [+ "lisdex-core",+ "lisdex-fuzz",+ "lisdex-triage",+ "thiserror 2.0.19",+]+[[package]]name = "lisdex-report"version = "0.0.0"@@ -767,7 +1181,7 @@ version = "0.1.0"dependencies = ["clang","serde",- "thiserror",+ "thiserror 2.0.19",][[package]]@@ -778,6 +1192,16 @@ dependencies = ["lisdex-core",]+[[package]]+name = "lisdex-tui"+version = "0.0.0"+dependencies = [+ "lisdex-core",+ "lisdex-monitor",+ "ratatui",+ "thiserror 2.0.19",+]+[[package]]name = "litemap"version = "0.8.2"@@ -791,10 +1215,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"[[package]]-name = "log"-version = "0.4.33"+name = "lock_api"+version = "0.4.14"source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"+checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"+dependencies = [+ "scopeguard",+]++[[package]]+name = "log"+version = "0.4.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"++[[package]]+name = "lru"+version = "0.18.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5d2f2f9b4ba7e6b24d95e7e899329d35be83bcded72c8540cdd5368932d1d90a"+dependencies = [+ "hashbrown 0.17.1",+]++[[package]]+name = "mac_address"+version = "1.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c0aeb26bf5e836cc1c341c8106051b573f1766dfa05aa87f0b98be5e51b02303"+dependencies = [+ "nix",+ "winapi",+][[package]]name = "memchr"@@ -802,6 +1254,27 @@ version = "2.8.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"+[[package]]+name = "memmem"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a64a92489e2744ce060c349162be1c5f33c6969234104dbd99ddb5feb08b8c15"++[[package]]+name = "memoffset"+version = "0.9.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a"+dependencies = [+ "autocfg",+]++[[package]]+name = "minimal-lexical"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"+[[package]]name = "miniz_oxide"version = "0.8.9"@@ -812,12 +1285,58 @@ dependencies = ["simd-adler32",]+[[package]]+name = "mio"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427"+dependencies = [+ "libc",+ "log",+ "wasi",+ "windows-sys 0.61.2",+]++[[package]]+name = "nix"+version = "0.29.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"+dependencies = [+ "bitflags 2.13.1",+ "cfg-if",+ "cfg_aliases",+ "libc",+ "memoffset",+]++[[package]]+name = "nom"+version = "7.1.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"+dependencies = [+ "memchr",+ "minimal-lexical",+]+[[package]]name = "num-conv"version = "0.2.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"+[[package]]+name = "num-derive"+version = "0.4.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]+[[package]]name = "num-traits"version = "0.2.19"@@ -827,6 +1346,15 @@ dependencies = ["autocfg",]+[[package]]+name = "num_threads"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"+dependencies = [+ "libc",+]+[[package]]name = "once_cell"version = "1.21.4"@@ -839,12 +1367,171 @@ version = "1.70.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"+[[package]]+name = "ordered-float"+version = "4.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951"+dependencies = [+ "num-traits",+]++[[package]]+name = "palette"+version = "0.7.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ddeed8580d347d2abf3dcf06a5f0b3dc020258338526b277847cd4248a70fc64"+dependencies = [+ "approx",+ "libm",+ "palette_derive",+ "palette_math",+]++[[package]]+name = "palette_derive"+version = "0.7.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "88537020289b719d81be994ccf1bbf4990f477e2f69ee52fe3e45f43a02e56be"+dependencies = [+ "by_address",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "palette_math"+version = "0.7.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6e6eb142958d64335fb0e345c5b9ead2ecd6fc438c307e9d7d3c4fd428dbaf12"+dependencies = [+ "libm",+]++[[package]]+name = "parking_lot"+version = "0.12.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a"+dependencies = [+ "lock_api",+ "parking_lot_core",+]++[[package]]+name = "parking_lot_core"+version = "0.9.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"+dependencies = [+ "cfg-if",+ "libc",+ "redox_syscall",+ "smallvec",+ "windows-link",+]+[[package]]name = "percent-encoding"version = "2.3.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"+[[package]]+name = "pest"+version = "2.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7df728be843c7070fab6ab7c328c4e9e9d78e23bf749c0669c86ee7ebfa050a2"+dependencies = [+ "memchr",+ "ucd-trie",+]++[[package]]+name = "pest_derive"+version = "2.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e2dd6fc3b26b3462ee188aac870f5a41d398f1cd5e2408d16531bd71c9591fd"+dependencies = [+ "pest",+ "pest_generator",+]++[[package]]+name = "pest_generator"+version = "2.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6a7a9205cfb6f596a9e8b689c0a15f9ceb7a1aafae7aaf788150ac65b29975b6"+dependencies = [+ "pest",+ "pest_meta",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "pest_meta"+version = "2.8.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "85abd351c0de1e8384fc791a0737111a350394937e92b956b743dac12429f57c"+dependencies = [+ "pest",+]++[[package]]+name = "phf"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"+dependencies = [+ "phf_macros",+ "phf_shared",+]++[[package]]+name = "phf_codegen"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a"+dependencies = [+ "phf_generator",+ "phf_shared",+]++[[package]]+name = "phf_generator"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"+dependencies = [+ "phf_shared",+ "rand",+]++[[package]]+name = "phf_macros"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216"+dependencies = [+ "phf_generator",+ "phf_shared",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]++[[package]]+name = "phf_shared"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"+dependencies = [+ "siphasher",+]+[[package]]name = "pin-project-lite"version = "0.2.17"@@ -857,6 +1544,12 @@ version = "0.3.33"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"+[[package]]+name = "portable-atomic"+version = "1.15.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"+[[package]]name = "potential_utf"version = "0.1.5"@@ -890,6 +1583,143 @@ dependencies = ["proc-macro2",]+[[package]]+name = "r-efi"+version = "5.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"++[[package]]+name = "r-efi"+version = "6.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"++[[package]]+name = "rand"+version = "0.8.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a"+dependencies = [+ "rand_core",+]++[[package]]+name = "rand_core"+version = "0.6.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"++[[package]]+name = "ratatui"+version = "0.30.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3274ba0a2c5e1bcad2a2005d20f4dc59dad26b2eb0940fb094500dba4099d57d"+dependencies = [+ "instability",+ "ratatui-core",+ "ratatui-crossterm",+ "ratatui-macros",+ "ratatui-termina",+ "ratatui-termwiz",+ "ratatui-widgets",+ "serde",+]++[[package]]+name = "ratatui-core"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cbb175c433c8e28a809d1f5773a2ae96e68c0ce40db865cbab1020bf33ae479c"+dependencies = [+ "bitflags 2.13.1",+ "compact_str",+ "critical-section",+ "hashbrown 0.17.1",+ "itertools",+ "kasuari",+ "lru",+ "palette",+ "serde",+ "strum",+ "thiserror 2.0.19",+ "unicode-segmentation",+ "unicode-truncate",+ "unicode-width",+]++[[package]]+name = "ratatui-crossterm"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "567584a3b0e6a8203c23de40b4861497266725eb5363dbfd18a1edd603cca9f0"+dependencies = [+ "cfg-if",+ "crossterm",+ "instability",+ "ratatui-core",+]++[[package]]+name = "ratatui-macros"+version = "0.7.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed7dc68daa7498a43e4d68e0eb078427e10c38fbcfbb1e42d955f1fa2140d814"+dependencies = [+ "ratatui-core",+ "ratatui-widgets",+]++[[package]]+name = "ratatui-termina"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c0bf912d9e66f057a759d92e386a280ea886b352ab757d6ac4d653c7ed2c43c2"+dependencies = [+ "instability",+ "ratatui-core",+ "termina",+]++[[package]]+name = "ratatui-termwiz"+version = "0.1.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "faf03e0380b7744054d6cb74224fe3adf062a029754933f575ca1e3b4c2ce977"+dependencies = [+ "ratatui-core",+ "termwiz",+]++[[package]]+name = "ratatui-widgets"+version = "0.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "66e3d19bcc9130ca376277d93b60767ff121ace3be06f5f95f81dd68956407d1"+dependencies = [+ "bitflags 2.13.1",+ "hashbrown 0.17.1",+ "indoc",+ "instability",+ "itertools",+ "line-clipping",+ "ratatui-core",+ "serde",+ "strum",+ "time",+ "unicode-segmentation",+ "unicode-width",+]++[[package]]+name = "redox_syscall"+version = "0.5.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"+dependencies = [+ "bitflags 2.13.1",+]+[[package]]name = "regex"version = "1.13.1"@@ -927,7 +1757,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"dependencies = ["cc","cfg-if",- "getrandom",+ "getrandom 0.2.17","libc","untrusted","windows-sys 0.52.0",@@ -939,7 +1769,7 @@ version = "0.32.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7753b721174eb8ff87a9a0e799e2d7bc3749323e773db92e0984debb00019d6e"dependencies = [- "bitflags",+ "bitflags 2.13.1","fallible-iterator","fallible-streaming-iterator","hashlink",@@ -947,6 +1777,28 @@ dependencies = ["smallvec",]+[[package]]+name = "rustc_version"+version = "0.4.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92"+dependencies = [+ "semver",+]++[[package]]+name = "rustix"+version = "1.1.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190"+dependencies = [+ "bitflags 2.13.1",+ "errno",+ "libc",+ "linux-raw-sys",+ "windows-sys 0.61.2",+]+[[package]]name = "rustls"version = "0.23.43"@@ -988,6 +1840,24 @@ version = "1.0.23"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"+[[package]]+name = "ryu"+version = "1.0.23"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"++[[package]]+name = "scopeguard"+version = "1.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"++[[package]]+name = "semver"+version = "1.0.28"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd"+[[package]]name = "serde"version = "1.0.229"@@ -1048,12 +1918,49 @@ version = "2.0.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"+[[package]]+name = "signal-hook"+version = "0.3.18"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"+dependencies = [+ "libc",+ "signal-hook-registry",+]++[[package]]+name = "signal-hook-mio"+version = "0.2.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b75a19a7a740b25bc7944bdee6172368f988763b744e3d4dfe753f6b4ece40cc"+dependencies = [+ "libc",+ "mio",+ "signal-hook",+]++[[package]]+name = "signal-hook-registry"+version = "1.4.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"+dependencies = [+ "errno",+ "libc",+]+[[package]]name = "simd-adler32"version = "0.3.10"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"+[[package]]+name = "siphasher"+version = "1.0.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649"+[[package]]name = "slab"version = "0.4.12"@@ -1072,18 +1979,56 @@ version = "1.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"+[[package]]+name = "static_assertions"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"+[[package]]name = "strsim"version = "0.11.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"+[[package]]+name = "strum"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd"+dependencies = [+ "strum_macros",+]++[[package]]+name = "strum_macros"+version = "0.28.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664"+dependencies = [+ "heck",+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]+[[package]]name = "subtle"version = "2.6.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"+[[package]]+name = "syn"+version = "1.0.109"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"+dependencies = [+ "proc-macro2",+ "quote",+ "unicode-ident",+]+[[package]]name = "syn"version = "2.0.119"@@ -1117,13 +2062,109 @@ dependencies = ["syn 2.0.119",]+[[package]]+name = "termina"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9048a889effe34a5cddee0af7f53285198b16dca3be510858d38dfdb3e62a04e"+dependencies = [+ "bitflags 2.13.1",+ "parking_lot",+ "rustix",+ "signal-hook",+ "windows-sys 0.61.2",+]++[[package]]+name = "terminfo"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d4ea810f0692f9f51b382fff5893887bb4580f5fa246fde546e0b13e7fcee662"+dependencies = [+ "fnv",+ "nom",+ "phf",+ "phf_codegen",+]++[[package]]+name = "termios"+version = "0.3.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "411c5bf740737c7918b8b1fe232dca4dc9f8e754b8ad5e20966814001ed0ac6b"+dependencies = [+ "libc",+]++[[package]]+name = "termwiz"+version = "0.23.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4676b37242ccbd1aabf56edb093a4827dc49086c0ffd764a5705899e0f35f8f7"+dependencies = [+ "anyhow",+ "base64",+ "bitflags 2.13.1",+ "fancy-regex",+ "filedescriptor",+ "finl_unicode",+ "fixedbitset",+ "hex",+ "lazy_static",+ "libc",+ "log",+ "memmem",+ "nix",+ "num-derive",+ "num-traits",+ "ordered-float",+ "pest",+ "pest_derive",+ "phf",+ "sha2",+ "signal-hook",+ "siphasher",+ "terminfo",+ "termios",+ "thiserror 1.0.69",+ "ucd-trie",+ "unicode-segmentation",+ "vtparse",+ "wezterm-bidi",+ "wezterm-blob-leases",+ "wezterm-color-types",+ "wezterm-dynamic",+ "wezterm-input-types",+ "winapi",+]++[[package]]+name = "thiserror"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"+dependencies = [+ "thiserror-impl 1.0.69",+]+[[package]]name = "thiserror"version = "2.0.19"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "09a43598840e33d5b0331f38c5e30d13bb11c11210a4b58f0d9b18a5a5eefcd9"dependencies = [- "thiserror-impl",+ "thiserror-impl 2.0.19",+]++[[package]]+name = "thiserror-impl"+version = "1.0.69"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",][[package]]@@ -1144,7 +2185,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"dependencies = ["deranged",+ "libc","num-conv",+ "num_threads","powerfmt","serde_core","time-core",@@ -1183,12 +2226,41 @@ version = "1.20.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"+[[package]]+name = "ucd-trie"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"+[[package]]name = "unicode-ident"version = "1.0.24"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"+[[package]]+name = "unicode-segmentation"+version = "1.13.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8"++[[package]]+name = "unicode-truncate"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "16b380a1238663e5f8a691f9039c73e1cdae598a30e9855f541d29b08b53e9a5"+dependencies = [+ "itertools",+ "unicode-segmentation",+ "unicode-width",+]++[[package]]+name = "unicode-width"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"+[[package]]name = "untrusted"version = "0.9.0"@@ -1257,6 +2329,18 @@ version = "0.2.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"+[[package]]+name = "uuid"+version = "1.24.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239"+dependencies = [+ "atomic",+ "getrandom 0.4.3",+ "js-sys",+ "wasm-bindgen",+]+[[package]]name = "vcpkg"version = "0.2.15"@@ -1269,6 +2353,15 @@ version = "0.9.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"+[[package]]+name = "vtparse"+version = "0.6.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6d9b2acfb050df409c972a37d3b8e08cdea3bddb0c09db9d53137e504cfabed0"+dependencies = [+ "utf8parse",+]+[[package]]name = "wait-timeout"version = "0.2.1"@@ -1284,6 +2377,15 @@ version = "0.11.1+wasi-snapshot-preview1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"+[[package]]+name = "wasip2"+version = "1.0.4+wasi-0.2.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"+dependencies = [+ "wit-bindgen",+]+[[package]]name = "wasm-bindgen"version = "0.2.127"@@ -1338,6 +2440,100 @@ dependencies = ["rustls-pki-types",]+[[package]]+name = "wezterm-bidi"+version = "0.2.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0c0a6e355560527dd2d1cf7890652f4f09bb3433b6aadade4c9b5ed76de5f3ec"+dependencies = [+ "log",+ "wezterm-dynamic",+]++[[package]]+name = "wezterm-blob-leases"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "692daff6d93d94e29e4114544ef6d5c942a7ed998b37abdc19b17136ea428eb7"+dependencies = [+ "getrandom 0.3.4",+ "mac_address",+ "sha2",+ "thiserror 1.0.69",+ "uuid",+]++[[package]]+name = "wezterm-color-types"+version = "0.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7de81ef35c9010270d63772bebef2f2d6d1f2d20a983d27505ac850b8c4b4296"+dependencies = [+ "csscolorparser",+ "deltae",+ "lazy_static",+ "wezterm-dynamic",+]++[[package]]+name = "wezterm-dynamic"+version = "0.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5f2ab60e120fd6eaa68d9567f3226e876684639d22a4219b313ff69ec0ccd5ac"+dependencies = [+ "log",+ "ordered-float",+ "strsim",+ "thiserror 1.0.69",+ "wezterm-dynamic-derive",+]++[[package]]+name = "wezterm-dynamic-derive"+version = "0.1.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "46c0cf2d539c645b448eaffec9ec494b8b19bd5077d9e58cb1ae7efece8d575b"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 1.0.109",+]++[[package]]+name = "wezterm-input-types"+version = "0.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7012add459f951456ec9d6c7e6fc340b1ce15d6fc9629f8c42853412c029e57e"+dependencies = [+ "bitflags 1.3.2",+ "euclid",+ "lazy_static",+ "serde",+ "wezterm-dynamic",+]++[[package]]+name = "winapi"+version = "0.3.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"+dependencies = [+ "winapi-i686-pc-windows-gnu",+ "winapi-x86_64-pc-windows-gnu",+]++[[package]]+name = "winapi-i686-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"++[[package]]+name = "winapi-x86_64-pc-windows-gnu"+version = "0.4.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"+[[package]]name = "windows-core"version = "0.62.2"@@ -1479,6 +2675,12 @@ version = "0.52.6"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"+[[package]]+name = "wit-bindgen"+version = "0.57.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"+[[package]]name = "writeable"version = "0.6.3"diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.tomlindex 32e45711..1cd6d011 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.toml+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.toml@@ -21,6 +21,7 @@ clap = { version = "4", features = ["derive"] }serde = { version = "1", features = ["derive"] }serde_json = "1"ureq = { version = "3", features = ["json"] }+ratatui = "0.30"lisdex-core = { path = "crates/lisdex-core" }lisdex-fuzz = { path = "crates/lisdex-fuzz" }lisdex-ingest = { path = "crates/lisdex-ingest" }@@ -30,6 +31,8 @@ lisdex-harness = { path = "crates/lisdex-harness" }lisdex-llm = { path = "crates/lisdex-llm" }lisdex-triage = { path = "crates/lisdex-triage" }lisdex-report = { path = "crates/lisdex-report" }+lisdex-monitor = { path = "crates/lisdex-monitor" }+lisdex-tui = { path = "crates/lisdex-tui" }[workspace.lints.rust]unsafe_code = "deny"diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-core/src/store.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-core/src/store.rsindex 456c5d51..eb31c2cf 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-core/src/store.rs+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-core/src/store.rs@@ -33,6 +33,7 @@ const UPDATE_CAMPAIGN_STATUS_SQL: &str = "UPDATE campaigns SET status = ?1 WHEREconst INSERT_CRASH_SQL: &str = "INSERT INTO crashes (campaign_id, input, sanitizer_report, stack_hash) VALUES (?1, ?2, ?3, ?4)";const SELECT_CRASHES_SQL: &str ="SELECT campaign_id, input, sanitizer_report FROM crashes WHERE campaign_id = ?1 ORDER BY id";+const SELECT_ALL_CAMPAIGNS_SQL: &str = "SELECT id, target, status FROM campaigns ORDER BY id";#[derive(Debug, thiserror::Error)]pub enum StoreError {@@ -111,6 +112,26 @@ impl Store {Ok(())}+ pub fn list_campaigns(&self) -> Result<Vec<(CampaignId, Campaign)>, StoreError> {+ let mut stmt = self.conn.prepare(SELECT_ALL_CAMPAIGNS_SQL)?;+ let rows = stmt+ .query_map([], |row| {+ Ok((+ row.get::<_, i64>(0)?,+ row.get::<_, String>(1)?,+ row.get::<_, String>(2)?,+ ))+ })?+ .collect::<Result<Vec<_>, _>>()?;+ let mut campaigns = Vec::with_capacity(rows.len());+ for (id, target, status_str) in rows {+ let status = CampaignStatus::from_db_str(&status_str)+ .ok_or(StoreError::UnknownStatus(status_str))?;+ campaigns.push((CampaignId(id), Campaign::from_stored(target, status)));+ }+ Ok(campaigns)+ }+pub fn insert_crash(&self, crash: &Crash) -> Result<CrashId, StoreError> {self.conn.execute(INSERT_CRASH_SQL,@@ -301,6 +322,53 @@ mod tests {assert!(matches!(err, StoreError::CampaignNotFound(9999)));}+ #[test]+ fn list_campaigns_returns_every_row_in_insertion_order() {+ let store = Store::open_in_memory().unwrap();+ for target in ["libpng", "libtiff", "openjpeg"] {+ store.insert_campaign(&Campaign::new(target)).unwrap();+ }+ let listed = store.list_campaigns().unwrap();+ let targets: Vec<&str> = listed+ .iter()+ .map(|(_, campaign)| campaign.target())+ .collect();+ assert_eq!(targets, vec!["libpng", "libtiff", "openjpeg"]);+ }++ #[test]+ fn list_campaigns_carries_the_id_a_caller_needs_to_fetch_crashes() {+ let store = Store::open_in_memory().unwrap();+ let inserted = store.insert_campaign(&Campaign::new("libpng")).unwrap();+ store+ .insert_crash(&Crash::from_report(+ inserted,+ b"seed".to_vec(),+ KEYED_REPORT,+ ))+ .unwrap();+ let (listed_id, _) = store.list_campaigns().unwrap()[0];+ assert_eq!(listed_id, inserted);+ assert_eq!(store.crashes_for_campaign(listed_id).unwrap().len(), 1);+ }++ #[test]+ fn list_campaigns_preserves_status_rather_than_resetting_to_pending() {+ let store = Store::open_in_memory().unwrap();+ let id = store.insert_campaign(&Campaign::new("libpng")).unwrap();+ store+ .update_campaign_status(id, CampaignStatus::Building)+ .unwrap();+ let listed = store.list_campaigns().unwrap();+ assert_eq!(listed[0].1.status(), CampaignStatus::Building);+ }++ #[test]+ fn list_campaigns_on_an_empty_store_is_empty_not_an_error() {+ let store = Store::open_in_memory().unwrap();+ assert!(store.list_campaigns().unwrap().is_empty());+ }+#[test]fn crashes_for_campaign_without_crashes_is_empty() {let store = Store::open_in_memory().unwrap();diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-fuzz/src/runner.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-fuzz/src/runner.rsindex c4d0a2d8..fd826d99 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-fuzz/src/runner.rs+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-fuzz/src/runner.rs@@ -15,6 +15,7 @@ use lisdex_core::crash::Crash;use lisdex_core::report::SanitizerReport;use crate::dictionary;+use crate::plot::{self, CoverageCurve, PLOT_FILE_NAME, PlotError};use crate::stats::{FuzzerStats, STATS_FILE_NAME, StatsError};pub const AFL_FUZZ_BIN: &str = "afl-fuzz";@@ -95,6 +96,10 @@ pub enum RunnerError {Io(#[from] std::io::Error),#[error("stats error: {0}")]Stats(#[from] StatsError),+ #[error("plot error: {0}")]+ Plot(#[from] PlotError),+ #[error("no fuzzer instance under {findings}")]+ NoInstance { findings: String },#[error("{AFL_FUZZ_BIN} failed before writing stats ({status}); check the {AFL_FUZZ_BIN} output above")]@@ -105,6 +110,19 @@ pub enum RunnerError {NothingToResume { findings: String },}+#[derive(Debug, Clone, PartialEq)]+pub struct InstanceStats {+ pub name: String,+ pub stats: FuzzerStats,+}++impl InstanceStats {+ #[must_use]+ pub fn is_main(&self) -> bool {+ self.name == MAIN_INSTANCE || self.name == DEFAULT_INSTANCE+ }+}+#[derive(Debug, Clone, PartialEq, Eq)]pub struct Reproduction {pub output: String,@@ -281,6 +299,42 @@ pub fn read_all_stats(findings: &Path) -> Result<Vec<FuzzerStats>, RunnerError>Ok(all)}+pub fn primary_instance(findings: &Path) -> Result<PathBuf, RunnerError> {+ let dirs = instance_dirs(findings)?;+ let named = |wanted: &str| {+ dirs.iter()+ .find(|dir| dir.file_name().is_some_and(|name| name == wanted))+ .cloned()+ };+ named(MAIN_INSTANCE)+ .or_else(|| named(DEFAULT_INSTANCE))+ .or_else(|| dirs.first().cloned())+ .ok_or_else(|| RunnerError::NoInstance {+ findings: findings.display().to_string(),+ })+}++pub fn read_curve(findings: &Path) -> Result<CoverageCurve, RunnerError> {+ let path = primary_instance(findings)?.join(PLOT_FILE_NAME);+ Ok(plot::parse(&std::fs::read_to_string(path)?)?)+}++pub fn read_instance_stats(findings: &Path) -> Result<Vec<InstanceStats>, RunnerError> {+ let mut all = Vec::new();+ for dir in instance_dirs(findings)? {+ let name = dir.file_name().map_or_else(+ || DEFAULT_INSTANCE.to_owned(),+ |n| n.to_string_lossy().into_owned(),+ );+ let text = std::fs::read_to_string(dir.join(STATS_FILE_NAME))?;+ all.push(InstanceStats {+ name,+ stats: FuzzerStats::parse(&text)?,+ });+ }+ Ok(all)+}+#[must_use]pub fn combine_stats(instances: &[FuzzerStats]) -> Option<FuzzerStats> {let first = instances.first()?;diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/Cargo.tomlnew file mode 100644index 00000000..bc437ded--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/Cargo.toml@@ -0,0 +1,19 @@+# ©AngelaMos | 2026+# Cargo.toml++[package]+name = "lisdex-monitor"+version = "0.0.0"+edition.workspace = true+rust-version.workspace = true+license.workspace = true+authors.workspace = true++[dependencies]+lisdex-core = { workspace = true }+lisdex-fuzz = { workspace = true }+lisdex-triage = { workspace = true }+thiserror = { workspace = true }++[lints]+workspace = truediff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/src/lib.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/src/lib.rsnew file mode 100644index 00000000..a2c438d2--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/src/lib.rs@@ -0,0 +1,4 @@+// ©AngelaMos | 2026+// lib.rs++pub mod snapshot;diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/src/snapshot.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/src/snapshot.rsnew file mode 100644index 00000000..4d585d08--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/src/snapshot.rs@@ -0,0 +1,815 @@+// ©AngelaMos | 2026+// snapshot.rs++use std::path::{Path, PathBuf};++use lisdex_core::campaign::{CampaignId, CampaignStatus};+use lisdex_core::crash::Crash;+use lisdex_core::dedup;+use lisdex_core::report::SanitizerReport;+use lisdex_core::store::{Store, StoreError};+use lisdex_fuzz::plot::CoverageCurve;+use lisdex_fuzz::runner;+use lisdex_triage::classify::{self, Classification, DecidedBy};+use lisdex_triage::severity::Severity as TriageSeverity;++pub const SHORT_KEY_LEN: usize = 12;+pub const DISPLAYED_FRAMES: usize = 6;+pub const NO_KEY_REASON: &str = "refused: no symbolized frames to key on";+pub const NO_FRAMES_REASON: &str = "none survived the noise filter";++const UNPARSED_KIND: &str = "unparsed";+const UNKEYED_LABEL: &str = "unkeyed";++#[derive(Debug, thiserror::Error)]+pub enum MonitorError {+ #[error("store error: {0}")]+ Store(#[from] StoreError),+ #[error("no campaign {id} in {db}")]+ CampaignNotFound { id: i64, db: String },+}++#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]+pub enum Severity {+ Unclassified,+ Undefined,+ NotExploitable,+ ProbablyExploitable,+ Exploitable,+}++impl Severity {+ #[must_use]+ pub fn as_str(self) -> &'static str {+ match self {+ Severity::Exploitable => "EXPLOITABLE",+ Severity::ProbablyExploitable => "PROBABLY_EXPLOITABLE",+ Severity::NotExploitable => "NOT_EXPLOITABLE",+ Severity::Undefined => "UNDEFINED",+ Severity::Unclassified => "UNCLASSIFIED",+ }+ }++ #[must_use]+ fn project(source: TriageSeverity) -> Severity {+ match source {+ TriageSeverity::Exploitable => Severity::Exploitable,+ TriageSeverity::ProbablyExploitable => Severity::ProbablyExploitable,+ TriageSeverity::NotExploitable => Severity::NotExploitable,+ TriageSeverity::Undefined => Severity::Undefined,+ }+ }+}++#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum Decider {+ Casr,+ Lisdex,+}++impl Decider {+ #[must_use]+ pub fn as_str(self) -> &'static str {+ match self {+ Decider::Casr => "casr",+ Decider::Lisdex => "lisdex",+ }+ }++ #[must_use]+ fn project(source: DecidedBy) -> Decider {+ match source {+ DecidedBy::Casr => Decider::Casr,+ DecidedBy::Lisdex => Decider::Lisdex,+ }+ }+}++#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum Phase {+ Pending,+ Building,+ Fuzzing,+ Completed,+ Failed,+}++impl Phase {+ #[must_use]+ pub fn as_str(self) -> &'static str {+ match self {+ Phase::Pending => "PENDING",+ Phase::Building => "BUILDING",+ Phase::Fuzzing => "FUZZING",+ Phase::Completed => "COMPLETED",+ Phase::Failed => "FAILED",+ }+ }++ #[must_use]+ pub fn is_live(self) -> bool {+ matches!(self, Phase::Building | Phase::Fuzzing)+ }++ #[must_use]+ fn project(source: CampaignStatus) -> Phase {+ match source {+ CampaignStatus::Pending => Phase::Pending,+ CampaignStatus::Building => Phase::Building,+ CampaignStatus::Fuzzing => Phase::Fuzzing,+ CampaignStatus::Completed => Phase::Completed,+ CampaignStatus::Failed => Phase::Failed,+ }+ }+}++#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum Notice {+ NoCurveRecorded,+ NoInstanceStats,+ CoverageNotMonotonic,+ NoCampaignInStore,+ UnkeyedCrashes(usize),+}++impl Notice {+ #[must_use]+ pub fn message(self) -> String {+ match self {+ Notice::NoCurveRecorded => {+ "no coverage curve on disk yet; the campaign has not written its first sample"+ .to_owned()+ }+ Notice::NoInstanceStats => {+ "no fuzzer instance has written stats under this findings directory".to_owned()+ }+ Notice::CoverageNotMonotonic => {+ "coverage fell, so this campaign was resumed and plot_data was concatenated; any first-to-last delta understates it"+ .to_owned()+ }+ Notice::NoCampaignInStore => {+ "the store holds no campaign, so crashes and findings are unavailable".to_owned()+ }+ Notice::UnkeyedCrashes(count) => format!(+ "{count} crash(es) could not be keyed, so they are listed individually rather than merged"+ ),+ }+ }+}++#[derive(Debug, Clone, PartialEq, Eq)]+pub struct CampaignView {+ pub id: i64,+ pub target: String,+ pub phase: Phase,+}++#[derive(Debug, Clone, Copy, PartialEq)]+pub struct CurvePoint {+ pub secs: u64,+ pub edges: u64,+ pub corpus: u64,+ pub execs_per_sec: f64,+ pub total_execs: u64,+ pub saved_crashes: u64,+ pub map_density_pct: f64,+}++#[derive(Debug, Clone, PartialEq)]+pub struct InstanceView {+ pub name: String,+ pub is_main: bool,+ pub execs_done: u64,+ pub execs_per_sec: f64,+ pub edges_found: u64,+ pub total_edges: u64,+ pub saved_crashes: u64,+ pub map_density_pct: f64,+}++#[derive(Debug, Clone, PartialEq)]+pub struct Totals {+ pub execs_done: u64,+ pub execs_per_sec: f64,+ pub edges_found: u64,+ pub total_edges: u64,+ pub saved_crashes: u64,+ pub map_density_pct: f64,+ pub afl_version: String,+}++impl Totals {+ #[must_use]+ pub fn edge_ratio(&self) -> f64 {+ if self.total_edges == 0 {+ return 0.0;+ }+ #[expect(clippy::cast_precision_loss)]+ let ratio = self.edges_found as f64 / self.total_edges as f64;+ ratio.clamp(0.0, 1.0)+ }+}++#[derive(Debug, Clone, PartialEq, Eq)]+pub struct FindingView {+ pub key: Option<String>,+ pub crash_count: usize,+ pub severity: Severity,+ pub class: String,+ pub kind: String,+ pub crash_site: Option<String>,+ pub frames: Vec<String>,+ pub input_bytes: usize,+ pub is_security_relevant: bool,+ pub decided_by: Option<Decider>,+ pub sanitizer_report: String,+}++impl FindingView {+ #[must_use]+ pub fn short_key(&self) -> String {+ match self.key.as_deref() {+ Some(key) => key+ .char_indices()+ .nth(SHORT_KEY_LEN)+ .map_or(key, |(at, _)| &key[..at])+ .to_owned(),+ None => UNKEYED_LABEL.to_owned(),+ }+ }++ #[must_use]+ pub fn is_keyed(&self) -> bool {+ self.key.is_some()+ }++ #[must_use]+ pub fn key_status(&self) -> String {+ self.key.clone().unwrap_or_else(|| NO_KEY_REASON.to_owned())+ }++ #[must_use]+ pub fn decider(&self) -> &'static str {+ self.decided_by.map_or("unclassified", Decider::as_str)+ }+}++#[derive(Debug, Clone, PartialEq, Eq)]+pub struct Source {+ pub db: PathBuf,+ pub findings: PathBuf,+ pub campaign: Option<i64>,+}++#[derive(Debug, Clone, PartialEq)]+pub struct Snapshot {+ campaign: Option<CampaignView>,+ curve: Vec<CurvePoint>,+ curve_instance: Option<String>,+ instances: Vec<InstanceView>,+ totals: Option<Totals>,+ findings: Vec<FindingView>,+ unkeyed_crashes: usize,+ total_crashes: usize,+ notices: Vec<Notice>,+}++impl Snapshot {+ pub fn read(source: &Source) -> Result<Snapshot, MonitorError> {+ let mut notices = Vec::new();+ let (campaign, crashes) = read_campaign(source, &mut notices)?;+ let (curve, curve_instance) = read_curve(&source.findings, &mut notices);+ let (instances, totals) = read_instances(&source.findings, &mut notices);+ let grouping = dedup::group_crashes(&crashes);+ let findings = build_findings(&grouping);+ if grouping.unkeyed_crashes() > 0 {+ notices.push(Notice::UnkeyedCrashes(grouping.unkeyed_crashes()));+ }++ Ok(Snapshot {+ campaign,+ curve,+ curve_instance,+ instances,+ totals,+ findings,+ unkeyed_crashes: grouping.unkeyed_crashes(),+ total_crashes: crashes.len(),+ notices,+ })+ }++ #[must_use]+ pub fn empty() -> Snapshot {+ Snapshot {+ campaign: None,+ curve: Vec::new(),+ curve_instance: None,+ instances: Vec::new(),+ totals: None,+ findings: Vec::new(),+ unkeyed_crashes: 0,+ total_crashes: 0,+ notices: Vec::new(),+ }+ }++ #[must_use]+ pub fn campaign(&self) -> Option<&CampaignView> {+ self.campaign.as_ref()+ }++ #[must_use]+ pub fn curve(&self) -> &[CurvePoint] {+ &self.curve+ }++ #[must_use]+ pub fn curve_instance(&self) -> Option<&str> {+ self.curve_instance.as_deref()+ }++ #[must_use]+ pub fn instances(&self) -> &[InstanceView] {+ &self.instances+ }++ #[must_use]+ pub fn totals(&self) -> Option<&Totals> {+ self.totals.as_ref()+ }++ #[must_use]+ pub fn findings(&self) -> &[FindingView] {+ &self.findings+ }++ #[must_use]+ pub fn unkeyed_crashes(&self) -> usize {+ self.unkeyed_crashes+ }++ #[must_use]+ pub fn total_crashes(&self) -> usize {+ self.total_crashes+ }++ #[must_use]+ pub fn distinct_bugs(&self) -> usize {+ self.findings.iter().filter(|f| f.is_keyed()).count()+ }++ #[must_use]+ pub fn notices(&self) -> &[Notice] {+ &self.notices+ }++ #[must_use]+ pub fn elapsed_secs(&self) -> u64 {+ self.curve.last().map_or(0, |point| point.secs)+ }++ #[must_use]+ pub fn peak_edges(&self) -> u64 {+ self.curve+ .iter()+ .map(|point| point.edges)+ .max()+ .unwrap_or(0)+ }++ #[must_use]+ pub fn lowest_edges(&self) -> u64 {+ self.curve+ .iter()+ .map(|point| point.edges)+ .min()+ .unwrap_or(0)+ }++ #[must_use]+ pub fn latest_execs_per_sec(&self) -> Option<f64> {+ self.curve.last().map(|point| point.execs_per_sec)+ }++ #[must_use]+ pub fn latest_corpus(&self) -> Option<u64> {+ self.curve.last().map(|point| point.corpus)+ }++ #[must_use]+ pub fn is_live(&self) -> bool {+ self.campaign+ .as_ref()+ .is_some_and(|campaign| campaign.phase.is_live())+ }+}++fn read_campaign(+ source: &Source,+ notices: &mut Vec<Notice>,+) -> Result<(Option<CampaignView>, Vec<Crash>), MonitorError> {+ if !source.db.exists() {+ notices.push(Notice::NoCampaignInStore);+ return Ok((None, Vec::new()));+ }+ let store = Store::open(&source.db)?;+ let selected = match source.campaign {+ Some(id) => {+ let campaign_id = CampaignId(id);+ let campaign =+ store+ .get_campaign(campaign_id)?+ .ok_or_else(|| MonitorError::CampaignNotFound {+ id,+ db: source.db.display().to_string(),+ })?;+ Some((campaign_id, campaign))+ }+ None => store.list_campaigns()?.pop(),+ };++ let Some((campaign_id, campaign)) = selected else {+ notices.push(Notice::NoCampaignInStore);+ return Ok((None, Vec::new()));+ };++ let crashes = store.crashes_for_campaign(campaign_id)?;+ Ok((+ Some(CampaignView {+ id: campaign_id.0,+ target: campaign.target().to_owned(),+ phase: Phase::project(campaign.status()),+ }),+ crashes,+ ))+}++fn read_curve(findings: &Path, notices: &mut Vec<Notice>) -> (Vec<CurvePoint>, Option<String>) {+ let Ok(curve) = runner::read_curve(findings) else {+ notices.push(Notice::NoCurveRecorded);+ return (Vec::new(), None);+ };+ if curve.is_empty() {+ notices.push(Notice::NoCurveRecorded);+ return (Vec::new(), None);+ }+ if !curve.edges_are_monotonic() {+ notices.push(Notice::CoverageNotMonotonic);+ }+ let instance = runner::primary_instance(findings)+ .ok()+ .and_then(|dir| dir.file_name().map(|n| n.to_string_lossy().into_owned()));+ (points(&curve), instance)+}++fn points(curve: &CoverageCurve) -> Vec<CurvePoint> {+ curve+ .samples()+ .iter()+ .map(|sample| CurvePoint {+ secs: sample.relative_time,+ edges: sample.edges_found,+ corpus: sample.corpus_count,+ execs_per_sec: sample.execs_per_sec,+ total_execs: sample.total_execs,+ saved_crashes: sample.saved_crashes,+ map_density_pct: sample.map_size_pct,+ })+ .collect()+}++fn read_instances(+ findings: &Path,+ notices: &mut Vec<Notice>,+) -> (Vec<InstanceView>, Option<Totals>) {+ let Ok(instances) = runner::read_instance_stats(findings) else {+ notices.push(Notice::NoInstanceStats);+ return (Vec::new(), None);+ };+ if instances.is_empty() {+ notices.push(Notice::NoInstanceStats);+ return (Vec::new(), None);+ }++ let raw: Vec<_> = instances.iter().map(|i| i.stats.clone()).collect();+ let totals = runner::combine_stats(&raw).map(|combined| Totals {+ execs_done: combined.execs_done,+ execs_per_sec: combined.execs_per_sec,+ edges_found: combined.edges_found,+ total_edges: combined.total_edges,+ saved_crashes: combined.saved_crashes,+ map_density_pct: combined.bitmap_coverage_pct,+ afl_version: combined.afl_version,+ });++ let views = instances+ .iter()+ .map(|instance| InstanceView {+ name: instance.name.clone(),+ is_main: instance.is_main(),+ execs_done: instance.stats.execs_done,+ execs_per_sec: instance.stats.execs_per_sec,+ edges_found: instance.stats.edges_found,+ total_edges: instance.stats.total_edges,+ saved_crashes: instance.stats.saved_crashes,+ map_density_pct: instance.stats.bitmap_coverage_pct,+ })+ .collect();++ (views, totals)+}++fn build_findings(grouping: &dedup::Grouping<'_>) -> Vec<FindingView> {+ let mut findings: Vec<FindingView> = grouping+ .groups()+ .iter()+ .filter_map(|group| {+ group+ .representative()+ .map(|crash| finding(crash, group.len(), Some(group.key().to_owned())))+ })+ .collect();++ findings.extend(+ grouping+ .unkeyed()+ .iter()+ .map(|crash| finding(crash, 1, None)),+ );++ findings.sort_by(|left, right| {+ right+ .severity+ .cmp(&left.severity)+ .then(right.crash_count.cmp(&left.crash_count))+ .then(left.key.cmp(&right.key))+ });+ findings+}++fn finding(crash: &Crash, crash_count: usize, key: Option<String>) -> FindingView {+ let report = SanitizerReport::parse(crash.sanitizer_report());+ let classification = classify::classify(crash.sanitizer_report());++ FindingView {+ key,+ crash_count,+ severity: classification+ .as_ref()+ .map_or(Severity::Unclassified, |c| Severity::project(c.severity())),+ class: classification+ .as_ref()+ .map_or(UNPARSED_KIND, |c| c.class())+ .to_owned(),+ kind: report+ .as_ref()+ .map_or(UNPARSED_KIND, SanitizerReport::kind)+ .to_owned(),+ crash_site: report+ .as_ref()+ .and_then(SanitizerReport::crash_site)+ .map(str::to_owned),+ frames: report.as_ref().map_or_else(Vec::new, |r| {+ r.frames().iter().take(DISPLAYED_FRAMES).cloned().collect()+ }),+ input_bytes: crash.input().len(),+ is_security_relevant: classification+ .as_ref()+ .is_some_and(Classification::is_security_relevant),+ decided_by: classification+ .as_ref()+ .map(Classification::decided_by)+ .map(Decider::project),+ sanitizer_report: crash.sanitizer_report().to_owned(),+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ const KEY: &str = "2167ce84a15da0f82167ce84a15da0f82167ce84a15da0f82167ce84a15da0f8";++ fn view(severity: Severity, crash_count: usize, key: Option<&str>) -> FindingView {+ FindingView {+ key: key.map(str::to_owned),+ crash_count,+ severity,+ class: "heap-buffer-overflow".to_owned(),+ kind: "heap-buffer-overflow".to_owned(),+ crash_site: None,+ frames: Vec::new(),+ input_bytes: 0,+ is_security_relevant: true,+ decided_by: None,+ sanitizer_report: String::new(),+ }+ }++ #[test]+ fn severity_orders_exploitable_above_every_other_verdict() {+ let mut all = [+ Severity::NotExploitable,+ Severity::Exploitable,+ Severity::Unclassified,+ Severity::ProbablyExploitable,+ Severity::Undefined,+ ];+ all.sort_unstable();+ assert_eq!(+ all.last(),+ Some(&Severity::Exploitable),+ "the model sorts findings by this ordering and the view renders that order verbatim, so a wrong Ord puts the worst bug at the bottom of the operator's screen"+ );+ assert_eq!(all.first(), Some(&Severity::Unclassified));+ }++ #[test]+ fn every_triage_severity_projects_without_collapsing_two_into_one() {+ let projected = [+ TriageSeverity::Exploitable,+ TriageSeverity::ProbablyExploitable,+ TriageSeverity::NotExploitable,+ TriageSeverity::Undefined,+ ]+ .map(Severity::project);+ let mut unique = projected.to_vec();+ unique.sort_unstable();+ unique.dedup();+ assert_eq!(+ unique.len(),+ 4,+ "a projection that maps two triage verdicts onto one monitor verdict would silently downgrade a finding"+ );+ }++ #[test]+ fn projected_severity_keeps_the_string_triage_decided() {+ assert_eq!(+ Severity::project(TriageSeverity::Exploitable).as_str(),+ TriageSeverity::Exploitable.as_str(),+ "the view prints this string; if the projection renames a verdict the screen disagrees with `lisdex crashes`"+ );+ }++ #[test]+ fn a_more_severe_bug_outranks_a_more_frequent_one() {+ let findings = {+ let mut all = vec![+ view(Severity::NotExploitable, 90, Some("aaa")),+ view(Severity::Exploitable, 1, Some("bbb")),+ ];+ all.sort_by(|left, right| {+ right+ .severity+ .cmp(&left.severity)+ .then(right.crash_count.cmp(&left.crash_count))+ .then(left.key.cmp(&right.key))+ });+ all+ };+ assert_eq!(+ findings[0].severity,+ Severity::Exploitable,+ "one exploitable write matters more than ninety non-exploitable reads, and the operator reads top-down"+ );+ }++ #[test]+ fn short_key_truncates_on_a_char_boundary_and_names_the_unkeyed() {+ assert_eq!(+ view(Severity::Exploitable, 1, Some(KEY)).short_key().len(),+ SHORT_KEY_LEN+ );+ assert_eq!(+ view(Severity::Exploitable, 1, None).short_key(),+ UNKEYED_LABEL+ );+ }++ #[test]+ fn a_key_shorter_than_the_display_width_is_not_padded_or_panicked_on() {+ assert_eq!(+ view(Severity::Exploitable, 1, Some("abc")).short_key(),+ "abc"+ );+ }++ #[test]+ fn edge_ratio_is_zero_when_the_map_size_is_unknown_rather_than_dividing_by_zero() {+ let totals = Totals {+ execs_done: 0,+ execs_per_sec: 0.0,+ edges_found: 10,+ total_edges: 0,+ saved_crashes: 0,+ map_density_pct: 0.0,+ afl_version: String::new(),+ };+ assert!((totals.edge_ratio() - 0.0).abs() < f64::EPSILON);+ }++ #[test]+ fn edge_ratio_is_clamped_so_a_gauge_can_consume_it_directly() {+ let totals = Totals {+ execs_done: 0,+ execs_per_sec: 0.0,+ edges_found: 9_000,+ total_edges: 3_000,+ saved_crashes: 0,+ map_density_pct: 0.0,+ afl_version: String::new(),+ };+ assert!(+ (totals.edge_ratio() - 1.0).abs() < f64::EPSILON,+ "ratatui's Gauge panics on a ratio outside 0..=1, so the model clamps rather than trusting two independently-read counters"+ );+ }++ #[test]+ fn only_a_live_phase_is_reported_live() {+ assert!(Phase::Fuzzing.is_live());+ assert!(Phase::Building.is_live());+ assert!(!Phase::Completed.is_live());+ assert!(!Phase::Failed.is_live());+ assert!(!Phase::Pending.is_live());+ }++ #[test]+ fn every_campaign_status_projects_to_a_distinct_phase() {+ let projected = [+ CampaignStatus::Pending,+ CampaignStatus::Building,+ CampaignStatus::Fuzzing,+ CampaignStatus::Completed,+ CampaignStatus::Failed,+ ]+ .map(Phase::project);+ let mut labels: Vec<&str> = projected.iter().map(|p| p.as_str()).collect();+ labels.sort_unstable();+ labels.dedup();+ assert_eq!(labels.len(), 5);+ }++ #[test]+ fn an_empty_snapshot_reports_nothing_rather_than_defaulting_to_zeroes_that_look_real() {+ let empty = Snapshot::empty();+ assert!(empty.campaign().is_none());+ assert!(empty.totals().is_none());+ assert!(empty.curve().is_empty());+ assert!(empty.findings().is_empty());+ assert_eq!(empty.distinct_bugs(), 0);+ assert_eq!(empty.elapsed_secs(), 0);+ assert_eq!(empty.peak_edges(), 0);+ }++ #[test]+ fn every_notice_carries_a_message_an_operator_can_act_on() {+ for notice in [+ Notice::NoCurveRecorded,+ Notice::NoInstanceStats,+ Notice::CoverageNotMonotonic,+ Notice::NoCampaignInStore,+ Notice::UnkeyedCrashes(3),+ ] {+ assert!(notice.message().len() > 20);+ }+ }++ #[test]+ fn the_unkeyed_notice_states_the_count_it_was_given() {+ assert!(Notice::UnkeyedCrashes(7).message().contains('7'));+ assert_ne!(+ Notice::UnkeyedCrashes(1).message(),+ Notice::UnkeyedCrashes(2).message(),+ "a notice that renders the same text for any count is not reporting the campaign's state"+ );+ }++ #[test]+ fn every_triage_decider_projects_to_a_distinct_label() {+ let labels = [DecidedBy::Casr, DecidedBy::Lisdex]+ .map(Decider::project)+ .map(Decider::as_str);+ assert_eq!(labels, ["casr", "lisdex"]);+ }++ #[test]+ fn an_unclassified_finding_names_no_decider_rather_than_debug_printing_one() {+ let unclassified = FindingView {+ decided_by: None,+ ..view(Severity::Unclassified, 1, None)+ };+ assert_eq!(unclassified.decider(), "unclassified");+ }++ #[test]+ fn a_finding_that_could_not_be_keyed_states_why_instead_of_showing_an_empty_field() {+ assert_eq!(+ view(Severity::Exploitable, 1, None).key_status(),+ NO_KEY_REASON+ );+ assert_eq!(view(Severity::Exploitable, 1, Some(KEY)).key_status(), KEY);+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/tests/real_campaign.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/tests/real_campaign.rsnew file mode 100644index 00000000..be86807f--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-monitor/tests/real_campaign.rs@@ -0,0 +1,449 @@+// ©AngelaMos | 2026+// real_campaign.rs++use std::path::PathBuf;++use lisdex_core::campaign::{Campaign, CampaignStatus};+use lisdex_core::crash::Crash;+use lisdex_core::store::Store;+use lisdex_monitor::snapshot::{MonitorError, Notice, Severity, Snapshot, Source};++const REAL_PLOT: &str = include_str!("../../lisdex-fuzz/tests/fixtures/plot_data.txt");+const REAL_HEAP_WRITE: &str = include_str!("../../lisdex-triage/tests/fixtures/heapw.txt");+const REAL_HEAP_READ: &str = include_str!("../../lisdex-triage/tests/fixtures/heapr.txt");++const KEYED_WRITE_REPORT: &str = "\+=================================================================+==53767==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7bd6bfde0020 at pc 0x558474e40fd9+WRITE of size 32 at 0x7bd6bfde0020 thread T0+ #0 0x558474e40fd8 in png_handle_PLTE /src/libpng/pngrutil.c:992:4+ #1 0x558474e41111 in png_read_info /src/libpng/pngread.c:160:10+SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/harness+0xcdfd8) in png_handle_PLTE+";++const KEYED_READ_REPORT: &str = "\+=================================================================+==53768==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7bc207fe0020 at pc 0x55afa18b1a77+READ of size 1 at 0x7bc207fe0020 thread T0+ #0 0x55afa18b1a76 in png_handle_tRNS /src/libpng/pngrutil.c:1470:9+ #1 0x55afa18b2200 in png_read_info /src/libpng/pngread.c:171:10+SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/harness+0x114a76) in png_handle_tRNS+";++const MAIN_STATS: &str = "\+start_time : 1784982517+last_update : 1784983139+run_time : 600+fuzzer_pid : 2790+cycles_done : 64+execs_done : 34283406+execs_per_sec : 71170.98+execs_ps_last_min : 70000.00+corpus_count : 1413+bitmap_cvg : 19.74%+saved_crashes : 80+saved_hangs : 0+edges_found : 13647+total_edges : 69140+auto_dict_entries : 53+afl_banner : lisdex_libpng_read+afl_version : ++5.02c+target_mode : persistent shmem_testcase deferred+";++const SECONDARY_STATS: &str = "\+start_time : 1784982517+last_update : 1784983139+run_time : 600+fuzzer_pid : 2791+cycles_done : 58+execs_done : 30000000+execs_per_sec : 65000.00+execs_ps_last_min : 64000.00+corpus_count : 1290+bitmap_cvg : 18.80%+saved_crashes : 60+saved_hangs : 0+edges_found : 13000+total_edges : 69140+auto_dict_entries : 53+afl_banner : lisdex_libpng_read+afl_version : ++5.02c+target_mode : persistent shmem_testcase deferred+";++struct Lab {+ root: PathBuf,+}++impl Lab {+ fn new(name: &str) -> Lab {+ let root = std::env::temp_dir().join(format!(+ "lisdex-monitor-{name}-{}-{:?}",+ std::process::id(),+ std::thread::current().id()+ ));+ let _ = std::fs::remove_dir_all(&root);+ std::fs::create_dir_all(&root).unwrap();+ Lab { root }+ }++ fn findings(&self) -> PathBuf {+ self.root.join("findings")+ }++ fn db(&self) -> PathBuf {+ self.root.join("lisdex.sqlite")+ }++ fn instance(&self, name: &str, stats: &str, plot: Option<&str>) -> &Lab {+ let dir = self.findings().join(name);+ std::fs::create_dir_all(&dir).unwrap();+ std::fs::write(dir.join("fuzzer_stats"), stats).unwrap();+ if let Some(plot) = plot {+ std::fs::write(dir.join("plot_data"), plot).unwrap();+ }+ self+ }++ fn finished(&self) -> &Lab {+ let store = Store::open(self.db()).unwrap();+ let (id, _) = store.list_campaigns().unwrap().pop().unwrap();+ store+ .update_campaign_status(id, CampaignStatus::Completed)+ .unwrap();+ self+ }++ fn campaign(&self, target: &str, reports: &[&str]) -> &Lab {+ let store = Store::open(self.db()).unwrap();+ let mut campaign = Campaign::new(target);+ let id = store.insert_campaign(&campaign).unwrap();+ campaign.advance(CampaignStatus::Building).unwrap();+ campaign.advance(CampaignStatus::Fuzzing).unwrap();+ store+ .update_campaign_status(id, CampaignStatus::Fuzzing)+ .unwrap();+ for (index, report) in reports.iter().enumerate() {+ store+ .insert_crash(&Crash::from_report(+ id,+ format!("input-{index}").into_bytes(),+ *report,+ ))+ .unwrap();+ }+ self+ }++ fn source(&self) -> Source {+ Source {+ db: self.db(),+ findings: self.findings(),+ campaign: None,+ }+ }++ fn read(&self) -> Snapshot {+ Snapshot::read(&self.source()).unwrap()+ }+}++impl Drop for Lab {+ fn drop(&mut self) {+ let _ = std::fs::remove_dir_all(&self.root);+ }+}++fn full_lab(name: &str) -> Lab {+ let lab = Lab::new(name);+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ lab.instance("secondary1", SECONDARY_STATS, None);+ lab.campaign(+ "lisdex_libpng_read",+ &[KEYED_WRITE_REPORT, KEYED_WRITE_REPORT, KEYED_READ_REPORT],+ );+ lab+}++#[test]+fn a_snapshot_of_a_real_campaign_carries_every_panel_the_monitor_renders() {+ let snapshot = full_lab("full").read();++ let campaign = snapshot.campaign().expect("the store holds a campaign");+ assert_eq!(campaign.target, "lisdex_libpng_read");+ assert!(campaign.phase.is_live());+ assert!(+ snapshot.curve().len() > 100,+ "the curve comes from the 600s magma libpng capture; a parser reading only the first rows would still look green on a two-row fixture"+ );+ assert_eq!(snapshot.instances().len(), 2);+ assert!(snapshot.totals().is_some());+ assert_eq!(snapshot.distinct_bugs(), 2);+ assert_eq!(snapshot.total_crashes(), 3);+}++#[test]+fn the_curve_comes_from_the_main_instance_when_several_are_running() {+ let lab = Lab::new("curve-source");+ lab.instance("secondary1", SECONDARY_STATS, Some(REAL_PLOT));+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ lab.campaign("libpng", &[]);+ assert_eq!(+ lab.read().curve_instance(),+ Some("main"),+ "instances share one coverage map, so the curve must be read from one authoritative instance rather than whichever the directory listing returned first"+ );+}++#[test]+fn a_single_instance_campaign_reads_its_curve_from_the_default_directory() {+ let lab = Lab::new("single");+ lab.instance("default", MAIN_STATS, Some(REAL_PLOT));+ lab.campaign("libpng", &[]);+ let snapshot = lab.read();+ assert_eq!(snapshot.curve_instance(), Some("default"));+ assert!(!snapshot.curve().is_empty());+}++#[test]+fn totals_take_the_highest_coverage_and_never_the_sum_of_it() {+ let totals = full_lab("totals")+ .read()+ .totals()+ .expect("two instances wrote stats")+ .clone();+ assert_eq!(+ totals.edges_found, 13_647,+ "instances share one coverage map and sync; summing edges_found would report 26647 edges the campaign never had"+ );+ assert_eq!(+ totals.execs_done, 64_283_406,+ "work really is additive across instances, unlike coverage"+ );+ assert_eq!(totals.saved_crashes, 140);+ assert_eq!(totals.afl_version, "++5.02c");+}++#[test]+fn the_edge_ratio_a_gauge_consumes_matches_the_counters_it_came_from() {+ let totals = full_lab("ratio").read().totals().unwrap().clone();+ let expected = 13_647.0_f64 / 69_140.0_f64;+ assert!((totals.edge_ratio() - expected).abs() < 1e-9);+ assert!((0.0..=1.0).contains(&totals.edge_ratio()));+}++#[test]+fn a_crash_seen_twice_is_one_finding_that_counts_two() {+ let findings = full_lab("dedup").read().findings().to_vec();+ let repeated = findings+ .iter()+ .find(|finding| finding.crash_count == 2)+ .expect("the write overflow was stored twice under one key");+ assert!(repeated.is_keyed());+ assert_eq!(repeated.crash_site.as_deref(), Some("png_handle_PLTE"));+}++#[test]+fn a_write_overflow_outranks_a_read_overflow_on_screen() {+ let findings = full_lab("severity-order").read().findings().to_vec();+ assert_eq!(+ findings[0].severity,+ Severity::Exploitable,+ "the read/write axis is the dominant severity factor, and the operator reads the list top-down"+ );+ assert_eq!(findings[0].crash_site.as_deref(), Some("png_handle_PLTE"));+ assert_eq!(+ findings[1].severity,+ Severity::NotExploitable,+ "a heap read overflow is not exploitable by the shipped classifier, whatever a severity table would have published"+ );+}++#[test]+fn unsymbolized_captures_appear_as_findings_that_were_never_keyed() {+ let lab = Lab::new("unkeyed");+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ lab.campaign("libpng", &[REAL_HEAP_WRITE, REAL_HEAP_READ]);+ let snapshot = lab.read();+ assert_eq!(+ snapshot.distinct_bugs(),+ 0,+ "these are real captures taken unsymbolized, so keying them would key on a module offset shared by every crash of that kind"+ );+ assert_eq!(snapshot.unkeyed_crashes(), 2);+ assert_eq!(snapshot.findings().len(), 2);+ assert!(+ snapshot.notices().contains(&Notice::UnkeyedCrashes(2)),+ "the refusal to key is the model's decision, so the model states it; a renderer inventing that sentence could contradict dedup without a single test going red"+ );+ for finding in snapshot.findings() {+ assert!(!finding.is_keyed());+ assert_eq!(finding.short_key(), "unkeyed");+ }+}++#[test]+fn an_unsymbolized_capture_is_still_classified_even_though_it_cannot_be_keyed() {+ let lab = Lab::new("unkeyed-severity");+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ lab.campaign("libpng", &[REAL_HEAP_WRITE]);+ let snapshot = lab.read();+ let finding = &snapshot.findings()[0];+ assert_eq!(+ finding.severity,+ Severity::Exploitable,+ "refusing to key a crash must not also discard its severity; the operator still needs to see it"+ );+ assert!(finding.is_security_relevant);+ assert!(finding.decided_by.is_some());+}++#[test]+fn a_findings_directory_that_does_not_exist_yet_is_a_notice_not_an_error() {+ let lab = Lab::new("no-findings");+ lab.campaign("libpng", &[]);+ let snapshot = lab.read();+ assert!(snapshot.notices().contains(&Notice::NoCurveRecorded));+ assert!(snapshot.notices().contains(&Notice::NoInstanceStats));+ assert!(+ snapshot.campaign().is_some(),+ "a campaign that has been recorded but has not started fuzzing must still render"+ );+}++#[test]+fn a_store_that_does_not_exist_yet_is_a_notice_not_an_error() {+ let lab = Lab::new("no-db");+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ let snapshot = lab.read();+ assert!(snapshot.notices().contains(&Notice::NoCampaignInStore));+ assert!(snapshot.campaign().is_none());+ assert!(+ !snapshot.curve().is_empty(),+ "a live campaign writes its curve before anything asks the store for it"+ );+}++#[test]+fn a_resumed_campaign_is_reported_as_resumed_rather_than_silently_understated() {+ let lab = Lab::new("resumed");+ let concatenated = format!("{REAL_PLOT}{}", strip_header(REAL_PLOT));+ lab.instance("main", MAIN_STATS, Some(&concatenated));+ lab.campaign("libpng", &[]);+ assert!(+ lab.read().notices().contains(&Notice::CoverageNotMonotonic),+ "resuming genuinely concatenates plot_data, and a first-to-last delta computed over the join understates coverage"+ );+}++#[test]+fn one_campaign_run_is_not_reported_as_resumed() {+ assert!(+ !full_lab("not-resumed")+ .read()+ .notices()+ .contains(&Notice::CoverageNotMonotonic),+ "if this fires on a single unmodified capture the monotonicity check is a constant and proves nothing about the resumed case"+ );+}++#[test]+fn with_no_campaign_named_the_most_recent_one_is_shown() {+ let lab = Lab::new("latest");+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ let store = Store::open(lab.db()).unwrap();+ for target in ["libpng", "libtiff", "openjpeg"] {+ store.insert_campaign(&Campaign::new(target)).unwrap();+ }+ drop(store);+ assert_eq!(lab.read().campaign().unwrap().target, "openjpeg");+}++#[test]+fn a_named_campaign_is_shown_instead_of_the_most_recent_one() {+ let lab = Lab::new("named");+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ let store = Store::open(lab.db()).unwrap();+ let mut first = None;+ for target in ["libpng", "libtiff"] {+ let id = store.insert_campaign(&Campaign::new(target)).unwrap();+ first.get_or_insert(id);+ }+ drop(store);+ let source = Source {+ campaign: Some(first.unwrap().0),+ ..lab.source()+ };+ let snapshot = Snapshot::read(&source).unwrap();+ assert_eq!(snapshot.campaign().unwrap().target, "libpng");+}++#[test]+fn naming_a_campaign_the_store_does_not_hold_is_an_error_not_an_empty_screen() {+ let lab = Lab::new("missing-campaign");+ lab.campaign("libpng", &[]);+ let source = Source {+ campaign: Some(9999),+ ..lab.source()+ };+ let err = Snapshot::read(&source).unwrap_err();+ assert!(+ matches!(err, MonitorError::CampaignNotFound { id: 9999, .. }),+ "silently falling back to another campaign would show an operator numbers from a run they did not ask about"+ );+}++#[test]+fn a_finished_campaign_is_not_reported_as_live_even_though_its_stats_files_remain() {+ let lab = full_lab("finished");+ lab.finished();+ let snapshot = lab.read();+ assert!(+ !snapshot.is_live(),+ "afl-fuzz leaves fuzzer_stats on disk after it exits, so instance count can never be the liveness signal; only the campaign's own phase is"+ );+ assert_eq!(+ snapshot.instances().len(),+ 2,+ "the dead instances must still be readable; the fix is to stop calling them running, not to hide them"+ );+}++#[test]+fn a_running_campaign_is_reported_as_live() {+ assert!(+ full_lab("still-running").read().is_live(),+ "if this is false for a fuzzing campaign the liveness check is a constant and proves nothing about the finished case"+ );+}++#[test]+fn elapsed_and_peak_come_from_the_curve_the_campaign_actually_wrote() {+ let snapshot = full_lab("elapsed").read();+ assert_eq!(snapshot.elapsed_secs(), 600);+ assert_eq!(+ snapshot.peak_edges(),+ 13_647,+ "the peak comes from the curve on disk, not from the stats file; reading it from the wrong source would report the first sample as the best one"+ );+}++#[test]+fn instance_roles_are_reported_so_a_reader_can_tell_which_map_is_authoritative() {+ let snapshot = full_lab("roles").read();+ let main = snapshot+ .instances()+ .iter()+ .find(|instance| instance.is_main)+ .expect("one instance is the main");+ assert_eq!(main.name, "main");+ assert_eq!(snapshot.instances().iter().filter(|i| i.is_main).count(), 1);+}++fn strip_header(plot: &str) -> String {+ plot.lines()+ .filter(|line| !line.trim_start().starts_with('#'))+ .collect::<Vec<_>>()+ .join("\n")+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/Cargo.tomlnew file mode 100644index 00000000..a0851d4b--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/Cargo.toml@@ -0,0 +1,21 @@+# ©AngelaMos | 2026+# Cargo.toml++[package]+name = "lisdex-tui"+version = "0.0.0"+edition.workspace = true+rust-version.workspace = true+license.workspace = true+authors.workspace = true++[dependencies]+lisdex-monitor = { workspace = true }+ratatui = { workspace = true }+thiserror = { workspace = true }++[dev-dependencies]+lisdex-core = { workspace = true }++[lints]+workspace = truediff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/app.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/app.rsnew file mode 100644index 00000000..2a046465--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/app.rs@@ -0,0 +1,347 @@+// ©AngelaMos | 2026+// app.rs++use std::time::{Duration, Instant};++use lisdex_monitor::snapshot::{MonitorError, Snapshot, Source};++pub const DEFAULT_REFRESH_MS: u64 = 1000;+pub const INPUT_POLL_MS: u64 = 80;+pub const DETAIL_SCROLL_STEP: u16 = 5;++#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum Tab {+ Overview,+ Findings,+ Instances,+}++impl Tab {+ pub const ALL: [Tab; 3] = [Tab::Overview, Tab::Findings, Tab::Instances];++ #[must_use]+ pub fn title(self) -> &'static str {+ match self {+ Tab::Overview => "OVERVIEW",+ Tab::Findings => "FINDINGS",+ Tab::Instances => "INSTANCES",+ }+ }++ #[must_use]+ pub fn index(self) -> usize {+ match self {+ Tab::Overview => 0,+ Tab::Findings => 1,+ Tab::Instances => 2,+ }+ }++ #[must_use]+ pub fn next(self) -> Tab {+ Tab::ALL[(self.index() + 1) % Tab::ALL.len()]+ }++ #[must_use]+ pub fn previous(self) -> Tab {+ Tab::ALL[(self.index() + Tab::ALL.len() - 1) % Tab::ALL.len()]+ }+}++#[derive(Debug, Clone, Copy, PartialEq, Eq)]+pub enum Action {+ Quit,+ NextTab,+ PreviousTab,+ SelectTab(Tab),+ Down,+ Up,+ First,+ Last,+ ScrollDetailDown,+ ScrollDetailUp,+ TogglePause,+ Refresh,+ Ignore,+}++pub struct App {+ source: Source,+ snapshot: Snapshot,+ error: Option<String>,+ tab: Tab,+ selected: usize,+ detail_scroll: u16,+ paused: bool,+ refresh: Duration,+ last_refresh: Instant,+ ticks: u64,+ running: bool,+}++impl App {+ #[must_use]+ pub fn new(source: Source, refresh: Duration) -> App {+ let mut app = App {+ source,+ snapshot: Snapshot::empty(),+ error: None,+ tab: Tab::Overview,+ selected: 0,+ detail_scroll: 0,+ paused: false,+ refresh,+ last_refresh: Instant::now(),+ ticks: 0,+ running: true,+ };+ app.reload();+ app+ }++ #[must_use]+ pub fn from_snapshot(snapshot: Snapshot) -> App {+ App {+ source: Source {+ db: std::path::PathBuf::new(),+ findings: std::path::PathBuf::new(),+ campaign: None,+ },+ snapshot,+ error: None,+ tab: Tab::Overview,+ selected: 0,+ detail_scroll: 0,+ paused: true,+ refresh: Duration::from_millis(DEFAULT_REFRESH_MS),+ last_refresh: Instant::now(),+ ticks: 0,+ running: true,+ }+ }++ #[must_use]+ pub fn snapshot(&self) -> &Snapshot {+ &self.snapshot+ }++ #[must_use]+ pub fn tab(&self) -> Tab {+ self.tab+ }++ #[must_use]+ pub fn set_tab(&mut self, tab: Tab) -> Tab {+ self.tab = tab;+ tab+ }++ #[must_use]+ pub fn selected(&self) -> usize {+ self.selected+ }++ #[must_use]+ pub fn detail_scroll(&self) -> u16 {+ self.detail_scroll+ }++ #[must_use]+ pub fn is_paused(&self) -> bool {+ self.paused+ }++ #[must_use]+ pub fn is_running(&self) -> bool {+ self.running+ }++ #[must_use]+ pub fn ticks(&self) -> u64 {+ self.ticks+ }++ #[must_use]+ pub fn error(&self) -> Option<&str> {+ self.error.as_deref()+ }++ #[must_use]+ pub fn refresh_interval(&self) -> Duration {+ self.refresh+ }++ pub fn tick(&mut self) {+ self.ticks = self.ticks.wrapping_add(1);+ }++ pub fn reload(&mut self) {+ match Snapshot::read(&self.source) {+ Ok(snapshot) => {+ self.snapshot = snapshot;+ self.error = None;+ self.clamp_selection();+ }+ Err(err) => self.error = Some(describe(&err)),+ }+ self.last_refresh = Instant::now();+ }++ pub fn reload_if_due(&mut self) {+ if !self.paused && self.last_refresh.elapsed() >= self.refresh {+ self.reload();+ }+ }++ pub fn apply(&mut self, action: Action) {+ match action {+ Action::Quit => self.running = false,+ Action::NextTab => self.tab = self.tab.next(),+ Action::PreviousTab => self.tab = self.tab.previous(),+ Action::SelectTab(tab) => self.tab = tab,+ Action::Down => self.move_selection(true),+ Action::Up => self.move_selection(false),+ Action::First => {+ self.selected = 0;+ self.detail_scroll = 0;+ }+ Action::Last => {+ self.selected = self.snapshot.findings().len().saturating_sub(1);+ self.detail_scroll = 0;+ }+ Action::ScrollDetailDown => {+ self.detail_scroll = self.detail_scroll.saturating_add(DETAIL_SCROLL_STEP);+ }+ Action::ScrollDetailUp => {+ self.detail_scroll = self.detail_scroll.saturating_sub(DETAIL_SCROLL_STEP);+ }+ Action::TogglePause => self.paused = !self.paused,+ Action::Refresh => self.reload(),+ Action::Ignore => {}+ }+ }++ fn move_selection(&mut self, forward: bool) {+ self.detail_scroll = 0;+ let count = self.snapshot.findings().len();+ if count == 0 {+ self.selected = 0;+ return;+ }+ self.selected = if forward {+ (self.selected + 1).min(count - 1)+ } else {+ self.selected.saturating_sub(1)+ };+ }++ fn clamp_selection(&mut self) {+ let count = self.snapshot.findings().len();+ if count == 0 {+ self.selected = 0;+ } else if self.selected >= count {+ self.selected = count - 1;+ }+ }+}++fn describe(err: &MonitorError) -> String {+ err.to_string()+}++#[cfg(test)]+mod tests {+ use super::*;++ fn app() -> App {+ App::from_snapshot(Snapshot::empty())+ }++ #[test]+ fn tabs_cycle_forwards_and_backwards_without_falling_off_the_end() {+ assert_eq!(Tab::Overview.next(), Tab::Findings);+ assert_eq!(Tab::Instances.next(), Tab::Overview);+ assert_eq!(Tab::Overview.previous(), Tab::Instances);+ assert_eq!(Tab::Findings.previous(), Tab::Overview);+ }++ #[test]+ fn every_tab_has_a_distinct_title_and_index() {+ let mut titles: Vec<&str> = Tab::ALL.iter().map(|tab| tab.title()).collect();+ titles.sort_unstable();+ titles.dedup();+ assert_eq!(titles.len(), Tab::ALL.len());+ for (index, tab) in Tab::ALL.iter().enumerate() {+ assert_eq!(tab.index(), index);+ }+ }++ #[test]+ fn quit_stops_the_loop() {+ let mut app = app();+ assert!(app.is_running());+ app.apply(Action::Quit);+ assert!(!app.is_running());+ }++ #[test]+ fn moving_the_selection_over_an_empty_finding_list_never_indexes_past_the_end() {+ let mut app = app();+ for action in [Action::Down, Action::Down, Action::Last, Action::Up] {+ app.apply(action);+ assert_eq!(+ app.selected(),+ 0,+ "a campaign with no crashes yet must not select a row the renderer would then index"+ );+ }+ }++ #[test]+ fn scrolling_the_detail_pane_up_from_the_top_stays_at_the_top() {+ let mut app = app();+ app.apply(Action::ScrollDetailUp);+ assert_eq!(app.detail_scroll(), 0);+ app.apply(Action::ScrollDetailDown);+ assert_eq!(app.detail_scroll(), DETAIL_SCROLL_STEP);+ app.apply(Action::ScrollDetailUp);+ assert_eq!(app.detail_scroll(), 0);+ }++ #[test]+ fn changing_the_selection_returns_the_detail_pane_to_the_top() {+ let mut app = app();+ app.apply(Action::ScrollDetailDown);+ app.apply(Action::Down);+ assert_eq!(+ app.detail_scroll(),+ 0,+ "keeping the old offset would open a shorter report scrolled past its end"+ );+ }++ #[test]+ fn pausing_toggles_and_a_paused_app_does_not_reload_on_its_own() {+ let mut app = app();+ assert!(app.is_paused());+ app.apply(Action::TogglePause);+ assert!(!app.is_paused());+ app.apply(Action::TogglePause);+ assert!(app.is_paused());+ }++ #[test]+ fn a_tab_can_be_selected_directly() {+ let mut app = app();+ app.apply(Action::SelectTab(Tab::Instances));+ assert_eq!(app.tab(), Tab::Instances);+ }++ #[test]+ fn ticks_wrap_rather_than_overflowing_the_animation_counter() {+ let mut app = app();+ app.ticks = u64::MAX;+ app.tick();+ assert_eq!(app.ticks(), 0);+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/chrome.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/chrome.rsnew file mode 100644index 00000000..dfa4d737--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/chrome.rs@@ -0,0 +1,160 @@+// ©AngelaMos | 2026+// chrome.rs++use ratatui::Frame;+use ratatui::layout::{Alignment, Rect};+use ratatui::style::{Modifier, Style};+use ratatui::text::{Line, Span};+use ratatui::widgets::{Paragraph, Tabs};++use crate::app::{App, Tab};+use crate::format;+use crate::theme;++pub const HEADER_HEIGHT: u16 = 3;+pub const TABS_HEIGHT: u16 = 1;+pub const FOOTER_HEIGHT: u16 = 2;++const TAGLINE: &str = "keyless memory-corruption scanner";+const RULE_CHAR: &str = "━";+const RULE_SEGMENTS: u16 = 14;+const KEYS: &str = "q quit · tab/1-3 panel · j/k select · g/G first/last · J/K scroll report · p pause · r refresh";++pub fn header(frame: &mut Frame, area: Rect, app: &App) {+ let lines = vec![wordmark(), status(app), rule(area.width, app.ticks())];+ frame.render_widget(Paragraph::new(lines).style(theme::panel()), area);+}++fn wordmark() -> Line<'static> {+ let mut spans = vec![Span::raw(" ")];+ for (letter, colour) in theme::WORDMARK {+ spans.push(Span::styled(+ letter.to_string(),+ Style::default().fg(colour).add_modifier(Modifier::BOLD),+ ));+ spans.push(Span::raw(" "));+ }+ spans.push(Span::styled(" ", theme::dim()));+ spans.push(Span::styled(TAGLINE, theme::dim()));+ Line::from(spans)+}++fn status(app: &App) -> Line<'static> {+ let snapshot = app.snapshot();+ let Some(campaign) = snapshot.campaign() else {+ return Line::from(vec![+ Span::raw(" "),+ Span::styled("no campaign in store", theme::label()),+ ]);+ };+ let mut spans = vec![+ Span::raw(" "),+ Span::styled(+ format!(" {} ", campaign.phase.as_str()),+ Style::default()+ .fg(theme::PANEL)+ .bg(theme::phase_color(campaign.phase))+ .add_modifier(Modifier::BOLD),+ ),+ Span::raw(" "),+ Span::styled(campaign.target.clone(), theme::value(theme::INK)),+ Span::styled(format!(" #{}", campaign.id), theme::dim()),+ ];+ spans.extend(field("elapsed", &format::duration(snapshot.elapsed_secs())));+ spans.extend(field("bugs", &snapshot.distinct_bugs().to_string()));+ spans.extend(field("crashes", &snapshot.total_crashes().to_string()));+ if let Some(totals) = snapshot.totals() {+ spans.extend(field("afl", &totals.afl_version));+ }+ if app.is_paused() {+ spans.push(Span::styled(" PAUSED", theme::value(theme::AMBER)));+ }+ Line::from(spans)+}++fn field(name: &str, value: &str) -> Vec<Span<'static>> {+ vec![+ Span::styled(format!(" {name} "), theme::label()),+ Span::styled(value.to_owned(), theme::value(theme::INK)),+ ]+}++fn rule(width: u16, ticks: u64) -> Line<'static> {+ if width == 0 {+ return Line::default();+ }+ let segment = (width / RULE_SEGMENTS).max(1);+ let mut spans = Vec::new();+ let mut drawn = 0;+ let mut index = 0;+ while drawn < width {+ let take = segment.min(width - drawn);+ let shift = usize::try_from(ticks / 2).unwrap_or(0);+ spans.push(Span::styled(+ RULE_CHAR.repeat(take as usize),+ Style::default().fg(theme::ramp_at(index + shift)),+ ));+ drawn += take;+ index += 1;+ }+ Line::from(spans)+}++pub fn tabs(frame: &mut Frame, area: Rect, app: &App) {+ let titles: Vec<Line<'static>> = Tab::ALL+ .iter()+ .enumerate()+ .map(|(index, tab)| {+ Line::from(Span::styled(+ format!(" {} {} ", index + 1, tab.title()),+ Style::default().fg(theme::SLATE),+ ))+ })+ .collect();+ let widget = Tabs::new(titles)+ .select(app.tab().index())+ .divider(Span::styled("│", theme::border()))+ .padding("", "")+ .highlight_style(+ Style::default()+ .fg(theme::NEON_CYAN)+ .add_modifier(Modifier::BOLD | Modifier::REVERSED),+ )+ .style(theme::panel());+ frame.render_widget(widget, area);+}++pub fn footer(frame: &mut Frame, area: Rect, app: &App) {+ let lines = vec![+ notice_line(app),+ Line::from(Span::styled(KEYS, theme::dim())),+ ];+ frame.render_widget(+ Paragraph::new(lines)+ .style(theme::panel())+ .alignment(Alignment::Left),+ area,+ );+}++fn notice_line(app: &App) -> Line<'static> {+ if let Some(error) = app.error() {+ return Line::from(vec![+ Span::styled(" ERROR ", theme::value(theme::HOT_RED)),+ Span::styled(error.to_owned(), Style::default().fg(theme::HOT_RED)),+ ]);+ }+ let snapshot = app.snapshot();+ let mut spans = Vec::new();+ for notice in snapshot.notices() {+ spans.push(Span::styled(" ! ", theme::value(theme::AMBER)));+ spans.push(Span::styled(notice.message(), theme::label()));+ }+ if spans.is_empty() {+ return Line::from(Span::styled(+ " nothing is re-analysed here; every number is read from the campaign's own artifacts",+ theme::dim(),+ ));+ }+ Line::from(spans)+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/findings.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/findings.rsnew file mode 100644index 00000000..17477379--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/findings.rs@@ -0,0 +1,193 @@+// ©AngelaMos | 2026+// findings.rs++use lisdex_monitor::snapshot::{FindingView, NO_FRAMES_REASON};+use ratatui::Frame;+use ratatui::layout::{Constraint, Layout, Rect};+use ratatui::style::{Modifier, Style};+use ratatui::text::{Line, Span};+use ratatui::widgets::{Paragraph, Row, Table, TableState, Wrap};++use crate::app::App;+use crate::format;+use crate::overview::{panel, placeholder};+use crate::theme;++const SELECTED_MARKER: &str = "▐ ";+const NO_SITE: &str = "-";++pub fn render(frame: &mut Frame, area: Rect, app: &App) {+ let snapshot = app.snapshot();+ if snapshot.findings().is_empty() {+ placeholder(+ frame,+ area,+ "FINDINGS",+ theme::HOT_RED,+ "no crash has been persisted for this campaign yet",+ );+ return;+ }+ let [list, detail] =+ Layout::horizontal([Constraint::Percentage(52), Constraint::Percentage(48)]).areas(area);+ table(frame, list, app);+ report(frame, detail, app);+}++fn table(frame: &mut Frame, area: Rect, app: &App) {+ let snapshot = app.snapshot();+ let rows: Vec<Row<'static>> = snapshot.findings().iter().map(row).collect();+ let widget = Table::new(+ rows,+ [+ Constraint::Length(20),+ Constraint::Length(13),+ Constraint::Length(5),+ Constraint::Min(16),+ ],+ )+ .header(+ Row::new(vec!["SEVERITY", "KEY", "SEEN", "SITE"])+ .style(theme::title(theme::SLATE))+ .height(1),+ )+ .block(panel(+ &format!(+ "FINDINGS {} distinct {} crashes",+ snapshot.distinct_bugs(),+ snapshot.total_crashes()+ ),+ theme::HOT_RED,+ ))+ .column_spacing(1)+ .row_highlight_style(+ Style::default()+ .bg(theme::EDGE)+ .add_modifier(Modifier::BOLD),+ )+ .highlight_symbol(Span::styled(+ SELECTED_MARKER,+ theme::value(theme::NEON_CYAN),+ ));++ let mut state = TableState::default().with_selected(Some(app.selected()));+ frame.render_stateful_widget(widget, area, &mut state);+}++fn row(finding: &FindingView) -> Row<'static> {+ let marker = if finding.is_security_relevant {+ ""+ } else {+ " (non-security)"+ };+ Row::new(vec![+ Span::styled(+ format!("{}{marker}", finding.severity.as_str()),+ theme::severity_style(finding.severity),+ ),+ Span::styled(+ finding.short_key(),+ if finding.is_keyed() {+ theme::value(theme::INK)+ } else {+ theme::dim()+ },+ ),+ Span::styled(format!("x{}", finding.crash_count), theme::label()),+ Span::styled(+ finding+ .crash_site+ .clone()+ .unwrap_or_else(|| NO_SITE.to_owned()),+ Style::default().fg(theme::NEON_CYAN),+ ),+ ])+}++fn report(frame: &mut Frame, area: Rect, app: &App) {+ let snapshot = app.snapshot();+ let Some(finding) = snapshot.findings().get(app.selected()) else {+ placeholder(+ frame,+ area,+ "REPORT",+ theme::NEON_VIOLET,+ "select a finding to read its report",+ );+ return;+ };++ let mut lines = vec![+ pair(+ "class",+ &finding.class,+ theme::severity_color(finding.severity),+ ),+ pair("kind", &finding.kind, theme::INK),+ pair(+ "severity",+ finding.severity.as_str(),+ theme::severity_color(finding.severity),+ ),+ pair("decided by", finding.decider(), theme::NEON_BLUE),+ pair(+ "reproducer",+ &format::bytes(finding.input_bytes),+ theme::INK,+ ),+ pair(+ "stack key",+ &finding.key_status(),+ if finding.is_keyed() {+ theme::ACID_GREEN+ } else {+ theme::AMBER+ },+ ),+ Line::default(),+ Line::from(Span::styled("FRAMES", theme::title(theme::SLATE))),+ ];++ for (index, frame_name) in finding.frames.iter().enumerate() {+ lines.push(Line::from(vec![+ Span::styled(format!(" #{index} "), theme::dim()),+ Span::styled(frame_name.clone(), Style::default().fg(theme::NEON_CYAN)),+ ]));+ }+ if finding.frames.is_empty() {+ lines.push(Line::from(Span::styled(+ format!(" {NO_FRAMES_REASON}"),+ theme::dim(),+ )));+ }++ lines.push(Line::default());+ lines.push(Line::from(Span::styled(+ "SANITIZER REPORT",+ theme::title(theme::SLATE),+ )));+ for text in finding.sanitizer_report.lines() {+ lines.push(Line::from(Span::styled(+ text.to_owned(),+ Style::default().fg(theme::SLATE),+ )));+ }++ frame.render_widget(+ Paragraph::new(lines)+ .block(panel(+ &format!("REPORT {}", finding.short_key()),+ theme::NEON_VIOLET,+ ))+ .wrap(Wrap { trim: false })+ .scroll((app.detail_scroll(), 0)),+ area,+ );+}++fn pair(name: &str, value: &str, accent: ratatui::style::Color) -> Line<'static> {+ Line::from(vec![+ Span::styled(format!("{name:<12}"), theme::label()),+ Span::styled(value.to_owned(), theme::value(accent)),+ ])+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/format.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/format.rsnew file mode 100644index 00000000..4693f4f4--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/format.rs@@ -0,0 +1,146 @@+// ©AngelaMos | 2026+// format.rs++const GROUP: usize = 3;+const SECONDS_PER_MINUTE: u64 = 60;+const SECONDS_PER_HOUR: u64 = 3600;+const THOUSAND: f64 = 1000.0;+const MILLION: f64 = 1_000_000.0;++#[must_use]+pub fn count(value: u64) -> String {+ let digits = value.to_string();+ let mut grouped = String::with_capacity(digits.len() + digits.len() / GROUP);+ for (index, digit) in digits.chars().enumerate() {+ if index > 0 && (digits.len() - index).is_multiple_of(GROUP) {+ grouped.push(',');+ }+ grouped.push(digit);+ }+ grouped+}++#[must_use]+pub fn rate(value: f64) -> String {+ if !value.is_finite() || value < 0.0 {+ return "-".to_owned();+ }+ if value >= MILLION {+ return format!("{:.2}M/s", value / MILLION);+ }+ if value >= THOUSAND {+ return format!("{:.1}k/s", value / THOUSAND);+ }+ format!("{value:.0}/s")+}++#[must_use]+pub fn duration(secs: u64) -> String {+ let hours = secs / SECONDS_PER_HOUR;+ let minutes = (secs % SECONDS_PER_HOUR) / SECONDS_PER_MINUTE;+ let seconds = secs % SECONDS_PER_MINUTE;+ if hours > 0 {+ return format!("{hours}h {minutes:02}m {seconds:02}s");+ }+ if minutes > 0 {+ return format!("{minutes}m {seconds:02}s");+ }+ format!("{seconds}s")+}++#[must_use]+pub fn percent(ratio: f64) -> String {+ format!("{:.2}%", ratio * 100.0)+}++#[must_use]+pub fn density(already_a_percentage: f64) -> String {+ format!("{already_a_percentage:.2}%")+}++#[must_use]+pub fn bar_value(value: f64) -> u64 {+ if !value.is_finite() || value <= 0.0 {+ return 0;+ }+ #[expect(clippy::cast_possible_truncation, clippy::cast_sign_loss)]+ let rounded = value.round() as u64;+ rounded+}++#[must_use]+pub fn bytes(value: usize) -> String {+ format!("{} B", count(value as u64))+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn counts_are_grouped_from_the_right() {+ assert_eq!(count(0), "0");+ assert_eq!(count(7), "7");+ assert_eq!(count(999), "999");+ assert_eq!(count(1_000), "1,000");+ assert_eq!(count(34_283_406), "34,283,406");+ assert_eq!(count(u64::MAX), "18,446,744,073,709,551,615");+ }++ #[test]+ fn rates_shorten_only_once_they_would_stop_fitting() {+ assert_eq!(rate(0.0), "0/s");+ assert_eq!(rate(999.4), "999/s");+ assert_eq!(rate(1_000.0), "1.0k/s");+ assert_eq!(rate(71_170.98), "71.2k/s");+ assert_eq!(rate(2_500_000.0), "2.50M/s");+ }++ #[test]+ fn a_rate_that_is_not_a_number_renders_as_unknown_rather_than_nan() {+ assert_eq!(rate(f64::NAN), "-");+ assert_eq!(rate(f64::INFINITY), "-");+ assert_eq!(rate(-1.0), "-");+ }++ #[test]+ fn durations_drop_the_units_they_do_not_need() {+ assert_eq!(duration(0), "0s");+ assert_eq!(duration(45), "45s");+ assert_eq!(duration(600), "10m 00s");+ assert_eq!(duration(3_661), "1h 01m 01s");+ assert_eq!(duration(86_400), "24h 00m 00s");+ }++ #[test]+ fn a_ratio_renders_as_the_percentage_the_stats_file_printed() {+ assert_eq!(percent(13_647.0 / 69_140.0), "19.74%");+ assert_eq!(percent(0.0), "0.00%");+ assert_eq!(percent(1.0), "100.00%");+ }++ #[test]+ fn a_value_already_in_percent_is_not_multiplied_by_a_hundred_again() {+ assert_eq!(+ density(19.74),+ "19.74%",+ "fuzzer_stats reports bitmap_cvg as 0..100 while edge_ratio is 0..1; feeding the former to percent() prints 1974.00%"+ );+ assert_eq!(percent(0.1974), "19.74%");+ assert_ne!(density(19.74), percent(19.74));+ }++ #[test]+ fn a_bar_value_that_is_not_a_number_is_zero_rather_than_a_panic() {+ assert_eq!(bar_value(f64::NAN), 0);+ assert_eq!(bar_value(-1.0), 0);+ assert_eq!(bar_value(f64::INFINITY), 0);+ assert_eq!(bar_value(71_170.98), 71_171);+ }++ #[test]+ fn byte_counts_are_grouped_like_every_other_count() {+ assert_eq!(bytes(0), "0 B");+ assert_eq!(bytes(4_096), "4,096 B");+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/input.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/input.rsnew file mode 100644index 00000000..4c00d505--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/input.rs@@ -0,0 +1,127 @@+// ©AngelaMos | 2026+// input.rs++use ratatui::crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};++use crate::app::{Action, Tab};++#[must_use]+pub fn action_of(event: &Event) -> Action {+ match event {+ Event::Key(key) if key.kind == KeyEventKind::Press => key_action(*key),+ _ => Action::Ignore,+ }+}++#[must_use]+pub fn key_action(key: KeyEvent) -> Action {+ if key.modifiers.contains(KeyModifiers::CONTROL) && matches!(key.code, KeyCode::Char('c')) {+ return Action::Quit;+ }+ match key.code {+ KeyCode::Char('q') | KeyCode::Esc => Action::Quit,+ KeyCode::Tab | KeyCode::Right | KeyCode::Char('l') => Action::NextTab,+ KeyCode::BackTab | KeyCode::Left | KeyCode::Char('h') => Action::PreviousTab,+ KeyCode::Char('1') => Action::SelectTab(Tab::Overview),+ KeyCode::Char('2') => Action::SelectTab(Tab::Findings),+ KeyCode::Char('3') => Action::SelectTab(Tab::Instances),+ KeyCode::Char('j') | KeyCode::Down => Action::Down,+ KeyCode::Char('k') | KeyCode::Up => Action::Up,+ KeyCode::Char('g') | KeyCode::Home => Action::First,+ KeyCode::Char('G') | KeyCode::End => Action::Last,+ KeyCode::Char('J') | KeyCode::PageDown => Action::ScrollDetailDown,+ KeyCode::Char('K') | KeyCode::PageUp => Action::ScrollDetailUp,+ KeyCode::Char('p' | ' ') => Action::TogglePause,+ KeyCode::Char('r') => Action::Refresh,+ _ => Action::Ignore,+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn press(code: KeyCode) -> KeyEvent {+ KeyEvent::new(code, KeyModifiers::NONE)+ }++ #[test]+ fn quitting_works_from_every_documented_key() {+ for code in [KeyCode::Char('q'), KeyCode::Esc] {+ assert_eq!(key_action(press(code)), Action::Quit);+ }+ assert_eq!(+ key_action(KeyEvent::new(KeyCode::Char('c'), KeyModifiers::CONTROL)),+ Action::Quit,+ "the alternate screen swallows the terminal's own interrupt, so the app must handle it"+ );+ }++ #[test]+ fn a_plain_c_is_not_a_quit() {+ assert_eq!(key_action(press(KeyCode::Char('c'))), Action::Ignore);+ }++ #[test]+ fn every_panel_has_a_direct_number_key() {+ assert_eq!(+ key_action(press(KeyCode::Char('1'))),+ Action::SelectTab(Tab::Overview)+ );+ assert_eq!(+ key_action(press(KeyCode::Char('2'))),+ Action::SelectTab(Tab::Findings)+ );+ assert_eq!(+ key_action(press(KeyCode::Char('3'))),+ Action::SelectTab(Tab::Instances)+ );+ }++ #[test]+ fn vim_keys_and_arrows_agree() {+ assert_eq!(key_action(press(KeyCode::Char('j'))), Action::Down);+ assert_eq!(key_action(press(KeyCode::Down)), Action::Down);+ assert_eq!(key_action(press(KeyCode::Char('k'))), Action::Up);+ assert_eq!(key_action(press(KeyCode::Up)), Action::Up);+ assert_eq!(key_action(press(KeyCode::Tab)), Action::NextTab);+ assert_eq!(key_action(press(KeyCode::BackTab)), Action::PreviousTab);+ }++ #[test]+ fn shifted_movement_scrolls_the_report_rather_than_changing_the_selection() {+ assert_eq!(+ key_action(press(KeyCode::Char('J'))),+ Action::ScrollDetailDown+ );+ assert_eq!(+ key_action(press(KeyCode::Char('K'))),+ Action::ScrollDetailUp+ );+ }++ #[test]+ fn an_unmapped_key_does_nothing_rather_than_something_surprising() {+ assert_eq!(key_action(press(KeyCode::Char('z'))), Action::Ignore);+ assert_eq!(key_action(press(KeyCode::F(7))), Action::Ignore);+ }++ #[test]+ fn a_key_release_is_not_a_key_press() {+ let release = Event::Key(KeyEvent::new_with_kind(+ KeyCode::Char('q'),+ KeyModifiers::NONE,+ KeyEventKind::Release,+ ));+ assert_eq!(+ action_of(&release),+ Action::Ignore,+ "windows terminals deliver both press and release, and acting on both fires every action twice"+ );+ }++ #[test]+ fn a_resize_is_not_an_action() {+ assert_eq!(action_of(&Event::Resize(80, 24)), Action::Ignore);+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/instances.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/instances.rsnew file mode 100644index 00000000..09bd07ac--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/instances.rs@@ -0,0 +1,132 @@+// ©AngelaMos | 2026+// instances.rs++use lisdex_monitor::snapshot::InstanceView;+use ratatui::Frame;+use ratatui::layout::{Constraint, Layout, Rect};+use ratatui::style::Style;+use ratatui::text::{Line, Span};+use ratatui::widgets::{Bar, BarChart, BarGroup, Row, Table};++use crate::app::App;+use crate::format;+use crate::overview::{panel, placeholder};+use crate::theme;++const BAR_WIDTH: u16 = 11;+const BAR_GAP: u16 = 1;+const CHART_HEIGHT: u16 = 12;+const ROLE_MAIN: &str = "main";+const ROLE_SECONDARY: &str = "secondary";++pub fn render(frame: &mut Frame, area: Rect, app: &App) {+ let snapshot = app.snapshot();+ if snapshot.instances().is_empty() {+ placeholder(+ frame,+ area,+ "INSTANCES",+ theme::ACID_GREEN,+ "no fuzzer instance has written stats under this findings directory",+ );+ return;+ }+ let [table_area, chart_area] =+ Layout::vertical([Constraint::Min(5), Constraint::Length(CHART_HEIGHT)]).areas(area);+ table(frame, table_area, snapshot.instances());+ bars(frame, chart_area, snapshot.instances());+}++fn table(frame: &mut Frame, area: Rect, instances: &[InstanceView]) {+ let rows: Vec<Row<'static>> = instances+ .iter()+ .enumerate()+ .map(|(i, v)| row(i, v))+ .collect();+ let widget = Table::new(+ rows,+ [+ Constraint::Length(14),+ Constraint::Length(10),+ Constraint::Length(11),+ Constraint::Length(14),+ Constraint::Length(10),+ Constraint::Length(9),+ Constraint::Min(8),+ ],+ )+ .header(+ Row::new(vec![+ "INSTANCE",+ "ROLE",+ "EXEC RATE",+ "EXECS",+ "EDGES",+ "MAP",+ "CRASHES",+ ])+ .style(theme::title(theme::SLATE))+ .height(1),+ )+ .block(panel(+ &format!("INSTANCES {}", instances.len()),+ theme::ACID_GREEN,+ ))+ .column_spacing(1);+ frame.render_widget(widget, area);+}++fn row(index: usize, instance: &InstanceView) -> Row<'static> {+ let accent = theme::ramp_at(index);+ let (role, role_style) = if instance.is_main {+ (ROLE_MAIN, theme::value(theme::ACID_GREEN))+ } else {+ (ROLE_SECONDARY, theme::label())+ };+ Row::new(vec![+ Span::styled(instance.name.clone(), theme::value(accent)),+ Span::styled(role, role_style),+ Span::styled(+ format::rate(instance.execs_per_sec),+ theme::value(theme::NEON_MAGENTA),+ ),+ Span::styled(format::count(instance.execs_done), theme::value(theme::INK)),+ Span::styled(+ format::count(instance.edges_found),+ theme::value(theme::NEON_CYAN),+ ),+ Span::styled(+ format::density(instance.map_density_pct),+ theme::value(theme::NEON_BLUE),+ ),+ Span::styled(+ format::count(instance.saved_crashes),+ theme::value(theme::AMBER),+ ),+ ])+}++fn bars(frame: &mut Frame, area: Rect, instances: &[InstanceView]) {+ let bars: Vec<Bar<'static>> = instances+ .iter()+ .enumerate()+ .map(|(index, instance)| {+ Bar::default()+ .value(format::bar_value(instance.execs_per_sec))+ .label(Line::from(Span::styled(+ instance.name.clone(),+ theme::label(),+ )))+ .text_value(format::rate(instance.execs_per_sec))+ .style(Style::default().fg(theme::ramp_at(index)))+ .value_style(Style::default().fg(theme::PANEL).bg(theme::ramp_at(index)))+ })+ .collect();++ let widget = BarChart::default()+ .block(panel("EXEC RATE BY INSTANCE", theme::NEON_MAGENTA))+ .data(BarGroup::default().bars(&bars))+ .bar_width(BAR_WIDTH)+ .bar_gap(BAR_GAP);+ frame.render_widget(widget, area);+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/lib.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/lib.rsnew file mode 100644index 00000000..0b670aa1--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/lib.rs@@ -0,0 +1,83 @@+// ©AngelaMos | 2026+// lib.rs++pub mod app;+pub mod chrome;+pub mod findings;+pub mod format;+pub mod input;+pub mod instances;+pub mod overview;+pub mod theme;+pub mod view;++use std::io;+use std::time::Duration;++use lisdex_monitor::snapshot::Source;+use ratatui::Terminal;+use ratatui::backend::TestBackend;+use ratatui::buffer::Buffer;+use ratatui::crossterm::event;++use crate::app::{App, DEFAULT_REFRESH_MS, INPUT_POLL_MS};++pub const ONCE_WIDTH: u16 = 170;+pub const ONCE_HEIGHT: u16 = 46;++#[derive(Debug, thiserror::Error)]+pub enum TuiError {+ #[error("terminal error: {0}")]+ Terminal(#[from] io::Error),+}++impl From<std::convert::Infallible> for TuiError {+ fn from(never: std::convert::Infallible) -> TuiError {+ match never {}+ }+}++pub fn render_once(+ source: Source,+ tab: app::Tab,+ width: u16,+ height: u16,+) -> Result<String, TuiError> {+ let mut app = App::new(source, Duration::from_millis(DEFAULT_REFRESH_MS));+ let _ = app.set_tab(tab);+ let mut terminal = Terminal::new(TestBackend::new(width, height))?;+ terminal.draw(|frame| view::render(frame, &app))?;+ Ok(plain_text(terminal.backend().buffer()))+}++#[must_use]+pub fn plain_text(buffer: &Buffer) -> String {+ let mut out = String::new();+ for y in 0..buffer.area.height {+ for x in 0..buffer.area.width {+ out.push_str(buffer[(x, y)].symbol());+ }+ out.push('\n');+ }+ out+}++pub fn run(source: Source, refresh: Duration) -> Result<(), TuiError> {+ let mut terminal = ratatui::try_init()?;+ let outcome = drive(&mut terminal, App::new(source, refresh));+ ratatui::try_restore()?;+ outcome+}++fn drive(terminal: &mut ratatui::DefaultTerminal, mut app: App) -> Result<(), TuiError> {+ let poll = Duration::from_millis(INPUT_POLL_MS);+ while app.is_running() {+ terminal.draw(|frame| view::render(frame, &app))?;+ if event::poll(poll)? {+ app.apply(input::action_of(&event::read()?));+ }+ app.tick();+ app.reload_if_due();+ }+ Ok(())+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/overview.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/overview.rsnew file mode 100644index 00000000..dc26e7a7--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/overview.rs@@ -0,0 +1,346 @@+// ©AngelaMos | 2026+// overview.rs++use lisdex_monitor::snapshot::{CurvePoint, Snapshot, Totals};+use ratatui::Frame;+use ratatui::layout::{Constraint, Layout, Rect};+use ratatui::style::{Color, Style};+use ratatui::symbols::Marker;+use ratatui::text::{Line, Span};+use ratatui::widgets::{+ Axis, Block, BorderType, Chart, Dataset, GraphType, LineGauge, Paragraph, Sparkline,+};++use crate::app::App;+use crate::format;+use crate::theme;++const SPARK_SAMPLES: usize = 120;+const CHART_BANDS: usize = theme::RAMP.len();+const MIN_BAND_POINTS: usize = 2;+const RIGHT_COLUMN_WIDTH: u16 = 32;+const SPARK_HEIGHT: u16 = 6;+const GAUGE_HEIGHT: u16 = 3;++pub fn render(frame: &mut Frame, area: Rect, app: &App) {+ let [top, gauge] =+ Layout::vertical([Constraint::Min(6), Constraint::Length(GAUGE_HEIGHT)]).areas(area);+ let [left, right] =+ Layout::horizontal([Constraint::Min(24), Constraint::Length(RIGHT_COLUMN_WIDTH)])+ .areas(top);+ let [spark, telemetry] =+ Layout::vertical([Constraint::Length(SPARK_HEIGHT), Constraint::Min(0)]).areas(right);++ coverage(frame, left, app.snapshot());+ exec_rate(frame, spark, app.snapshot());+ numbers(frame, telemetry, app.snapshot());+ coverage_gauge(frame, gauge, app.snapshot());+}++#[must_use]+pub fn panel(title: &str, accent: Color) -> Block<'static> {+ Block::bordered()+ .border_type(BorderType::Rounded)+ .border_style(theme::border())+ .title_top(Line::from(Span::styled(+ format!(" {title} "),+ theme::title(accent),+ )))+ .style(theme::panel())+}++pub fn placeholder(frame: &mut Frame, area: Rect, title: &str, accent: Color, message: &str) {+ frame.render_widget(+ Paragraph::new(Line::from(Span::styled(message.to_owned(), theme::dim())))+ .block(panel(title, accent)),+ area,+ );+}++fn coverage(frame: &mut Frame, area: Rect, snapshot: &Snapshot) {+ let curve = snapshot.curve();+ if curve.len() < MIN_BAND_POINTS {+ placeholder(+ frame,+ area,+ "COVERAGE",+ theme::NEON_CYAN,+ "waiting for the campaign to write its first samples",+ );+ return;+ }++ let points = plot_points(curve);+ let (x_max, y_min, y_max) = bounds(+ &points,+ as_f64(snapshot.lowest_edges()),+ as_f64(snapshot.peak_edges()),+ );+ let bands = band_ranges(points.len());+ let datasets: Vec<Dataset<'_>> = bands+ .iter()+ .enumerate()+ .map(|(index, range)| {+ Dataset::default()+ .marker(Marker::Braille)+ .graph_type(GraphType::Line)+ .style(Style::default().fg(theme::ramp_at(index)))+ .data(&points[range.clone()])+ })+ .collect();++ let title = snapshot+ .curve_instance()+ .map_or_else(|| "COVERAGE".to_owned(), |name| format!("COVERAGE {name}"));++ let chart = Chart::new(datasets)+ .block(panel(&title, theme::NEON_CYAN))+ .x_axis(+ Axis::default()+ .style(theme::dim())+ .bounds([0.0, x_max])+ .labels(vec![+ Span::styled("0s", theme::dim()),+ Span::styled(format::duration(snapshot.elapsed_secs()), theme::label()),+ ]),+ )+ .y_axis(+ Axis::default()+ .style(theme::dim())+ .bounds([y_min, y_max])+ .labels(vec![+ Span::styled(format::count(format::bar_value(y_min)), theme::dim()),+ Span::styled(+ format::count(format::bar_value(y_max)),+ theme::value(theme::ACID_GREEN),+ ),+ ]),+ );+ frame.render_widget(chart, area);+}++fn plot_points(curve: &[CurvePoint]) -> Vec<(f64, f64)> {+ curve+ .iter()+ .map(|point| (as_f64(point.secs), as_f64(point.edges)))+ .collect()+}++fn bounds(points: &[(f64, f64)], y_min: f64, peak: f64) -> (f64, f64, f64) {+ let x_max = points.last().map_or(1.0, |point| point.0).max(1.0);+ let y_max = if (peak - y_min).abs() < 1.0 {+ y_min + 1.0+ } else {+ peak+ };+ (x_max, y_min, y_max)+}++fn band_ranges(len: usize) -> Vec<std::ops::Range<usize>> {+ if len < CHART_BANDS * MIN_BAND_POINTS {+ return std::iter::once(0..len).collect();+ }+ let step = len / CHART_BANDS;+ (0..CHART_BANDS)+ .map(|index| {+ let start = index * step;+ let end = if index == CHART_BANDS - 1 {+ len+ } else {+ (start + step + 1).min(len)+ };+ start..end+ })+ .collect()+}++fn exec_rate(frame: &mut Frame, area: Rect, snapshot: &Snapshot) {+ let curve = snapshot.curve();+ if curve.is_empty() {+ placeholder(+ frame,+ area,+ "EXEC RATE",+ theme::NEON_MAGENTA,+ "no samples yet",+ );+ return;+ }+ let data: Vec<u64> = curve+ .iter()+ .rev()+ .take(SPARK_SAMPLES)+ .map(|point| format::bar_value(point.execs_per_sec))+ .collect::<Vec<_>>()+ .into_iter()+ .rev()+ .collect();+ let latest = snapshot.latest_execs_per_sec().unwrap_or(0.0);+ let widget = Sparkline::default()+ .block(panel(+ &format!("EXEC RATE {}", format::rate(latest)),+ theme::NEON_MAGENTA,+ ))+ .style(Style::default().fg(theme::NEON_MAGENTA))+ .data(data);+ frame.render_widget(widget, area);+}++fn numbers(frame: &mut Frame, area: Rect, snapshot: &Snapshot) {+ let totals = snapshot.totals();+ let lines = vec![+ stat(+ "execs",+ &totals.map_or_else(|| "-".to_owned(), |t| format::count(t.execs_done)),+ theme::INK,+ ),+ stat(+ "combined rate",+ &totals.map_or_else(|| "-".to_owned(), |t| format::rate(t.execs_per_sec)),+ theme::NEON_MAGENTA,+ ),+ stat(+ "corpus",+ &snapshot+ .latest_corpus()+ .map_or_else(|| "-".to_owned(), format::count),+ theme::INK,+ ),+ stat(+ "peak edges",+ &format::count(snapshot.peak_edges()),+ theme::NEON_CYAN,+ ),+ stat(+ "map density",+ &totals.map_or_else(|| "-".to_owned(), |t| format::density(t.map_density_pct)),+ theme::NEON_BLUE,+ ),+ stat(+ "saved crashes",+ &totals.map_or_else(|| "-".to_owned(), |t| format::count(t.saved_crashes)),+ theme::AMBER,+ ),+ stat(+ "distinct bugs",+ &snapshot.distinct_bugs().to_string(),+ theme::HOT_RED,+ ),+ stat(+ "unkeyed",+ &snapshot.unkeyed_crashes().to_string(),+ theme::NEON_VIOLET,+ ),+ stat(+ "instances",+ &snapshot.instances().len().to_string(),+ theme::ACID_GREEN,+ ),+ ];+ frame.render_widget(+ Paragraph::new(lines).block(panel("TELEMETRY", theme::NEON_VIOLET)),+ area,+ );+}++fn stat(name: &str, value: &str, accent: Color) -> Line<'static> {+ Line::from(vec![+ Span::styled(format!("{name:<14}"), theme::label()),+ Span::styled(value.to_owned(), theme::value(accent)),+ ])+}++fn coverage_gauge(frame: &mut Frame, area: Rect, snapshot: &Snapshot) {+ let Some(totals) = snapshot.totals() else {+ placeholder(+ frame,+ area,+ "EDGE COVERAGE",+ theme::ACID_GREEN,+ "no instance has reported a coverage map",+ );+ return;+ };+ let widget = LineGauge::default()+ .block(panel(&gauge_title(totals), theme::ACID_GREEN))+ .filled_style(Style::default().fg(theme::ACID_GREEN))+ .unfilled_style(Style::default().fg(theme::EDGE))+ .label(Span::styled(+ format::percent(totals.edge_ratio()),+ theme::value(theme::ACID_GREEN),+ ))+ .ratio(totals.edge_ratio());+ frame.render_widget(widget, area);+}++fn gauge_title(totals: &Totals) -> String {+ format!(+ "EDGE COVERAGE {} / {}",+ format::count(totals.edges_found),+ format::count(totals.total_edges)+ )+}++#[expect(clippy::cast_precision_loss)]+fn as_f64(value: u64) -> f64 {+ value as f64+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn a_short_curve_is_drawn_as_one_band_rather_than_six_empty_ones() {+ assert_eq!(band_ranges(4), vec![0..4]);+ assert_eq!(band_ranges(0), vec![0..0]);+ }++ #[test]+ fn bands_cover_the_whole_curve_and_overlap_so_the_line_never_breaks() {+ let len = 120;+ let bands = band_ranges(len);+ assert_eq!(bands.len(), CHART_BANDS);+ assert_eq!(bands[0].start, 0);+ assert_eq!(bands[bands.len() - 1].end, len);+ for pair in bands.windows(2) {+ assert!(+ pair[0].end > pair[1].start,+ "adjacent colour bands must share a point or the gradient line renders with gaps at every seam"+ );+ }+ }++ #[test]+ fn every_band_is_a_valid_slice_of_the_curve() {+ for len in [12, 13, 61, 107, 601] {+ for range in band_ranges(len) {+ assert!(range.start <= range.end);+ assert!(range.end <= len, "a band ran past the end of the curve");+ }+ }+ }++ #[test]+ fn a_flat_curve_still_produces_a_drawable_y_range() {+ let points = vec![(0.0, 500.0), (10.0, 500.0)];+ let (x_max, y_min, y_max) = bounds(&points, 500.0, 500.0);+ assert!(x_max > 0.0);+ assert!(+ y_max > y_min,+ "a zero-height y axis makes ratatui divide by the range and render nothing"+ );+ }++ #[test]+ fn the_axis_uses_the_range_the_model_measured_rather_than_rescanning_the_curve() {+ let points = vec![(0.0, 100.0), (5.0, 900.0), (9.0, 400.0)];+ let (x_max, y_min, y_max) = bounds(&points, 100.0, 900.0);+ assert!((x_max - 9.0).abs() < f64::EPSILON);+ assert!((y_min - 100.0).abs() < f64::EPSILON);+ assert!(+ (y_max - 900.0).abs() < f64::EPSILON,+ "the top axis label is the campaign's peak coverage, and it must be the same number the telemetry panel prints"+ );+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/theme.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/theme.rsnew file mode 100644index 00000000..a4b94789--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/theme.rs@@ -0,0 +1,176 @@+// ©AngelaMos | 2026+// theme.rs++use lisdex_monitor::snapshot::{Phase, Severity};+use ratatui::style::{Color, Modifier, Style};++pub const INK: Color = Color::Rgb(232, 238, 252);+pub const SLATE: Color = Color::Rgb(118, 130, 164);+pub const DUSK: Color = Color::Rgb(70, 80, 112);+pub const EDGE: Color = Color::Rgb(52, 60, 96);+pub const PANEL: Color = Color::Rgb(15, 17, 30);++pub const NEON_CYAN: Color = Color::Rgb(20, 215, 235);+pub const NEON_MAGENTA: Color = Color::Rgb(255, 45, 175);+pub const NEON_VIOLET: Color = Color::Rgb(175, 85, 255);+pub const NEON_BLUE: Color = Color::Rgb(60, 150, 250);+pub const ACID_GREEN: Color = Color::Rgb(55, 250, 145);+pub const AMBER: Color = Color::Rgb(255, 190, 70);+pub const HOT_RED: Color = Color::Rgb(255, 62, 96);++pub const WORDMARK: [(char, Color); 6] = [+ ('L', NEON_MAGENTA),+ ('I', NEON_VIOLET),+ ('S', Color::Rgb(110, 110, 250)),+ ('D', NEON_BLUE),+ ('E', NEON_CYAN),+ ('X', ACID_GREEN),+];++pub const RAMP: [Color; 6] = [+ Color::Rgb(139, 92, 246),+ Color::Rgb(99, 102, 241),+ Color::Rgb(59, 130, 246),+ Color::Rgb(14, 165, 233),+ Color::Rgb(20, 220, 200),+ Color::Rgb(52, 255, 145),+];++#[must_use]+pub fn ramp_at(position: usize) -> Color {+ RAMP[position % RAMP.len()]+}++#[must_use]+pub fn panel() -> Style {+ Style::default().bg(PANEL)+}++#[must_use]+pub fn border() -> Style {+ Style::default().fg(EDGE)+}++#[must_use]+pub fn title(accent: Color) -> Style {+ Style::default().fg(accent).add_modifier(Modifier::BOLD)+}++#[must_use]+pub fn label() -> Style {+ Style::default().fg(SLATE)+}++#[must_use]+pub fn value(accent: Color) -> Style {+ Style::default().fg(accent).add_modifier(Modifier::BOLD)+}++#[must_use]+pub fn dim() -> Style {+ Style::default().fg(DUSK)+}++#[must_use]+pub fn severity_color(severity: Severity) -> Color {+ match severity {+ Severity::Exploitable => HOT_RED,+ Severity::ProbablyExploitable => AMBER,+ Severity::NotExploitable => NEON_CYAN,+ Severity::Undefined => NEON_VIOLET,+ Severity::Unclassified => SLATE,+ }+}++#[must_use]+pub fn severity_style(severity: Severity) -> Style {+ let style = Style::default().fg(severity_color(severity));+ if severity == Severity::Exploitable {+ return style.add_modifier(Modifier::BOLD);+ }+ style+}++#[must_use]+pub fn phase_color(phase: Phase) -> Color {+ match phase {+ Phase::Pending => SLATE,+ Phase::Building => AMBER,+ Phase::Fuzzing => ACID_GREEN,+ Phase::Completed => NEON_CYAN,+ Phase::Failed => HOT_RED,+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ #[test]+ fn the_wordmark_spells_the_tool() {+ let spelled: String = WORDMARK.iter().map(|(letter, _)| letter).collect();+ assert_eq!(spelled, "LISDEX");+ }++ #[test]+ fn every_wordmark_letter_gets_its_own_colour() {+ let mut colours: Vec<Color> = WORDMARK.iter().map(|(_, colour)| *colour).collect();+ colours.dedup();+ assert_eq!(colours.len(), WORDMARK.len());+ }++ #[test]+ fn the_ramp_wraps_rather_than_panicking_past_its_end() {+ assert_eq!(ramp_at(0), RAMP[0]);+ assert_eq!(ramp_at(RAMP.len()), RAMP[0]);+ assert_eq!(ramp_at(usize::MAX), RAMP[usize::MAX % RAMP.len()]);+ }++ #[test]+ fn no_two_severities_share_a_colour() {+ let mut colours: Vec<Color> = [+ Severity::Exploitable,+ Severity::ProbablyExploitable,+ Severity::NotExploitable,+ Severity::Undefined,+ Severity::Unclassified,+ ]+ .iter()+ .map(|severity| severity_color(*severity))+ .collect();+ colours.dedup();+ assert_eq!(+ colours.len(),+ 5,+ "two severities sharing a colour would make an exploitable write look like a benign read on screen"+ );+ }++ #[test]+ fn the_worst_severity_is_the_only_one_rendered_bold() {+ assert!(+ severity_style(Severity::Exploitable)+ .add_modifier+ .contains(Modifier::BOLD)+ );+ for severity in [+ Severity::ProbablyExploitable,+ Severity::NotExploitable,+ Severity::Undefined,+ Severity::Unclassified,+ ] {+ assert!(+ !severity_style(severity)+ .add_modifier+ .contains(Modifier::BOLD)+ );+ }+ }++ #[test]+ fn a_failed_campaign_never_shows_the_colour_a_healthy_one_does() {+ assert_ne!(phase_color(Phase::Failed), phase_color(Phase::Fuzzing));+ assert_eq!(phase_color(Phase::Failed), HOT_RED);+ assert_eq!(phase_color(Phase::Fuzzing), ACID_GREEN);+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/view.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/view.rsnew file mode 100644index 00000000..f905ad29--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/src/view.rs@@ -0,0 +1,32 @@+// ©AngelaMos | 2026+// view.rs++use ratatui::Frame;+use ratatui::layout::{Constraint, Layout};+use ratatui::widgets::Block;++use crate::app::{App, Tab};+use crate::chrome::{self, FOOTER_HEIGHT, HEADER_HEIGHT, TABS_HEIGHT};+use crate::{findings, instances, overview, theme};++pub fn render(frame: &mut Frame, app: &App) {+ let area = frame.area();+ frame.render_widget(Block::default().style(theme::panel()), area);++ let [header, tabs, body, footer] = Layout::vertical([+ Constraint::Length(HEADER_HEIGHT),+ Constraint::Length(TABS_HEIGHT),+ Constraint::Min(0),+ Constraint::Length(FOOTER_HEIGHT),+ ])+ .areas(area);++ chrome::header(frame, header, app);+ chrome::tabs(frame, tabs, app);+ match app.tab() {+ Tab::Overview => overview::render(frame, body, app),+ Tab::Findings => findings::render(frame, body, app),+ Tab::Instances => instances::render(frame, body, app),+ }+ chrome::footer(frame, footer, app);+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/tests/render.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/tests/render.rsnew file mode 100644index 00000000..56d338d4--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-tui/tests/render.rs@@ -0,0 +1,533 @@+// ©AngelaMos | 2026+// render.rs++use std::path::PathBuf;++use lisdex_core::campaign::{Campaign, CampaignStatus};+use lisdex_core::crash::Crash;+use lisdex_core::store::Store;+use lisdex_monitor::snapshot::{Snapshot, Source};+use lisdex_tui::app::{Action, App, Tab};+use lisdex_tui::theme;+use lisdex_tui::view;+use ratatui::Terminal;+use ratatui::backend::TestBackend;+use ratatui::buffer::Buffer;+use ratatui::style::Color;++const REAL_PLOT: &str = include_str!("../../lisdex-fuzz/tests/fixtures/plot_data.txt");+const REAL_UNSYMBOLIZED: &str = include_str!("../../lisdex-triage/tests/fixtures/heapw.txt");++const KEYED_WRITE_REPORT: &str = "\+=================================================================+==53767==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7bd6bfde0020 at pc 0x558474e40fd9+WRITE of size 32 at 0x7bd6bfde0020 thread T0+ #0 0x558474e40fd8 in png_handle_PLTE /src/libpng/pngrutil.c:992:4+ #1 0x558474e41111 in png_read_info /src/libpng/pngread.c:160:10+SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/harness+0xcdfd8) in png_handle_PLTE+";++const KEYED_READ_REPORT: &str = "\+=================================================================+==53768==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7bc207fe0020 at pc 0x55afa18b1a77+READ of size 1 at 0x7bc207fe0020 thread T0+ #0 0x55afa18b1a76 in png_handle_tRNS /src/libpng/pngrutil.c:1470:9+ #1 0x55afa18b2200 in png_read_info /src/libpng/pngread.c:171:10+SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/harness+0x114a76) in png_handle_tRNS+";++const MAIN_STATS: &str = "\+start_time : 1784982517+last_update : 1784983139+run_time : 600+fuzzer_pid : 2790+cycles_done : 64+execs_done : 34283406+execs_per_sec : 71170.98+corpus_count : 1413+bitmap_cvg : 19.74%+saved_crashes : 80+saved_hangs : 0+edges_found : 13647+total_edges : 69140+afl_banner : lisdex_libpng_read+afl_version : ++5.02c+target_mode : persistent shmem_testcase deferred+";++const SECONDARY_STATS: &str = "\+start_time : 1784982517+last_update : 1784983139+run_time : 600+fuzzer_pid : 2791+cycles_done : 58+execs_done : 30000000+execs_per_sec : 65000.00+corpus_count : 1290+bitmap_cvg : 18.80%+saved_crashes : 60+saved_hangs : 0+edges_found : 13000+total_edges : 69140+afl_banner : lisdex_libpng_read+afl_version : ++5.02c+target_mode : persistent shmem_testcase deferred+";++struct Lab {+ root: PathBuf,+}++impl Lab {+ fn new(name: &str) -> Lab {+ let root = std::env::temp_dir().join(format!(+ "lisdex-tui-{name}-{}-{:?}",+ std::process::id(),+ std::thread::current().id()+ ));+ let _ = std::fs::remove_dir_all(&root);+ std::fs::create_dir_all(&root).unwrap();+ let lab = Lab { root };+ lab.instance("main", MAIN_STATS, Some(REAL_PLOT));+ lab.instance("secondary1", SECONDARY_STATS, None);+ lab.campaign();+ lab+ }++ fn instance(&self, name: &str, stats: &str, plot: Option<&str>) {+ let dir = self.root.join("findings").join(name);+ std::fs::create_dir_all(&dir).unwrap();+ std::fs::write(dir.join("fuzzer_stats"), stats).unwrap();+ if let Some(plot) = plot {+ std::fs::write(dir.join("plot_data"), plot).unwrap();+ }+ }++ fn campaign(&self) {+ let store = Store::open(self.root.join("lisdex.sqlite")).unwrap();+ let mut campaign = Campaign::new("lisdex_libpng_read");+ let id = store.insert_campaign(&campaign).unwrap();+ campaign.advance(CampaignStatus::Building).unwrap();+ campaign.advance(CampaignStatus::Fuzzing).unwrap();+ store+ .update_campaign_status(id, CampaignStatus::Fuzzing)+ .unwrap();+ for (index, report) in [KEYED_WRITE_REPORT, KEYED_WRITE_REPORT, KEYED_READ_REPORT]+ .iter()+ .enumerate()+ {+ store+ .insert_crash(&Crash::from_report(+ id,+ format!("input-{index}").into_bytes(),+ *report,+ ))+ .unwrap();+ }+ }++ fn add_crash(&self, report: &str) {+ let store = Store::open(self.root.join("lisdex.sqlite")).unwrap();+ let (id, _) = store.list_campaigns().unwrap().pop().unwrap();+ store+ .insert_crash(&Crash::from_report(id, b"late".to_vec(), report))+ .unwrap();+ }++ fn finish(&self) {+ let store = Store::open(self.root.join("lisdex.sqlite")).unwrap();+ let (id, _) = store.list_campaigns().unwrap().pop().unwrap();+ store+ .update_campaign_status(id, CampaignStatus::Completed)+ .unwrap();+ }++ fn source(&self) -> Source {+ Source {+ db: self.root.join("lisdex.sqlite"),+ findings: self.root.join("findings"),+ campaign: None,+ }+ }++ fn app(&self) -> App {+ App::from_snapshot(Snapshot::read(&self.source()).unwrap())+ }+}++impl Drop for Lab {+ fn drop(&mut self) {+ let _ = std::fs::remove_dir_all(&self.root);+ }+}++fn draw(app: &App, width: u16, height: u16) -> Buffer {+ let mut terminal = Terminal::new(TestBackend::new(width, height)).unwrap();+ terminal.draw(|frame| view::render(frame, app)).unwrap();+ terminal.backend().buffer().clone()+}++fn text(buffer: &Buffer) -> String {+ let mut out = String::new();+ for y in 0..buffer.area.height {+ for x in 0..buffer.area.width {+ out.push_str(buffer[(x, y)].symbol());+ }+ out.push('\n');+ }+ out+}++fn colour_of(buffer: &Buffer, needle: &str) -> Option<Color> {+ for y in 0..buffer.area.height {+ let row: String = (0..buffer.area.width)+ .map(|x| buffer[(x, y)].symbol())+ .collect();+ if let Some(at) = row.find(needle) {+ let x = u16::try_from(row[..at].chars().count()).ok()?;+ return Some(buffer[(x, y)].fg);+ }+ }+ None+}++#[test]+fn the_overview_renders_the_campaign_a_real_run_wrote() {+ let lab = Lab::new("overview");+ let rendered = text(&draw(&lab.app(), 160, 44));++ assert!(rendered.contains("L I S D E X"), "the wordmark is missing");+ assert!(rendered.contains("lisdex_libpng_read"));+ assert!(rendered.contains("FUZZING"));+ assert!(rendered.contains("COVERAGE"));+ assert!(rendered.contains("EXEC RATE"));+ assert!(rendered.contains("TELEMETRY"));+ assert!(rendered.contains("EDGE COVERAGE"));+}++#[test]+fn the_numbers_on_screen_are_the_numbers_the_campaign_recorded() {+ let lab = Lab::new("numbers");+ let rendered = text(&draw(&lab.app(), 160, 44));++ assert!(+ rendered.contains("64,283,406"),+ "the execs total must be the sum across both instances, grouped for reading"+ );+ assert!(+ rendered.contains("13,647"),+ "edges must be the highest single instance, never the sum of the two"+ );+ assert!(+ !rendered.contains("26,647"),+ "instances share one coverage map; a summed edge count would report coverage the campaign never had"+ );+ assert!(rendered.contains("19.74%"), "the edge ratio is missing");+ assert!(rendered.contains("10m 00s"), "the elapsed time is missing");+}++#[test]+fn the_findings_panel_lists_the_worst_bug_first() {+ let lab = Lab::new("findings");+ let mut app = lab.app();+ app.apply(Action::SelectTab(Tab::Findings));+ let buffer = draw(&app, 160, 44);+ let rendered = text(&buffer);++ assert!(rendered.contains("EXPLOITABLE"));+ assert!(rendered.contains("png_handle_PLTE"));+ assert!(rendered.contains("png_handle_tRNS"));++ let exploitable = rendered.find("EXPLOITABLE").unwrap();+ let not_exploitable = rendered.find("NOT_EXPLOITABLE").unwrap();+ assert!(+ exploitable < not_exploitable,+ "the operator reads top-down, so the exploitable write must sit above the non-exploitable read"+ );+}++#[test]+fn severity_is_carried_by_colour_and_not_only_by_the_word() {+ let lab = Lab::new("severity-colour");+ let mut app = lab.app();+ app.apply(Action::SelectTab(Tab::Findings));+ let buffer = draw(&app, 160, 44);++ assert_eq!(+ colour_of(&buffer, "NOT_EXPLOITABLE"),+ Some(theme::NEON_CYAN),+ "a severity rendered in the default colour tells an operator scanning the screen nothing"+ );+}++#[test]+fn the_selected_finding_shows_its_frames_and_its_raw_report() {+ let lab = Lab::new("detail");+ let mut app = lab.app();+ app.apply(Action::SelectTab(Tab::Findings));+ let rendered = text(&draw(&app, 200, 50));++ assert!(rendered.contains("FRAMES"));+ assert!(rendered.contains("SANITIZER REPORT"));+ assert!(+ rendered.contains("AddressSanitizer"),+ "the raw report an advisory would quote must be readable without leaving the tool"+ );+ assert!(rendered.contains("stack key"));+}++#[test]+fn moving_the_selection_changes_which_report_is_shown() {+ let lab = Lab::new("selection");+ let mut app = lab.app();+ app.apply(Action::SelectTab(Tab::Findings));+ let first = text(&draw(&app, 200, 50));+ app.apply(Action::Down);+ let second = text(&draw(&app, 200, 50));+ assert_ne!(+ first, second,+ "if the frame is identical after moving the cursor the detail pane is not reading the selection"+ );+ assert!(second.contains("png_handle_tRNS"));+}++#[test]+fn moving_the_selection_returns_a_scrolled_report_to_its_top() {+ let lab = Lab::new("scroll-reset");+ let mut app = lab.app();+ app.apply(Action::SelectTab(Tab::Findings));+ app.apply(Action::ScrollDetailDown);+ assert!(app.detail_scroll() > 0);+ app.apply(Action::Down);+ assert_eq!(+ app.detail_scroll(),+ 0,+ "keeping the old offset would open a shorter report already scrolled past its end"+ );+}++#[test]+fn the_instances_panel_names_every_instance_and_its_role() {+ let lab = Lab::new("instances");+ let mut app = lab.app();+ app.apply(Action::SelectTab(Tab::Instances));+ let rendered = text(&draw(&app, 160, 44));++ assert!(rendered.contains("main"));+ assert!(rendered.contains("secondary1"));+ assert!(rendered.contains("71.2k/s"));+ assert!(rendered.contains("65.0k/s"));+ assert!(rendered.contains("EXEC RATE BY INSTANCE"));+}++#[test]+fn a_campaign_with_nothing_recorded_yet_renders_its_reason_instead_of_blank_panels() {+ let app = App::from_snapshot(Snapshot::empty());+ let rendered = text(&draw(&app, 120, 36));++ assert!(rendered.contains("no campaign in store"));+ assert!(+ rendered.contains("waiting for the campaign to write its first samples"),+ "an empty chart with no explanation reads as a broken tool rather than an early campaign"+ );+}++#[test]+fn every_panel_survives_a_terminal_far_smaller_than_its_layout() {+ let lab = Lab::new("tiny");+ let mut app = lab.app();+ for tab in Tab::ALL {+ app.apply(Action::SelectTab(tab));+ for (width, height) in [(20_u16, 6_u16), (40, 10), (80, 24), (1, 1)] {+ let rendered = draw(&app, width, height);+ assert_eq!(rendered.area.width, width);+ assert_eq!(rendered.area.height, height);+ }+ }+}++#[test]+fn every_panel_survives_an_empty_snapshot_at_every_size() {+ let mut app = App::from_snapshot(Snapshot::empty());+ for tab in Tab::ALL {+ app.apply(Action::SelectTab(tab));+ for (width, height) in [(1_u16, 1_u16), (30, 8), (160, 44)] {+ let _ = draw(&app, width, height);+ }+ }+}++#[test]+fn the_keybindings_are_on_screen_so_the_panel_needs_no_manual() {+ let lab = Lab::new("keys");+ let rendered = text(&draw(&lab.app(), 160, 44));+ assert!(rendered.contains("q quit"));+ assert!(rendered.contains("p pause"));+}++#[test]+fn switching_panels_switches_what_is_drawn() {+ let lab = Lab::new("tabs");+ let mut app = lab.app();+ let overview = text(&draw(&app, 160, 44));+ app.apply(Action::NextTab);+ let findings = text(&draw(&app, 160, 44));+ app.apply(Action::NextTab);+ let instances = text(&draw(&app, 160, 44));++ assert!(overview.contains("TELEMETRY"));+ assert!(findings.contains("SANITIZER REPORT"));+ assert!(instances.contains("EXEC RATE BY INSTANCE"));+ assert_ne!(overview, findings);+ assert_ne!(findings, instances);+}++#[test]+fn the_header_gradient_advances_with_the_clock() {+ let lab = Lab::new("gradient");+ let mut app = lab.app();+ let first = draw(&app, 160, 44);+ for _ in 0..4 {+ app.tick();+ }+ let later = draw(&app, 160, 44);+ assert_ne!(+ first, later,+ "the header rule is drawn from a tick counter, so a frozen buffer means the counter never reaches the renderer"+ );+}++#[test]+fn a_panel_built_from_a_source_loads_that_source_rather_than_starting_empty() {+ let lab = Lab::new("reload");+ let app = App::new(lab.source(), std::time::Duration::from_secs(1));+ assert!(+ app.error().is_none(),+ "reading a valid campaign must not error: {:?}",+ app.error()+ );+ let rendered = text(&draw(&app, 160, 44));+ assert!(+ rendered.contains("lisdex_libpng_read"),+ "the app read its source at construction; an empty first frame means reload never reached the store"+ );+ assert!(rendered.contains("FUZZING"));+ assert!(!app.snapshot().findings().is_empty());+}++#[test]+fn refreshing_a_panel_re_reads_the_campaign_from_disk() {+ let lab = Lab::new("refresh");+ let mut app = App::new(lab.source(), std::time::Duration::from_secs(1));+ let before = app.snapshot().total_crashes();+ lab.add_crash(KEYED_READ_REPORT);+ app.apply(Action::Refresh);+ assert_eq!(+ app.snapshot().total_crashes(),+ before + 1,+ "a refresh that returns the same counts is not re-reading the store a live campaign keeps writing to"+ );+}++#[test]+fn pointing_a_panel_at_a_campaign_that_is_not_there_reports_it_instead_of_rendering_nothing() {+ let app = App::new(+ Source {+ db: PathBuf::from("/nonexistent/lisdex.sqlite"),+ findings: PathBuf::from("/nonexistent/findings"),+ campaign: Some(41),+ },+ std::time::Duration::from_secs(1),+ );+ let rendered = text(&draw(&app, 160, 44));+ assert!(rendered.contains("no campaign in store"));+}++#[test]+fn a_crash_that_could_not_be_keyed_renders_as_refused_rather_than_as_a_bug() {+ let lab = Lab::new("unkeyed-render");+ lab.add_crash(REAL_UNSYMBOLIZED);+ let mut app = App::new(lab.source(), std::time::Duration::from_secs(1));+ app.apply(Action::SelectTab(Tab::Findings));++ let unkeyed_at = app+ .snapshot()+ .findings()+ .iter()+ .position(|finding| !finding.is_keyed())+ .expect("the unsymbolized capture is a finding of its own");+ for _ in 0..unkeyed_at {+ app.apply(Action::Down);+ }+ assert_eq!(app.selected(), unkeyed_at);+ let rendered = text(&draw(&app, 200, 50));++ assert!(+ rendered.contains("unkeyed"),+ "an unsymbolized capture has no stack key, and the row must say so rather than show a blank column"+ );+ assert!(+ rendered.contains("refused: no symbolized frames to key on"),+ "the reason a crash was not keyed is the operator's cue that it is not a missing bug; hiding it reads as a tool that lost data"+ );+ assert!(+ rendered.contains("EXPLOITABLE"),+ "refusing to key a crash must not also discard the severity the classifier did decide"+ );+ assert_eq!(+ app.snapshot().distinct_bugs(),+ 2,+ "an unkeyed crash must not be counted as a distinct bug alongside the two that really keyed"+ );+ assert_eq!(app.snapshot().unkeyed_crashes(), 1);+}++#[test]+fn a_finished_campaign_is_never_described_as_running_or_live() {+ let lab = Lab::new("finished-wording");+ lab.finish();+ let mut app = App::new(lab.source(), std::time::Duration::from_secs(1));+ for tab in Tab::ALL {+ app.apply(Action::SelectTab(tab));+ let rendered = text(&draw(&app, 200, 50));+ assert!(+ rendered.contains("COMPLETED"),+ "the fixture campaign is completed; if this fails the test is not exercising a finished run"+ );+ assert!(+ !rendered.contains("running"),+ "afl-fuzz leaves fuzzer_stats behind after it exits, so counting instance directories and calling them running asserts liveness the tool cannot observe"+ );+ assert!(+ !rendered.contains("live campaign"),+ "the footer must not claim the campaign is live when it has finished"+ );+ }+}++#[test]+fn the_unkeyed_warning_is_the_model_s_sentence_and_not_the_renderer_s() {+ let lab = Lab::new("unkeyed-notice");+ lab.add_crash(REAL_UNSYMBOLIZED);+ let app = App::new(lab.source(), std::time::Duration::from_secs(1));+ let rendered = text(&draw(&app, 200, 50));+ let expected = app+ .snapshot()+ .notices()+ .iter()+ .map(|notice| notice.message())+ .find(|message| message.contains("could not be keyed"))+ .expect("the model raises the unkeyed notice itself");+ assert!(+ rendered.contains(expected.trim()),+ "the footer must print the model's wording verbatim; a renderer that composes its own sentence can contradict dedup with every test still green"+ );+}++#[test]+fn a_paused_panel_says_so_on_screen() {+ let lab = Lab::new("paused");+ let app = lab.app();+ assert!(app.is_paused());+ assert!(text(&draw(&app, 160, 44)).contains("PAUSED"));+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.tomlindex 5b1655fc..99622227 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.toml+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.toml@@ -27,4 +27,6 @@ lisdex-harness.workspace = truelisdex-llm.workspace = truelisdex-report.workspace = truelisdex-triage.workspace = true+lisdex-monitor.workspace = true+lisdex-tui.workspace = trueserde_json.workspace = truediff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/src/main.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/src/main.rsindex e2d1b30b..1031ac37 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/src/main.rs+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/src/main.rs@@ -33,6 +33,7 @@ use lisdex_harness::synth;use lisdex_harness::verify::{Bench, Corpus, Toolchain, Verdict};use lisdex_ingest::acquire::{self, Source};use lisdex_ingest::detect;+use lisdex_monitor::snapshot::Source as MonitorSource;use lisdex_report::advisory::Advisory;use lisdex_report::bundle::{self, Reproducer};use lisdex_report::{json, markdown};@@ -117,6 +118,68 @@ enum Command {Coverage(CoverageArgs),#[command(about = "distil a corpus to the smallest set that still reaches the same edges")]Corpus(CorpusArgs),+ #[command(about = "watch a campaign live in a terminal dashboard")]+ Tui(TuiArgs),+}++#[derive(clap::Args)]+struct TuiArgs {+ #[arg(long, help = "sqlite database a campaign is writing to")]+ db: PathBuf,+ #[arg(long, help = "afl-fuzz output directory the campaign is writing to")]+ findings: PathBuf,+ #[arg(+ long,+ help = "campaign id to watch; defaults to the most recent one in the store"+ )]+ campaign: Option<i64>,+ #[arg(+ long,+ default_value_t = lisdex_tui::app::DEFAULT_REFRESH_MS,+ help = "milliseconds between re-reads of the campaign's state"+ )]+ refresh: u64,+ #[arg(+ long,+ help = "render one frame as plain text and exit, for scripting and for terminals that are not interactive"+ )]+ once: bool,+ #[arg(+ long,+ default_value_t = lisdex_tui::ONCE_WIDTH,+ help = "columns to render at with --once"+ )]+ width: u16,+ #[arg(+ long,+ default_value_t = lisdex_tui::ONCE_HEIGHT,+ help = "rows to render at with --once"+ )]+ height: u16,+ #[arg(+ long,+ value_enum,+ default_value_t = PanelArg::Overview,+ help = "which panel to open on"+ )]+ panel: PanelArg,+}++#[derive(Clone, Copy, clap::ValueEnum)]+enum PanelArg {+ Overview,+ Findings,+ Instances,+}++impl From<PanelArg> for lisdex_tui::app::Tab {+ fn from(value: PanelArg) -> Self {+ match value {+ PanelArg::Overview => lisdex_tui::app::Tab::Overview,+ PanelArg::Findings => lisdex_tui::app::Tab::Findings,+ PanelArg::Instances => lisdex_tui::app::Tab::Instances,+ }+ }}#[derive(clap::Args)]@@ -530,9 +593,29 @@ fn dispatch() -> Result<(), Box<dyn Error>> {Command::Corpus(args) => distil_corpus(args),Command::Minimize(args) => minimize_campaign(args),Command::Llm(args) => llm(args),+ Command::Tui(args) => tui(args),}}+fn tui(args: &TuiArgs) -> Result<(), Box<dyn Error>> {+ let source = MonitorSource {+ db: args.db.clone(),+ findings: args.findings.clone(),+ campaign: args.campaign,+ };+ if args.once {+ let frame = lisdex_tui::render_once(source, args.panel.into(), args.width, args.height)?;+ let stdout = std::io::stdout();+ let mut out = stdout.lock();+ if let Err(err) = write!(out, "{frame}") {+ return finish_stream(&err);+ }+ return Ok(());+ }+ lisdex_tui::run(source, Duration::from_millis(args.refresh))?;+ Ok(())+}+fn llm(args: &LlmArgs) -> Result<(), Box<dyn Error>> {let tier = LlmTier::from(args.tier);let booster = lisdex_llm::select(tier);@@ -1498,24 +1581,8 @@ fn distil_corpus(args: &CorpusArgs) -> Result<(), Box<dyn Error>> {Ok(())}-fn curve_source(findings: &std::path::Path) -> Result<PathBuf, Box<dyn Error>> {- let dirs = runner::instance_dirs(findings)?;- let named = |wanted: &str| {- dirs.iter()- .find(|dir| dir.file_name().is_some_and(|name| name == wanted))- .cloned()- };- named(runner::MAIN_INSTANCE)- .or_else(|| named(runner::DEFAULT_INSTANCE))- .or_else(|| dirs.first().cloned())- .ok_or_else(|| format!("no fuzzer instance under {}", findings.display()).into())-}-fn coverage_curve(findings: &std::path::Path) -> Result<plot::CoverageCurve, Box<dyn Error>> {- let path = curve_source(findings)?.join(plot::PLOT_FILE_NAME);- let text =- std::fs::read_to_string(&path).map_err(|err| format!("{}: {err}", path.display()))?;- Ok(plot::parse(&text)?)+ Ok(runner::read_curve(findings)?)}fn print_coverage_curve(findings: &std::path::Path) {@@ -1530,7 +1597,7 @@ fn print_coverage_curve(findings: &std::path::Path) {eprintln!("warning: the coverage curve is empty; the campaign wrote no sample");return;};- if let Ok(source) = curve_source(findings)+ if let Ok(source) = runner::primary_instance(findings)&& let Some(name) = source.file_name(){println!("curve_instance {}", name.to_string_lossy());diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/justfile b/PROJECTS/advanced/zero-day-vulnerability-scanner/justfileindex 5d031b9b..ad6bb57d 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/justfile+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/justfile@@ -93,3 +93,9 @@ m8-gate:m8-gate-reset:docker compose -f dev.compose.yml exec toolchain bash scripts/m8-gate.sh reset++m9-gate:+ docker compose -f dev.compose.yml exec toolchain bash scripts/m9-gate.sh++m9-gate-reset:+ docker compose -f dev.compose.yml exec toolchain bash scripts/m9-gate.sh resetdiff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m9-gate.sh b/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m9-gate.shnew file mode 100755index 00000000..733260ed--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/scripts/m9-gate.sh@@ -0,0 +1,255 @@+#!/usr/bin/env bash+# ©AngelaMos | 2026+# m9-gate.sh++set -euo pipefail++WORK="${MAGMA_WORK:-/opt/magma-work}"+OUT_ROOT="$WORK/out/libpng"+SEEDS="$WORK/libpng/corpus/libpng_read_fuzzer"+GATE="$WORK/m9"+FINDINGS="$GATE/findings"+DB="$GATE/lisdex.sqlite"+EMPTY="$GATE/empty"+GATE_LOG="$GATE/stage.log"+CAMPAIGN_LOG="$GATE/campaign.log"+LISDEX_BIN="${CARGO_TARGET_DIR:-/cargo-target}/debug/lisdex"+TARGET="$OUT_ROOT/afl/lisdex_libpng_read"+CMPLOG="$OUT_ROOT/cmplog/lisdex_libpng_read"+GATE_DURATION="${LISDEX_M9_DURATION:-240}"+GATE_JOBS="${LISDEX_M9_JOBS:-2}"++TUI_MANIFEST="crates/lisdex-tui/Cargo.toml"+TUI_SRC="crates/lisdex-tui/src"+ANALYSIS_SRC=(+ "crates/lisdex-monitor/src"+ "crates/lisdex-core/src"+ "crates/lisdex-fuzz/src"+ "crates/lisdex-triage/src"+)+LIVE_WAIT_SECONDS=90+RENDER_WIDTH=170+RENDER_HEIGHT=46++ANALYSIS_SYMBOLS=(+ "classify"+ "group_crashes"+ "SanitizerReport"+ "plot::parse"+ "stack_hash"+ "libcasr"+ "rusqlite"+)++FAILURES=0++log() { printf '\n[m9] %s\n' "$1"; }+die() { printf '\n[m9] FAIL: %s\n' "$1" >&2; exit 1; }+pass() { printf ' PASS %s\n' "$1"; }+fail() { printf ' FAIL %s\n' "$1"; FAILURES=$((FAILURES + 1)); }++if [ "${1:-}" = "reset" ]; then+ log "resetting $GATE"+ rm -rf "$GATE"+fi++[ -x "$TARGET" ] || die "magma libpng not built; run: just magma-libpng"+[ -x "$CMPLOG" ] || die "cmplog target missing at $CMPLOG"+[ -d "$SEEDS" ] || die "seed corpus missing at $SEEDS"+[ -f "$TUI_MANIFEST" ] || die "run this from the project root; $TUI_MANIFEST not found"++mkdir -p "$GATE" "$EMPTY"++log "stage 1/8: build lisdex"+cargo build -p lisdex+[ -x "$LISDEX_BIN" ] || die "lisdex binary not found at $LISDEX_BIN"++log "stage 2/8: the view cannot reach analysis, because it does not link it"+# Only [dependencies] is inspected. A dev-dependency cannot be reached by the+# shipped view code, so it can build fixtures without weakening this property.+LINKED="$(awk '/^\[dependencies\]/{on=1;next} /^\[/{on=0} on' "$TUI_MANIFEST" \+ | grep -oE '^lisdex-[a-z]+' | sort -u | tr '\n' ' ' | sed 's/ $//')"+if [ "$LINKED" = "lisdex-monitor" ]; then+ pass "lisdex-tui links exactly one lisdex crate: $LINKED"+else+ fail "lisdex-tui links [$LINKED]; a pure view must link only lisdex-monitor"+fi++log "stage 3/8: no analysis symbol appears anywhere in the view's source"+for symbol in "${ANALYSIS_SYMBOLS[@]}"; do+ HITS="$(grep -rF -- "$symbol" "$TUI_SRC" | grep -c . || true)"+ if [ "$HITS" -eq 0 ]; then+ pass "view is free of '$symbol'"+ else+ fail "view mentions '$symbol' $HITS time(s); analysis belongs in the model"+ fi+done++log "stage 3b/8: control - the same searches find those symbols in the analysis layer"+# Without this, stage 3 passes on a wrong path or a typo'd pattern and certifies+# nothing. Each symbol is searched across every crate the view refuses to link,+# because that is where the analysis it must not contain actually lives.+MISSING=""+for symbol in "${ANALYSIS_SYMBOLS[@]}"; do+ HITS="$(grep -rF -- "$symbol" "${ANALYSIS_SRC[@]}" | grep -c . || true)"+ [ "$HITS" -eq 0 ] && MISSING="$MISSING $symbol"+done+if [ -z "$MISSING" ]; then+ pass "all ${#ANALYSIS_SYMBOLS[@]} searched symbols are live in the analysis layer"+else+ fail "searched symbol(s) absent from the analysis layer:$MISSING; stage 3 proves nothing about them"+fi++log "stage 4/8: the model and the view answer for themselves"+if cargo test -p lisdex-monitor -p lisdex-tui > "$GATE_LOG" 2>&1; then+ TESTS="$(grep -oE 'test result: ok\. [0-9]+' "$GATE_LOG" \+ | grep -oE '[0-9]+' | paste -sd+ | bc)"+ pass "lisdex-monitor and lisdex-tui: $TESTS tests"+else+ fail "model or view tests (see $GATE_LOG)"+fi++log "stage 5/8: a live campaign renders while it is still running (${GATE_DURATION}s)"+rm -rf "$FINDINGS" "$DB"+"$LISDEX_BIN" fuzz --target "$TARGET" --cmplog "$CMPLOG" --seeds "$SEEDS" \+ --findings "$FINDINGS" --db "$DB" --duration "$GATE_DURATION" \+ --jobs "$GATE_JOBS" > "$CAMPAIGN_LOG" 2>&1 &+CAMPAIGN_PID=$!++WAITED=0+while [ "$WAITED" -lt "$LIVE_WAIT_SECONDS" ]; do+ if find "$FINDINGS" -name plot_data -size +1c 2>/dev/null | grep -q .; then+ break+ fi+ sleep 2+ WAITED=$((WAITED + 2))+done++LIVE_FRAME="$GATE/live.frame"+"$LISDEX_BIN" tui --db "$DB" --findings "$FINDINGS" --once \+ --width "$RENDER_WIDTH" --height "$RENDER_HEIGHT" > "$LIVE_FRAME" 2>&1 \+ || fail "rendering a running campaign failed (see $LIVE_FRAME)"++if grep -q 'FUZZING' "$LIVE_FRAME"; then+ pass "the panel reports the campaign as FUZZING while afl-fuzz is still up"+else+ fail "a running campaign did not render as FUZZING (see $LIVE_FRAME)"+fi+if grep -q 'lisdex_libpng_read' "$LIVE_FRAME"; then+ pass "the panel names the target the campaign is fuzzing"+else+ fail "the target name is missing from the live frame"+fi++wait "$CAMPAIGN_PID" || die "campaign failed (see $CAMPAIGN_LOG)"++log "stage 6/8: the finished campaign renders on every panel"+for panel in overview findings instances; do+ "$LISDEX_BIN" tui --db "$DB" --findings "$FINDINGS" --once --panel "$panel" \+ --width "$RENDER_WIDTH" --height "$RENDER_HEIGHT" > "$GATE/$panel.frame" 2>&1 \+ || fail "rendering panel $panel failed"+done++grep -q 'EDGE COVERAGE' "$GATE/overview.frame" \+ && pass "overview draws the coverage gauge" \+ || fail "overview is missing the coverage gauge"+grep -q 'SANITIZER REPORT' "$GATE/findings.frame" \+ && pass "findings draws the raw report an advisory would quote" \+ || fail "findings is missing the sanitizer report pane"+grep -q 'EXEC RATE BY INSTANCE' "$GATE/instances.frame" \+ && pass "instances draws the per-instance rate chart" \+ || fail "instances is missing the per-instance chart"++RENDERED_INSTANCES="$(grep -cE '^│(main|secondary[0-9]+) ' "$GATE/instances.frame" || true)"+if [ "$RENDERED_INSTANCES" -eq "$GATE_JOBS" ]; then+ pass "$RENDERED_INSTANCES instance row(s) rendered, matching the $GATE_JOBS that ran"+else+ fail "expected $GATE_JOBS instance rows, rendered $RENDERED_INSTANCES"+fi++# Stage 3 proves the view cannot CALL analysis. It cannot prove the view does not+# ASSERT. afl-fuzz leaves fuzzer_stats on disk after it exits, so any liveness+# word printed over a finished campaign is a claim the tool cannot observe.+# The pattern matches the CLAIM ("2 running", "live campaign"), not the bare word:+# the findings panel quotes the target's own stderr, and magma's canary harness+# prints "Monitor not running. Canaries will be disabled." on every crash.+LIVENESS_CLAIM='[0-9]+ running|live campaign'+LIVENESS_CLAIMS=0+for panel in overview findings instances; do+ grep -qE "$LIVENESS_CLAIM" "$GATE/$panel.frame" \+ && LIVENESS_CLAIMS=$((LIVENESS_CLAIMS + 1))+done+if ! grep -q 'COMPLETED' "$GATE/overview.frame"; then+ fail "this campaign did not render as COMPLETED, so the liveness check below is vacuous"+elif [ "$LIVENESS_CLAIMS" -eq 0 ]; then+ pass "no panel calls a finished campaign running or live"+else+ fail "$LIVENESS_CLAIMS panel(s) assert liveness over a campaign that has already exited"+fi++log "stage 7/8: the panel agrees with the tools it is a view over"+CLI_CRASHES="$("$LISDEX_BIN" crashes --db "$DB" --campaign 1 | grep -c 'stack_hash' || true)"+CLI_BUGS="$("$LISDEX_BIN" crashes --db "$DB" --campaign 1 \+ | grep -oE 'stack_hash [0-9a-f]+' | sort -u | grep -c . || true)"+CLI_PEAK="$("$LISDEX_BIN" coverage --findings "$FINDINGS" \+ | awk '/curve_peak_edges/ {print $2}')"++TUI_CRASHES="$(grep -oE 'crashes [0-9]+' "$GATE/overview.frame" | head -1 | grep -oE '[0-9]+')"+TUI_BUGS="$(grep -oE 'bugs [0-9]+' "$GATE/overview.frame" | head -1 | grep -oE '[0-9]+')"+TUI_PEAK="$(grep -oE 'peak edges *[0-9,]+' "$GATE/overview.frame" | head -1 \+ | grep -oE '[0-9,]+' | tr -d ',' || true)"++if [ "$CLI_CRASHES" -gt 0 ]; then+ pass "the campaign persisted $CLI_CRASHES crash(es), so the comparison is not vacuous"+else+ fail "no crash was persisted; the findings comparison below proves nothing"+fi+if [ "$TUI_CRASHES" = "$CLI_CRASHES" ]; then+ pass "crash count agrees with 'lisdex crashes': $TUI_CRASHES"+else+ fail "panel shows $TUI_CRASHES crashes, 'lisdex crashes' reports $CLI_CRASHES"+fi+if [ "$TUI_BUGS" = "$CLI_BUGS" ]; then+ pass "distinct-bug count agrees with 'lisdex crashes': $TUI_BUGS"+else+ fail "panel shows $TUI_BUGS bugs, 'lisdex crashes' reports $CLI_BUGS"+fi+if [ "$TUI_PEAK" = "$CLI_PEAK" ]; then+ pass "peak edges agrees with 'lisdex coverage': $TUI_PEAK"+else+ fail "panel charts a peak of $TUI_PEAK, 'lisdex coverage' reports $CLI_PEAK"+fi++log "stage 8/8: control - an empty campaign must not render the numbers of a real one"+EMPTY_FRAME="$GATE/empty.frame"+"$LISDEX_BIN" tui --db "$EMPTY/none.sqlite" --findings "$EMPTY" --once \+ --width "$RENDER_WIDTH" --height "$RENDER_HEIGHT" > "$EMPTY_FRAME" 2>&1 \+ || fail "rendering an empty source failed instead of reporting it"++if grep -q 'no campaign in store' "$EMPTY_FRAME"; then+ pass "an empty source renders its reason rather than a blank panel"+else+ fail "an empty source did not say why it is empty (see $EMPTY_FRAME)"+fi+if grep -q 'lisdex_libpng_read' "$EMPTY_FRAME"; then+ fail "the empty frame names a target it was never given; the panel is printing a template"+else+ pass "the empty frame names no target, so the live frame really was read from disk"+fi+if cmp -s "$GATE/overview.frame" "$EMPTY_FRAME"; then+ fail "the real and empty frames are byte-identical; the renderer ignores its input"+else+ pass "the real and empty frames differ, so the panel renders what it was pointed at"+fi++log "RESULT"+if [ "$FAILURES" -eq 0 ]; then+ printf '\n[m9] M9 EXIT GATE PASSED\n'+ printf ' CHECK 1 the view links only the read-model, and names no analysis symbol\n'+ printf ' CHECK 2 a campaign still running renders live, on every panel\n'+ printf ' CHECK 3 its counts equal what lisdex crashes and lisdex coverage report\n'+ printf ' CHECK 4 an empty source renders its reason, and not the numbers of a real run\n'+ exit 0+fi+printf '\n[m9] M9 EXIT GATE FAILED: %s check(s)\n' "$FAILURES" >&2+exit 1