Files
proffesor-for-testing__agen…/docs/releases/v3.9.2.md
Dragan Spiridonov 76383372da fix(init): resolve patterns.rvf deadlock + CLI exit hang (v3.9.2)
Two related fixes for the init flow broken in v3.9.1:

1. aqe init --auto hangs at "Code intelligence pre-scan"

After v3.9.1 flipped useRVFPatternStore to true by default,
AQELearningEngine.initialize() would open patterns.rvf twice in
the same process:

  a) createPatternStore() -> _createRvfStore('.agentic-qe/patterns.rvf')
     acquires an exclusive native file lock via @ruvector/rvf-node
  b) getSharedRvfDualWriter() -> getSharedRvfAdapter() ->
     createRvfStore('.agentic-qe/patterns.rvf') tries to acquire the
     same exclusive lock -> deadlocks forever

Fix: createPatternStore() now routes through the getSharedRvfAdapter()
singleton. Only one file handle exists per process; subsequent callers
receive the cached instance. RvfPatternStore.dispose() gains a
skipCloseOnDispose option so it won't close a shared adapter.

2. CLI doesn't exit after init completes

Native NAPI handles from @ruvector/rvf-node and @ruvector/router
kept the event loop alive indefinitely. cleanupAndExit() previously
used async dynamic imports for cleanup modules, which loaded more
native bindings before the unref'd 3s force-exit timer could fire.

Fix: cleanupAndExit() is now synchronous — fire-and-forget disposes
followed by immediate process.exit(). Init completes and exits
cleanly in ~7s.

Verification:
- aqe init --auto on fresh project: EXIT=0, ~7s, all 12 phases pass
- Isolated npm pack+install: aqe --version returns 3.9.2
- 65 pattern-store + rvf-pattern-store tests pass
- 15/15 performance gates pass
- Build + typecheck: zero errors

Note: Full unit suite runtime regression (>22min, unrelated to this
fix) tracked separately in #396.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 06:51:55 +00:00

1.6 KiB

v3.9.2 Release Notes

Release Date: 2026-04-06

Highlights

Hotfix for aqe init --auto hanging at the "Code intelligence pre-scan" phase on projects that previously had v3.9.0 installed. Also fixes a related issue where the CLI process wouldn't exit cleanly after init completed.

Fixed

  • aqe init --auto hangs at "Code intelligence pre-scan" — After v3.9.1 enabled RVF pattern store by default, the learning engine initialization opened patterns.rvf twice in the same process: once directly via createPatternStore() and again through getSharedRvfDualWriter(). The native @ruvector/rvf-node binding holds an exclusive file lock on open, so the second call deadlocked waiting for a lock the same process already owned. createPatternStore() now routes through the shared adapter singleton, guaranteeing only one handle per process.
  • CLI doesn't exit after aqe init completes — Native NAPI handles from RVF and router kept the event loop alive indefinitely, and the async dynamic imports in the cleanup path loaded even more native bindings before the 3-second force-exit timer could fire. The cleanup path is now synchronous with immediate process.exit(). Init completes and exits cleanly in ~7 seconds.

Changed

  • RvfPatternStore.dispose() respects shared adapters — New skipCloseOnDispose option prevents accidentally closing adapters owned by the singleton, so other consumers retain access.

Upgrading

npx agentic-qe@3.9.2 init --auto

No manual migration needed. If you had v3.9.0 or v3.9.1 and aqe init --auto was hanging, the upgrade resolves it automatically.