Files
Dragan Spiridonov ce1222a7c4 fix(learning): stop brain-export hook leak + harden DB backups on virtiofs mount
Real-time hook learning-capture was failing on this macOS Docker bind mount
with `Failed to initialize UnifiedMemoryManager: database is locked`, and a
brain-checkpoint hook was leaking deadlocked `brain export` subprocesses
(4 found, ~1.5GB RSS). Root cause is SQLite concurrency on a WAL-hostile
virtiofs mount, NOT a native-binary mismatch (better-sqlite3 loads fine).

- brain-checkpoint.cjs: add AQE_DISABLE_BRAIN_CHECKPOINT env / marker-file kill
  switch (opt-in; shipped installs unaffected). The export spawns a native RVF
  writer that deadlocks in a futex and ignores the SIGTERM the timeout sends,
  so orphaned exporters piled up. Disabling stops the leak at the source.
- aqe-hook.cjs: make the FATAL health-log fix-hint conditional. Only suggest
  `npm rebuild better-sqlite3` for real native markers; lock-contention
  failures now point at the actual cause instead of sending users down the
  wrong path.
- feature-flags.ts: add the missing RUVECTOR_USE_RVF_PATTERN_STORE env override
  (the only RuVector flag lacking one) so an RVF FsyncFailed can fall back to
  the SQLite HNSW PatternStore. Activates after build.
- scripts/aqe-db-backup.sh: consistent VACUUM INTO snapshots (safe with
  concurrent writers), integrity-verified before promotion, rotating + daily,
  to the host mount so they survive container loss. Restore round-trip tested.
- devcontainer.json: auto-restart the backup loop (postStartCommand) and set
  bind-mount env mitigations (remoteEnv: AQE_DISABLE_WAL,
  RUVECTOR_USE_RVF_PATTERN_STORE=false, AQE_DISABLE_BRAIN_CHECKPOINT).
- learning-config.json: clear the stale rebuildMode flag (no src reader; on
  since 2025-12).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-08 15:22:43 +00:00
..
2025-11-01 19:02:10 +00:00
2025-09-30 19:59:56 +00:00