feat(patterns): add temporal_rhythm detector (seventh deterministic detector) (#20) - #39
Open
Sarcastic-Soul wants to merge 2 commits into
Open
Conversation
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.
Closes #10. Re-submits #20 on fresh
mainbase with review feedback addressed.Summary
Adds
temporal_rhythms()as the seventh deterministic detector insrc/activity_frames/patterns.py.What it does
Clusters focused app frames by local 30-minute hour bins across calendar days. Emits
WorkPattern(kind="temporal_rhythm")when:MIN_DAYS_FOR_RHYTHM = 3)Adjacent qualifying bins per app are merged into a single contiguous span before the global
[:12]cut, preventing an always-focused app from occupying all output slots.Example label:
Cursor active 09:00-10:00 on 5/5 days (regularity 1.00)Review Feedback Addressed (from #20)
WorkPatternblock before the[:12]cut.LIMIT 50000to the SQL query.distinct_days_hit / total_active_days_in_window.Tier Contract (SPEC §7)
The label carries observed time windows and a regularity score only — no interpretation or intent labels (e.g., "morning routine"). The detector remains strictly Tier-1 (measured, deterministic).
Checklist
pytest -qpasses