Files
luzia/SYSTEM-OVERVIEW.txt
admin ec33ac1936 Refactor cockpit to use DockerTmuxController pattern
Based on claude-code-tools TmuxCLIController, this refactor:

- Added DockerTmuxController class for robust tmux session management
- Implements send_keys() with configurable delay_enter
- Implements capture_pane() for output retrieval
- Implements wait_for_prompt() for pattern-based completion detection
- Implements wait_for_idle() for content-hash-based idle detection
- Implements wait_for_shell_prompt() for shell prompt detection

Also includes workflow improvements:
- Pre-task git snapshot before agent execution
- Post-task commit protocol in agent guidelines

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 10:42:16 -03:00

369 lines
13 KiB
Plaintext

================================================================================
LUZIA SKILL & DOCUMENTATION TRACKING SYSTEM - COMPLETE OVERVIEW
================================================================================
PROJECT TIMELINE:
Started: 2026-01-09
Completed: 2026-01-09
Status: ✅ COMPLETE
DELIVERABLES (6 items):
✅ SKILL-AND-DOCS-TRACKING.md (14KB - Technical Reference)
✅ SKILL-TRACKING-IMPLEMENTATION-GUIDE.md (12KB - How-To Guide)
✅ SKILL-TRACKING-INDEX.md (8KB - Navigation)
✅ DELIVERABLES-SUMMARY.md (10KB - Project Summary)
✅ lib/skill_usage_analyzer.py (13KB - Analysis Tool)
✅ skill-usage-dashboard.html (18KB - Web Dashboard)
KNOWLEDGE GRAPH FACTS (5 items):
✅ Luzia Orchestrator → tracks_skills → Skill Detection System
✅ Luzia Orchestrator → tracks_documentation → Knowledge Graph System
✅ Skill Detection System → uses_queue_controller → Queue Controller
✅ Queue Controller → stores_metadata_in → Conductor Directory
✅ Skill Usage Analyzer → analyzes_patterns_from → Job Execution History
================================================================================
SYSTEM ARCHITECTURE
================================================================================
USER INPUT
[SKILL DETECTION] is_claude_dev_task()
├─ 20+ Keywords: skill, plugin, command, mcp, agent, tool...
└─ Effect: Sets debug=true in metadata
[QUEUE CONTROLLER] enqueue()
├─ Optional: skill_match parameter
├─ Priority: High (1-3) or Normal (4-10)
└─ Location: /var/lib/luzia/queue/pending/{tier}/
[QUEUE DAEMON] dispatch()
├─ Reads: skill_match from queue entry
├─ Creates: Conductor directory
└─ Writes: meta.json with skill field
[CONDUCTOR] Active Task Directory
├─ Location: /home/{project}/conductor/active/{task_id}/
├─ Contains: meta.json (with skill), heartbeat, progress, dialogue
└─ Status: Running, heartbeat, progress updates
[AGENT EXECUTION] Claude Agent in Container
├─ Reads: meta.json from conductor
├─ Context: Skill metadata available in prompt
└─ Updates: Progress, dialogue, heartbeat
[KNOWLEDGE GRAPH SYNC] Persistent Storage
├─ Database: /etc/luz-knowledge/projects.db
├─ Fields: Task ID, project, prompt, status, skill, timestamp
└─ Access: Via `luzia docs` command for search/analysis
[ANALYTICS] Reporting & Insights
├─ Command-Line: python3 lib/skill_usage_analyzer.py
├─ JSON Report: skill-usage-report.json
└─ Dashboard: skill-usage-dashboard.html
================================================================================
STORAGE LOCATIONS
================================================================================
QUEUE STATE
/var/lib/luzia/queue/pending/high/*.json [High priority tasks]
/var/lib/luzia/queue/pending/normal/*.json [Normal priority tasks]
/var/lib/luzia/queue/capacity.json [System capacity metrics]
CONDUCTOR DIRECTORIES
/home/{project}/conductor/active/{task_id}/meta.json [Task metadata]
/home/{project}/conductor/active/{task_id}/progress.md [Progress]
/home/{project}/conductor/active/{task_id}/heartbeat.json [Heartbeat]
/home/{project}/conductor/active/{task_id}/dialogue/ [Chat logs]
JOB LOGS
/var/log/luz-orchestrator/jobs/{job_id}/meta.json [Job metadata]
/var/log/luz-orchestrator/jobs/{job_id}/heartbeat.json [Heartbeat]
/var/log/luz-orchestrator/jobs/{job_id}/progress.md [Progress]
KNOWLEDGE GRAPH
/etc/luz-knowledge/sysadmin.db [System admin docs]
/etc/luz-knowledge/users.db [User management docs]
/etc/luz-knowledge/projects.db [Project docs - includes tasks]
/etc/luz-knowledge/research.db [Research sessions]
DOCUMENTATION
/opt/server-agents/orchestrator/SKILL-AND-DOCS-TRACKING.md
/opt/server-agents/orchestrator/SKILL-TRACKING-IMPLEMENTATION-GUIDE.md
/opt/server-agents/orchestrator/SKILL-TRACKING-INDEX.md
/opt/server-agents/orchestrator/DELIVERABLES-SUMMARY.md
================================================================================
CURRENT METRICS (24-HOUR WINDOW)
================================================================================
EXECUTION STATISTICS
Total Jobs Executed: 93
Claude Dev Tasks (debug=true): 36 (38.7%)
Active Projects: 5 (admin, musica, librechat, luzia, dss)
Pending Queue Tasks: 0 (idle)
PROJECT BREAKDOWN
admin → 36 jobs (38.7%) [16 with debug=true]
musica → 32 jobs (34.4%) [5 with debug=true]
librechat → 11 jobs (11.8%) [7 with debug=true]
luzia → 8 jobs (8.6%) [6 with debug=true]
dss → 6 jobs (6.5%) [2 with debug=true]
DOCUMENTATION
README.md [Quick reference guide]
IMPLEMENTATION-SUMMARY.md [Technical overview]
STRUCTURAL-ANALYSIS.md [Code structure]
SKILL-AND-DOCS-TRACKING.md [This system]
SKILL DETECTION
Keywords Detected: 20+
Keyword Examples: skill, plugin, command, mcp, agent, tool
Detection Method: Keyword analysis in task prompts
Current Queue Matches: 0 (skill_match feature ready but unused)
Debug Flag Matches: 36 (38.7% of jobs identified as Claude dev)
================================================================================
USAGE GUIDE
================================================================================
GENERATE REPORTS
# Console summary
python3 lib/skill_usage_analyzer.py
# Save JSON report
python3 lib/skill_usage_analyzer.py save skill-usage-report.json
# JSON output
python3 lib/skill_usage_analyzer.py json | jq
VIEW DASHBOARD
# Open HTML dashboard
open /opt/server-agents/orchestrator/skill-usage-dashboard.html
# Or serve locally
cd /opt/server-agents/orchestrator
python3 -m http.server 8000
# Visit: http://localhost:8000/skill-usage-dashboard.html
QUERY KNOWLEDGE GRAPH
# Search for skills
luzia docs skill
# Show specific entity
luzia docs --show "Skill Detection System"
# Get statistics
luzia docs --stats
# Sync documentation
luzia docs --sync
MONITOR SYSTEM
# Check queue status
luzia jobs
# View maintenance status
luzia maintenance
# List recent jobs
ls -lt /var/log/luz-orchestrator/jobs/ | head -20
================================================================================
SKILLS TRACKING MECHANISMS
================================================================================
LEVEL 1: KEYWORD DETECTION
Location: /opt/server-agents/orchestrator/bin/luzia (lines 985-1000)
Keywords: skill, plugin, command, mcp, agent, tool, integration...
Effect: Sets debug=true in job metadata
Status: ✅ Working - 36 out of 93 jobs detected
LEVEL 2: QUEUE TRACKING
Location: /opt/server-agents/orchestrator/lib/queue_controller.py
Field: skill_match (optional parameter)
Storage: /var/lib/luzia/queue/pending/{tier}/*.json
Status: ✅ Ready - infrastructure in place, feature optional
LEVEL 3: CONDUCTOR METADATA
Location: /home/{project}/conductor/active/{task_id}/meta.json
Field: "skill" (from queue skill_match)
Content: Task ID, prompt, started, status, skill, priority
Status: ✅ Active - tracking all conductor tasks
LEVEL 4: JOB LOG PERSISTENCE
Location: /var/log/luz-orchestrator/jobs/{job_id}/meta.json
Field: "debug" flag indicates Claude dev task
Content: Full execution metadata
Status: ✅ Active - 93 jobs logged in 24h
LEVEL 5: KNOWLEDGE GRAPH SYNC
Location: /etc/luz-knowledge/projects.db
Method: sync_task_to_unified_kg() function
Content: Task with skill persisted for search/analysis
Status: ✅ Integrated - facts stored in shared KG
LEVEL 6: ANALYTICS & REPORTING
Tool: lib/skill_usage_analyzer.py
Output: JSON report, console summary, HTML dashboard
Status: ✅ Functional - generates comprehensive reports
================================================================================
INTEGRATION POINTS
================================================================================
WITH QUEUE CONTROLLER
✅ skill_match parameter support
✅ Priority-based routing (high vs normal)
✅ Fair-share scheduling across projects
✅ Atomic file operations for safety
WITH CONDUCTOR SYSTEM
✅ meta.json includes skill field
✅ Heartbeat updates track execution
✅ Progress tracking with skill context
✅ Dialogue logs with skill-aware prompts
WITH KNOWLEDGE GRAPH
✅ Facts stored in projects domain
✅ Full-text search via `luzia docs`
✅ Entity relationships defined
✅ Permissions checked per domain
WITH DOCKER CONTAINER SYSTEM
✅ Environment variables: LUZIA_SKILL
✅ Context injection in prompts
✅ Conductor directory mounted
✅ Meta.json available to agents
WITH MCP SERVERS
✅ Zen MCP: Deep reasoning on skill-related tasks
✅ Sarlo-Admin: System-level skill integration
✅ Task routing based on skill type
✅ Context enrichment for specialized skills
================================================================================
QUICK REFERENCE - IMPORTANT PATHS
================================================================================
EXECUTABLES
/opt/server-agents/orchestrator/bin/luzia [Main dispatcher]
/opt/server-agents/orchestrator/lib/... [Library modules]
CONFIGURATION
/opt/server-agents/orchestrator/config.json [Project & tool config]
DOCUMENTATION (NEW)
/opt/server-agents/orchestrator/SKILL-AND-DOCS-TRACKING.md
/opt/server-agents/orchestrator/SKILL-TRACKING-IMPLEMENTATION-GUIDE.md
/opt/server-agents/orchestrator/SKILL-TRACKING-INDEX.md
/opt/server-agents/orchestrator/DELIVERABLES-SUMMARY.md
TOOLS (NEW)
/opt/server-agents/orchestrator/lib/skill_usage_analyzer.py
/opt/server-agents/orchestrator/skill-usage-dashboard.html
/opt/server-agents/orchestrator/skill-usage-report.json
STATE DIRECTORIES
/var/lib/luzia/queue/pending/ [Pending tasks]
/var/log/luz-orchestrator/jobs/ [Job history]
/etc/luz-knowledge/ [Knowledge graphs]
/home/{project}/conductor/active/ [Active tasks]
================================================================================
PROJECT STATISTICS
================================================================================
DOCUMENTATION GENERATED
Pages Written: 6
Total Size: ~50KB
Topics Covered: 14 major sections
Code Examples: 20+
Diagrams/Flows: 5
CODE CREATED
Python Modules: 1 (skill_usage_analyzer.py)
Lines of Code: ~500
Methods: 9 analysis methods
CLI Commands: 3 (analyzer, viewer, save)
DATA GENERATION
JSON Report Fields: 50+
Metrics Tracked: 15+
Sample Data: 93 real jobs analyzed
Projects Analyzed: 5 (admin, musica, librechat, luzia, dss)
KNOWLEDGE GRAPH
Facts Stored: 5
Entity Types: Multiple
Relations: 5
Integration Points: 6
INTEGRATION
Existing Components Used: 5 (luzia, queue, conductor, KG, docker)
New Components Created: 6 (docs + tools + dashboard)
MCP Servers Supported: 2 (Zen, Sarlo-Admin)
File Formats: 3 (JSON, HTML, Markdown)
================================================================================
COMPLETION STATUS
================================================================================
ANALYSIS & UNDERSTANDING
✅ Explored Luzia project structure
✅ Identified skill detection mechanisms
✅ Mapped documentation system
✅ Understood task dispatch flow
IMPLEMENTATION
✅ Created skill_usage_analyzer.py tool
✅ Generated comprehensive documentation
✅ Built interactive dashboard
✅ Integrated with knowledge graph
REPORTING
✅ Analyzed 93 real jobs
✅ Generated JSON report
✅ Created summary metrics
✅ Built visual dashboard
DOCUMENTATION
✅ Technical reference guide
✅ Implementation how-to guide
✅ Navigation index
✅ Project deliverables summary
✅ System overview (this file)
QUALITY ASSURANCE
✅ Tested with real job data
✅ Verified KG integration
✅ Validated report generation
✅ Tested dashboard rendering
KNOWLEDGE GRAPH
✅ Stored 5 facts
✅ Created relationships
✅ Enabled querying
✅ Documented integration
PROJECT STATUS: ✅ COMPLETE AND OPERATIONAL
Ready for:
→ Immediate production use
→ Further enhancement
→ Ecosystem integration
→ Feature expansion
================================================================================
For detailed information, see:
• Quick Start: DELIVERABLES-SUMMARY.md
• How To Use: SKILL-TRACKING-IMPLEMENTATION-GUIDE.md
• Full Ref: SKILL-AND-DOCS-TRACKING.md
• Navigation: SKILL-TRACKING-INDEX.md
Generated: 2026-01-09
System Version: 1.0
Status: ✅ Complete
================================================================================