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): lisdex-llm thin - the ballot is the guarantee, and the answer was in the other field
CarterPerez-dev0ab3103443cc
diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lock b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lockindex b9b75ea5..4f73ba3b 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lock+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.lock@@ -2,6 +2,12 @@# It is not intended for manual editing.version = 4+[[package]]+name = "adler2"+version = "2.0.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"+[[package]]name = "ahash"version = "0.8.12"@@ -50,7 +56,7 @@ version = "1.1.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"dependencies = [- "windows-sys",+ "windows-sys 0.61.2",][[package]]@@ -61,9 +67,15 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"dependencies = ["anstyle","once_cell_polyfill",- "windows-sys",+ "windows-sys 0.61.2",]+[[package]]+name = "base64"+version = "0.22.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"+[[package]]name = "bitflags"version = "2.13.1"@@ -79,6 +91,12 @@ dependencies = ["generic-array",]+[[package]]+name = "bytes"+version = "1.12.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"+[[package]]name = "cc"version = "1.4.0"@@ -162,6 +180,35 @@ version = "1.0.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570"+[[package]]+name = "cookie"+version = "0.18.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747"+dependencies = [+ "percent-encoding",+ "time",+ "version_check",+]++[[package]]+name = "cookie_store"+version = "0.22.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206"+dependencies = [+ "cookie",+ "document-features",+ "idna",+ "indexmap",+ "log",+ "serde",+ "serde_derive",+ "serde_json",+ "time",+ "url",+]+[[package]]name = "cpufeatures"version = "0.2.17"@@ -171,6 +218,15 @@ dependencies = ["libc",]+[[package]]+name = "crc32fast"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511"+dependencies = [+ "cfg-if",+]+[[package]]name = "crypto-common"version = "0.1.7"@@ -181,6 +237,12 @@ dependencies = ["typenum",]+[[package]]+name = "deranged"+version = "0.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c"+[[package]]name = "digest"version = "0.10.7"@@ -191,6 +253,32 @@ dependencies = ["crypto-common",]+[[package]]+name = "displaydoc"+version = "0.2.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 3.0.3",+]++[[package]]+name = "document-features"+version = "0.2.12"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61"+dependencies = [+ "litrs",+]++[[package]]+name = "equivalent"+version = "1.0.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"+[[package]]name = "fallible-iterator"version = "0.3.0"@@ -209,6 +297,25 @@ version = "0.1.9"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"+[[package]]+name = "flate2"+version = "1.1.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c"+dependencies = [+ "crc32fast",+ "miniz_oxide",+]++[[package]]+name = "form_urlencoded"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf"+dependencies = [+ "percent-encoding",+]+[[package]]name = "generic-array"version = "0.14.7"@@ -219,6 +326,17 @@ dependencies = ["version_check",]+[[package]]+name = "getrandom"+version = "0.2.17"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"+dependencies = [+ "cfg-if",+ "libc",+ "wasi",+]+[[package]]name = "glob"version = "0.3.4"@@ -234,13 +352,19 @@ dependencies = ["ahash",]+[[package]]+name = "hashbrown"+version = "0.17.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"+[[package]]name = "hashlink"version = "0.9.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af"dependencies = [- "hashbrown",+ "hashbrown 0.14.5",][[package]]@@ -249,6 +373,135 @@ version = "0.5.0"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"+[[package]]+name = "http"+version = "1.5.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0"+dependencies = [+ "bytes",+ "itoa",+]++[[package]]+name = "httparse"+version = "1.10.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"++[[package]]+name = "icu_collections"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c"+dependencies = [+ "displaydoc",+ "potential_utf",+ "utf8_iter",+ "yoke",+ "zerofrom",+ "zerovec",+]++[[package]]+name = "icu_locale_core"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29"+dependencies = [+ "displaydoc",+ "litemap",+ "tinystr",+ "writeable",+ "zerovec",+]++[[package]]+name = "icu_normalizer"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4"+dependencies = [+ "icu_collections",+ "icu_normalizer_data",+ "icu_properties",+ "icu_provider",+ "smallvec",+ "zerovec",+]++[[package]]+name = "icu_normalizer_data"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38"++[[package]]+name = "icu_properties"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de"+dependencies = [+ "icu_collections",+ "icu_locale_core",+ "icu_properties_data",+ "icu_provider",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "icu_properties_data"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14"++[[package]]+name = "icu_provider"+version = "2.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421"+dependencies = [+ "displaydoc",+ "icu_locale_core",+ "writeable",+ "yoke",+ "zerofrom",+ "zerotrie",+ "zerovec",+]++[[package]]+name = "idna"+version = "1.1.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de"+dependencies = [+ "idna_adapter",+ "smallvec",+ "utf8_iter",+]++[[package]]+name = "idna_adapter"+version = "1.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714"+dependencies = [+ "icu_normalizer",+ "icu_properties",+]++[[package]]+name = "indexmap"+version = "2.14.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9"+dependencies = [+ "equivalent",+ "hashbrown 0.17.1",+]+[[package]]name = "is_terminal_polyfill"version = "1.70.2"@@ -298,6 +551,7 @@ dependencies = ["lisdex-fuzz","lisdex-harness","lisdex-ingest",+ "lisdex-llm","lisdex-surface","serde_json",]@@ -348,6 +602,17 @@ dependencies = ["thiserror",]+[[package]]+name = "lisdex-llm"+version = "0.0.0"+dependencies = [+ "lisdex-core",+ "serde",+ "serde_json",+ "thiserror",+ "ureq",+]+[[package]]name = "lisdex-surface"version = "0.1.0"@@ -357,12 +622,46 @@ dependencies = ["thiserror",]+[[package]]+name = "litemap"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"++[[package]]+name = "litrs"+version = "1.0.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092"++[[package]]+name = "log"+version = "0.4.33"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad"+[[package]]name = "memchr"version = "2.8.3"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"+[[package]]+name = "miniz_oxide"+version = "0.8.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316"+dependencies = [+ "adler2",+ "simd-adler32",+]++[[package]]+name = "num-conv"+version = "0.2.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"+[[package]]name = "once_cell"version = "1.21.4"@@ -375,12 +674,33 @@ version = "1.70.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe"+[[package]]+name = "percent-encoding"+version = "2.3.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"+[[package]]name = "pkg-config"version = "0.3.33"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e"+[[package]]+name = "potential_utf"+version = "0.1.5"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"+dependencies = [+ "zerovec",+]++[[package]]+name = "powerfmt"+version = "0.2.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"+[[package]]name = "proc-macro2"version = "1.0.107"@@ -399,6 +719,20 @@ dependencies = ["proc-macro2",]+[[package]]+name = "ring"+version = "0.17.14"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"+dependencies = [+ "cc",+ "cfg-if",+ "getrandom",+ "libc",+ "untrusted",+ "windows-sys 0.52.0",+]+[[package]]name = "rusqlite"version = "0.32.1"@@ -413,6 +747,41 @@ dependencies = ["smallvec",]+[[package]]+name = "rustls"+version = "0.23.43"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0283386ce02abc0151e1761d08802dfe86c173b0b494af5cbc086574e453da06"+dependencies = [+ "log",+ "once_cell",+ "ring",+ "rustls-pki-types",+ "rustls-webpki",+ "subtle",+ "zeroize",+]++[[package]]+name = "rustls-pki-types"+version = "1.15.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96"+dependencies = [+ "zeroize",+]++[[package]]+name = "rustls-webpki"+version = "0.103.13"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e"+dependencies = [+ "ring",+ "rustls-pki-types",+ "untrusted",+]+[[package]]name = "serde"version = "1.0.229"@@ -473,18 +842,36 @@ version = "2.0.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"+[[package]]+name = "simd-adler32"+version = "0.3.10"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea"+[[package]]name = "smallvec"version = "1.15.2"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90"+[[package]]+name = "stable_deref_trait"+version = "1.2.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"+[[package]]name = "strsim"version = "0.11.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"+[[package]]+name = "subtle"+version = "2.6.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"+[[package]]name = "syn"version = "2.0.119"@@ -507,6 +894,17 @@ dependencies = ["unicode-ident",]+[[package]]+name = "synstructure"+version = "0.13.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]+[[package]]name = "thiserror"version = "2.0.19"@@ -527,6 +925,46 @@ dependencies = ["syn 3.0.3",]+[[package]]+name = "time"+version = "0.3.55"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"+dependencies = [+ "deranged",+ "num-conv",+ "powerfmt",+ "serde_core",+ "time-core",+ "time-macros",+]++[[package]]+name = "time-core"+version = "0.1.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"++[[package]]+name = "time-macros"+version = "0.2.32"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"+dependencies = [+ "num-conv",+ "time-core",+]++[[package]]+name = "tinystr"+version = "0.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"+dependencies = [+ "displaydoc",+ "zerovec",+]+[[package]]name = "typenum"version = "1.20.1"@@ -539,6 +977,68 @@ version = "1.0.24"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"+[[package]]+name = "untrusted"+version = "0.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1"++[[package]]+name = "ureq"+version = "3.3.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0"+dependencies = [+ "base64",+ "cookie_store",+ "flate2",+ "log",+ "percent-encoding",+ "rustls",+ "rustls-pki-types",+ "serde",+ "serde_json",+ "ureq-proto",+ "utf8-zero",+ "webpki-roots",+]++[[package]]+name = "ureq-proto"+version = "0.6.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c"+dependencies = [+ "base64",+ "http",+ "httparse",+ "log",+]++[[package]]+name = "url"+version = "2.5.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"+dependencies = [+ "form_urlencoded",+ "idna",+ "percent-encoding",+ "serde",+]++[[package]]+name = "utf8-zero"+version = "0.8.1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e"++[[package]]+name = "utf8_iter"+version = "1.0.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"+[[package]]name = "utf8parse"version = "0.2.2"@@ -557,12 +1057,36 @@ version = "0.9.5"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"+[[package]]+name = "wasi"+version = "0.11.1+wasi-snapshot-preview1"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"++[[package]]+name = "webpki-roots"+version = "1.0.9"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a"+dependencies = [+ "rustls-pki-types",+]+[[package]]name = "windows-link"version = "0.2.1"source = "registry+https://github.com/rust-lang/crates.io-index"checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"+[[package]]+name = "windows-sys"+version = "0.52.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"+dependencies = [+ "windows-targets",+]+[[package]]name = "windows-sys"version = "0.61.2"@@ -572,6 +1096,99 @@ dependencies = ["windows-link",]+[[package]]+name = "windows-targets"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"+dependencies = [+ "windows_aarch64_gnullvm",+ "windows_aarch64_msvc",+ "windows_i686_gnu",+ "windows_i686_gnullvm",+ "windows_i686_msvc",+ "windows_x86_64_gnu",+ "windows_x86_64_gnullvm",+ "windows_x86_64_msvc",+]++[[package]]+name = "windows_aarch64_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"++[[package]]+name = "windows_aarch64_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"++[[package]]+name = "windows_i686_gnu"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"++[[package]]+name = "windows_i686_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"++[[package]]+name = "windows_i686_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"++[[package]]+name = "windows_x86_64_gnu"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"++[[package]]+name = "windows_x86_64_gnullvm"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"++[[package]]+name = "windows_x86_64_msvc"+version = "0.52.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"++[[package]]+name = "writeable"+version = "0.6.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"++[[package]]+name = "yoke"+version = "0.8.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5"+dependencies = [+ "stable_deref_trait",+ "yoke-derive",+ "zerofrom",+]++[[package]]+name = "yoke-derive"+version = "0.8.2"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+ "synstructure",+]+[[package]]name = "zerocopy"version = "0.8.55"@@ -592,6 +1209,66 @@ dependencies = ["syn 2.0.119",]+[[package]]+name = "zerofrom"+version = "0.1.8"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272"+dependencies = [+ "zerofrom-derive",+]++[[package]]+name = "zerofrom-derive"+version = "0.1.7"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+ "synstructure",+]++[[package]]+name = "zeroize"+version = "1.9.0"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"++[[package]]+name = "zerotrie"+version = "0.2.4"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"+dependencies = [+ "displaydoc",+ "yoke",+ "zerofrom",+]++[[package]]+name = "zerovec"+version = "0.11.6"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"+dependencies = [+ "yoke",+ "zerofrom",+ "zerovec-derive",+]++[[package]]+name = "zerovec-derive"+version = "0.11.3"+source = "registry+https://github.com/rust-lang/crates.io-index"+checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"+dependencies = [+ "proc-macro2",+ "quote",+ "syn 2.0.119",+]+[[package]]name = "zmij"version = "1.0.23"diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.tomlindex da330ed7..cfd55532 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.toml+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/Cargo.toml@@ -19,12 +19,14 @@ sha2 = "0.10"clap = { version = "4", features = ["derive"] }serde = { version = "1", features = ["derive"] }serde_json = "1"+ureq = { version = "3", features = ["json"] }lisdex-core = { path = "crates/lisdex-core" }lisdex-fuzz = { path = "crates/lisdex-fuzz" }lisdex-ingest = { path = "crates/lisdex-ingest" }lisdex-build = { path = "crates/lisdex-build" }lisdex-surface = { path = "crates/lisdex-surface" }lisdex-harness = { path = "crates/lisdex-harness" }+lisdex-llm = { path = "crates/lisdex-llm" }[workspace.lints.rust]unsafe_code = "deny"diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/Cargo.tomlnew file mode 100644index 00000000..908ac946--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/Cargo.toml@@ -0,0 +1,20 @@+# ©AngelaMos | 2026+# Cargo.toml++[package]+name = "lisdex-llm"+version = "0.0.0"+edition.workspace = true+rust-version.workspace = true+license.workspace = true+authors.workspace = true++[dependencies]+lisdex-core = { workspace = true }+serde = { workspace = true }+serde_json = { workspace = true }+thiserror = { workspace = true }+ureq = { workspace = true }++[lints]+workspace = truediff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/api.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/api.rsnew file mode 100644index 00000000..f2af7786--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/api.rs@@ -0,0 +1,229 @@+// ©AngelaMos | 2026+// api.rs++use std::time::{Duration, Instant};++use lisdex_core::config::LlmTier;++use crate::ballot::{self, Declined};+use crate::wire::{self, PROMPT_TIMEOUT_SECS};+use crate::{Ask, Booster, Outcome, Proposal};++pub const ENDPOINT_ENV: &str = "LISDEX_LLM_API_ENDPOINT";+pub const KEY_ENV: &str = "LISDEX_LLM_API_KEY";+pub const MODEL_ENV: &str = "LISDEX_LLM_API_MODEL";+pub const CHAT_PATH: &str = "/chat/completions";+pub const SCHEMA_NAME: &str = "lisdex_ballot";++pub struct ApiBooster {+ endpoint: Option<String>,+ key: Option<String>,+ model: Option<String>,+}++impl ApiBooster {+ #[must_use]+ pub fn new(endpoint: Option<String>, key: Option<String>, model: Option<String>) -> Self {+ Self {+ endpoint,+ key,+ model,+ }+ }++ #[must_use]+ pub fn from_env() -> Self {+ Self::new(+ std::env::var(ENDPOINT_ENV).ok(),+ std::env::var(KEY_ENV).ok(),+ std::env::var(MODEL_ENV).ok(),+ )+ }++ // The keyless doctrine puts this tier entirely outside the default path: it is configured or+ // it declines, and declining is never an error. Nothing the tool does for its own sake may+ // depend on a key existing.+ fn configured(&self) -> Result<(&str, &str, &str), Declined> {+ let missing: Vec<&str> = [+ (ENDPOINT_ENV, self.endpoint.is_none()),+ (KEY_ENV, self.key.is_none()),+ (MODEL_ENV, self.model.is_none()),+ ]+ .into_iter()+ .filter_map(|(name, absent)| absent.then_some(name))+ .collect();+ if !missing.is_empty() {+ return Err(Declined::BackendUnavailable {+ detail: format!(+ "the api tier is not configured; set {}. The local and none tiers need no key",+ missing.join(", ")+ ),+ });+ }+ match (+ self.endpoint.as_deref(),+ self.key.as_deref(),+ self.model.as_deref(),+ ) {+ (Some(endpoint), Some(key), Some(model)) => Ok((endpoint, key, model)),+ _ => Err(Declined::BackendUnavailable {+ detail: "the api tier is not configured".to_owned(),+ }),+ }+ }+}++impl Booster for ApiBooster {+ fn propose(&self, ask: &Ask) -> Outcome {+ let (endpoint, key, model) = match self.configured() {+ Ok(parts) => parts,+ Err(declined) => return Outcome::Declined(declined),+ };+ let agent = wire::agent(Duration::from_secs(PROMPT_TIMEOUT_SECS));+ let url = format!("{endpoint}{CHAT_PATH}");+ let request = serde_json::json!({+ "model": model,+ "temperature": 0,+ "messages": [{ "role": "user", "content": wire::prompt(ask) }],+ "response_format": {+ "type": "json_schema",+ "json_schema": {+ "name": SCHEMA_NAME,+ "strict": true,+ "schema": wire::schema(ask.ballot()),+ }+ },+ });+ let started = Instant::now();+ let body = match wire::post(&agent, &url, &request, Some(key)) {+ Ok(body) => body,+ Err(failure) => {+ return Outcome::Declined(Declined::BackendUnavailable {+ detail: failure.to_string(),+ });+ }+ };+ let elapsed = started.elapsed();+ let raw = body+ .get("choices")+ .and_then(serde_json::Value::as_array)+ .and_then(|choices| choices.first())+ .and_then(|choice| choice.get("message"))+ .and_then(|message| message.get("content"))+ .and_then(serde_json::Value::as_str);+ let Some(raw) = raw else {+ return Outcome::Declined(Declined::BackendUnavailable {+ detail: format!("{url} answered JSON with no choices[0].message.content"),+ });+ };+ match ballot::adjudicate(ask.ballot(), raw) {+ Ok(choice) => Outcome::Proposed(Proposal {+ choice,+ tier: LlmTier::Api,+ model: model.to_owned(),+ elapsed,+ }),+ Err(declined) => Outcome::Declined(declined),+ }+ }++ fn describe(&self) -> String {+ match (self.endpoint.as_deref(), self.model.as_deref()) {+ (Some(endpoint), Some(model)) if self.key.is_some() => {+ format!("api ({model} at {endpoint})")+ }+ _ => "api (not configured)".to_owned(),+ }+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn ask() -> Ask {+ Ask::new(+ "is src a byte buffer or a string",+ "int LZ4_decompress_safe(const char *src, char *dst, int n, int max);",+ vec!["byte_buffer".to_owned(), "nul_terminated_string".to_owned()],+ )+ .expect("valid ask")+ }++ #[test]+ fn an_unconfigured_api_tier_declines_and_names_every_missing_variable() {+ let booster = ApiBooster::new(None, None, None);+ let Outcome::Declined(Declined::BackendUnavailable { detail }) = booster.propose(&ask())+ else {+ panic!("an unconfigured api tier did not decline gracefully");+ };+ for name in [ENDPOINT_ENV, KEY_ENV, MODEL_ENV] {+ assert!(detail.contains(name), "{name} not named in: {detail}");+ }+ }++ #[test]+ fn a_partly_configured_api_tier_names_only_what_is_missing() {+ let booster = ApiBooster::new(+ Some("https://example.invalid/v1".to_owned()),+ None,+ Some("some-model".to_owned()),+ );+ let Outcome::Declined(Declined::BackendUnavailable { detail }) = booster.propose(&ask())+ else {+ panic!("a partly configured api tier did not decline gracefully");+ };+ assert!(detail.contains(KEY_ENV), "{detail}");+ assert!(!detail.contains(ENDPOINT_ENV), "{detail}");+ assert!(!detail.contains(MODEL_ENV), "{detail}");+ }++ // The doctrine, asserted rather than described: an unconfigured optional tier must point the+ // user at the tiers that need nothing, never at a signup page.+ #[test]+ fn the_unconfigured_reason_points_at_the_keyless_tiers() {+ let booster = ApiBooster::new(None, None, None);+ let Outcome::Declined(Declined::BackendUnavailable { detail }) = booster.propose(&ask())+ else {+ panic!("an unconfigured api tier did not decline gracefully");+ };+ assert!(+ detail.contains("local") && detail.contains("none"),+ "the remedy does not mention the keyless tiers: {detail}"+ );+ }++ #[test]+ fn an_unconfigured_api_tier_describes_itself_as_unconfigured() {+ assert_eq!(+ ApiBooster::new(None, None, None).describe(),+ "api (not configured)"+ );+ }++ #[test]+ fn a_fully_configured_api_tier_describes_its_model_and_endpoint() {+ let booster = ApiBooster::new(+ Some("https://example.invalid/v1".to_owned()),+ Some("secret".to_owned()),+ Some("some-model".to_owned()),+ );+ let described = booster.describe();+ assert!(described.contains("some-model"), "{described}");+ assert!(+ described.contains("https://example.invalid/v1"),+ "{described}"+ );+ }++ // A description is printed in run reports. A key that reaches a report reaches a paste.+ #[test]+ fn the_description_never_carries_the_key() {+ let booster = ApiBooster::new(+ Some("https://example.invalid/v1".to_owned()),+ Some("sk-do-not-print-me".to_owned()),+ Some("some-model".to_owned()),+ );+ assert!(!booster.describe().contains("sk-do-not-print-me"));+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/ballot.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/ballot.rsnew file mode 100644index 00000000..a25241ab--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/ballot.rs@@ -0,0 +1,208 @@+// ©AngelaMos | 2026+// ballot.rs++pub const CHOICE_FIELD: &str = "choice";+pub const FENCE: &str = "```";++#[derive(Debug, Clone, PartialEq, Eq)]+pub enum Declined {+ NoBooster,+ BackendUnavailable { detail: String },+ OffBallot { returned: String },+ Empty,+}++impl std::fmt::Display for Declined {+ fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {+ match self {+ Declined::NoBooster => write!(+ formatter,+ "no booster is configured, so the deterministic answer stands"+ ),+ Declined::BackendUnavailable { detail } => write!(+ formatter,+ "the booster backend is unavailable, so the deterministic answer stands: {detail}"+ ),+ Declined::OffBallot { returned } => write!(+ formatter,+ "the model answered {returned:?}, which was not on the ballot; a choice the caller did not offer is a fabrication and is discarded"+ ),+ Declined::Empty => write!(formatter, "the model returned nothing to adjudicate"),+ }+ }+}++fn strip_fence(text: &str) -> &str {+ let trimmed = text.trim();+ let Some(inner) = trimmed.strip_prefix(FENCE) else {+ return trimmed;+ };+ let inner = inner.strip_suffix(FENCE).unwrap_or(inner);+ match inner.split_once('\n') {+ Some((_language, body)) => body.trim(),+ None => inner.trim(),+ }+}++fn strip_quotes(text: &str) -> &str {+ for quote in ['"', '\''] {+ if let Some(inner) = text.strip_prefix(quote)+ && let Some(inner) = inner.strip_suffix(quote)+ {+ return inner;+ }+ }+ text+}++// The model is asked for a JSON object because a server that honours a schema cannot answer off+// the ballot at all. The raw text is still adjudicated when that object does not arrive, because+// schema support is a property of the server rather than of the protocol, and a booster that+// declines whenever a server is old is a booster nobody can use.+#[must_use]+pub fn extract(raw: &str) -> String {+ let body = strip_fence(raw);+ if let Ok(serde_json::Value::Object(fields)) = serde_json::from_str::<serde_json::Value>(body)+ && let Some(serde_json::Value::String(choice)) = fields.get(CHOICE_FIELD)+ {+ return choice.trim().to_owned();+ }+ strip_quotes(body.trim()).trim().to_owned()+}++// Exact match, and deliberately nothing looser. Every near-miss rule considered here (case+// folding, trailing punctuation, substring containment) turns "the model said something adjacent+// to an option" into "the caller acted on an option", which is the fabrication this whole layer+// exists to prevent. Declining costs a booster suggestion; guessing costs a fabricated crash.+pub fn adjudicate(ballot: &[String], raw: &str) -> Result<String, Declined> {+ let answer = extract(raw);+ if answer.is_empty() {+ return Err(Declined::Empty);+ }+ if ballot.iter().any(|option| option == &answer) {+ return Ok(answer);+ }+ Err(Declined::OffBallot { returned: answer })+}++#[cfg(test)]+mod tests {+ use super::*;++ fn ballot() -> Vec<String> {+ vec![+ "byte_buffer".to_owned(),+ "nul_terminated_string".to_owned(),+ "element_count".to_owned(),+ ]+ }++ #[test]+ fn a_bare_option_is_accepted() {+ assert_eq!(+ adjudicate(&ballot(), "byte_buffer"),+ Ok("byte_buffer".to_owned())+ );+ }++ #[test]+ fn surrounding_whitespace_does_not_change_the_verdict() {+ assert_eq!(+ adjudicate(&ballot(), "\n element_count \t\n"),+ Ok("element_count".to_owned())+ );+ }++ #[test]+ fn the_schema_object_is_unwrapped_to_its_choice() {+ assert_eq!(+ adjudicate(&ballot(), r#"{"choice":"nul_terminated_string"}"#),+ Ok("nul_terminated_string".to_owned())+ );+ }++ #[test]+ fn a_fenced_schema_object_is_unwrapped_too() {+ let raw = "```json\n{\"choice\": \"byte_buffer\"}\n```";+ assert_eq!(adjudicate(&ballot(), raw), Ok("byte_buffer".to_owned()));+ }++ #[test]+ fn a_quoted_bare_option_is_accepted() {+ assert_eq!(+ adjudicate(&ballot(), "\"byte_buffer\""),+ Ok("byte_buffer".to_owned())+ );+ }++ // The whole point of the layer. An answer the caller never offered is discarded and NAMED,+ // never rounded to the nearest option.+ #[test]+ fn an_answer_that_is_not_on_the_ballot_is_refused_and_reported_verbatim() {+ let got = adjudicate(&ballot(), "size_t");+ assert_eq!(+ got,+ Err(Declined::OffBallot {+ returned: "size_t".to_owned()+ })+ );+ }++ #[test]+ fn a_near_miss_is_still_off_ballot_because_case_is_not_folded() {+ let got = adjudicate(&ballot(), "Byte_Buffer");+ assert_eq!(+ got,+ Err(Declined::OffBallot {+ returned: "Byte_Buffer".to_owned()+ })+ );+ }++ // Prose that CONTAINS an option is not a vote for it. Accepting this is how a model that+ // hedges ("it is not byte_buffer") gets read as having chosen byte_buffer.+ #[test]+ fn prose_containing_an_option_is_not_a_vote_for_it() {+ let got = adjudicate(&ballot(), "It is certainly not byte_buffer here.");+ assert!(+ matches!(got, Err(Declined::OffBallot { .. })),+ "prose was read as a choice: {got:?}"+ );+ }++ #[test]+ fn an_empty_answer_is_named_as_empty_rather_than_off_ballot() {+ assert_eq!(adjudicate(&ballot(), " \n "), Err(Declined::Empty));+ }++ #[test]+ fn a_schema_object_carrying_an_invented_choice_is_still_refused() {+ let got = adjudicate(&ballot(), r#"{"choice":"whatever_i_want"}"#);+ assert_eq!(+ got,+ Err(Declined::OffBallot {+ returned: "whatever_i_want".to_owned()+ })+ );+ }++ #[test]+ fn every_declined_variant_says_something_actionable() {+ let variants = [+ Declined::NoBooster,+ Declined::BackendUnavailable {+ detail: "connection refused".to_owned(),+ },+ Declined::OffBallot {+ returned: "nonsense".to_owned(),+ },+ Declined::Empty,+ ];+ for variant in variants {+ assert!(+ variant.to_string().len() > 20,+ "{variant:?} explains nothing"+ );+ }+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/lib.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/lib.rsnew file mode 100644index 00000000..c5a8e052--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/lib.rs@@ -0,0 +1,201 @@+// ©AngelaMos | 2026+// lib.rs++pub mod api;+pub mod ballot;+pub mod local;+pub mod wire;++use std::time::Duration;++use lisdex_core::config::LlmTier;++pub use ballot::{Declined, adjudicate};++#[derive(Debug, Clone, PartialEq, Eq)]+pub struct Ask {+ subject: String,+ evidence: String,+ ballot: Vec<String>,+}++#[derive(Debug, thiserror::Error, PartialEq, Eq)]+pub enum AskError {+ #[error(+ "an ask with no ballot has nothing to choose from, so the model would answer in free text and the caller would have to trust it"+ )]+ EmptyBallot,+ #[error("ballot option {index} is blank, and a blank choice cannot be adjudicated")]+ BlankOption { index: usize },+ #[error("ballot option {option} appears more than once, so a match cannot be attributed")]+ DuplicateOption { option: String },+}++impl Ask {+ pub fn new(+ subject: impl Into<String>,+ evidence: impl Into<String>,+ ballot: Vec<String>,+ ) -> Result<Self, AskError> {+ if ballot.is_empty() {+ return Err(AskError::EmptyBallot);+ }+ for (index, option) in ballot.iter().enumerate() {+ if option.trim().is_empty() {+ return Err(AskError::BlankOption { index });+ }+ }+ for (index, option) in ballot.iter().enumerate() {+ if ballot[index + 1..].contains(option) {+ return Err(AskError::DuplicateOption {+ option: option.clone(),+ });+ }+ }+ Ok(Self {+ subject: subject.into(),+ evidence: evidence.into(),+ ballot,+ })+ }++ #[must_use]+ pub fn subject(&self) -> &str {+ &self.subject+ }++ #[must_use]+ pub fn evidence(&self) -> &str {+ &self.evidence+ }++ #[must_use]+ pub fn ballot(&self) -> &[String] {+ &self.ballot+ }+}++#[derive(Debug, Clone, PartialEq, Eq)]+pub struct Proposal {+ pub choice: String,+ pub tier: LlmTier,+ pub model: String,+ pub elapsed: Duration,+}++#[derive(Debug, Clone, PartialEq, Eq)]+pub enum Outcome {+ Declined(Declined),+ Proposed(Proposal),+}++impl Outcome {+ #[must_use]+ pub fn proposal(&self) -> Option<&Proposal> {+ match self {+ Outcome::Proposed(proposal) => Some(proposal),+ Outcome::Declined(_) => None,+ }+ }+}++pub trait Booster {+ fn propose(&self, ask: &Ask) -> Outcome;+ fn describe(&self) -> String;+}++pub struct NoBooster;++impl Booster for NoBooster {+ fn propose(&self, _ask: &Ask) -> Outcome {+ Outcome::Declined(Declined::NoBooster)+ }++ fn describe(&self) -> String {+ "none (deterministic only)".to_owned()+ }+}++#[must_use]+pub fn select(tier: LlmTier) -> Box<dyn Booster> {+ match tier {+ LlmTier::None => Box::new(NoBooster),+ LlmTier::Local => Box::new(local::LocalBooster::from_env()),+ LlmTier::Api => Box::new(api::ApiBooster::from_env()),+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ fn ballot() -> Vec<String> {+ vec!["byte_buffer".to_owned(), "nul_terminated_string".to_owned()]+ }++ #[test]+ fn an_ask_with_no_ballot_is_refused_at_construction() {+ assert_eq!(+ Ask::new("subject", "evidence", Vec::new()),+ Err(AskError::EmptyBallot)+ );+ }++ #[test]+ fn a_blank_ballot_option_is_refused() {+ let got = Ask::new(+ "subject",+ "evidence",+ vec!["ok".to_owned(), " ".to_owned()],+ );+ assert_eq!(got, Err(AskError::BlankOption { index: 1 }));+ }++ #[test]+ fn a_repeated_ballot_option_is_refused_because_a_match_cannot_be_attributed() {+ let got = Ask::new(+ "subject",+ "evidence",+ vec!["same".to_owned(), "same".to_owned()],+ );+ assert_eq!(+ got,+ Err(AskError::DuplicateOption {+ option: "same".to_owned()+ })+ );+ }++ #[test]+ fn the_none_tier_declines_every_ask_and_never_proposes() {+ let ask = Ask::new("what is src", "const char *src", ballot()).expect("valid ask");+ let outcome = NoBooster.propose(&ask);+ assert_eq!(outcome, Outcome::Declined(Declined::NoBooster));+ assert!(outcome.proposal().is_none());+ }++ // The keyless doctrine is that the `none` tier is a real tier, not an error path: selecting+ // it must hand back a working booster rather than failing, because every capability has to+ // work with no model present before an LLM tier is credited with anything.+ #[test]+ fn selecting_the_none_tier_yields_a_booster_that_works() {+ let booster = select(LlmTier::None);+ let ask = Ask::new("what is src", "const char *src", ballot()).expect("valid ask");+ assert_eq!(+ booster.propose(&ask),+ Outcome::Declined(Declined::NoBooster)+ );+ assert_eq!(booster.describe(), "none (deterministic only)");+ }++ #[test]+ fn every_tier_selects_a_booster_that_describes_itself() {+ for tier in [LlmTier::None, LlmTier::Local, LlmTier::Api] {+ let booster = select(tier);+ assert!(+ !booster.describe().is_empty(),+ "tier {tier:?} described itself as nothing"+ );+ }+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/local.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/local.rsnew file mode 100644index 00000000..784bf85f--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/local.rs@@ -0,0 +1,280 @@+// ©AngelaMos | 2026+// local.rs++use std::time::{Duration, Instant};++use lisdex_core::config::LlmTier;++use crate::ballot::{self, Declined};+use crate::wire::{self, PROBE_TIMEOUT_SECS, PROMPT_TIMEOUT_SECS};+use crate::{Ask, Booster, Outcome, Proposal};++pub const DEFAULT_ENDPOINT: &str = "http://127.0.0.1:11434";+pub const DEFAULT_MODEL: &str = "qwen2.5-coder:14b-instruct-q6_K";+pub const ENDPOINT_ENV: &str = "LISDEX_LLM_ENDPOINT";+pub const MODEL_ENV: &str = "LISDEX_LLM_MODEL";+pub const GENERATE_PATH: &str = "/api/generate";+pub const TAGS_PATH: &str = "/api/tags";+pub const RESPONSE_FIELD: &str = "response";+pub const THINKING_FIELD: &str = "thinking";+pub const MODELS_FIELD: &str = "models";+pub const NAME_FIELD: &str = "name";++// Measured 2026-08-05 against a live daemon: a REASONING model returns an empty `response` and+// puts the schema-constrained object in `thinking` instead. `qwen3.5-abliterated:9b` answered+// `{"choice": "byte_buffer"}` there - the correct answer, and the one the 3b model got wrong -+// while `response` was the empty string, so reading only `response` discarded a right answer and+// reported it as "the model returned nothing". Adjudication stays strict over both fields, so a+// model that merely reasons ABOUT an option in prose is still refused as off-ballot.+fn answer_of(body: &serde_json::Value) -> Option<&str> {+ let response = body.get(RESPONSE_FIELD).and_then(serde_json::Value::as_str);+ if let Some(text) = response+ && !text.trim().is_empty()+ {+ return Some(text);+ }+ let thinking = body.get(THINKING_FIELD).and_then(serde_json::Value::as_str);+ match thinking {+ Some(text) if !text.trim().is_empty() => Some(text),+ _ => response.or(thinking),+ }+}++pub struct LocalBooster {+ endpoint: String,+ model: String,+}++impl LocalBooster {+ #[must_use]+ pub fn new(endpoint: impl Into<String>, model: impl Into<String>) -> Self {+ Self {+ endpoint: endpoint.into(),+ model: model.into(),+ }+ }++ #[must_use]+ pub fn from_env() -> Self {+ Self::new(+ std::env::var(ENDPOINT_ENV).unwrap_or_else(|_| DEFAULT_ENDPOINT.to_owned()),+ std::env::var(MODEL_ENV).unwrap_or_else(|_| DEFAULT_MODEL.to_owned()),+ )+ }++ #[must_use]+ pub fn endpoint(&self) -> &str {+ &self.endpoint+ }++ #[must_use]+ pub fn model(&self) -> &str {+ &self.model+ }++ fn installed_models(&self) -> Result<Vec<String>, wire::WireError> {+ let agent = wire::agent(Duration::from_secs(PROBE_TIMEOUT_SECS));+ let url = format!("{}{TAGS_PATH}", self.endpoint);+ let body = wire::get(&agent, &url)?;+ let listed = body+ .get(MODELS_FIELD)+ .and_then(serde_json::Value::as_array)+ .ok_or_else(|| wire::WireError::MissingField {+ url,+ field: MODELS_FIELD.to_owned(),+ })?;+ Ok(listed+ .iter()+ .filter_map(|entry| entry.get(NAME_FIELD).and_then(serde_json::Value::as_str))+ .map(ToOwned::to_owned)+ .collect())+ }++ // Only reached once a request has already failed, so the extra round trip costs nothing in+ // the happy path and buys the difference between "start the daemon" and "pull the model",+ // which are the two failures a user can actually act on.+ fn why_unavailable(&self, failure: &wire::WireError) -> Declined {+ match self.installed_models() {+ Err(_) => Declined::BackendUnavailable {+ detail: format!(+ "no model runtime answered at {} ({failure}); start one, or point {ENDPOINT_ENV} at one, or run with the `none` tier",+ self.endpoint+ ),+ },+ Ok(installed) if !installed.iter().any(|name| name == &self.model) => {+ Declined::BackendUnavailable {+ detail: format!(+ "{} is reachable but does not have {}; install it or set {MODEL_ENV} to one of: {}",+ self.endpoint,+ self.model,+ if installed.is_empty() {+ "(nothing installed)".to_owned()+ } else {+ installed.join(", ")+ }+ ),+ }+ }+ Ok(_) => Declined::BackendUnavailable {+ detail: format!(+ "{} has {} but the request failed: {failure}",+ self.endpoint, self.model+ ),+ },+ }+ }+}++impl Booster for LocalBooster {+ fn propose(&self, ask: &Ask) -> Outcome {+ let agent = wire::agent(Duration::from_secs(PROMPT_TIMEOUT_SECS));+ let url = format!("{}{GENERATE_PATH}", self.endpoint);+ let request = serde_json::json!({+ "model": self.model,+ "prompt": wire::prompt(ask),+ "stream": false,+ "format": wire::schema(ask.ballot()),+ "options": { "temperature": 0 },+ });+ let started = Instant::now();+ let body = match wire::post(&agent, &url, &request, None) {+ Ok(body) => body,+ Err(failure) => return Outcome::Declined(self.why_unavailable(&failure)),+ };+ let elapsed = started.elapsed();+ let Some(raw) = answer_of(&body) else {+ return Outcome::Declined(Declined::BackendUnavailable {+ detail: format!(+ "{url} answered JSON with neither a {RESPONSE_FIELD} nor a {THINKING_FIELD} field"+ ),+ });+ };+ match ballot::adjudicate(ask.ballot(), raw) {+ Ok(choice) => Outcome::Proposed(Proposal {+ choice,+ tier: LlmTier::Local,+ model: self.model.clone(),+ elapsed,+ }),+ Err(declined) => Outcome::Declined(declined),+ }+ }++ fn describe(&self) -> String {+ format!("local ({} at {})", self.model, self.endpoint)+ }+}++#[cfg(test)]+mod tests {+ use super::*;++ // Port 1 is reserved and nothing listens on it, so this is a connection refusal rather than a+ // timeout and the test stays fast.+ const CLOSED: &str = "http://127.0.0.1:1";++ fn ask() -> Ask {+ Ask::new(+ "is src a byte buffer or a string",+ "int LZ4_decompress_safe(const char *src, char *dst, int n, int max);",+ vec!["byte_buffer".to_owned(), "nul_terminated_string".to_owned()],+ )+ .expect("valid ask")+ }++ // The deliverable the design names: with no model runtime present the tool keeps working and+ // says why, rather than erroring out and taking the deterministic pipeline down with it.+ #[test]+ fn an_absent_runtime_declines_gracefully_and_names_the_remedy() {+ let booster = LocalBooster::new(CLOSED, DEFAULT_MODEL);+ let outcome = booster.propose(&ask());+ let Outcome::Declined(Declined::BackendUnavailable { detail }) = outcome else {+ panic!("an absent runtime did not decline gracefully: {outcome:?}");+ };+ assert!(+ detail.contains(CLOSED),+ "the reason hides the endpoint: {detail}"+ );+ assert!(+ detail.contains(ENDPOINT_ENV) || detail.contains("none"),+ "the reason offers no remedy: {detail}"+ );+ }++ #[test]+ fn an_absent_runtime_never_proposes_anything() {+ let booster = LocalBooster::new(CLOSED, DEFAULT_MODEL);+ assert!(booster.propose(&ask()).proposal().is_none());+ }++ #[test]+ fn a_plain_model_is_read_from_the_response_field() {+ let body = serde_json::json!({ "response": "{\"choice\":\"byte_buffer\"}" });+ assert_eq!(answer_of(&body), Some("{\"choice\":\"byte_buffer\"}"));+ }++ // The reproduction of the 2026-08-05 measurement: an empty `response` beside a populated+ // `thinking` must yield the thinking text, or a reasoning model can never answer at all.+ #[test]+ fn a_reasoning_model_is_read_from_the_thinking_field_when_response_is_empty() {+ let body = serde_json::json!({+ "response": "",+ "thinking": "{\"choice\": \"byte_buffer\"}",+ });+ assert_eq!(answer_of(&body), Some("{\"choice\": \"byte_buffer\"}"));+ }++ // The negative control for the fallback: `response` WINS when it has content, so a model that+ // answers normally is never adjudicated on its chain of thought.+ #[test]+ fn a_populated_response_beats_the_thinking_field() {+ let body = serde_json::json!({+ "response": "nul_terminated_string",+ "thinking": "byte_buffer",+ });+ assert_eq!(answer_of(&body), Some("nul_terminated_string"));+ }++ #[test]+ fn a_body_with_neither_field_yields_nothing() {+ assert_eq!(answer_of(&serde_json::json!({ "done": true })), None);+ }++ // Reading `thinking` must not become a licence to accept reasoning prose. The strict+ // adjudicator is what keeps the fallback safe, so it is asserted here and not assumed.+ #[test]+ fn reasoning_prose_that_merely_mentions_an_option_is_still_refused() {+ let ballot = vec!["byte_buffer".to_owned(), "nul_terminated_string".to_owned()];+ let body = serde_json::json!({+ "response": "",+ "thinking": "Hmm, byte_buffer seems plausible, but let me reconsider.",+ });+ let raw = answer_of(&body).expect("thinking is present");+ assert!(+ matches!(+ ballot::adjudicate(&ballot, raw),+ Err(Declined::OffBallot { .. })+ ),+ "reasoning prose was accepted as a choice"+ );+ }++ #[test]+ fn the_defaults_are_the_pinned_model_on_the_loopback_runtime() {+ let booster = LocalBooster::new(DEFAULT_ENDPOINT, DEFAULT_MODEL);+ assert_eq!(booster.endpoint(), DEFAULT_ENDPOINT);+ assert_eq!(booster.model(), DEFAULT_MODEL);+ assert!(booster.describe().contains(DEFAULT_MODEL));+ }++ #[test]+ fn the_description_names_both_the_model_and_where_it_is_expected() {+ let booster = LocalBooster::new("http://example.invalid:9", "some-model");+ let described = booster.describe();+ assert!(described.contains("some-model"), "{described}");+ assert!(+ described.contains("http://example.invalid:9"),+ "{described}"+ );+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/wire.rs b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/wire.rsnew file mode 100644index 00000000..6fdbc5df--- /dev/null+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex-llm/src/wire.rs@@ -0,0 +1,181 @@+// ©AngelaMos | 2026+// wire.rs++use std::time::Duration;++use crate::Ask;++pub const PROMPT_TIMEOUT_SECS: u64 = 180;+pub const PROBE_TIMEOUT_SECS: u64 = 5;+pub const CONTENT_TYPE: &str = "content-type";+pub const APPLICATION_JSON: &str = "application/json";+pub const AUTHORIZATION: &str = "authorization";++pub const PROMPT_TEMPLATE: &str = "\+You are answering ONE question about a C library's public header.++Question: {subject}++Evidence, which is the library's own header text:+{evidence}++Answer with exactly one of these options, copied verbatim:+{options}++Reply with a JSON object of the form {\"choice\": \"<one option>\"} and nothing else. \+If the evidence does not settle the question, pick the option that is safest for a caller \+who must not read or write out of bounds.";++#[derive(Debug, thiserror::Error)]+pub enum WireError {+ #[error("{url} did not answer: {source}")]+ Unreachable {+ url: String,+ source: Box<ureq::Error>,+ },+ #[error("{url} answered with a body this client could not read as JSON: {source}")]+ Unreadable {+ url: String,+ source: Box<ureq::Error>,+ },+ #[error("{url} answered JSON with no {field} field")]+ MissingField { url: String, field: String },+}++#[must_use]+pub fn agent(timeout: Duration) -> ureq::Agent {+ ureq::Agent::config_builder()+ .timeout_global(Some(timeout))+ .build()+ .into()+}++#[must_use]+pub fn prompt(ask: &Ask) -> String {+ let options = ask+ .ballot()+ .iter()+ .map(|option| format!("- {option}"))+ .collect::<Vec<_>>()+ .join("\n");+ PROMPT_TEMPLATE+ .replace("{subject}", ask.subject())+ .replace("{evidence}", ask.evidence())+ .replace("{options}", &options)+}++// The ballot travels to the server as a JSON-schema enum as well as in the prompt. A server that+// honours the schema cannot answer off the ballot at all, which turns the local adjudication from+// the only guard into the second one.+#[must_use]+pub fn schema(ballot: &[String]) -> serde_json::Value {+ serde_json::json!({+ "type": "object",+ "properties": {+ crate::ballot::CHOICE_FIELD: {+ "type": "string",+ "enum": ballot,+ }+ },+ "required": [crate::ballot::CHOICE_FIELD],+ })+}++pub fn post(+ agent: &ureq::Agent,+ url: &str,+ body: &serde_json::Value,+ bearer: Option<&str>,+) -> Result<serde_json::Value, WireError> {+ let mut request = agent.post(url).header(CONTENT_TYPE, APPLICATION_JSON);+ if let Some(token) = bearer {+ request = request.header(AUTHORIZATION, &format!("Bearer {token}"));+ }+ let mut response = request.send_json(body).map_err(|source| {+ let url = url.to_owned();+ WireError::Unreachable {+ url,+ source: Box::new(source),+ }+ })?;+ response+ .body_mut()+ .read_json::<serde_json::Value>()+ .map_err(|source| WireError::Unreadable {+ url: url.to_owned(),+ source: Box::new(source),+ })+}++pub fn get(agent: &ureq::Agent, url: &str) -> Result<serde_json::Value, WireError> {+ let mut response = agent+ .get(url)+ .call()+ .map_err(|source| WireError::Unreachable {+ url: url.to_owned(),+ source: Box::new(source),+ })?;+ response+ .body_mut()+ .read_json::<serde_json::Value>()+ .map_err(|source| WireError::Unreadable {+ url: url.to_owned(),+ source: Box::new(source),+ })+}++#[cfg(test)]+mod tests {+ use super::*;++ fn ask() -> Ask {+ Ask::new(+ "is src a byte buffer or a string",+ "int LZ4_decompress_safe(const char *src, char *dst, int n, int max);",+ vec!["byte_buffer".to_owned(), "nul_terminated_string".to_owned()],+ )+ .expect("valid ask")+ }++ #[test]+ fn the_prompt_carries_the_subject_the_evidence_and_every_option() {+ let text = prompt(&ask());+ assert!(text.contains("is src a byte buffer or a string"));+ assert!(text.contains("LZ4_decompress_safe"));+ assert!(text.contains("- byte_buffer"));+ assert!(text.contains("- nul_terminated_string"));+ }++ #[test]+ fn no_placeholder_survives_into_the_rendered_prompt() {+ let text = prompt(&ask());+ for placeholder in ["{subject}", "{evidence}", "{options}"] {+ assert!(+ !text.contains(placeholder),+ "{placeholder} was never substituted"+ );+ }+ }++ #[test]+ fn the_schema_pins_the_enum_to_exactly_the_ballot() {+ let ballot = vec!["one".to_owned(), "two".to_owned()];+ let built = schema(&ballot);+ let listed = built["properties"][crate::ballot::CHOICE_FIELD]["enum"]+ .as_array()+ .expect("enum is an array");+ assert_eq!(listed.len(), ballot.len());+ for option in &ballot {+ assert!(+ listed.iter().any(|value| value == option),+ "{option} missing from the schema enum"+ );+ }+ }++ #[test]+ fn the_required_field_is_the_one_the_adjudicator_reads() {+ let built = schema(&["one".to_owned()]);+ assert_eq!(built["required"][0], crate::ballot::CHOICE_FIELD);+ }+}diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.toml b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.tomlindex 57c6c539..97ed6d20 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.toml+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/crates/lisdex/Cargo.toml@@ -24,4 +24,5 @@ lisdex-ingest.workspace = truelisdex-build.workspace = truelisdex-surface.workspace = truelisdex-harness.workspace = true+lisdex-llm.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 4f4a836d..a745681c 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@@ -13,6 +13,7 @@ use lisdex_build::ladder::{self, BuildOptions};use lisdex_build::layout::{BuildLayout, VARIANT_AFL, VARIANT_BENCH};use lisdex_build::verify::Requirements;use lisdex_core::campaign::{Campaign, CampaignId, CampaignStatus};+use lisdex_core::config::LlmTier;use lisdex_core::report::SanitizerReport;use lisdex_core::store::Store;use lisdex_fuzz::runner::{self, AflOptions};@@ -45,6 +46,10 @@ const NO_ARCHIVE: &str = "--archive is required: the harness has to link againstinstrumented library that `lisdex build` produced";const UNVERIFIED_BANNER: &str = "UNVERIFIED: no oracle was run against this harness. It may not \compile, may crash on valid input, or may read none of it.";+const LLM_PROBE_SUBJECT: &str = "is the parameter src a byte buffer or a nul-terminated string";+const LLM_PROBE_EVIDENCE: &str =+ "int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity);";+const LLM_PROBE_BALLOT: [&str; 2] = ["byte_buffer", "nul_terminated_string"];#[derive(Parser)]#[command(@@ -71,6 +76,41 @@ enum Command {Verify(VerifyArgs),#[command(about = "list the crashes persisted for a campaign")]Crashes(CrashesArgs),+ #[command(about = "report which LLM booster tier is configured and whether it answers")]+ Llm(LlmArgs),+}++#[derive(clap::Args)]+struct LlmArgs {+ #[arg(+ long,+ value_enum,+ default_value_t = TierArg::Local,+ help = "booster tier to report on"+ )]+ tier: TierArg,+ #[arg(+ long,+ help = "put the configured tier to a live question instead of only describing it"+ )]+ ask: bool,+}++#[derive(Clone, Copy, clap::ValueEnum)]+enum TierArg {+ None,+ Local,+ Api,+}++impl From<TierArg> for LlmTier {+ fn from(value: TierArg) -> Self {+ match value {+ TierArg::None => LlmTier::None,+ TierArg::Local => LlmTier::Local,+ TierArg::Api => LlmTier::Api,+ }+ }}#[derive(clap::Args)]@@ -323,9 +363,38 @@ fn dispatch() -> Result<(), Box<dyn Error>> {Command::Harness(args) => harness(args),Command::Verify(args) => verify(args),Command::Crashes(args) => crashes(args),+ Command::Llm(args) => llm(args),}}+fn llm(args: &LlmArgs) -> Result<(), Box<dyn Error>> {+ let tier = LlmTier::from(args.tier);+ let booster = lisdex_llm::select(tier);+ println!("tier: {}", booster.describe());+ if !args.ask {+ return Ok(());+ }+ let ask = lisdex_llm::Ask::new(LLM_PROBE_SUBJECT, LLM_PROBE_EVIDENCE, probe_ballot())?;+ match booster.propose(&ask) {+ lisdex_llm::Outcome::Proposed(proposal) => {+ println!(+ "answered {:?} in {:.1}s",+ proposal.choice,+ proposal.elapsed.as_secs_f64()+ );+ }+ lisdex_llm::Outcome::Declined(declined) => println!("declined: {declined}"),+ }+ Ok(())+}++fn probe_ballot() -> Vec<String> {+ LLM_PROBE_BALLOT+ .iter()+ .map(|option| (*option).to_owned())+ .collect()+}+fn library_vocabulary(analysis: &surface::Surface,parse: &lisdex_surface::extract::ParseOptions,diff --git a/PROJECTS/advanced/zero-day-vulnerability-scanner/dev.compose.yml b/PROJECTS/advanced/zero-day-vulnerability-scanner/dev.compose.ymlindex f49a22f8..cc5b06b7 100644--- a/PROJECTS/advanced/zero-day-vulnerability-scanner/dev.compose.yml+++ b/PROJECTS/advanced/zero-day-vulnerability-scanner/dev.compose.yml@@ -12,11 +12,14 @@ services:container_name: lisdex-dev-toolchaininit: trueshm_size: 2gb+ extra_hosts:+ - "host.docker.internal:host-gateway"environment:AFL_SKIP_CPUFREQ: "1"AFL_NO_AFFINITY: "1"AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES: "1"RUST_BACKTRACE: "1"+ LISDEX_LLM_ENDPOINT: "http://host.docker.internal:11434"volumes:- .:/work- cargo-target:/cargo-target