Fix/app ledger session tracking - #37
Open
rautaditya2606 wants to merge 4 commits into
Open
Conversation
nossa-y
requested changes
Aug 1, 2026
nossa-y
left a comment
Owner
There was a problem hiding this comment.
Reproduced - the bug is real, and the core fix is right. Before merge:
- Respect the 20s flicker fold: a 5s interruption must not split a session (as-is app_ledger contradicts segments() on the repo fixture). Add test: A 10m, 5s B, A 10m => 1 session, 20m.
- Restore the
assert reason in validline clobbered in test_break_reason_in_output_with_debug. - Drop the pyproject.toml line (separate chore PR if you want it).
- CHANGELOG entry for #36 (session counts change in
aframes apps+ get_day_summary).
…witch in app_ledger
… and configure pytest pythonpath
rautaditya2606
force-pushed
the
fix/app-ledger-session-tracking
branch
from
August 2, 2026 16:42
654547d to
25670b7
Compare
nossa-y
force-pushed
the
main
branch
3 times, most recently
from
August 6, 2026 18:51
972b4d9 to
e92e599
Compare
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.
Description
Fixes #36 by finalizing and resetting active application session durations on app transitions in
app_ledger().Previously,
cur_sessiononly cleared on global idle gaps (gap > 300s). Switching away and returning to an app within 300s (e.g.Cursor (10m) -> Chrome (10m) -> Cursor (10m)) misreported 1 session of 20m instead of 2 sessions of 10m.Changes
src/activity_frames/sessionize.py: Trackcur_apptransitions; finalize session length intolongest[app]when the focused app changes.pyproject.toml: Configuredpythonpath = ["src"]under[tool.pytest.ini_options]for out-of-the-boxpytestruns.tests/test_sessionize.py: Addedtest_app_ledger_multiple_sessions_across_app_switches.Testing
pytest(105 passed in 0.28s).