feat: integrate hunos web server + jwt-nim-baraba + real WAL recovery + compaction

HTTP Server:
- Replaced asynchttpserver with hunos (multi-threaded, trie router, CORS middleware)
- JWT authentication via jwt-nim-baraba (HS256 with BearSSL crypto)
- POST /query, GET /health, GET /metrics, POST /auth, GET /api (OpenAPI spec)
- Proper CORS headers via hunos corsMiddleware

WAL Recovery:
- recover() now actually applies committed entries (REDO)
- Skips uncommitted entries (UNDO)
- Takes optional LSMTree parameter to apply recovery

SSTable Compaction:
- Real compaction: reads SSTable entries, merges by key (newest wins), writes merged file
- Deduplication: keeps only newest version per key
- Tombstone cleanup: removes deleted entries
- Old SSTable files deleted after merge

Dependencies:
- Added hunos >= 1.2.0 and jwt >= 2.1.0 to nimble

SSTable fields exported for compaction access.

All 216 tests pass
This commit is contained in:
2026-05-06 13:42:37 +03:00
parent a7e274d846
commit 1fb715a1d4
5 changed files with 216 additions and 126 deletions
+2
View File
@@ -9,6 +9,8 @@ binDir = "build"
# Dependencies
requires "nim >= 2.2.0"
requires "hunos >= 1.2.0"
requires "jwt >= 2.1.0"
# Tasks
task build_debug, "Build debug version":