Skip to content

feat(sessionize): quantify sessionization debug reasons and cover fli… - #35

Open
Sarcastic-Soul wants to merge 2 commits into
nossa-y:mainfrom
Sarcastic-Soul:feat/sessionization-debug-reasons
Open

feat(sessionize): quantify sessionization debug reasons and cover fli…#35
Sarcastic-Soul wants to merge 2 commits into
nossa-y:mainfrom
Sarcastic-Soul:feat/sessionization-debug-reasons

Conversation

@Sarcastic-Soul

Copy link
Copy Markdown
Contributor

What this changes

Closes #18.

Summary

Extends the sessionization debug info (_debug block emitted when --debug / debug=True is enabled) with quantified reason strings and coverage for deterministic boundaries (§5):

  1. Quantified Reason Strings:
    • session_gap: Formatted with measured gap against §5.2 threshold (session_gap: 3600s > 300s).
  2. Deterministic Boundary Coverage:
    • merged flicker: Notes folded interruptions and their span vs §5.3 limit (merged flicker: Slack 8s <= 20s).
    • dwell capped: Notes when frame active time is capped at §5.1 limit (dwell capped: 90s).
    • device: Notes when frames are partitioned by monitor device (device: Display 1).

Remains Tier-1: measured, reproducible, namespaced under _debug, opt-in via --debug, and byte-identical when off.

Checklist

  • Output stays deterministic (no clock, network, randomness, or model calls)
  • New behavior has a test; pytest -q passes
  • New schema fields, if any, are measured - or live in the tier-2 inferred block with a confidence tag
  • No typed text or page content is emitted by default

@nossa-y nossa-y left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Debug-off output is byte-identical - good. But the flicker note quotes the wrong quantity: the SPEC 5.3 gate is B's span (8s on the fixture), the note prints interruption seconds - so it emits "Slack 20s <= 20s", and an A-B-A with a dwell-capped return prints "B 100s <= 20s", which is false. Your PR body's own example ("8s <= 20s") is the correct output.

  1. Compare wall_seconds() in the note; update tests to cover span != active.
  2. Add a device-boundary test (SPEC 5.5, see test_multidevice.py).
  3. Only emit the device note when the window spans >1 device - as-is every entry on a single-monitor DB gets "; device: monitor_1".
  4. Drop Segment.device - written, never read.

@nossa-y
nossa-y force-pushed the main branch 3 times, most recently from 972b4d9 to e92e599 Compare August 6, 2026 18:51
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.

Sessionization debug reasons: quantify strings + cover flicker/dwell/device boundaries

2 participants