feat(session): sk session digest + stats — per-session deep-dive and aggregate stats (#719 #724)#730
Merged
Merged
Conversation
There was a problem hiding this comment.
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: addscmd_digest()andcmd_stats()plusdigest/statsdispatch in_run.sk.py: adds asessiongroup withlabel/labels/digest/statsand routing inmain.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 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) | ||
|
|
cc59959 to
975fdd2
Compare
…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>
975fdd2 to
4f69642
Compare
- 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>
Owner
Author
|
Reviewer comment noted. The inline comment about syntax was from an earlier diff version — the current branch passes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
sk session digestandsk session statscommands.Closes #719
Closes #724
Changes
query-session.py: Addedcmd_digest()andcmd_stats()sk.py: Addedsessiongroup routingtest_fixes.py: 50 I724 tests (now correctly placed after sys.exit fix)Fixes
Review