Skip to content

feat: add Session Summary Report Generator (#77)#255

Open
Aspirant200715 wants to merge 2 commits into
sahoo-tech:mainfrom
Aspirant200715:main
Open

feat: add Session Summary Report Generator (#77)#255
Aspirant200715 wants to merge 2 commits into
sahoo-tech:mainfrom
Aspirant200715:main

Conversation

@Aspirant200715
Copy link
Copy Markdown

🔗 Related Issue

Closes #77


📝 Summary of Changes

This PR introduces the Session Summary Report Generator feature as requested. It aggregates action logs and guidance metrics directly from the local SQLite database to provide users with a concise report of their session.

Key Changes:

  1. Core Logic: Created core/intelligence/session_summarizer.py with a SessionSummarizer class to compute session duration, completed steps, error frequency, and guidance confidence.
  2. API Layer: Added api/routes/session.py with endpoints GET /api/v1/session/{session_id}/summary (JSON) and /summary.md (Markdown).
  3. Frontend Integration: Updated dashboard/src/routes/+page.svelte to include a "Session Summary" UI block in the ADMIN_CONTROLS section. It features a fully-styled dark-mode modal overlay to render the generated Markdown report.
  4. Download Support: Added a button to instantly download the raw .md report directly from the frontend dashboard.
  5. Testing: Implemented robust unit tests using an in-memory SQLite setup in tests/unit/test_session_summarizer.py.

🔍 Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Test addition
  • Refactor / Code cleanup

🧪 How Was This Tested?

  1. Unit Tests: Ran python -m pytest tests/unit/test_session_summarizer.py successfully.
  2. Manual End-to-End: Booted main.py and the Svelte frontend (npm run dev). Navigated to the dashboard, generated a few simulated actions, and triggered the report generation for the live session ID.
  3. Frontend Build: Verified npm run build succeeds in the dashboard/ directory.

Test environment:

  • OS: Windows 11
  • Python version: 3.11.9
  • Node version: 18+

📸 Screenshots / Recordings (if applicable)

Screenshot 2026-05-26 132945 Screenshot 2026-05-26 133108 Screenshot 2026-05-26 133123

✅ Pre-Submission Checklist

  • My branch is up to date with upstream/main.
  • My code follows the project's coding standards (Black, isort, flake8 pass)
  • I have written/updated tests for my changes
  • All existing tests pass (python -m pytest tests/) (Note: Existing unrelated test failures in main were bypassed, new tests pass 100%)
  • I have added docstrings and type hints to all new public functions
  • I have updated relevant documentation (README, docs/, inline comments)
  • My PR title follows the Conventional Commits format

Adds backend summarizer logic, API endpoints, and a frontend dashboard UI to display and download session markdown reports.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a Session Summary Report Generator

1 participant