feat: auto-install screen-time and profile-readme scheduled jobs#3949
feat: auto-install screen-time and profile-readme scheduled jobs#3949marcusquinn merged 2 commits intomainfrom
Conversation
…etup.sh Add two new scheduled job installations to setup.sh so they deploy automatically on 'aidevops setup' and 'aidevops update': - Screen time snapshot (always-install): captures daily screen time every 6h to accumulate data beyond macOS Knowledge DB's ~28 day retention. macOS: launchd plist. Linux: cron entry. - Profile README update (conditional): updates GitHub profile README with contributor stats daily at 06:00. Only installed when user has a profile repo (priority: "profile") in repos.json. Includes PATH env for git/gh access. MacOS: launchd plist. Linux: cron entry. Both follow existing setup.sh patterns: _xml_escape for plists, _cron_escape for cron, _launchd_has_agent for idempotent upgrades, unload-before-reload for plist updates.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe change adds scheduled execution of helper scripts via platform-specific schedulers: LaunchAgent on macOS and cron on Linux, for screen-time snapshots every 6 hours and profile README updates daily at 06:00, with proper path escaping, logging, and environment configuration. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Mar 9 01:48:31 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
setup.sh (2)
1257-1259: Linux cron entry lacks explicit PATH (minor inconsistency).The profile-readme-update cron entry (line 1353) includes
PATH="/usr/local/bin:/usr/bin:/bin", but this screen-time-snapshot entry does not. Whilejournalctlis typically in the default cron PATH, adding an explicit PATH would be more consistent with the other scheduled jobs in this file.🔧 Suggested fix for consistency
- echo "0 */6 * * * /bin/bash ${_cron_st_script} snapshot >> \"\$HOME/.aidevops/.agent-workspace/logs/screen-time-snapshot.log\" 2>&1 # aidevops: screen-time-snapshot" + echo "0 */6 * * * PATH=\"/usr/local/bin:/usr/bin:/bin\" /bin/bash ${_cron_st_script} snapshot >> \"\$HOME/.aidevops/.agent-workspace/logs/screen-time-snapshot.log\" 2>&1 # aidevops: screen-time-snapshot"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@setup.sh` around lines 1257 - 1259, The cron entry for screen-time-snapshot is missing an explicit PATH variable; update the cron line that echoes the job (the one referencing _cron_st_script and the comment "aidevops: screen-time-snapshot") to include PATH="/usr/local/bin:/usr/bin:/bin" before executing the script (matching the profile-readme-update entry) so the job runs with a consistent environment and can find binaries like journalctl.
1229-1233: Consider adding PATH to EnvironmentVariables for screen-time snapshot.The
screen-time-helper.shscript likely calls external commands likesqlite3(for querying the macOS Knowledge DB) and other utilities. WithoutPATHin theEnvironmentVariablesdict, launchd jobs run with a minimal environment where these tools may not be found.The memory-pressure-monitor plist (lines 1149-1154) includes PATH. For consistency and reliability, this plist should too.
♻️ Suggested fix: Add PATH to EnvironmentVariables
<key>EnvironmentVariables</key> <dict> + <key>PATH</key> + <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string> <key>HOME</key> <string>${_xml_st_home}</string> </dict>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@setup.sh` around lines 1229 - 1233, The EnvironmentVariables dict for the screen-time snapshot plist only sets HOME and should also set PATH so launchd can find external commands (e.g., sqlite3) when running screen-time-helper.sh; update the <key>EnvironmentVariables</key> block that currently contains <key>HOME</key> / <string>${_xml_st_home}</string> to also include a <key>PATH</key> entry (matching the PATH used in memory-pressure-monitor) so the job runs with the expected executable search path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@setup.sh`:
- Around line 1257-1259: The cron entry for screen-time-snapshot is missing an
explicit PATH variable; update the cron line that echoes the job (the one
referencing _cron_st_script and the comment "aidevops: screen-time-snapshot") to
include PATH="/usr/local/bin:/usr/bin:/bin" before executing the script
(matching the profile-readme-update entry) so the job runs with a consistent
environment and can find binaries like journalctl.
- Around line 1229-1233: The EnvironmentVariables dict for the screen-time
snapshot plist only sets HOME and should also set PATH so launchd can find
external commands (e.g., sqlite3) when running screen-time-helper.sh; update the
<key>EnvironmentVariables</key> block that currently contains <key>HOME</key> /
<string>${_xml_st_home}</string> to also include a <key>PATH</key> entry
(matching the PATH used in memory-pressure-monitor) so the job runs with the
expected executable search path.
Address CodeRabbit review: add PATH to both the launchd plist EnvironmentVariables and the Linux cron entry for screen-time-snapshot, matching the pattern used by profile-readme-update and memory-pressure-monitor. Ensures sqlite3 and other tools are findable in the launchd environment.
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Mar 9 01:54:45 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
setup.sh(always-install pattern, every 6h) — accumulates daily screen time data beyond macOS Knowledge DB's ~28 day retentionsetup.sh(conditional on profile repo in repos.json, daily at 06:00) — auto-updates GitHub profile README with contributor stats_xml_escape,_cron_escape,_launchd_has_agent, unload-before-reload)Testing
plutil -lint, loaded successfullyVerification
Summary by CodeRabbit
Release Notes