Test scripts for that implement card selection based on session timing.
General Note: 1 LLM-prompt might use 0.3-3 watt hours.
The trigger system uses time-based peudo-random card selection:
- Session Start: Record conversation start time (HH:MM)
- Interval Calculation:
(start_minute % 3) + 3gives intervals of 3, 4, or 6 minutes - Card Selection:
(start_minute + current_minute) % 66 + 1for deterministic card choice - Application: Card applied when
(current_time - session_start) >= interval_minutesAND session is sustained (10+ minutes)
- Session starts at 14:23 (minute 23)
- Interval:
(23 % 3) + 3 = 2 + 3 = 5 minutes - First card at 14:28 (5 minutes later)
- Card selection:
(23 + 28) % 66 + 1 = 51 + 1 = 52→ Card #52
- Same session start time = same interval and card sequence
- Different start times = different patterns
- Predictable but varied across sessions
- Good for study consistency
IF (current_time - session_start) >= interval_minutes AND session >= 10 minutes:
- Check for recent logs (within last 3 minutes)
- If no recent logs:
- Select card using deterministic formula
- Log card usage to session file
- Output TRIGGER:<card_number>
- Else:
- Skip (output SKIP:Recent)
ELSE:
- Skip (output SKIP:Timing)
- Consistent: Same session = same card sequence
- Varied: Different sessions = different patterns
- Time-based: Cards appear during sustained work (10+ minutes)
- Study-friendly: Predictable for analysis and reproducibility
PowerShell (Windows):
# Run from the repository root
.\scripts\trigger.ps1Bash (Linux/macOS):
# Run from the repository root
./scripts/trigger.shThe script will:
- Calculate if trigger conditions are met
- Select a card number deterministically if conditions are met
- Log all actions to
study_logs/logs/trigger-log-YYYY-MM-DD-HHmmss.md - Output
TRIGGER:<card_number>,SKIP:Recent, orSKIP:Timing
Edit the script to set:
$sessionStart: The actual session start time (currently hardcoded for testing)- Card count: Currently set to 66 cards (modify the modulo operation if needed)
All trigger decisions are logged to study_logs/logs/ with:
- Session info (date, time, start time, minutes elapsed)
- Trigger analysis (interval, conditions, decision)
- Card selection (if triggered)
- Study logs: See
../study_logs/README.mdfor logging format - Rule cards: See
../rule_cards/README.mdfor card structure
This is a test/development script. It sort works, but its not good. For production use, integrate proper logic into your extension or application.