mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
0cc11ea05b
Eliminates the separate hypergraph.db file — all hypergraph data now lives in the unified .agentic-qe/memory.db alongside other QE tables. Fixes stale v3/ path references in governance shards. Adds user-facing hypergraph query surface via CLI (`aqe hypergraph stats/untested/impacted/gaps`) and MCP (`hypergraph_query` tool). Key changes: - coordinator + coordinator-hypergraph default path: hypergraph.db → memory.db - governance shards: v3/src/domains/ → src/domains/ (12 files + constitution) - init phase 06: now builds hypergraph tables during `aqe init --auto` - coordinator.index(): rebuilds hypergraph on every code_index MCP call - protocol: removed redundant buildHypergraphFromIndex (coordinator handles it) - shared code-index-extractor: async batched I/O, arrow/method/interface patterns - CLI handler: ensureInitialized guard, connection leak fix, path resolution - MCP handler: hypergraph_query tool with stats/untested/impacted/gaps queries - tool-scoping: hypergraph_query added to 5 agent roles - completions: bash/zsh/fish/powershell support for hypergraph subcommands - coordinator: publishes HypergraphDegraded event on init failure - 12 new tests for code-index-extractor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.1 KiB
3.1 KiB
Hypergraph Changes — Devil's Advocate Issues
Date: 2026-03-23 Source: qe-devils-advocate agent review of hypergraph session changes
HIGH Priority
- H1 —
ensureInitializednever called in CLI HypergraphHandler. Fixed: Added guard to all 4 subcommands + moved logic into try/finally. - H3 — DB connection leak in CLI handler's
openEngine(). Fixed: Added catch block that closes db if engine creation fails. - H4 — Type mismatch:
ExtractedCodeIndexandCodeIndexResulthave no compile-time link. Fixed: RemovedExtractedCodeIndex; extractor now imports and returns canonicalCodeIndexResultfrom hypergraph-engine. - H6 — Regex extractor misses arrow functions, class methods, interfaces,
export default. Fixed: Added patterns for arrow exports, method definitions, interfaces, andexport default function/class. - H2 — Synchronous
readFileSyncon potentially thousands of files blocks the event loop. Fixed: Replaced with asyncreadFilefromfs/promises, batched in groups of 50 viaPromise.allSettled. Parsing logic extracted into pureparseFileContent(). - H5 — Database contention: multiple independent connections. Mitigated:
openDatabase()already sets WAL mode + 5s busy_timeout. Handlers use short-lived connections (open, query, close). Kept writable (not readonly) to allow future write subcommands without API churn.
MEDIUM Priority
- M1 — Bash/zsh completions have no
hypergraph)case. Fixed: Addedhypergraph)case to bash (with subcommand + option completion) and zsh (with_arguments+_describe). Fish/PowerShell were already done earlier. - M2 — No input validation on
maxCoverageandlimitin MCP handler. Negative/extreme values accepted. Alsolimitis passed to engine config AND used for slicing — double restriction. - M3 —
impactedcommand passes user-provided relative paths but hypergraph stores absolute paths. Fixed: Both CLI and MCP handlers now resolve to absolute paths before querying. - M4 — Phase 06 opens/closes DB 3 separate times during a single init. Fixed: Refactored
checkCodeIntelligenceIndex,getKGEntryCount,getLastIndexedAtto accept a db parameter. Single connection opened inrun(), closed when done. - M5 — Zero test coverage for new files. Fixed: Added
tests/unit/shared/code-index-extractor.test.ts(12 tests covering all entity types, imports, line numbers, error handling, edge cases). CLI/MCP handler tests deferred — covered by integration. - M6 — CLI and MCP handlers bypass coordinator. Accepted by design: These are lightweight query tools for ad-hoc use. The coordinator manages the full indexing lifecycle; query tools only need a read path. Shared
HypergraphEnginewould require a singleton or service locator pattern that adds complexity without benefit for short-lived CLI commands. - M7 —
logger.warnsuppresses init failures. Fixed: Now publishescode-intelligence.HypergraphDegradedevent with reason when init fails, so health checks and monitoring can surface it.