mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-30 06:42:43 +00:00
* Initial plan * fix(mcp): read fresh metadata from disk in context resource to fix stale staleness banner and stats (#2438) The context resource (gitnexus://repo/{name}/context) was serving stale lastCommit and stats after an out-of-process `analyze --index-only` refresh. The LocalBackend's in-memory RepoHandle is cached and only refreshes on registry misses — never on a disk update from an external process. Fix: read fresh metadata via loadMeta(repo.storagePath) on every context resource read, mirroring the ensureInitialized hot-swap pattern. Use the fresh lastCommit for the staleness check and fresh stats for the stats block; fall back to cached values when the disk read fails. Tests: - 5 new unit tests in resources.test.ts covering fresh meta, fallback behavior - 3 new integration tests in context-resource-staleness.test.ts covering the exact reproduce sequence from the issue report * fix(test): use @ladybugdb/core mock to prevent native addon load in integration test The context-resource-staleness integration test used importOriginal() in the vi.mock factories for pool-adapter.js and mcp/core/lbug-adapter.js. That caused the real pool-adapter.ts to load @ladybugdb/core, which tries to dlopen lbugjs.node — a native addon that requires postinstall (not run with --ignore-scripts in CI). Fix: - Add a vi.mock('@ladybugdb/core') at the package boundary, matching the pattern in lbug-pool-fts-load.test.ts and pool-wal-recovery.test.ts. - Replace the two importOriginal()-based lbug mocks with direct factories that provide all necessary exports (initLbug, executeQuery, executeParameterized, closeLbug, isLbugReady) without loading the real module. All 3 integration tests now pass in CI (no lbugjs.node required). * test(integration): run context staleness flow end-to-end without mocks * Address PR review feedback (#2439) - Restore libc selectors for optional native packages --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Gergő Magyar <gergomagyar@icloud.com> |
||
|---|---|---|
| .. | ||
| fixtures | ||
| helpers | ||
| integration | ||
| unit | ||
| utils | ||