Skip to content

Add Debug Mode to ksd dashboard for manual triggers and result examination #21

@durapensa

Description

@durapensa

Overview

Enhance ksd dashboard with Debug Mode capabilities for better control over analysis triggers and result examination.

Proposed Features

1. Enhanced Triggers Screen [T]

When pressing [T] in ksd, show an enhanced screen with:

  • Detailed trigger statistics (last triggered, events since trigger, queue status)
  • Force trigger options for each analysis type:
    • [1] Force theme extraction
    • [2] Force connection finding
    • [3] Force pattern identification
  • Parameter override options:
    • Event count override
    • Lookback period adjustment
    • Skip threshold/pending checks

2. Debug Mode [D]

New mode accessible from main ksd screen showing:

  • Live Queue Status: Real-time view of analysis_queue.json
  • Recent Findings Preview: Last N findings from each analysis type
  • Analysis Logs: Tail of background process logs
  • Force Trigger Buttons: Quick access to manual triggers
  • System Health: Memory usage, process status, file sizes

3. Result Examination Tools

Integration options for viewing analysis results:

  • Built-in Viewers:
    • [V] View latest findings (formatted, not raw JSON)
    • [H] History browser for approved/rejected findings
    • [S] Search findings by type/content
  • External Tool Support:
    • fx (terminal JSON viewer with JSONL support)
    • jless (already used, could be better integrated)
    • fzf integration for fuzzy search
    • bat for syntax-highlighted viewing

4. Additional Enhancements

  • Timeline view of analysis history
  • Quick stats on approval/rejection rates
  • Export findings to different formats
  • Temporary threshold adjustments for testing

Implementation Notes

  • Keep existing ksd architecture intact
  • Add new screens/modes without disrupting current workflow
  • Ensure all debug features are clearly marked as such
  • Consider making debug mode optional via environment variable

JSON/JSONL Viewer Research

Based on research, the best TUI options are:

  • fx: Supports JSON Lines streaming, JavaScript expressions
  • jless: Current tool, good for exploration
  • json-tui: C++ based, minimal dependencies

For a custom viewer specific to ks needs, it would be developed in a separate repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions