aidevops 3.34.8 → 3.34.9

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/README.md CHANGED
@@ -25,7 +25,7 @@ token efficiency, and quality control built in.**
25
25
  [![Maintainability](https://qlty.sh/gh/marcusquinn/projects/aidevops/maintainability.svg)](https://qlty.sh/gh/marcusquinn/projects/aidevops)
26
26
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/2b1adbd66c454dae92234341e801b984)](https://app.codacy.com/gh/marcusquinn/aidevops/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
27
27
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
28
- [![Version](https://img.shields.io/badge/Version-3.34.8-blue.svg)](https://github.com/marcusquinn/aidevops/releases)
28
+ [![Version](https://img.shields.io/badge/Version-3.34.9-blue.svg)](https://github.com/marcusquinn/aidevops/releases)
29
29
  [![npm version](https://img.shields.io/npm/v/aidevops)](https://www.npmjs.com/package/aidevops)
30
30
  [![Homebrew](https://img.shields.io/badge/homebrew-marcusquinn%2Ftap-orange)](https://github.com/marcusquinn/homebrew-tap)
31
31
 
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.34.8
1
+ 3.34.9
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.34.8
8
+ # Version: 3.34.9
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.34.8",
3
+ "version": "3.34.9",
4
4
  "description": "AI DevOps Framework - AI-assisted development workflows, code quality, and deployment automation",
5
5
  "type": "module",
6
6
  "packageManager": "bun@1.3.11",
package/setup.sh CHANGED
@@ -17,7 +17,7 @@ fi
17
17
  # AI Assistant Server Access Framework Setup Script
18
18
  # Helps developers set up the framework for their infrastructure
19
19
  #
20
- # Version: 3.34.8
20
+ # Version: 3.34.9
21
21
  #
22
22
  # Quick Install:
23
23
  # npm install -g aidevops && aidevops update (recommended)
@@ -1116,16 +1116,34 @@ _setup_redact_secret_like_command_values() {
1116
1116
  return 0
1117
1117
  }
1118
1118
 
1119
+ _setup_claim_noninteractive_setup_lock() {
1120
+ local lock_dir="$1"
1121
+ shift
1122
+ local lane_rc=0
1123
+
1124
+ SETUP_NONINTERACTIVE_LOCK_DIR="$lock_dir"
1125
+ SETUP_NONINTERACTIVE_LOCK_HELD=true
1126
+ printf '%s\n' "$$" >"$lock_dir/owner.pid" 2>/dev/null || true
1127
+ printf '%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" >"$lock_dir/started_at" 2>/dev/null || true
1128
+ printf '%s\n' "$(date +%s 2>/dev/null || printf '0')" >"$lock_dir/started_at_epoch" 2>/dev/null || true
1129
+ printf '%s\n' "$0 $*" >"$lock_dir/command" 2>/dev/null || true
1130
+ _setup_guard_active_release_lane || lane_rc=$?
1131
+ if [[ "$lane_rc" -ne 0 ]]; then
1132
+ _setup_release_noninteractive_setup_lock
1133
+ return "$lane_rc"
1134
+ fi
1135
+ trap '_setup_cleanup_noninteractive_children; _setup_release_noninteractive_setup_lock' EXIT
1136
+ trap '_setup_noninteractive_signal_exit TERM' TERM
1137
+ trap '_setup_noninteractive_signal_exit INT' INT
1138
+ return 0
1139
+ }
1140
+
1119
1141
  _setup_acquire_noninteractive_setup_lock() {
1120
1142
  local lock_dir="${AIDEVOPS_SETUP_LOCK_DIR:-$HOME/.aidevops/locks/setup-noninteractive.lock.d}"
1121
- # Max seconds to wait for a live, non-stale owner before timing out.
1122
1143
  local wait_ceiling="${AIDEVOPS_SETUP_WAIT_TIMEOUT_S:-900}"
1123
- # Max seconds a live owner may hold the lock before it is treated as
1124
- # stale and reclaimed (0 disables stale-live reclaim).
1125
1144
  local stale_ceiling="${AIDEVOPS_SETUP_STALE_TIMEOUT_S:-1800}"
1126
1145
  local owner_pid="" owner_cmd="" owner_age=0
1127
1146
  local reclaim_attempts=0 waited=0
1128
- local lane_rc=0
1129
1147
  local _diag_stl="$HOME/.aidevops/logs/setup-stage-timings.log"
1130
1148
  local _diag_interval_s="${AIDEVOPS_SETUP_LOCK_DIAG_INTERVAL_S:-60}"
1131
1149
  _setup_guard_active_release_lane || return $?
@@ -1133,24 +1151,10 @@ _setup_acquire_noninteractive_setup_lock() {
1133
1151
  mkdir -p "$(dirname "$lock_dir")" 2>/dev/null || true
1134
1152
  while true; do
1135
1153
  if mkdir "$lock_dir" 2>/dev/null; then
1136
- SETUP_NONINTERACTIVE_LOCK_DIR="$lock_dir"
1137
- SETUP_NONINTERACTIVE_LOCK_HELD=true
1138
- printf '%s\n' "$$" >"$lock_dir/owner.pid" 2>/dev/null || true
1139
- printf '%s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" >"$lock_dir/started_at" 2>/dev/null || true
1140
- printf '%s\n' "$(date +%s 2>/dev/null || printf '0')" >"$lock_dir/started_at_epoch" 2>/dev/null || true
1141
- printf '%s\n' "$0 $*" >"$lock_dir/command" 2>/dev/null || true
1142
- _setup_guard_active_release_lane || lane_rc=$?
1143
- if [[ "$lane_rc" -ne 0 ]]; then
1144
- _setup_release_noninteractive_setup_lock
1145
- return "$lane_rc"
1146
- fi
1147
- trap '_setup_cleanup_noninteractive_children; _setup_release_noninteractive_setup_lock' EXIT
1148
- trap '_setup_noninteractive_signal_exit TERM' TERM
1149
- trap '_setup_noninteractive_signal_exit INT' INT
1150
- return 0
1154
+ _setup_claim_noninteractive_setup_lock "$lock_dir" "$@"
1155
+ return $?
1151
1156
  fi
1152
1157
 
1153
- # Lock exists — inspect owner.
1154
1158
  owner_pid=""
1155
1159
  if [[ -r "$lock_dir/owner.pid" ]]; then
1156
1160
  owner_pid=$(tr -d '[:space:]' <"$lock_dir/owner.pid" 2>/dev/null || true)
@@ -1174,7 +1178,6 @@ _setup_acquire_noninteractive_setup_lock() {
1174
1178
  fi
1175
1179
 
1176
1180
  if ! _setup_lock_pid_alive "$owner_pid"; then
1177
- # Dead owner — reclaim the stale lock.
1178
1181
  if [[ "$reclaim_attempts" -ge 2 ]]; then
1179
1182
  print_error "Unable to acquire setup.sh --non-interactive lock at ${lock_dir} after ${reclaim_attempts} stale-lock removals"
1180
1183
  return 75
@@ -1198,7 +1201,6 @@ _setup_acquire_noninteractive_setup_lock() {
1198
1201
  continue
1199
1202
  fi
1200
1203
 
1201
- # Owner is alive — compute age and read current setup stage.
1202
1204
  owner_age=$(_setup_lock_owner_age "$lock_dir" "$owner_pid")
1203
1205
  owner_cmd=""
1204
1206
  [[ -r "$lock_dir/command" ]] && owner_cmd=$(tr '\n' ' ' <"$lock_dir/command" 2>/dev/null || true)
@@ -1210,7 +1212,6 @@ _setup_acquire_noninteractive_setup_lock() {
1210
1212
  [[ -n "$_diag_cur_stage" ]] && _diag_stage=", stage: ${_diag_cur_stage}"
1211
1213
  fi
1212
1214
 
1213
- # Stale-live reclaim: owner alive but running far too long.
1214
1215
  if [[ "$stale_ceiling" -gt 0 && "$owner_age" -ge "$stale_ceiling" ]]; then
1215
1216
  if [[ "$reclaim_attempts" -ge 2 ]]; then
1216
1217
  print_error "Unable to acquire setup.sh --non-interactive lock: owner (pid ${owner_pid}, age ${owner_age}s) exceeds stale ceiling but reclaim limit reached. Diagnose: ${_diag_stl}"
@@ -1222,13 +1223,11 @@ _setup_acquire_noninteractive_setup_lock() {
1222
1223
  continue
1223
1224
  fi
1224
1225
 
1225
- # Live non-stale owner — check wait ceiling before sleeping.
1226
1226
  if [[ "$waited" -ge "$wait_ceiling" ]]; then
1227
1227
  print_error "Timed out waiting ${waited}s for setup.sh --non-interactive lock (owner pid ${owner_pid}, age ${owner_age}s${_diag_stage}${owner_cmd:+, command: ${owner_cmd}}). Increase AIDEVOPS_SETUP_WAIT_TIMEOUT_S (current: ${wait_ceiling}s) or kill pid ${owner_pid} to unblock. Diagnose: ${_diag_stl}"
1228
1228
  return 75
1229
1229
  fi
1230
1230
 
1231
- # Emit diagnostics on first block and every diagnostic interval thereafter.
1232
1231
  if [[ "$waited" -eq 0 ]]; then
1233
1232
  print_info "Another setup.sh --non-interactive is running (pid ${owner_pid}, age ${owner_age}s${_diag_stage}${owner_cmd:+, command: ${owner_cmd}}). Waiting up to ${wait_ceiling}s (AIDEVOPS_SETUP_WAIT_TIMEOUT_S). Diagnose: ${_diag_stl}"
1234
1233
  elif [[ $((waited % _diag_interval_s)) -eq 0 ]]; then
@@ -1543,22 +1542,7 @@ reconcile_buzz_desktop_compatibility() {
1543
1542
  esac
1544
1543
  }
1545
1544
 
1546
- _setup_run_non_interactive() {
1547
- print_info "Non-interactive mode: deploying agents and running safe migrations only"
1548
-
1549
- _setup_init_stage_timing_log
1550
-
1551
- _time_step "protect_current_setup_worktree" protect_current_setup_worktree
1552
- _time_step "verify_location" verify_location
1553
- _time_step "check_requirements" check_requirements
1554
- # Run quality tool detection in non-interactive mode too (warn-only path).
1555
- _time_step "check_quality_tools" check_quality_tools
1556
- # Check setsid availability; auto-install util-linux on macOS if missing
1557
- # (GH#21102 / t2926: missing setsid kills workers on every pulse restart).
1558
- _time_step "setup_setsid_advisory" setup_setsid_advisory
1559
- _time_step "check_python_upgrade_available" check_python_upgrade_available
1560
- _time_step "setup_vault_python_env" setup_vault_python_env || print_warning "Vault crypto runtime setup encountered issues; Vault status remains metadata-only"
1561
- _time_step "set_permissions" set_permissions
1545
+ _setup_run_noninteractive_migrations() {
1562
1546
  _time_step "migrate_old_backups" migrate_old_backups
1563
1547
  _time_step "migrate_loop_state_directories" migrate_loop_state_directories
1564
1548
  _time_step "migrate_agent_to_agents_folder" migrate_agent_to_agents_folder
@@ -1576,12 +1560,23 @@ _setup_run_non_interactive() {
1576
1560
  _time_step "cleanup_worktree_entries_in_repos_json" cleanup_worktree_entries_in_repos_json
1577
1561
  _time_step "_cleanup_legacy_model_config" _cleanup_legacy_model_config
1578
1562
  _time_step "cleanup_legacy_dashboard_launchagent" cleanup_legacy_dashboard_launchagent
1579
- # t2888: install/heal opencode-ai. Companion to t2887's runtime canary
1580
- # fail-fast -- t2887 detects when $OPENCODE_BIN_DEFAULT is wrong, this
1581
- # one fixes it by reinstalling opencode-ai@latest (overwriting any bin
1582
- # collision with @anthropic-ai/claude-code or similar). Skipping this
1583
- # in non-interactive mode is the bug PR #20189 introduced and what
1584
- # alex-solovyev's runner spam stemmed from.
1563
+ return 0
1564
+ }
1565
+
1566
+ _setup_run_non_interactive() {
1567
+ print_info "Non-interactive mode: deploying agents and running safe migrations only"
1568
+
1569
+ _setup_init_stage_timing_log
1570
+
1571
+ _time_step "protect_current_setup_worktree" protect_current_setup_worktree
1572
+ _time_step "verify_location" verify_location
1573
+ _time_step "check_requirements" check_requirements
1574
+ _time_step "check_quality_tools" check_quality_tools
1575
+ _time_step "setup_setsid_advisory" setup_setsid_advisory
1576
+ _time_step "check_python_upgrade_available" check_python_upgrade_available
1577
+ _time_step "setup_vault_python_env" setup_vault_python_env || print_warning "Vault crypto runtime setup encountered issues; Vault status remains metadata-only"
1578
+ _time_step "set_permissions" set_permissions
1579
+ _setup_run_noninteractive_migrations
1585
1580
  _time_step "$SETUP_STAGE_OPENCODE" setup_opencode_runtimes
1586
1581
  _time_step "validate_opencode_config" validate_opencode_config
1587
1582
  _time_step "$SETUP_STAGE_AGENTS" deploy_aidevops_agents
@@ -1599,9 +1594,6 @@ _setup_run_non_interactive() {
1599
1594
  fi
1600
1595
  _time_step "init_settings_json" init_settings_json
1601
1596
 
1602
- # Parallelise independent skill operations (t1356: ~84s serial -> ~18s parallel)
1603
- # generate_agent_skills must complete before create_skill_symlinks (symlinks
1604
- # depend on generated SKILL.md files). scan_imported_skills is independent.
1605
1597
  local _pid_symlinks=""
1606
1598
  if _time_step "generate_agent_skills" generate_agent_skills; then
1607
1599
  _time_step "create_skill_symlinks" create_skill_symlinks &