mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
6e0e655ca7
`QEReasoningBank.getStats()` only read `this.stats`, an in-memory object initialized to zeros per process. Every Claude Code hook spawns a fresh node — so every `aqe hooks stats` call reported zero routingRequests / learningOutcomes / patternSuccessRate regardless of historical data. This blocked session-start observability, pattern promotion thresholds, and experience consolidation triggers. Add a narrow `SQLitePatternStore.getAggregateOutcomeStats()` method that counts routing_outcomes, qe_pattern_usage, and the avg(success_rate) of qe_patterns with non-zero usage_count. `getStats()` uses in-memory counters when non-zero (current-process data) and falls back to the DB aggregate otherwise. Sentinel routing rows (quality_score = -1) count toward the total but are excluded from avgRoutingConfidence so partially closed turns don't drag the average. Verified: `aqe hooks stats --json` now reports routingRequests: 1904, avgRoutingConfidence: 0.396, learningOutcomes: 272, patternSuccessRate: 0.75 against the project's memory.db — previously all zero. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4.2 KiB
4.2 KiB