loki-mode 6.37.4 → 6.37.5

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/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with minimal human intervention. Requires --dangerously-skip-permissions flag.
4
4
  ---
5
5
 
6
- # Loki Mode v6.37.4
6
+ # Loki Mode v6.37.5
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -267,4 +267,4 @@ The following features are documented in skill modules but not yet fully automat
267
267
  | Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
268
268
  | Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
269
269
 
270
- **v6.37.4 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
270
+ **v6.37.5 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.37.4
1
+ 6.37.5
package/autonomy/loki CHANGED
@@ -1365,6 +1365,15 @@ cmd_pause() {
1365
1365
  fi
1366
1366
 
1367
1367
  if is_session_running; then
1368
+ # Warn if running in perpetual mode where PAUSE is auto-cleared (#84)
1369
+ local current_mode="${LOKI_AUTONOMY_MODE:-perpetual}"
1370
+ local perpetual_flag="${LOKI_PERPETUAL_MODE:-false}"
1371
+ if [ "$current_mode" = "perpetual" ] || [ "$perpetual_flag" = "true" ]; then
1372
+ echo -e "${YELLOW}Warning: Session is running in perpetual mode.${NC}"
1373
+ echo -e "${YELLOW}PAUSE signals are auto-cleared in perpetual mode and will be ignored.${NC}"
1374
+ echo -e "Use ${CYAN}loki stop${NC} to halt a perpetual session, or switch autonomy mode first:"
1375
+ echo -e " ${DIM}loki config set autonomy_mode checkpoint${NC}"
1376
+ fi
1368
1377
  touch "$LOKI_DIR/PAUSE"
1369
1378
  # Emit session pause event
1370
1379
  emit_event session cli pause "reason=user_requested"
@@ -4476,6 +4485,13 @@ cmd_watch() {
4476
4485
  return 1
4477
4486
  fi
4478
4487
 
4488
+ # Verify the PRD file is readable (#67)
4489
+ if [ ! -r "$prd_path" ]; then
4490
+ echo -e "${RED}PRD file is not readable: $prd_path${NC}"
4491
+ echo "Check file permissions: ls -la $prd_path"
4492
+ return 1
4493
+ fi
4494
+
4479
4495
  # Resolve to absolute path
4480
4496
  prd_path="$(cd "$(dirname "$prd_path")" && pwd)/$(basename "$prd_path")"
4481
4497
  local prd_basename
@@ -5001,7 +5017,11 @@ cmd_config_set() {
5001
5017
  ;;
5002
5018
  budget)
5003
5019
  if ! echo "$value" | grep -qE '^[0-9]+(\.[0-9]+)?$'; then
5004
- echo -e "${RED}Invalid budget: $value (expected: numeric USD amount)${NC}"; return 1
5020
+ echo -e "${RED}Invalid budget: $value (expected: positive numeric USD amount)${NC}"; return 1
5021
+ fi
5022
+ # Reject zero and negative values (#68)
5023
+ if echo "$value" | grep -qE '^0+(\.0+)?$'; then
5024
+ echo -e "${RED}Invalid budget: $value (must be greater than 0)${NC}"; return 1
5005
5025
  fi
5006
5026
  ;;
5007
5027
  model.planning|model.development|model.fast)
@@ -14717,33 +14737,40 @@ for a in agents:
14717
14737
  echo -e "${DIM}Persona: ${persona:0:80}...${NC}"
14718
14738
  echo ""
14719
14739
 
14720
- # Invoke current provider
14740
+ # Invoke current provider and capture exit code (#72)
14721
14741
  local provider="${LOKI_PROVIDER:-claude}"
14722
14742
  if [ -f ".loki/state/provider" ]; then
14723
14743
  provider=$(cat ".loki/state/provider" 2>/dev/null)
14724
14744
  fi
14725
14745
 
14746
+ local agent_exit=0
14726
14747
  case "$provider" in
14727
14748
  claude)
14728
- claude -p "$full_prompt" 2>&1
14749
+ claude -p "$full_prompt" 2>&1 || agent_exit=$?
14729
14750
  ;;
14730
14751
  codex)
14731
- codex exec --full-auto "$full_prompt" 2>&1
14752
+ codex exec --full-auto "$full_prompt" 2>&1 || agent_exit=$?
14732
14753
  ;;
14733
14754
  gemini)
14734
- gemini --approval-mode=yolo "$full_prompt" 2>&1
14755
+ gemini --approval-mode=yolo "$full_prompt" 2>&1 || agent_exit=$?
14735
14756
  ;;
14736
14757
  cline)
14737
- cline -y "$full_prompt" 2>&1
14758
+ cline -y "$full_prompt" 2>&1 || agent_exit=$?
14738
14759
  ;;
14739
14760
  aider)
14740
- aider --message "$full_prompt" --yes-always --no-auto-commits < /dev/null 2>&1
14761
+ aider --message "$full_prompt" --yes-always --no-auto-commits < /dev/null 2>&1 || agent_exit=$?
14741
14762
  ;;
14742
14763
  *)
14743
14764
  echo -e "${RED}Unknown provider: $provider${NC}"
14744
14765
  return 1
14745
14766
  ;;
14746
14767
  esac
14768
+
14769
+ if [ "$agent_exit" -ne 0 ]; then
14770
+ echo ""
14771
+ echo -e "${RED}Agent exited with code $agent_exit${NC}"
14772
+ return "$agent_exit"
14773
+ fi
14747
14774
  ;;
14748
14775
 
14749
14776
  start)
package/autonomy/run.sh CHANGED
@@ -1243,6 +1243,7 @@ detect_complexity() {
1243
1243
  if [ -n "$prd_path" ] && [ -f "$prd_path" ]; then
1244
1244
  local prd_words=$(wc -w < "$prd_path" | tr -d ' ')
1245
1245
  local feature_count=0
1246
+ local prd_lines=$(wc -l < "$prd_path" | tr -d ' ')
1246
1247
 
1247
1248
  # Detect PRD format and count features accordingly
1248
1249
  if [[ "$prd_path" == *.json ]]; then
@@ -1262,14 +1263,23 @@ detect_complexity() {
1262
1263
  feature_count=$(grep -c "^##\|^- \[" "$prd_path" 2>/dev/null || echo "0")
1263
1264
  fi
1264
1265
 
1265
- if [ "$prd_words" -lt 200 ] && [ "$feature_count" -lt 5 ]; then
1266
+ # Count distinct sections (h2/h3 headers) for structural complexity (#74)
1267
+ local section_count=0
1268
+ if [[ "$prd_path" != *.json ]]; then
1269
+ section_count=$(grep -c "^##\|^###" "$prd_path" 2>/dev/null || echo "0")
1270
+ fi
1271
+
1272
+ # PRD complexity uses content length, feature count, AND structural depth (#74)
1273
+ # A PRD with multiple sections or substantial content is not "simple" even with few project files
1274
+ if [ "$prd_words" -lt 200 ] && [ "$feature_count" -lt 5 ] && [ "$section_count" -lt 3 ]; then
1266
1275
  prd_complexity="simple"
1267
- elif [ "$prd_words" -gt 1000 ] || [ "$feature_count" -gt 15 ]; then
1276
+ elif [ "$prd_words" -gt 1000 ] || [ "$feature_count" -gt 15 ] || [ "$section_count" -gt 10 ]; then
1268
1277
  prd_complexity="complex"
1269
1278
  fi
1270
1279
  fi
1271
1280
 
1272
1281
  # Determine final complexity
1282
+ # A non-simple PRD always prevents "simple" classification regardless of file count (#74)
1273
1283
  if [ "$file_count" -le 5 ] && [ "$prd_complexity" = "simple" ] && \
1274
1284
  [ "$has_external" = "false" ] && [ "$has_microservices" = "false" ]; then
1275
1285
  DETECTED_COMPLEXITY="simple"
@@ -1280,7 +1290,7 @@ detect_complexity() {
1280
1290
  DETECTED_COMPLEXITY="standard"
1281
1291
  fi
1282
1292
 
1283
- log_info "Detected complexity: $DETECTED_COMPLEXITY (files: $file_count, external: $has_external, microservices: $has_microservices)"
1293
+ log_info "Detected complexity: $DETECTED_COMPLEXITY (files: $file_count, prd: $prd_complexity, external: $has_external, microservices: $has_microservices)"
1284
1294
  }
1285
1295
 
1286
1296
  # Get phases based on complexity tier
@@ -2824,6 +2834,9 @@ init_loki_dir() {
2824
2834
  mkdir -p .loki/artifacts/{releases,reports,backups}
2825
2835
  mkdir -p .loki/memory/{ledgers,handoffs,learnings,episodic,semantic,skills}
2826
2836
  mkdir -p .loki/metrics/{efficiency,rewards}
2837
+ # Clear stale metrics from previous sessions so loki metrics shows current run data (#75)
2838
+ rm -f .loki/metrics/efficiency/iteration-*.json 2>/dev/null || true
2839
+ rm -f .loki/metrics/rewards/*.json 2>/dev/null || true
2827
2840
  mkdir -p .loki/rules
2828
2841
  mkdir -p .loki/signals
2829
2842
 
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "6.37.4"
10
+ __version__ = "6.37.5"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -2,7 +2,7 @@
2
2
 
3
3
  The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installation instructions for all platforms and use cases.
4
4
 
5
- **Version:** v6.37.4
5
+ **Version:** v6.37.5
6
6
 
7
7
  ---
8
8
 
package/mcp/__init__.py CHANGED
@@ -57,4 +57,4 @@ try:
57
57
  except ImportError:
58
58
  __all__ = ['mcp']
59
59
 
60
- __version__ = '6.37.4'
60
+ __version__ = '6.37.5'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "6.37.4",
3
+ "version": "6.37.5",
4
4
  "description": "Loki Mode by Autonomi - Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "agent",