Skip to content

feat(session): sk session digest + stats — per-session deep-dive and aggregate stats (#719 #724)#730

Merged
magicpro97 merged 6 commits into
mainfrom
feat/i724-session-digest-stats-rebased
May 30, 2026
Merged

feat(session): sk session digest + stats — per-session deep-dive and aggregate stats (#719 #724)#730
magicpro97 merged 6 commits into
mainfrom
feat/i724-session-digest-stats-rebased

Conversation

@magicpro97
Copy link
Copy Markdown
Owner

Summary

Adds sk session digest and sk session stats commands.

Closes #719
Closes #724

Changes

  • query-session.py: Added cmd_digest() and cmd_stats()
  • sk.py: Added session group routing
  • test_fixes.py: 50 I724 tests (now correctly placed after sys.exit fix)

Fixes

  • Ruff CI errors fixed (rebased on main b0352a5)
  • I724 tests were dead code (after sys.exit) — fixed (original review by review-pr727)

Review

  • Opus review completed: dead code bug found and fixed
  • All 50 I724 tests now execute and pass ✅

Copilot AI review requested due to automatic review settings May 30, 2026 09:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds two new query-session subcommands — sk session digest <prefix> (per-session deep-dive: header, knowledge added, files touched, checkpoints) and sk session stats --by label|branch|day|week (aggregate counts/cost) — both with --json. Wires them through the sk shim under a new session group and adds I724 tests.

Changes:

  • query-session.py: adds cmd_digest() and cmd_stats() plus digest/stats dispatch in _run.
  • sk.py: adds a session group with label/labels/digest/stats and routing in main.
  • test_fixes.py: appends 16 I724 test groups (~50 assertions), but the new tail is structurally broken.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
query-session.py New cmd_digest/cmd_stats with parameterized SQL, optional-column detection, and dispatch in _run.
sk.py Adds session group to _GROUPS and a subcommand-passthrough branch in main.
test_fixes.py Appends I724 tests; final lines (9688–9692) form an orphaned print / dangling else: that makes the file fail to parse.

Comment thread test_fixes.py Outdated
Comment on lines +9688 to +9693
# ---------------------------------------------------------------------------
print("🎉 All tests passed!")
else:
print(f"⚠️ {FAIL} test(s) need attention")
sys.exit(0 if FAIL == 0 else 1)

@magicpro97 magicpro97 force-pushed the feat/i724-session-digest-stats-rebased branch 2 times, most recently from cc59959 to 975fdd2 Compare May 30, 2026 11:06
Linh Ngo and others added 5 commits May 30, 2026 18:36
…aggregate stats (#719 #724)

- query-session.py: cmd_digest (metadata/knowledge/files/checkpoints per session), cmd_stats (--by label|branch|day|week, --since, --limit)
- sk.py: wire sk session namespace with digest/stats subcommands
- test_fixes.py: +50 tests (I724)

Closes #719 #724

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@magicpro97 magicpro97 force-pushed the feat/i724-session-digest-stats-rebased branch from 975fdd2 to 4f69642 Compare May 30, 2026 11:38
- cmd_digest: return exit 1 with 'No session found matching <prefix>'
  when DB doesn't exist (matches no-match behavior expected by I724-6b)
- cmd_stats: return exit 0 with empty JSON [] when DB doesn't exist
  (matches I724-9a/9b expectations for fresh CI environment)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@magicpro97
Copy link
Copy Markdown
Owner Author

Reviewer comment noted. The inline comment about syntax was from an earlier diff version — the current branch passes python3 -c "import ast; ast.parse(...)" cleanly and all CI tests pass. Requesting re-review.

@magicpro97 magicpro97 merged commit 981c37c into main May 30, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants