Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .agentic-flow/intelligence.db-shm
Binary file not shown.
12 changes: 9 additions & 3 deletions .agentic-flow/intelligence.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"patterns": {
"command:": {
"success": 0.9999939236039033
"success": 0.9999980931625188
}
},
"sequences": {},
"memories": [],
"dirPatterns": {},
"errorPatterns": [],
"metrics": {
"totalRoutes": 168,
"successfulRoutes": 168,
"totalRoutes": 180,
"successfulRoutes": 180,
"routingHistory": [
{
"timestamp": "2025-12-31T04:00:09.334Z",
Expand Down Expand Up @@ -335,6 +335,12 @@
"task": "edit:",
"agent": "unknown",
"success": true
},
{
"timestamp": "2026-01-01T16:12:27.285Z",
"task": "edit:",
"agent": "unknown",
"success": true
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@
"enabledMcpjsonServers": ["claude-flow", "ruv-swarm"],
"statusLine": {
"type": "command",
"command": ".claude/statusline-command.sh"
"command": ".claude/statusline.sh"
}
}
111 changes: 36 additions & 75 deletions .claude/statusline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,104 +7,65 @@ INTEL_DB=".agentic-flow/intelligence.db"

# Default values
PATTERNS=0
MEMORIES=0
ROUTES=0
SUCCESS_RATE=0
TRAJECTORIES=0
MEMORIES=0
MODE="off"
LEARNING_RATE=10
EPSILON=10

# Get current git branch
GIT_BRANCH=""
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
GIT_BRANCH=$(git branch --show-current 2>/dev/null || echo "")
fi

# Check environment
if [ "$AGENTIC_FLOW_INTELLIGENCE" = "true" ]; then
MODE="on"
fi

# Read intelligence metrics
if [ -f "$INTEL_FILE" ]; then
# Pattern count
PATTERNS=$(jq -r '.patterns | length // 0' "$INTEL_FILE" 2>/dev/null || echo "0")

# Routing metrics
ROUTES=$(jq -r '.metrics.totalRoutes // 0' "$INTEL_FILE" 2>/dev/null || echo "0")
SUCCESSFUL=$(jq -r '.metrics.successfulRoutes // 0' "$INTEL_FILE" 2>/dev/null || echo "0")

# Calculate success rate (bash arithmetic)
if [ "$ROUTES" -gt 0 ] 2>/dev/null; then
SUCCESS_RATE=$(( (SUCCESSFUL * 100) / ROUTES ))
fi

# Active trajectories (RL learning)
TRAJECTORIES=$(jq -r '[.trajectories // {} | to_entries[] | select(.value.status == "active")] | length' "$INTEL_FILE" 2>/dev/null || echo "0")

# Memory count
MEMORIES=$(jq -r '.memories | length // 0' "$INTEL_FILE" 2>/dev/null || echo "0")
ROUTES=$(jq -r '.metrics.totalRoutes // 0' "$INTEL_FILE" 2>/dev/null || echo "0")
TRAJECTORIES=$(jq -r '.trajectories | length // 0' "$INTEL_FILE" 2>/dev/null || echo "0")

# Get learning parameters
LR=$(jq -r '.config.learningRate // 0.1' "$INTEL_FILE" 2>/dev/null || echo "0.1")
EPS=$(jq -r '.config.epsilon // 0.1' "$INTEL_FILE" 2>/dev/null || echo "0.1")
[ -z "$LR" ] || [ "$LR" = "null" ] && LR="0.1"
[ -z "$EPS" ] || [ "$EPS" = "null" ] && EPS="0.1"
LEARNING_RATE=$(awk "BEGIN {printf \"%.0f\", $LR * 100}" 2>/dev/null || echo "10")
EPSILON=$(awk "BEGIN {printf \"%.0f\", $EPS * 100}" 2>/dev/null || echo "10")

# Get active count
ACTIVE=$(jq -r '[.trajectories // {} | to_entries[] | select(.value.status == "active")] | length' "$INTEL_FILE" 2>/dev/null || echo "0")
fi

# Check for SQLite backend (HNSW-indexed)
DB_STATUS=""
if [ -f "$INTEL_DB" ]; then
DB_SIZE=$(du -h "$INTEL_DB" 2>/dev/null | cut -f1 || echo "0")
DB_STATUS=" | 🗄️ $DB_SIZE"
fi

# Build branch display
BRANCH_DISPLAY=""
if [ -n "$GIT_BRANCH" ]; then
BRANCH_DISPLAY=" ⎇ ${GIT_BRANCH}"
fi

# Get learning rate from environment
LEARNING_RATE="${AGENTIC_FLOW_LEARNING_RATE:-0.1}"
MEMORY_BACKEND="${AGENTIC_FLOW_MEMORY_BACKEND:-agentdb}"
# Attention mechanism status (check which are enabled)
NEURAL="●Neural"
DAG="◐DAG"
GRAPH="○Graph"
SSM="●SSM"

# Get total trajectories count
TOTAL_TRAJECTORIES=0
if [ -f "$INTEL_FILE" ]; then
TOTAL_TRAJECTORIES=$(jq -r '.trajectories | length // 0' "$INTEL_FILE" 2>/dev/null || echo "0")
# Check DB for vector count
VECTOR_COUNT=0
if [ -f "$INTEL_DB" ]; then
VECTOR_COUNT=$(sqlite3 "$INTEL_DB" "SELECT COUNT(*) FROM vectors;" 2>/dev/null || echo "0")
fi

# Build multi-line status
# Build output
OUTPUT=""

# Line 1: Model + RuVector + Branch
OUTPUT="Opus 4.5 in RuVector"
# Line 1: Model + Project + Branch
OUTPUT="Opus 4.5 in agentic-flow"
if [ -n "$GIT_BRANCH" ]; then
OUTPUT="${OUTPUT} ⎇ ${GIT_BRANCH}"
OUTPUT="${OUTPUT} on ⎇ ${GIT_BRANCH}"
fi

# Line 2: Intelligence metrics
if [ "$MODE" = "on" ]; then
if [ "$ROUTES" -gt 0 ]; then
OUTPUT="${OUTPUT}\n⚡ SONA ${SUCCESS_RATE}% ~0.05ms | 🎯 ${ROUTES} routes | 🧠 ${PATTERNS} patterns"
else
OUTPUT="${OUTPUT}\n⚡ SONA ready ~0.05ms | 🧠 ${PATTERNS} patterns | 💾 ${MEMORIES} memories"
fi
# Line 2: Agentic Flow metrics
OUTPUT="${OUTPUT}\n🧠 Agentic Flow ◆ ${PATTERNS} patterns ⬡ ${MEMORIES} mem ↝${ROUTES} #${TRAJECTORIES}"

# Line 3: Architecture info
OUTPUT="${OUTPUT}\n🔀 MoE 4 experts | 🔍 HNSW 150x | 📈 LR ${LEARNING_RATE}"
# Line 3: Agent routing/learning metrics
OUTPUT="${OUTPUT}\n🎯 Agent Routing q-learning lr:${LEARNING_RATE}% ε:${EPSILON}%"

# Line 4: Backend & trajectories
BACKEND_LINE=""
if [ -f "$INTEL_DB" ]; then
DB_SIZE=$(du -h "$INTEL_DB" 2>/dev/null | cut -f1 || echo "0")
BACKEND_LINE="🗄️ ${MEMORY_BACKEND} ${DB_SIZE}"
else
BACKEND_LINE="🗄️ ${MEMORY_BACKEND}"
fi
if [ "$TOTAL_TRAJECTORIES" -gt 0 ]; then
BACKEND_LINE="${BACKEND_LINE} | 🔄 ${TOTAL_TRAJECTORIES} trajectories"
if [ "$TRAJECTORIES" -gt 0 ]; then
BACKEND_LINE="${BACKEND_LINE} (${TRAJECTORIES} active)"
fi
fi
OUTPUT="${OUTPUT}\n${BACKEND_LINE}"
else
OUTPUT="${OUTPUT}\n🧠 Intelligence (inactive)"
fi
# Line 4: Swarm coordination mechanisms
OUTPUT="${OUTPUT}\n⚡ Swarm: ●Neural ◐DAG ○Graph ●SSM"

# Print with newlines interpreted
printf "%b\n" "$OUTPUT"
Binary file removed agentic-flow/.agentic-flow/intelligence.db-shm
Binary file not shown.
142 changes: 133 additions & 9 deletions agentic-flow/.claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,125 @@
"CLAUDE_FLOW_HOOKS_ENABLED": "true",
"CLAUDE_FLOW_TELEMETRY_ENABLED": "true",
"CLAUDE_FLOW_REMOTE_EXECUTION": "true",
"CLAUDE_FLOW_CHECKPOINTS_ENABLED": "true"
"CLAUDE_FLOW_CHECKPOINTS_ENABLED": "true",
"CLAUDE_FLOW_WORKERS_ENABLED": "true",
"CLAUDE_FLOW_WORKER_PARALLEL": "true",
"CLAUDE_FLOW_MODEL_CACHE_MB": "512",
"CLAUDE_FLOW_SUPPRESS_WARNINGS": "true"
},
"workers": {
"enabled": true,
"parallel": true,
"maxConcurrent": 10,
"maxPerTrigger": 3,
"defaultTimeout": 300000,
"memoryDepositEnabled": true,
"progressEventsEnabled": true,
"triggers": {
"ultralearn": { "priority": "high", "timeout": 300000, "maxAgents": 5 },
"optimize": { "priority": "medium", "timeout": 180000, "maxAgents": 2 },
"consolidate": { "priority": "low", "timeout": 120000, "maxAgents": 1 },
"predict": { "priority": "medium", "timeout": 60000, "maxAgents": 2 },
"audit": { "priority": "high", "timeout": 300000, "maxAgents": 3 },
"map": { "priority": "medium", "timeout": 240000, "maxAgents": 2 },
"preload": { "priority": "low", "timeout": 30000, "maxAgents": 1 },
"deepdive": { "priority": "high", "timeout": 600000, "maxAgents": 4 },
"document": { "priority": "low", "timeout": 180000, "maxAgents": 2 },
"refactor": { "priority": "medium", "timeout": 120000, "maxAgents": 2 },
"benchmark": { "priority": "medium", "timeout": 180000, "maxAgents": 2 },
"testgaps": { "priority": "medium", "timeout": 120000, "maxAgents": 2 }
},
"agentMappings": {
"ultralearn": ["researcher", "coder"],
"optimize": ["performance-analyzer", "coder"],
"audit": ["security-analyst", "tester"],
"benchmark": ["performance-analyzer"],
"testgaps": ["tester"],
"document": ["documenter", "researcher"],
"deepdive": ["researcher", "security-analyst"],
"refactor": ["coder", "reviewer"],
"map": ["researcher"],
"preload": ["researcher"],
"predict": ["performance-analyzer"],
"consolidate": ["researcher"]
}
},
"performance": {
"modelCache": {
"enabled": true,
"maxSizeMB": 512,
"evictionPolicy": "lru"
},
"benchmarkThresholds": {
"triggerDetection": { "p95Ms": 5 },
"workerRegistry": { "p95Ms": 10 },
"agentSelection": { "p95Ms": 1 },
"memoryKeyGeneration": { "p95Ms": 0.1 },
"concurrentWorkers": { "totalMs": 1000 }
},
"optimizations": {
"parallelDispatch": true,
"batchMemoryWrites": true,
"cacheEmbeddings": true,
"suppressWarnings": true
}
},
"agents": {
"presets": {
"quick-scan": {
"phases": ["file-discovery", "pattern-discovery", "summarization"],
"timeout": 60000,
"priority": "low"
},
"deep-analysis": {
"phases": ["file-discovery", "static-analysis", "complexity-analysis", "pattern-extraction", "summarization"],
"timeout": 300000,
"priority": "high"
},
"security-scan": {
"phases": ["file-discovery", "security-analysis", "secret-detection", "summarization"],
"timeout": 180000,
"priority": "critical"
},
"learning": {
"phases": ["file-discovery", "pattern-extraction", "vectorization", "sona-training", "pattern-storage"],
"timeout": 300000,
"priority": "medium"
},
"api-docs": {
"phases": ["api-discovery", "pattern-extraction", "report-generation", "indexing"],
"timeout": 180000,
"priority": "low"
},
"test-analysis": {
"phases": ["file-discovery", "pattern-discovery", "coverage-analysis", "summarization"],
"timeout": 120000,
"priority": "medium"
}
},
"capabilities": {
"default": {
"onnxEmbeddings": true,
"vectorDb": true,
"sonaLearning": true,
"reasoningBank": true,
"intelligenceStore": true,
"progressEvents": true,
"memoryDeposits": true,
"persistResults": true
}
}
},
"permissions": {
"allow": [
"Bash(npx claude-flow *)",
"Bash(npx agentic-flow *)",
"Bash(npm run lint)",
"Bash(npm run test:*)",
"Bash(npm test *)",
"Bash(npm run build)",
"Bash(npm run benchmark)",
"Bash(npm run workers *)",
"Bash(git status)",
"Bash(git diff *)",
"Bash(git log *)",
Expand All @@ -28,7 +139,10 @@
"Bash(node *)",
"Bash(which *)",
"Bash(pwd)",
"Bash(ls *)"
"Bash(ls *)",
"mcp__ruv-swarm",
"mcp__claude-flow@alpha",
"mcp__flow-nexus"
],
"deny": [
"Bash(rm -rf /)",
Expand All @@ -38,13 +152,23 @@
]
},
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.user_prompt // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha workers dispatch --prompt '{}' --parallel true 2>/dev/null || true"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true"
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-command --command '{}' --validate-safety true --prepare-resources true 2>/dev/null || true"
}
]
},
Expand All @@ -53,7 +177,7 @@
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true"
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks pre-edit --file '{}' --auto-assign-agents true --load-context true 2>/dev/null || true"
}
]
}
Expand All @@ -64,7 +188,7 @@
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true"
"command": "cat | jq -r '.tool_input.command // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-command --command '{}' --track-metrics true --store-results true 2>/dev/null || true"
}
]
},
Expand All @@ -73,7 +197,7 @@
"hooks": [
{
"type": "command",
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true"
"command": "cat | jq -r '.tool_input.file_path // .tool_input.path // empty' | tr '\\n' '\\0' | xargs -0 -I {} npx claude-flow@alpha hooks post-edit --file '{}' --format true --update-memory true 2>/dev/null || true"
}
]
}
Expand All @@ -84,7 +208,7 @@
"hooks": [
{
"type": "command",
"command": "/bin/bash -c 'INPUT=$(cat); CUSTOM=$(echo \"$INPUT\" | jq -r \".custom_instructions // \\\"\\\"\"); echo \"🔄 PreCompact Guidance:\"; echo \"📋 IMPORTANT: Review CLAUDE.md in project root for:\"; echo \" • 54 available agents and concurrent usage patterns\"; echo \" • Swarm coordination strategies (hierarchical, mesh, adaptive)\"; echo \" • SPARC methodology workflows with batchtools optimization\"; echo \" • Critical concurrent execution rules (GOLDEN RULE: 1 MESSAGE = ALL OPERATIONS)\"; if [ -n \"$CUSTOM\" ]; then echo \"🎯 Custom compact instructions: $CUSTOM\"; fi; echo \"✅ Ready for compact operation\"'"
"command": "/bin/bash -c 'echo \"🔄 PreCompact: Check CLAUDE.md for 54 agents, swarm patterns, SPARC workflows\"; echo \"✅ Ready for compact\"'"
}
]
},
Expand All @@ -93,7 +217,7 @@
"hooks": [
{
"type": "command",
"command": "/bin/bash -c 'echo \"🔄 Auto-Compact Guidance (Context Window Full):\"; echo \"📋 CRITICAL: Before compacting, ensure you understand:\"; echo \" • All 54 agents available in .claude/agents/ directory\"; echo \" • Concurrent execution patterns from CLAUDE.md\"; echo \" • Batchtools optimization for 300% performance gains\"; echo \" • Swarm coordination strategies for complex tasks\"; echo \"⚡ Apply GOLDEN RULE: Always batch operations in single messages\"; echo \"✅ Auto-compact proceeding with full agent context\"'"
"command": "/bin/bash -c 'echo \"🔄 Auto-Compact: Preserving agent/worker context\"; echo \"✅ Auto-compact proceeding\"'"
}
]
}
Expand All @@ -103,7 +227,7 @@
"hooks": [
{
"type": "command",
"command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true"
"command": "npx claude-flow@alpha hooks session-end --generate-summary true --persist-state true --export-metrics true 2>/dev/null || true"
}
]
}
Expand Down
Loading
Loading