gitnexus 1.6.8 → 1.6.9-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -176,6 +176,27 @@ export declare const tryFlushWAL: () => Promise<boolean>;
176
176
  * @see closeLbug — safeClose + module state reset (full teardown)
177
177
  */
178
178
  export declare const safeClose: () => Promise<void>;
179
+ /**
180
+ * CHECKPOINT for durability, then DELIBERATELY skip the native connection/database
181
+ * teardown. The name encodes the contract — there is no boolean flag to misuse:
182
+ * call this ONLY from a path that guarantees a `process.exit` immediately after
183
+ * (the CLI analyze success/SIGINT paths and the forked worker).
184
+ *
185
+ * LadybugDB's ClientContext/Connection destructor can double-free after large
186
+ * --pdg writes (gdb: `double free or corruption` in ClientContext::~ClientContext
187
+ * via NodeConnection::Close), aborting the process AFTER a fully-written,
188
+ * checkpointed index. flushWAL already persisted the data; process exit reclaims
189
+ * the native handles. We leave the handles referenced and module state intact so a
190
+ * GC finalizer cannot run the same destructor before exit, and any post-analyze
191
+ * read reuses the live connection. Mirrors the pool adapter's fire-and-forget
192
+ * native teardown (pool-adapter.ts) and the ONNX native-cleanup philosophy.
193
+ * Workaround for a LadybugDB engine bug (to be reported upstream).
194
+ *
195
+ * SAFETY: only valid when a process.exit is guaranteed to follow. Long-lived
196
+ * callers (MCP server, tests) leave `skipNativeCloseOnExit` unset, so
197
+ * runFullAnalysis closes for real via {@link closeLbug} — never this.
198
+ */
199
+ export declare const closeLbugBeforeExit: () => Promise<void>;
179
200
  export declare const closeLbug: () => Promise<void>;
180
201
  export declare const isLbugReady: () => boolean;
181
202
  /**