mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-09 14:04:06 +09:00
- Reorganize v3/ into implementation/ subfolders: - planning/, architecture/, migration/, integration/ - security/, adrs/, research/, swarm-plans/ - Add 15-agent concurrent swarm implementation plans: - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x) - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies - Update .claude/settings.json with proper hooks format - Add bash aliases for claude --dangerously-skip-permissions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
import BetterSqlite3 from 'better-sqlite3';
|
|
|
|
const dbPath = '.swarm/memory.db';
|
|
const db = new BetterSqlite3(dbPath);
|
|
db.pragma('journal_mode = WAL');
|
|
|
|
console.log('\n=== Direct SQL Query Test ===\n');
|
|
|
|
// Run the exact same query that fetchMemoryCandidates uses
|
|
const query = `
|
|
SELECT
|
|
p.*,
|
|
pe.vector as embedding,
|
|
CAST((julianday('now') - julianday(p.created_at)) AS INTEGER) as age_days
|
|
FROM patterns p
|
|
JOIN pattern_embeddings pe ON p.id = pe.id
|
|
WHERE p.type = 'reasoning_memory'
|
|
AND p.confidence >= ?
|
|
AND json_extract(p.pattern_data, '$.domain') = ?
|
|
ORDER BY p.confidence DESC, p.usage_count DESC
|
|
`;
|
|
|
|
const params = [0.3, 'semantic'];
|
|
|
|
console.log('Query:', query);
|
|
console.log('Params:', params);
|
|
|
|
const stmt = db.prepare(query);
|
|
const rows = stmt.all(...params);
|
|
|
|
console.log('\n✅ Results:', rows.length, 'rows');
|
|
if (rows.length > 0) {
|
|
console.log('\nFirst row:');
|
|
console.log(' ID:', rows[0].id);
|
|
console.log(' Type:', rows[0].type);
|
|
console.log(' Confidence:', rows[0].confidence);
|
|
console.log(' pattern_data:', rows[0].pattern_data);
|
|
}
|
|
|
|
db.close();
|
|
console.log('\n=== Test Complete ===\n');
|