A consumer report on the GA pair: any minimal add/find/close script hangs forever. Root cause was FOUR ref'd keep-alives brainy never released: 1+2. The global SIGTERM/SIGINT shutdown hooks (registered once at init) were anonymous and never removed — a process.on signal listener holds a ref'd signal handle. They are now named statics, deregistered when the LAST live instance closes (Brainy.instances also stopped leaking closed instances); a later init re-registers them. 3. UnifiedCache.startFairnessMonitor() created an interval it never stored, cleared, or unref'd — unclearable by construction. Now stored + unref'd (same posture as the existing memory-pressure timer): a cache monitor must never keep the host process alive. 4. brainy.close() never called VirtualFileSystem.close(), stranding the VFS background-maintenance interval and the PathResolver maintenance interval. close() now shuts the VFS down. Proof: a bare script (init/add/close, no process.exit) exits 1 ms after close() returns; before the fix it hung until killed. 3 new lifecycle tests pin the hook semantics (once globally, survive while other instances live, removed on last close, re-register after). |
||
|---|---|---|
| .. | ||
| api | ||
| benchmarks | ||
| comprehensive | ||
| configs | ||
| fixtures/import | ||
| helpers | ||
| integration | ||
| integrations | ||
| performance | ||
| regression | ||
| scripts | ||
| transaction | ||
| unit | ||
| vfs | ||
| critical-neural-validation.test.ts | ||
| critical-performance-benchmark.test.ts | ||
| model-loading.test.ts | ||
| package-size-breakdown.test.ts | ||
| package-size-limit.test.ts | ||
| setup-integration.ts | ||
| setup-semantic.ts | ||
| setup-unit.ts | ||
| setup.ts | ||
| type-utils.unit.test.ts | ||