GitNexus/gitnexus/test
evolution 8ca9cb1a4d
fix(lbug): recover from WAL corruption by quarantining .wal file (#1402) (#1417)
* fix(lbug): recover from WAL corruption by quarantining .wal file (#1402)

LadybugDB crashes when the WAL file is corrupted — the open fails with an
unrecoverable native error. This makes the pool adapter detect WAL corruption
errors, quarantine the offending .wal file, and retry the open. MCP tool
responses (cypher, context, impact) now include a recoverySuggestion field
when WAL corruption is detected.

Changes:
- Add isWalCorruptionError() regex-based detector in lbug-config.ts
- Add throwOnWalReplayFailure and enableChecksums to createLbugDatabase()
- Extract openReadOnlyDatabase() with stdout silencing + db.init()
- Add tryQuarantineAndReopen() for .wal quarantine + retry in doInitLbug
- Wrap cypher/context/impact with WAL recoverySuggestion in MCP responses
- Share WAL_RECOVERY_SUGGESTION constant across all MCP error paths
- Fix restoreStdout() placement (before db.init() → finally block)
- Add unit tests for detection, pool recovery, and MCP feedback

* fix(test): remove superfluous argument from LocalBackend constructor (#1402)

LocalBackend has no constructor — the { registryPath } argument was ignored.

* fix(lbug): address WAL recovery review feedback

---------

Co-authored-by: Gergő Magyar <gergomagyar@icloud.com>
2026-05-08 11:28:19 +01:00
..
fixtures feat(go): implement scope resolution hooks for Go language support (#1302) 2026-05-04 07:29:11 +01:00
helpers refactor(lbug): extract safeClose helper to consolidate WAL flush (#1377) 2026-05-06 19:18:04 +01:00
integration feat(core): adopt pino structured logger (#1336) 2026-05-07 20:56:25 +01:00
unit fix(lbug): recover from WAL corruption by quarantining .wal file (#1402) (#1417) 2026-05-08 11:28:19 +01:00
utils ci: add macOS to cross-platform test matrix (#208) 2026-03-07 10:38:32 +00:00