Files
Dragan Spiridonov 6dbc1c377b fix: critical memory/learning system fixes for v1.9.4 (#89)
* SwarmMemoryManager Refactoring Plan

* fix: add missing directories to npm package (v1.9.3)

Added templates/, .claude/helpers/, and docs/reference/ to package.json
files array. These were missing from the npm distribution, causing
`aqe init` to fail with "Template file not found" errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* checkpoint improvements

* fix: critical memory/learning system fixes for v1.9.4

## Critical Fixes
- Vector embeddings now stored correctly (was storing NULL)
- SQL parameter style fixed for agentdb's SqlJsDatabase wrapper
- HNSW index schema mismatch resolved with pattern_id column
- Hooks now save to correct database (.agentic-qe/agentdb.db)

## New Features
- Added 5 SwarmMemoryManager methods for learning data retrieval:
  - getBestAction() - Q-learning best action selection
  - getRecentLearningExperiences() - Recent experience retrieval
  - getLearningExperiencesByTaskType() - Task-filtered experiences
  - getHighRewardExperiences() - Successful experience extraction
  - getLearningStats() - Aggregate learning statistics
- Added comprehensive integration test for memory/learning loop
- Added RuVector pattern store integration (experimental)

## Technical Details
- Vector embeddings: 384 dimensions × 4 bytes = 1,536 bytes per pattern
- All 12 integration tests pass
- HNSW index: 150x faster vector search enabled

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: move ARM64-only ruvector packages to optionalDependencies

Fixes CI failures caused by platform-specific dependencies:
- @ruvector/node-linux-arm64-gnu (ARM64 only)
- ruvector-core-linux-arm64-gnu (ARM64 only)

These packages caused npm ci to fail on x64 CI runners with:
"EBADPLATFORM - wanted linux/arm64, current linux/x64"

Solution: Move ARM64 packages to optionalDependencies and add
x64 variants for cross-platform compatibility.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: regenerate package-lock.json with x64 ruvector packages

Updates lockfile to include optional x64 platform packages for
CI compatibility:
- @ruvector/node-linux-x64-gnu@0.1.17
- ruvector-core-linux-x64-gnu@0.1.15

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-30 20:52:44 +01:00

132 lines
4.1 KiB
Bash
Executable File

#!/bin/bash
# OTEL Stack Verification Script
# Agentic QE Fleet - Issue #71
set -e
echo "========================================="
echo "OTEL Stack Verification"
echo "========================================="
echo ""
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Check if Docker is running
echo "Checking Docker..."
if ! docker info > /dev/null 2>&1; then
echo -e "${RED}✗ Docker is not running${NC}"
exit 1
fi
echo -e "${GREEN}✓ Docker is running${NC}"
echo ""
# Check if services are running
echo "Checking OTEL stack services..."
services=("agentic-qe-otel-collector" "agentic-qe-prometheus" "agentic-qe-jaeger" "agentic-qe-grafana")
all_running=true
for service in "${services[@]}"; do
if docker ps --filter "name=$service" --filter "status=running" | grep -q "$service"; then
echo -e "${GREEN}✓ $service is running${NC}"
else
echo -e "${RED}✗ $service is not running${NC}"
all_running=false
fi
done
echo ""
if [ "$all_running" = false ]; then
echo -e "${YELLOW}Some services are not running. Start them with:${NC}"
echo " docker-compose -f config/docker-compose.otel.yml up -d"
echo ""
fi
# Check service health endpoints
echo "Checking service health endpoints..."
# OTEL Collector
if curl -s -f http://localhost:13133/health > /dev/null 2>&1; then
echo -e "${GREEN}✓ OTEL Collector health check OK${NC}"
else
echo -e "${RED}✗ OTEL Collector health check failed${NC}"
fi
# Prometheus
if curl -s -f http://localhost:9090/-/healthy > /dev/null 2>&1; then
echo -e "${GREEN}✓ Prometheus health check OK${NC}"
else
echo -e "${RED}✗ Prometheus health check failed${NC}"
fi
# Jaeger
if curl -s -f http://localhost:14269/ > /dev/null 2>&1; then
echo -e "${GREEN}✓ Jaeger health check OK${NC}"
else
echo -e "${RED}✗ Jaeger health check failed${NC}"
fi
# Grafana
if curl -s -f http://localhost:3001/api/health > /dev/null 2>&1; then
echo -e "${GREEN}✓ Grafana health check OK${NC}"
else
echo -e "${RED}✗ Grafana health check failed${NC}"
fi
echo ""
# Check OTLP endpoints
echo "Checking OTLP endpoints..."
# OTLP HTTP
if curl -s -o /dev/null -w "%{http_code}" http://localhost:4318/ 2>&1 | grep -q "200\|404\|405"; then
echo -e "${GREEN}✓ OTLP HTTP endpoint (4318) is accessible${NC}"
else
echo -e "${RED}✗ OTLP HTTP endpoint (4318) is not accessible${NC}"
fi
# OTLP gRPC (just check if port is open)
if nc -z localhost 4317 2>/dev/null; then
echo -e "${GREEN}✓ OTLP gRPC endpoint (4317) is accessible${NC}"
else
echo -e "${RED}✗ OTLP gRPC endpoint (4317) is not accessible${NC}"
fi
echo ""
# Check Prometheus targets
echo "Checking Prometheus scrape targets..."
targets_response=$(curl -s http://localhost:9090/api/v1/targets 2>/dev/null || echo "")
if echo "$targets_response" | grep -q "otel-collector"; then
echo -e "${GREEN}✓ Prometheus is scraping OTEL Collector${NC}"
else
echo -e "${YELLOW}⚠ Prometheus may not be scraping OTEL Collector yet${NC}"
fi
echo ""
# Display service URLs
echo "========================================="
echo "Service URLs:"
echo "========================================="
echo -e "${GREEN}Grafana:${NC} http://localhost:3001 (admin/admin)"
echo -e "${GREEN}Prometheus:${NC} http://localhost:9090"
echo -e "${GREEN}Jaeger:${NC} http://localhost:16686"
echo -e "${GREEN}OTEL Collector:${NC} http://localhost:13133/health"
echo ""
echo -e "${GREEN}OTLP Endpoints:${NC}"
echo " gRPC: localhost:4317"
echo " HTTP: localhost:4318"
echo ""
# Display quick start commands
echo "========================================="
echo "Quick Commands:"
echo "========================================="
echo "Start stack: docker-compose -f config/docker-compose.otel.yml up -d"
echo "Stop stack: docker-compose -f config/docker-compose.otel.yml down"
echo "View logs: docker-compose -f config/docker-compose.otel.yml logs -f"
echo "Check status: docker-compose -f config/docker-compose.otel.yml ps"
echo ""