fss-mini-rag-github/logs/log_functions.sh
fss-code-server 0dcfb4dfb3 Agent Test Results: Childcare Regulations Compliance System
- Tested FSS-Mini-RAG with childcare regulatory documentation
- Created intelligent compliance knowledge base with 3 documents
- Evaluated search effectiveness for regulatory workflows
- Documented 1 critical issue found (chunking algorithm)
- Rating: 4/10 overall effectiveness due to search precision issues
2025-09-08 15:57:40 +00:00

39 lines
1.6 KiB
Bash

#!/bin/bash
AGENT_ID=$(basename $(cd .. && pwd) | cut -d'_' -f1)
log_message() {
local level=$1
local phase=$2
local message=$3
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [AGENT-${AGENT_ID}] [$phase] [$level] $message" >> logs/agent_${AGENT_ID}_session.log
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$phase] [$level] $message"
if [ "$level" = "ERROR" ]; then
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [AGENT-${AGENT_ID}] [$phase] $message" >> logs/agent_${AGENT_ID}_errors.log
fi
}
update_progress() {
local phase=$1
local percentage=$2
jq --arg phase "$phase" --arg pct "$percentage" --arg time "$(date -Iseconds)" \
'.current_phase = $phase | .progress_percentage = ($pct | tonumber) | .last_update = $time' \
logs/agent_${AGENT_ID}_progress.json > logs/agent_${AGENT_ID}_progress.tmp && \
mv logs/agent_${AGENT_ID}_progress.tmp logs/agent_${AGENT_ID}_progress.json
}
log_gitea() {
local operation=$1
local details=$2
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [AGENT-${AGENT_ID}] [GITEA] $operation: $details" >> logs/agent_${AGENT_ID}_gitea.log
log_message "INFO" "GITEA" "$operation: $details"
}
mark_complete() {
local rating=$1
jq --arg time "$(date -Iseconds)" --arg rating "$rating" \
'.status = "completed" | .progress_percentage = 100 | .current_phase = "COMPLETE" | .overall_rating = ($rating | tonumber) | .last_update = $time' \
logs/agent_${AGENT_ID}_progress.json > logs/agent_${AGENT_ID}_progress.tmp && \
mv logs/agent_${AGENT_ID}_progress.tmp logs/agent_${AGENT_ID}_progress.json
}