aidevops 3.11.16 → 3.11.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.11.16
1
+ 3.11.17
package/aidevops.sh CHANGED
@@ -5,7 +5,7 @@
5
5
  # AI DevOps Framework CLI
6
6
  # Usage: aidevops <command> [options]
7
7
  #
8
- # Version: 3.11.16
8
+ # Version: 3.11.17
9
9
 
10
10
  set -euo pipefail
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aidevops",
3
- "version": "3.11.16",
3
+ "version": "3.11.17",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1684,6 +1684,121 @@ setup_contribution_watch() {
1684
1684
  return 0
1685
1685
  }
1686
1686
 
1687
+ # Install complexity scan via launchd (macOS).
1688
+ # Args: $1=label, $2=script path, $3=log dir
1689
+ # (t2903) Extracted from pulse dispatch preflight — independent schedule so
1690
+ # the 200-470s scan never starves dispatch or downstream scanners.
1691
+ _install_complexity_scan_launchd() {
1692
+ local cs_label="$1"
1693
+ local cs_script="$2"
1694
+ local _cs_log_dir="$3"
1695
+ local cs_plist="$HOME/Library/LaunchAgents/${cs_label}.plist"
1696
+
1697
+ local _xml_cs_script _xml_cs_home _xml_cs_log_dir
1698
+ _xml_cs_script=$(_xml_escape "$cs_script")
1699
+ _xml_cs_home=$(_xml_escape "$HOME")
1700
+ _xml_cs_log_dir=$(_xml_escape "$_cs_log_dir")
1701
+
1702
+ local cs_plist_content
1703
+ cs_plist_content=$(
1704
+ cat <<CS_PLIST
1705
+ <?xml version="1.0" encoding="UTF-8"?>
1706
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
1707
+ <plist version="1.0">
1708
+ <dict>
1709
+ <key>Label</key>
1710
+ <string>${cs_label}</string>
1711
+ <key>ProgramArguments</key>
1712
+ <array>
1713
+ <string>$(_xml_escape "$(_resolve_modern_bash)")</string>
1714
+ <string>${_xml_cs_script}</string>
1715
+ <string>run</string>
1716
+ </array>
1717
+ <key>StartInterval</key>
1718
+ <integer>3600</integer>
1719
+ <key>StandardOutPath</key>
1720
+ <string>${_xml_cs_log_dir}/complexity-scan-runner.log</string>
1721
+ <key>StandardErrorPath</key>
1722
+ <string>${_xml_cs_log_dir}/complexity-scan-runner.log</string>
1723
+ <key>EnvironmentVariables</key>
1724
+ <dict>
1725
+ <key>PATH</key>
1726
+ <string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
1727
+ <key>HOME</key>
1728
+ <string>${_xml_cs_home}</string>
1729
+ </dict>
1730
+ <key>RunAtLoad</key>
1731
+ <true/>
1732
+ <key>KeepAlive</key>
1733
+ <false/>
1734
+ <key>ProcessType</key>
1735
+ <string>Background</string>
1736
+ <key>LowPriorityBackgroundIO</key>
1737
+ <true/>
1738
+ <key>Nice</key>
1739
+ <integer>10</integer>
1740
+ </dict>
1741
+ </plist>
1742
+ CS_PLIST
1743
+ )
1744
+
1745
+ if _launchd_install_if_changed "$cs_label" "$cs_plist" "$cs_plist_content"; then
1746
+ print_info "Complexity scan enabled (launchd, hourly run)"
1747
+ else
1748
+ print_warning "Failed to load complexity scan LaunchAgent"
1749
+ fi
1750
+ return 0
1751
+ }
1752
+
1753
+ # Install complexity scan via systemd or cron (Linux).
1754
+ # Args: $1=script path, $2=log dir
1755
+ _install_complexity_scan_linux() {
1756
+ local cs_script="$1"
1757
+ local _cs_log_dir="$2"
1758
+ local cs_systemd="aidevops-complexity-scan"
1759
+ _install_scheduler_linux \
1760
+ "$cs_systemd" \
1761
+ "aidevops: complexity-scan" \
1762
+ "$CRON_HOURLY" \
1763
+ "\"${cs_script}\" run" \
1764
+ "3600" \
1765
+ "${_cs_log_dir}/complexity-scan-runner.log" \
1766
+ "" \
1767
+ "Complexity scan enabled (hourly run)" \
1768
+ "Failed to install complexity scan scheduler" \
1769
+ "true" \
1770
+ "true"
1771
+ return 0
1772
+ }
1773
+
1774
+ # Setup complexity scan (t2903) — extracts the weekly complexity scan from
1775
+ # pulse dispatch preflight into its own launchd/cron schedule. The scan was
1776
+ # observed consuming 200-470s per pulse cycle (26%+ of the 1800s pulse stale
1777
+ # ceiling), starving downstream scanners. Promoting it to its own schedule
1778
+ # decouples it from dispatch entirely. The runner reuses run_weekly_complexity_scan
1779
+ # from pulse-simplification.sh, which has internal 15-min cadence gating
1780
+ # (COMPLEXITY_SCAN_INTERVAL=900) so hourly launchd ticks are always safe.
1781
+ setup_complexity_scan() {
1782
+ local cs_script="$HOME/.aidevops/agents/scripts/complexity-scan-runner.sh"
1783
+ local cs_label="sh.aidevops.complexity-scan"
1784
+ if ! [[ -x "$cs_script" ]]; then
1785
+ return 0
1786
+ fi
1787
+
1788
+ # Reuse contribution-watch's log-dir resolver (same logic, same config key).
1789
+ local _cs_log_dir
1790
+ _cs_log_dir=$(_resolve_cw_log_dir) || return 1
1791
+ mkdir -p "$_cs_log_dir"
1792
+
1793
+ # Install/update scheduled runner
1794
+ if [[ "$(uname -s)" == "Darwin" ]]; then
1795
+ _install_complexity_scan_launchd "$cs_label" "$cs_script" "$_cs_log_dir"
1796
+ else
1797
+ _install_complexity_scan_linux "$cs_script" "$_cs_log_dir"
1798
+ fi
1799
+ return 0
1800
+ }
1801
+
1687
1802
  # Setup draft responses — private repo + local draft storage for reviewing
1688
1803
  # AI-drafted replies to external contributions (t1555).
1689
1804
  # Respects config: aidevops config set orchestration.draft_responses false
package/setup.sh CHANGED
@@ -12,7 +12,7 @@ shopt -s inherit_errexit 2>/dev/null || true
12
12
  # AI Assistant Server Access Framework Setup Script
13
13
  # Helps developers set up the framework for their infrastructure
14
14
  #
15
- # Version: 3.11.16
15
+ # Version: 3.11.17
16
16
  #
17
17
  # Quick Install:
18
18
  # npm install -g aidevops && aidevops update (recommended)
@@ -1159,6 +1159,63 @@ _setup_run_interactive() {
1159
1159
  }
1160
1160
 
1161
1161
  # Post-setup steps: schedulers, final instructions, optional tool update check.
1162
+ # Non-interactive scheduler installation. Extracted from
1163
+ # `_setup_post_setup_steps` (t2903) to keep the parent under the
1164
+ # function-complexity gate threshold. Each `_should_setup_noninteractive_*`
1165
+ # guard returns 0 when the corresponding scheduler is already installed
1166
+ # (regenerate on update) or first-time install is consented via config.
1167
+ _setup_noninteractive_schedulers() {
1168
+ local os="$1"
1169
+
1170
+ # Auto-update handles non-interactive internally (systemd detection fixed in GH#17861)
1171
+ setup_auto_update
1172
+ if _should_setup_noninteractive_supervisor_pulse; then
1173
+ setup_supervisor_pulse "$os"
1174
+ fi
1175
+ # Regenerate other schedulers if already installed (GH#17695 Finding B).
1176
+ # Stats wrapper is a pulse dependency — also install on first run when
1177
+ # the supervisor pulse is consented (t2418, GH#20016).
1178
+ if _should_setup_noninteractive_stats_wrapper; then
1179
+ setup_stats_wrapper "${PULSE_ENABLED:-}"
1180
+ fi
1181
+ if _should_setup_noninteractive_scheduler "Failure miner" "sh.aidevops.routine-gh-failure-miner" "aidevops: gh-failure-miner" "aidevops-gh-failure-miner"; then
1182
+ setup_failure_miner "${PULSE_ENABLED:-}"
1183
+ fi
1184
+ if _should_setup_noninteractive_scheduler "Process guard" "sh.aidevops.process-guard" "aidevops: process-guard" "aidevops-process-guard"; then
1185
+ setup_process_guard
1186
+ fi
1187
+ if _should_setup_noninteractive_scheduler "Memory pressure" "sh.aidevops.memory-pressure-monitor" "aidevops: memory-pressure-monitor" "aidevops-memory-pressure-monitor"; then
1188
+ setup_memory_pressure_monitor
1189
+ fi
1190
+ if _should_setup_noninteractive_scheduler "Screen time" "sh.aidevops.screen-time-snapshot" "aidevops: screen-time-snapshot" "aidevops-screen-time-snapshot"; then
1191
+ setup_screen_time_snapshot
1192
+ fi
1193
+ if _should_setup_noninteractive_scheduler "Contribution watch" "sh.aidevops.contribution-watch" "aidevops: contribution-watch" "aidevops-contribution-watch"; then
1194
+ setup_contribution_watch
1195
+ fi
1196
+ # t2903 (#21049): complexity scan — extracted from pulse dispatch preflight
1197
+ if _should_setup_noninteractive_scheduler "Complexity scan" "sh.aidevops.complexity-scan" "aidevops: complexity-scan" "aidevops-complexity-scan"; then
1198
+ setup_complexity_scan
1199
+ fi
1200
+ # Repo sync handles non-interactive mode internally (systemd detection fixed in GH#17861)
1201
+ setup_repo_sync
1202
+ # r914 repo-aidevops-health — daily drift keeper (t2366)
1203
+ setup_repo_aidevops_health
1204
+ if _should_setup_noninteractive_scheduler "Profile README" "sh.aidevops.profile-readme-update" "aidevops: profile-readme-update" "aidevops-profile-readme-update"; then
1205
+ setup_profile_readme
1206
+ fi
1207
+ if _should_setup_noninteractive_scheduler "OAuth token refresh" "sh.aidevops.token-refresh" "aidevops: token-refresh" "aidevops-token-refresh"; then
1208
+ setup_oauth_token_refresh
1209
+ fi
1210
+ # opencode DB maintenance (r913, t2183). Helper self-noops on missing
1211
+ # DB — safe to install unconditionally in non-interactive mode too.
1212
+ setup_opencode_db_maintenance
1213
+ # Migrate cron entries to systemd after schedulers are installed (GH#17695 Finding D)
1214
+ migrate_cron_to_systemd
1215
+ setup_tabby
1216
+ return 0
1217
+ }
1218
+
1162
1219
  _setup_post_setup_steps() {
1163
1220
  local os="$1"
1164
1221
 
@@ -1184,48 +1241,7 @@ _setup_post_setup_steps() {
1184
1241
  # Exceptions: regenerate existing schedulers (GH#17381, GH#17695 Finding B)
1185
1242
  # and allow first-time install when config consent is explicitly true (GH#17403).
1186
1243
  if [[ "$NON_INTERACTIVE" == "true" ]]; then
1187
- # Auto-update handles non-interactive internally (systemd detection fixed in GH#17861)
1188
- setup_auto_update
1189
- if _should_setup_noninteractive_supervisor_pulse; then
1190
- setup_supervisor_pulse "$os"
1191
- fi
1192
- # Regenerate other schedulers if already installed (GH#17695 Finding B).
1193
- # Stats wrapper is a pulse dependency — also install on first run when
1194
- # the supervisor pulse is consented (t2418, GH#20016).
1195
- if _should_setup_noninteractive_stats_wrapper; then
1196
- setup_stats_wrapper "${PULSE_ENABLED:-}"
1197
- fi
1198
- if _should_setup_noninteractive_scheduler "Failure miner" "sh.aidevops.routine-gh-failure-miner" "aidevops: gh-failure-miner" "aidevops-gh-failure-miner"; then
1199
- setup_failure_miner "${PULSE_ENABLED:-}"
1200
- fi
1201
- if _should_setup_noninteractive_scheduler "Process guard" "sh.aidevops.process-guard" "aidevops: process-guard" "aidevops-process-guard"; then
1202
- setup_process_guard
1203
- fi
1204
- if _should_setup_noninteractive_scheduler "Memory pressure" "sh.aidevops.memory-pressure-monitor" "aidevops: memory-pressure-monitor" "aidevops-memory-pressure-monitor"; then
1205
- setup_memory_pressure_monitor
1206
- fi
1207
- if _should_setup_noninteractive_scheduler "Screen time" "sh.aidevops.screen-time-snapshot" "aidevops: screen-time-snapshot" "aidevops-screen-time-snapshot"; then
1208
- setup_screen_time_snapshot
1209
- fi
1210
- if _should_setup_noninteractive_scheduler "Contribution watch" "sh.aidevops.contribution-watch" "aidevops: contribution-watch" "aidevops-contribution-watch"; then
1211
- setup_contribution_watch
1212
- fi
1213
- # Repo sync handles non-interactive mode internally (systemd detection fixed in GH#17861)
1214
- setup_repo_sync
1215
- # r914 repo-aidevops-health — daily drift keeper (t2366)
1216
- setup_repo_aidevops_health
1217
- if _should_setup_noninteractive_scheduler "Profile README" "sh.aidevops.profile-readme-update" "aidevops: profile-readme-update" "aidevops-profile-readme-update"; then
1218
- setup_profile_readme
1219
- fi
1220
- if _should_setup_noninteractive_scheduler "OAuth token refresh" "sh.aidevops.token-refresh" "aidevops: token-refresh" "aidevops-token-refresh"; then
1221
- setup_oauth_token_refresh
1222
- fi
1223
- # opencode DB maintenance (r913, t2183). Helper self-noops on missing
1224
- # DB — safe to install unconditionally in non-interactive mode too.
1225
- setup_opencode_db_maintenance
1226
- # Migrate cron entries to systemd after schedulers are installed (GH#17695 Finding D)
1227
- migrate_cron_to_systemd
1228
- setup_tabby
1244
+ _setup_noninteractive_schedulers "$os"
1229
1245
  return 0
1230
1246
  fi
1231
1247
 
@@ -1241,6 +1257,7 @@ _setup_post_setup_steps() {
1241
1257
  setup_memory_pressure_monitor
1242
1258
  setup_screen_time_snapshot
1243
1259
  setup_contribution_watch
1260
+ setup_complexity_scan
1244
1261
  setup_draft_responses
1245
1262
  setup_profile_readme
1246
1263
  setup_oauth_token_refresh