Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUv6d60d3540dec
diff --git a/v3/@claude-flow/cli/src/ruvector/coverage-router.ts b/v3/@claude-flow/cli/src/ruvector/coverage-router.ts
index 87db9c7a91..bf818e6d7d 100644
--- a/v3/@claude-flow/cli/src/ruvector/coverage-router.ts
+++ b/v3/@claude-flow/cli/src/ruvector/coverage-router.ts
@@ -484,14 +484,23 @@ export async function coverageGaps(
}
/**
- * Load project coverage data (stub - implement based on project setup)
+ * Load project coverage data (async with caching)
*/
-async function loadProjectCoverage(projectRoot?: string): Promise<CoverageReport | null> {
- const { existsSync, readFileSync } = require('fs');
- const { join } = require('path');
-
+async function loadProjectCoverage(projectRoot?: string, skipCache?: boolean): Promise<CoverageReport | null> {
const root = projectRoot || process.cwd();
+ // Check cache first
+ if (!skipCache) {
+ const cached = coverageDataCache.get(root);
+ if (cached && Date.now() - cached.timestamp < COVERAGE_CACHE_TTL_MS) {
+ return cached.report;
+ }
+ }
+
+ const { existsSync } = require('fs');
+ const { readFile } = require('fs/promises');
+ const { join } = require('path');
+
// Try common coverage locations
const coveragePaths = [
join(root, 'coverage', 'coverage-final.json'),
@@ -503,13 +512,21 @@ async function loadProjectCoverage(projectRoot?: string): Promise<CoverageReport
for (const coveragePath of coveragePaths) {
if (existsSync(coveragePath)) {
try {
- const content = readFileSync(coveragePath, 'utf-8');
+ // Use async file read for non-blocking I/O
+ const content = await readFile(coveragePath, 'utf-8');
const router = new CoverageRouter();
+ let report: CoverageReport | null = null;
if (coveragePath.endsWith('.json')) {
- return router.parseCoverage(JSON.parse(content), 'istanbul');
+ report = router.parseCoverage(JSON.parse(content), 'istanbul');
} else if (coveragePath.endsWith('.info')) {
- return router.parseCoverage(content, 'lcov');
+ report = router.parseCoverage(content, 'lcov');
+ }
+
+ // Cache the result
+ if (report) {
+ coverageDataCache.set(root, { report, timestamp: Date.now() });
+ return report;
}
} catch {
// Continue to next path