loki-mode 5.49.0 → 5.49.1

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
@@ -1,6 +1,6 @@
1
1
  # Loki Mode
2
2
 
3
- **The Flagship Product of [Autonomi](https://www.autonomi.dev/) -- The First Truly Autonomous Multi-Agent Startup System**
3
+ **The Flagship Product of [Autonomi](https://www.autonomi.dev/) -- An Autonomous Multi-Agent Development System**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/loki-mode)](https://www.npmjs.com/package/loki-mode)
6
6
  [![npm downloads](https://img.shields.io/npm/dw/loki-mode)](https://www.npmjs.com/package/loki-mode)
@@ -9,17 +9,15 @@
9
9
  [![GitHub Marketplace](https://img.shields.io/badge/Marketplace-Loki%20Mode-purple?logo=github)](https://github.com/marketplace/actions/loki-mode-code-review)
10
10
  [![Autonomi](https://img.shields.io/badge/Autonomi-autonomi.dev-5B4EEA)](https://www.autonomi.dev/)
11
11
  [![Agent Types](https://img.shields.io/badge/Agent%20Types-41-blue)]()
12
- [![Loki Mode](https://img.shields.io/badge/Loki%20Mode-98.78%25%20Pass%401-blueviolet)](benchmarks/results/)
13
- [![HumanEval](https://img.shields.io/badge/HumanEval-98.17%25%20Pass%401-brightgreen)](benchmarks/results/)
14
- [![SWE-bench](https://img.shields.io/badge/SWE--bench-99.67%25%20Patch%20Gen-brightgreen)](benchmarks/results/)
12
+ [![Benchmarks](https://img.shields.io/badge/Benchmarks-Infrastructure%20Ready-blue)](benchmarks/)
15
13
 
16
- **Current Version: v5.47.0**
14
+ **Current Version: v5.49.0**
17
15
 
18
16
  **[Autonomi](https://www.autonomi.dev/)** | **[Documentation](https://www.autonomi.dev/docs)** | **[GitHub](https://github.com/asklokesh/loki-mode)**
19
17
 
20
- > **PRD Deployed Product in Zero Human Intervention**
18
+ > **PRD to Deployed Product with Minimal Human Intervention**
21
19
  >
22
- > Loki Mode transforms a Product Requirements Document into a fully built, tested, deployed, and revenue-generating product while you sleep. No manual steps. No intervention. Just results.
20
+ > Loki Mode transforms a Product Requirements Document into a fully built, tested, and deployed product with autonomous multi-agent execution. Human oversight for deployment credentials, domain setup, and critical decisions.
23
21
 
24
22
  ---
25
23
 
@@ -79,7 +77,7 @@ jobs:
79
77
  runs-on: ubuntu-latest
80
78
  steps:
81
79
  - uses: actions/checkout@v4
82
- - uses: asklokesh/loki-mode@v5.38
80
+ - uses: asklokesh/loki-mode@v5
83
81
  with:
84
82
  github_token: ${{ secrets.GITHUB_TOKEN }}
85
83
  mode: review # review, fix, or test
@@ -163,40 +161,27 @@ See [skills/providers.md](skills/providers.md) for full provider documentation.
163
161
 
164
162
  ---
165
163
 
166
- ## Benchmark Results
164
+ ## Benchmarks
167
165
 
168
- ### Three-Way Comparison (HumanEval)
166
+ Benchmark infrastructure is included for HumanEval and SWE-bench evaluation. Results are self-reported from the included test harness and have not been independently verified.
169
167
 
170
- | System | Pass@1 | Details |
171
- |--------|--------|---------|
172
- | **Loki Mode (Multi-Agent)** | **98.78%** | 162/164 problems, RARV cycle recovered 2 |
173
- | Direct Claude | 98.17% | 161/164 problems (baseline) |
174
- | MetaGPT | 85.9-87.7% | Published benchmark |
168
+ | Benchmark | Result | Notes |
169
+ |-----------|--------|-------|
170
+ | HumanEval | 162/164 (98.78%) | Self-reported, max 3 retries per problem |
171
+ | SWE-bench | 299/300 patches generated | Patch generation only -- SWE-bench evaluator not yet run to verify correctness |
175
172
 
176
- **Loki Mode beats MetaGPT by +11-13%** thanks to the RARV (Reason-Act-Reflect-Verify) cycle.
173
+ **Note:** SWE-bench "patch generation" means the system produced a patch file, not that the patch correctly resolves the issue. The SWE-bench evaluator should be run to determine actual resolution rates.
177
174
 
178
- ### Full Results
179
-
180
- | Benchmark | Score | Details |
181
- |-----------|-------|---------|
182
- | **Loki Mode HumanEval** | **98.78% Pass@1** | 162/164 (multi-agent with RARV) |
183
- | **Direct Claude HumanEval** | **98.17% Pass@1** | 161/164 (single agent baseline) |
184
- | **Direct Claude SWE-bench** | **99.67% patch gen** | 299/300 problems |
185
- | **Loki Mode SWE-bench** | **99.67% patch gen** | 299/300 problems |
186
- | Model | Claude Opus 4.5 | |
187
-
188
- **Key Finding:** Multi-agent RARV matches single-agent performance on both benchmarks after timeout optimization. The 4-agent pipeline (Architect->Engineer->QA->Reviewer) achieves the same 99.67% patch generation as direct Claude.
189
-
190
- See [benchmarks/results/](benchmarks/results/) for full methodology and solutions.
175
+ See [benchmarks/](benchmarks/) for the test harness and raw results.
191
176
 
192
177
  ---
193
178
 
194
179
  ## What is Loki Mode?
195
180
 
196
- Loki Mode is a multi-provider AI skill that orchestrates **41 specialized AI agent types** across **7 swarms** to autonomously build, test, deploy, and scale complete startups. Works with **Claude Code**, **OpenAI Codex CLI**, and **Google Gemini CLI**. It dynamically spawns only the agents you need—**5-10 for simple projects, 100+ for complex startups**—working in parallel with continuous self-verification.
181
+ Loki Mode is a multi-provider AI skill that orchestrates **41 specialized AI agent types** across **8 swarms** to autonomously build, test, and deploy software projects. Works with **Claude Code**, **OpenAI Codex CLI**, and **Google Gemini CLI**. It dynamically spawns agents as needed -- typically **5-10 for simple projects, more for complex ones** -- working in parallel with continuous self-verification.
197
182
 
198
183
  ```
199
- PRD → Research → Architecture → Development → Testing → Deployment → Marketing → Revenue
184
+ PRD → Research → Architecture → Development → Testing → Deployment → Marketing
200
185
  ```
201
186
 
202
187
  **Just say "Loki Mode" and point to a PRD. Walk away. Come back to a deployed product.**
@@ -205,11 +190,11 @@ PRD → Research → Architecture → Development → Testing → Deployment →
205
190
 
206
191
  ## Why Loki Mode?
207
192
 
208
- ### **Better Than Anything Out There**
193
+ ### **How It Works**
209
194
 
210
195
  | What Others Do | What Loki Mode Does |
211
196
  |----------------|---------------------|
212
- | **Single agent** writes code linearly | **100+ agents** work in parallel across engineering, ops, business, data, product, and growth |
197
+ | **Single agent** writes code linearly | **Multiple agents** work in parallel across engineering, ops, business, data, product, and growth |
213
198
  | **Manual deployment** required | **Autonomous deployment** to AWS, GCP, Azure, Vercel, Railway with blue-green and canary strategies |
214
199
  | **No testing** or basic unit tests | **7 automated quality gates**: input/output guardrails, static analysis, blind review, anti-sycophancy, severity blocking, test coverage |
215
200
  | **Code only** - you handle the rest | **Full business operations**: marketing, sales, legal, HR, finance, investor relations |
@@ -221,8 +206,8 @@ PRD → Research → Architecture → Development → Testing → Deployment →
221
206
 
222
207
  ### **Core Advantages**
223
208
 
224
- 1. **Truly Autonomous**: RARV (Reason-Act-Reflect-Verify) cycle with self-verification achieves 2-3x quality improvement
225
- 2. **Massively Parallel**: 100+ agents working simultaneously, not sequential single-agent bottlenecks
209
+ 1. **Self-Verifying**: RARV (Reason-Act-Reflect-Verify) cycle with continuous self-verification catches errors early
210
+ 2. **Parallel Execution**: Multiple agents working simultaneously, not sequential single-agent bottlenecks
226
211
  3. **Production-Ready**: Not just code—handles deployment, monitoring, incident response, and business operations
227
212
  4. **Self-Improving**: Learns from mistakes, updates continuity logs, prevents repeated errors
228
213
  5. **Zero Babysitting**: Auto-resumes on rate limits, recovers from failures, runs until completion
@@ -255,7 +240,7 @@ PRD → Research → Architecture → Development → Testing → Deployment →
255
240
  | **GitHub Integration** | Issue import, PR creation, status sync | [GitHub Integration](skills/github-integration.md) |
256
241
  | **Distribution** | npm, Homebrew, Docker installation | [Installation Guide](docs/INSTALLATION.md) |
257
242
  | **Research Foundation** | OpenAI, DeepMind, Anthropic patterns | [Acknowledgements](docs/ACKNOWLEDGEMENTS.md) |
258
- | **Benchmarks** | HumanEval 98.78%, SWE-bench 99.67% | [Benchmark Results](benchmarks/results/) |
243
+ | **Benchmarks** | HumanEval and SWE-bench infrastructure included | [Benchmark Harness](benchmarks/) |
259
244
  | **Comparisons** | vs Auto-Claude, Cursor | [Auto-Claude](docs/auto-claude-comparison.md), [Cursor](docs/cursor-comparison.md) |
260
245
 
261
246
  ---
@@ -424,7 +409,7 @@ Loki Mode doesn't just write code—it **thinks, acts, learns, and verifies**:
424
409
  └─ Apply learning and RETRY from REASON
425
410
  ```
426
411
 
427
- **Result:** 2-3x quality improvement through continuous self-verification.
412
+ **Result:** Improved quality through continuous self-verification and multi-reviewer code review.
428
413
 
429
414
  ### **Perpetual Improvement Mode**
430
415
 
@@ -561,7 +546,7 @@ graph TB
561
546
  **Key components:**
562
547
  - **RARV+C Cycle** -- Reason, Act, Reflect, Verify, Compound. Every iteration follows this loop. Failed verification triggers retry from Reason.
563
548
  - **Provider Layer** -- Claude Code (full parallel agents, Task tool, MCP), Codex CLI and Gemini CLI (sequential, degraded mode).
564
- - **Agent Swarms** -- 41 specialized agent types across 7 swarms, spawned on demand based on project complexity.
549
+ - **Agent Swarms** -- 41 specialized agent types across 8 swarms, spawned on demand based on project complexity.
565
550
  - **Completion Council** -- 3 members vote on whether the project is done. Anti-sycophancy devil's advocate on unanimous votes.
566
551
  - **Memory System** -- Episodic traces, semantic patterns, procedural skills. Progressive disclosure reduces context usage by 60-80%.
567
552
  - **Dashboard** -- FastAPI server reading `.loki/` flat files, with real-time web UI for task queue, agents, logs, and council state. Now with TLS/HTTPS, OIDC/SSO, and RBAC (v5.36.0-v5.37.0).
@@ -609,7 +594,7 @@ Config search order: `.loki/config.yaml` (project) -> `~/.config/loki-mode/confi
609
594
 
610
595
  ## Agent Swarms (41 Types)
611
596
 
612
- Loki Mode has **41 predefined agent types** organized into **7 specialized swarms**. The orchestrator spawns only what you needsimple projects use 5-10 agents, complex startups spawn 100+.
597
+ Loki Mode has **41 predefined agent types** organized into **8 specialized swarms**. The orchestrator spawns only what you need -- simple projects typically use 5-10 agents, complex ones may use more.
613
598
 
614
599
  <img width="5309" height="979" alt="Agent Swarms Visualization" src="https://github.com/user-attachments/assets/7d18635d-a606-401f-8d9f-430e6e4ee689" />
615
600
 
@@ -981,7 +966,7 @@ Built for the [Claude Code](https://claude.ai) ecosystem, powered by Anthropic's
981
966
 
982
967
  Loki Mode is the flagship product of **[Autonomi](https://www.autonomi.dev/)** -- a platform for autonomous AI systems. Like Alphabet is to Google, Autonomi is the parent brand under which Loki Mode and future products operate.
983
968
 
984
- **Why Autonomi?** Loki Mode proved that multi-agent autonomous systems can build real software from a PRD with zero human intervention. Autonomi is the expansion of that vision into a broader platform of autonomous services and products.
969
+ **Why Autonomi?** Loki Mode proved that multi-agent autonomous systems can build real software from a PRD with minimal human intervention. Autonomi is the expansion of that vision into a broader platform of autonomous services and products.
985
970
 
986
971
  - **[autonomi.dev](https://www.autonomi.dev/)** -- Main website
987
972
  - **[Documentation](https://www.autonomi.dev/docs)** -- Full documentation
package/SKILL.md CHANGED
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  name: loki-mode
3
- description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with zero human intervention. Requires --dangerously-skip-permissions flag.
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 v5.49.0
6
+ # Loki Mode v5.49.1
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -263,4 +263,4 @@ The following features are documented in skill modules but not yet fully automat
263
263
  | Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
264
264
  | Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
265
265
 
266
- **v5.49.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
266
+ **v5.49.1 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.49.0
1
+ 5.49.1
@@ -142,7 +142,7 @@ GROWTH ──[continuous improvement loop]──> GROWTH
142
142
  - `Bash` - Command execution
143
143
  - `platform-orchestrator` - Deployment and service management
144
144
 
145
- **The 37 agent types are ROLES defined through prompts, not subagent_types.**
145
+ **The 41 agent types are ROLES defined through prompts, not subagent_types.**
146
146
 
147
147
  ---
148
148
 
@@ -158,7 +158,7 @@ skills/
158
158
  quality-gates.md # 7-gate system, anti-sycophancy
159
159
  testing.md # Playwright, E2E, property-based
160
160
  production.md # CI/CD, batch processing
161
- agents.md # 37 agent types, A2A patterns
161
+ agents.md # 41 agent types, A2A patterns
162
162
  parallel-workflows.md # Git worktrees, parallel streams
163
163
  troubleshooting.md # Error recovery, fallbacks
164
164
  artifacts.md # Code generation patterns
@@ -432,6 +432,10 @@ app_runner_start() {
432
432
  (cd "$dir" && bash -c "$_APP_RUNNER_METHOD" >> "$_APP_RUNNER_DIR/app.log" 2>&1) &
433
433
  fi
434
434
  _APP_RUNNER_PID=$!
435
+ # Register with central PID registry if available
436
+ if type register_pid &>/dev/null; then
437
+ register_pid "$_APP_RUNNER_PID" "app-runner" "method=$_APP_RUNNER_METHOD"
438
+ fi
435
439
 
436
440
  # Write PID file
437
441
  echo "$_APP_RUNNER_PID" > "$_APP_RUNNER_DIR/app.pid"
@@ -497,6 +501,11 @@ app_runner_stop() {
497
501
  kill -KILL "-$_APP_RUNNER_PID" 2>/dev/null || kill -KILL "$_APP_RUNNER_PID" 2>/dev/null || true
498
502
  fi
499
503
 
504
+ # Unregister from central PID registry
505
+ if type unregister_pid &>/dev/null && [ -n "$_APP_RUNNER_PID" ]; then
506
+ unregister_pid "$_APP_RUNNER_PID"
507
+ fi
508
+
500
509
  rm -f "$_APP_RUNNER_DIR/app.pid"
501
510
  _write_app_state "stopped"
502
511
  log_info "App Runner: application stopped"
package/autonomy/loki CHANGED
@@ -9,6 +9,7 @@
9
9
  # Usage:
10
10
  # loki start [PRD] - Start Loki Mode (optionally with PRD)
11
11
  # loki stop - Stop execution immediately
12
+ # loki cleanup - Kill orphaned processes from crashed sessions
12
13
  # loki pause - Pause after current session
13
14
  # loki resume - Resume paused execution
14
15
  # loki status - Show current status
@@ -312,6 +313,7 @@ show_help() {
312
313
  echo " init Build a PRD interactively or from templates"
313
314
  echo " issue <url|num> Generate PRD from GitHub issue and optionally start"
314
315
  echo " stop Stop execution immediately"
316
+ echo " cleanup Kill orphaned processes from crashed sessions"
315
317
  echo " pause Pause after current session"
316
318
  echo " resume Resume paused execution"
317
319
  echo " status [--json] Show current status (--json for machine-readable)"
@@ -704,6 +706,28 @@ except: pass
704
706
  rm -f "$LOKI_DIR/dashboard/dashboard.pid"
705
707
  fi
706
708
 
709
+ # Kill any remaining registered processes (2s graceful window matches run.sh)
710
+ if [ -d "$LOKI_DIR/pids" ]; then
711
+ for entry_file in "$LOKI_DIR/pids"/*.json; do
712
+ [ -f "$entry_file" ] || continue
713
+ local reg_pid
714
+ reg_pid=$(basename "$entry_file" .json)
715
+ case "$reg_pid" in ''|*[!0-9]*) continue ;; esac
716
+ if kill -0 "$reg_pid" 2>/dev/null; then
717
+ kill "$reg_pid" 2>/dev/null || true
718
+ local w=0
719
+ while [ $w -lt 4 ] && kill -0 "$reg_pid" 2>/dev/null; do
720
+ sleep 0.5
721
+ w=$((w + 1))
722
+ done
723
+ if kill -0 "$reg_pid" 2>/dev/null; then
724
+ kill -9 "$reg_pid" 2>/dev/null || true
725
+ fi
726
+ fi
727
+ rm -f "$entry_file"
728
+ done
729
+ fi
730
+
707
731
  # Emit session stop event
708
732
  emit_event session cli stop "reason=user_requested"
709
733
  # Emit success pattern for clean stop (SYN-018)
@@ -730,6 +754,86 @@ except: pass
730
754
  fi
731
755
  }
732
756
 
757
+ # Kill orphaned processes from crashed sessions
758
+ cmd_cleanup() {
759
+ local pids_dir="$LOKI_DIR/pids"
760
+ local killed=0
761
+ local stale=0
762
+
763
+ if [ ! -d "$pids_dir" ]; then
764
+ echo "No PID registry found. Nothing to clean up."
765
+ exit 0
766
+ fi
767
+
768
+ echo -e "${BOLD}Scanning for orphaned processes...${NC}"
769
+
770
+ for entry_file in "$pids_dir"/*.json; do
771
+ [ -f "$entry_file" ] || continue
772
+ local pid
773
+ pid=$(basename "$entry_file" .json)
774
+ case "$pid" in
775
+ ''|*[!0-9]*) continue ;;
776
+ esac
777
+
778
+ local label=""
779
+ local ppid_val=""
780
+ # Parse JSON fields (python3 with shell fallback)
781
+ if command -v python3 >/dev/null 2>&1; then
782
+ label=$(python3 -c "import json,sys; print(json.load(open(sys.argv[1])).get('label','unknown'))" "$entry_file" 2>/dev/null) || label="unknown"
783
+ ppid_val=$(python3 -c "import json,sys; print(json.load(open(sys.argv[1])).get('ppid',''))" "$entry_file" 2>/dev/null) || true
784
+ else
785
+ label=$(sed 's/.*"label":"//' "$entry_file" 2>/dev/null | sed 's/".*//' | head -1) || label="unknown"
786
+ ppid_val=$(sed 's/.*"ppid"://' "$entry_file" 2>/dev/null | sed 's/[,}].*//' | head -1) || true
787
+ fi
788
+
789
+ if kill -0 "$pid" 2>/dev/null; then
790
+ # Process is alive - check if parent is dead (orphan)
791
+ local is_orphan=false
792
+ # Validate ppid_val is numeric before using with kill
793
+ case "$ppid_val" in ''|*[!0-9]*) ppid_val="" ;; esac
794
+ if [ -n "$ppid_val" ] && ! kill -0 "$ppid_val" 2>/dev/null; then
795
+ is_orphan=true
796
+ fi
797
+
798
+ if [ "$is_orphan" = true ] || [ "${1:-}" = "--force" ]; then
799
+ echo -e " ${RED}Killing${NC} PID=$pid label=$label (parent $ppid_val dead)"
800
+ kill "$pid" 2>/dev/null || true
801
+ sleep 0.5
802
+ if kill -0 "$pid" 2>/dev/null; then
803
+ kill -9 "$pid" 2>/dev/null || true
804
+ fi
805
+ rm -f "$entry_file"
806
+ killed=$((killed + 1))
807
+ else
808
+ echo -e " ${GREEN}Alive${NC} PID=$pid label=$label (parent $ppid_val alive)"
809
+ fi
810
+ else
811
+ # Process is dead - clean up stale entry
812
+ rm -f "$entry_file"
813
+ stale=$((stale + 1))
814
+ fi
815
+ done
816
+
817
+ echo ""
818
+ echo "Results: $killed orphan(s) killed, $stale stale entries cleaned"
819
+
820
+ # Also kill orphaned loki-run temp scripts
821
+ local temp_killed=0
822
+ if pgrep -f "loki-run-" >/dev/null 2>&1; then
823
+ if ! is_session_running; then
824
+ echo "Killing orphaned loki-run temp scripts..."
825
+ pkill -f "loki-run-" 2>/dev/null || true
826
+ sleep 0.5
827
+ pkill -9 -f "loki-run-" 2>/dev/null || true
828
+ temp_killed=1
829
+ fi
830
+ fi
831
+
832
+ if [ $killed -eq 0 ] && [ $stale -eq 0 ] && [ $temp_killed -eq 0 ]; then
833
+ echo -e "${GREEN}System is clean. No orphans found.${NC}"
834
+ fi
835
+ }
836
+
733
837
  # Pause after current session
734
838
  cmd_pause() {
735
839
  if [ ! -d "$LOKI_DIR" ]; then
@@ -4497,6 +4601,9 @@ main() {
4497
4601
  stop)
4498
4602
  cmd_stop
4499
4603
  ;;
4604
+ cleanup)
4605
+ cmd_cleanup "$@"
4606
+ ;;
4500
4607
  pause)
4501
4608
  cmd_pause
4502
4609
  ;;
package/autonomy/run.sh CHANGED
@@ -667,6 +667,146 @@ log_error() { echo -e "${RED}[ERROR]${NC} $*"; }
667
667
  log_step() { echo -e "${CYAN}[STEP]${NC} $*"; }
668
668
  log_debug() { [[ "${LOKI_DEBUG:-}" == "true" ]] && echo -e "${CYAN}[DEBUG]${NC} $*" || true; }
669
669
 
670
+ #===============================================================================
671
+ # Process Registry (PID Supervisor)
672
+ # Central registry of all spawned child processes for reliable cleanup
673
+ #===============================================================================
674
+
675
+ PID_REGISTRY_DIR=""
676
+
677
+ # Initialize the PID registry directory
678
+ init_pid_registry() {
679
+ PID_REGISTRY_DIR="${TARGET_DIR:-.}/.loki/pids"
680
+ mkdir -p "$PID_REGISTRY_DIR"
681
+ }
682
+
683
+ # Parse a field from a JSON registry entry (python3 with shell fallback)
684
+ # Usage: _parse_json_field <file> <field>
685
+ _parse_json_field() {
686
+ local file="$1" field="$2"
687
+ if command -v python3 >/dev/null 2>&1; then
688
+ python3 -c "import json,sys; print(json.load(open(sys.argv[1])).get(sys.argv[2],''))" "$file" "$field" 2>/dev/null
689
+ else
690
+ # Shell fallback: extract value for simple flat JSON
691
+ sed 's/.*"'"$field"'":\s*//' "$file" 2>/dev/null | sed 's/[",}].*//' | head -1
692
+ fi
693
+ }
694
+
695
+ # Register a spawned process in the central registry
696
+ # Usage: register_pid <pid> <label> [<extra_info>]
697
+ # Example: register_pid $! "dashboard" "port=57374"
698
+ register_pid() {
699
+ local pid="$1"
700
+ # Sanitize label and extra for JSON safety (escape backslash first, then double-quote, strip newlines)
701
+ local label="${2//\\/\\\\}"
702
+ label="${label//\"/\\\"}"
703
+ label="$(printf '%s' "$label" | tr -d '\n\r')"
704
+ local extra="${3:-}"
705
+ extra="${extra//\\/\\\\}"
706
+ extra="${extra//\"/\\\"}"
707
+ extra="$(printf '%s' "$extra" | tr -d '\n\r')"
708
+ [ -z "$PID_REGISTRY_DIR" ] && init_pid_registry
709
+ local entry_file="$PID_REGISTRY_DIR/${pid}.json"
710
+ cat > "$entry_file" << EOF
711
+ {"pid":$pid,"label":"$label","started":"$(date -u +%Y-%m-%dT%H:%M:%SZ)","ppid":$$,"extra":"$extra"}
712
+ EOF
713
+ }
714
+
715
+ # Unregister a process from the registry (called on clean shutdown)
716
+ # Usage: unregister_pid <pid>
717
+ unregister_pid() {
718
+ local pid="$1"
719
+ [ -z "$PID_REGISTRY_DIR" ] && init_pid_registry
720
+ rm -f "$PID_REGISTRY_DIR/${pid}.json" 2>/dev/null
721
+ }
722
+
723
+ # Kill a registered process with SIGTERM -> wait -> SIGKILL escalation
724
+ # Usage: kill_registered_pid <pid>
725
+ kill_registered_pid() {
726
+ local pid="$1"
727
+ if kill -0 "$pid" 2>/dev/null; then
728
+ kill "$pid" 2>/dev/null || true
729
+ # Wait up to 2 seconds for graceful exit
730
+ local waited=0
731
+ while [ $waited -lt 4 ] && kill -0 "$pid" 2>/dev/null; do
732
+ sleep 0.5
733
+ waited=$((waited + 1))
734
+ done
735
+ # Escalate to SIGKILL if still alive
736
+ if kill -0 "$pid" 2>/dev/null; then
737
+ kill -9 "$pid" 2>/dev/null || true
738
+ fi
739
+ fi
740
+ unregister_pid "$pid"
741
+ }
742
+
743
+ # Scan registry for orphaned processes and kill them
744
+ # Called on startup and by `loki cleanup`
745
+ # Returns: number of orphans killed
746
+ cleanup_orphan_pids() {
747
+ [ -z "$PID_REGISTRY_DIR" ] && init_pid_registry
748
+ local orphan_count=0
749
+
750
+ if [ ! -d "$PID_REGISTRY_DIR" ]; then
751
+ echo "0"
752
+ return 0
753
+ fi
754
+
755
+ for entry_file in "$PID_REGISTRY_DIR"/*.json; do
756
+ [ -f "$entry_file" ] || continue
757
+ local pid
758
+ pid=$(basename "$entry_file" .json)
759
+
760
+ # Skip non-numeric filenames
761
+ case "$pid" in
762
+ ''|*[!0-9]*) continue ;;
763
+ esac
764
+
765
+ if kill -0 "$pid" 2>/dev/null; then
766
+ # Process is alive -- check if its parent session is dead
767
+ local ppid_val=""
768
+ ppid_val=$(_parse_json_field "$entry_file" "ppid") || true
769
+
770
+ # Validate ppid_val is numeric before using with kill
771
+ case "$ppid_val" in ''|*[!0-9]*) ppid_val="" ;; esac
772
+ if [ -n "$ppid_val" ] && [ "$ppid_val" != "$$" ]; then
773
+ if ! kill -0 "$ppid_val" 2>/dev/null; then
774
+ # Parent is dead -- this is an orphan
775
+ local label=""
776
+ label=$(_parse_json_field "$entry_file" "label") || label="unknown"
777
+ log_warn "Killing orphaned process: PID=$pid label=$label (parent $ppid_val is dead)" >&2
778
+ kill_registered_pid "$pid"
779
+ orphan_count=$((orphan_count + 1))
780
+ fi
781
+ fi
782
+ else
783
+ # Process is dead -- clean up stale registry entry
784
+ rm -f "$entry_file" 2>/dev/null
785
+ fi
786
+ done
787
+
788
+ echo "$orphan_count"
789
+ }
790
+
791
+ # Kill ALL registered processes (used during full shutdown)
792
+ kill_all_registered() {
793
+ [ -z "$PID_REGISTRY_DIR" ] && init_pid_registry
794
+
795
+ if [ ! -d "$PID_REGISTRY_DIR" ]; then
796
+ return 0
797
+ fi
798
+
799
+ for entry_file in "$PID_REGISTRY_DIR"/*.json; do
800
+ [ -f "$entry_file" ] || continue
801
+ local pid
802
+ pid=$(basename "$entry_file" .json)
803
+ case "$pid" in
804
+ ''|*[!0-9]*) continue ;;
805
+ esac
806
+ kill_registered_pid "$pid"
807
+ done
808
+ }
809
+
670
810
  #===============================================================================
671
811
  # Event Emission (Dashboard Integration)
672
812
  # Writes events to .loki/events.jsonl for dashboard consumption
@@ -1688,6 +1828,7 @@ create_worktree() {
1688
1828
  ) &
1689
1829
  # Capture install PID for cleanup on exit
1690
1830
  WORKTREE_INSTALL_PIDS+=($!)
1831
+ register_pid "$!" "worktree-install" "stream=$stream_name"
1691
1832
 
1692
1833
  log_info "Created worktree: $worktree_path"
1693
1834
  return 0
@@ -1796,6 +1937,7 @@ spawn_worktree_session() {
1796
1937
 
1797
1938
  local pid=$!
1798
1939
  WORKTREE_PIDS[$stream_name]=$pid
1940
+ register_pid "$pid" "worktree-session" "stream=$stream_name"
1799
1941
 
1800
1942
  log_info "Session spawned: $stream_name (PID: $pid)"
1801
1943
  return 0
@@ -2002,6 +2144,7 @@ cleanup_parallel_streams() {
2002
2144
  if kill -0 "$pid" 2>/dev/null; then
2003
2145
  kill "$pid" 2>/dev/null || true
2004
2146
  fi
2147
+ unregister_pid "$pid"
2005
2148
  done
2006
2149
  WORKTREE_INSTALL_PIDS=()
2007
2150
 
@@ -2012,6 +2155,7 @@ cleanup_parallel_streams() {
2012
2155
  log_step "Stopping session: $stream"
2013
2156
  kill "$pid" 2>/dev/null || true
2014
2157
  fi
2158
+ unregister_pid "$pid"
2015
2159
  done
2016
2160
 
2017
2161
  # Wait for all to finish
@@ -2620,8 +2764,8 @@ write_dashboard_state() {
2620
2764
  # Get complexity tier
2621
2765
  local complexity="${DETECTED_COMPLEXITY:-standard}"
2622
2766
 
2623
- # Get RARV cycle step (approximate based on iteration)
2624
- local rarv_step=$((ITERATION_COUNT % 4))
2767
+ # Get RARV cycle step from actual phase tracking (falls back to iteration-based)
2768
+ local rarv_step=${RARV_CURRENT_STEP:-$((ITERATION_COUNT % 4))}
2625
2769
  local rarv_stages='["reason", "act", "reflect", "verify"]'
2626
2770
 
2627
2771
  # Get memory system stats (if available)
@@ -2634,9 +2778,9 @@ write_dashboard_state() {
2634
2778
  [ -d ".loki/memory/skills" ] && procedural_count=$(find ".loki/memory/skills" -type f -name "*.json" 2>/dev/null | wc -l | tr -d ' ')
2635
2779
 
2636
2780
  # Get quality gates status (if available)
2637
- local quality_gates='{"staticAnalysis":"pending","codeReview":"pending","antiSycophancy":"pending","testCoverage":"pending","securityScan":"pending","performance":"pending"}'
2781
+ local quality_gates='null'
2638
2782
  if [ -f ".loki/state/quality-gates.json" ]; then
2639
- quality_gates=$(cat ".loki/state/quality-gates.json" 2>/dev/null || echo "$quality_gates")
2783
+ quality_gates=$(cat ".loki/state/quality-gates.json" 2>/dev/null || echo 'null')
2640
2784
  fi
2641
2785
 
2642
2786
  # Get Completion Council state (v5.25.0)
@@ -3037,6 +3181,7 @@ start_status_monitor() {
3037
3181
  done
3038
3182
  ) &
3039
3183
  STATUS_MONITOR_PID=$!
3184
+ register_pid "$STATUS_MONITOR_PID" "status-monitor"
3040
3185
 
3041
3186
  log_info "Status monitor started"
3042
3187
  log_info "Monitor progress: ${CYAN}watch -n 2 cat .loki/STATUS.txt${NC}"
@@ -3046,6 +3191,7 @@ stop_status_monitor() {
3046
3191
  if [ -n "$STATUS_MONITOR_PID" ]; then
3047
3192
  kill "$STATUS_MONITOR_PID" 2>/dev/null || true
3048
3193
  wait "$STATUS_MONITOR_PID" 2>/dev/null || true
3194
+ unregister_pid "$STATUS_MONITOR_PID"
3049
3195
  fi
3050
3196
  stop_resource_monitor
3051
3197
  }
@@ -3621,6 +3767,7 @@ start_resource_monitor() {
3621
3767
  done
3622
3768
  ) &
3623
3769
  RESOURCE_MONITOR_PID=$!
3770
+ register_pid "$RESOURCE_MONITOR_PID" "resource-monitor"
3624
3771
 
3625
3772
  log_info "Resource monitor started (CPU threshold: ${RESOURCE_CPU_THRESHOLD}%, Memory threshold: ${RESOURCE_MEM_THRESHOLD}%)"
3626
3773
  log_info "Check status: ${CYAN}cat .loki/state/resources.json${NC}"
@@ -3630,6 +3777,7 @@ stop_resource_monitor() {
3630
3777
  if [ -n "$RESOURCE_MONITOR_PID" ]; then
3631
3778
  kill "$RESOURCE_MONITOR_PID" 2>/dev/null || true
3632
3779
  wait "$RESOURCE_MONITOR_PID" 2>/dev/null || true
3780
+ unregister_pid "$RESOURCE_MONITOR_PID"
3633
3781
  fi
3634
3782
  }
3635
3783
 
@@ -4720,12 +4868,14 @@ BUILD_PROMPT
4720
4868
  esac
4721
4869
  ) &
4722
4870
  pids+=($!)
4871
+ register_pid "$!" "code-reviewer" "name=$reviewer_name"
4723
4872
  done
4724
4873
 
4725
4874
  # Wait for all reviewers to complete
4726
4875
  log_info "Waiting for $reviewer_count reviewers to complete (blind review)..."
4727
4876
  for pid in "${pids[@]}"; do
4728
4877
  wait "$pid" || true
4878
+ unregister_pid "$pid"
4729
4879
  done
4730
4880
 
4731
4881
  log_info "All reviewers complete. Aggregating verdicts..."
@@ -5191,6 +5341,7 @@ start_dashboard() {
5191
5341
  LOKI_TLS_CERT="${LOKI_TLS_CERT:-}" LOKI_TLS_KEY="${LOKI_TLS_KEY:-}" \
5192
5342
  LOKI_SKILL_DIR="${skill_dir}" PYTHONPATH="${skill_dir}" nohup "$python_cmd" -m dashboard.server > "$log_file" 2>&1 &
5193
5343
  DASHBOARD_PID=$!
5344
+ register_pid "$DASHBOARD_PID" "dashboard" "port=${DASHBOARD_PORT:-57374}"
5194
5345
 
5195
5346
  # Save PID for later cleanup
5196
5347
  mkdir -p .loki/dashboard
@@ -5224,6 +5375,7 @@ stop_dashboard() {
5224
5375
  if [ -n "$DASHBOARD_PID" ]; then
5225
5376
  kill "$DASHBOARD_PID" 2>/dev/null || true
5226
5377
  wait "$DASHBOARD_PID" 2>/dev/null || true
5378
+ unregister_pid "$DASHBOARD_PID"
5227
5379
  fi
5228
5380
 
5229
5381
  # Also try PID file
@@ -5231,6 +5383,7 @@ stop_dashboard() {
5231
5383
  local saved_pid=$(cat ".loki/dashboard/dashboard.pid" 2>/dev/null)
5232
5384
  if [ -n "$saved_pid" ]; then
5233
5385
  kill "$saved_pid" 2>/dev/null || true
5386
+ unregister_pid "$saved_pid"
5234
5387
  fi
5235
5388
  rm -f ".loki/dashboard/dashboard.pid"
5236
5389
  fi
@@ -7121,6 +7274,7 @@ cleanup() {
7121
7274
  fi
7122
7275
  stop_dashboard
7123
7276
  stop_status_monitor
7277
+ kill_all_registered
7124
7278
  rm -f "$loki_dir/loki.pid" 2>/dev/null
7125
7279
  if [ -f "$loki_dir/session.json" ]; then
7126
7280
  _LOKI_SESSION_FILE="$loki_dir/session.json" python3 -c "
@@ -7148,6 +7302,7 @@ except (json.JSONDecodeError, OSError): pass
7148
7302
  fi
7149
7303
  stop_dashboard
7150
7304
  stop_status_monitor
7305
+ kill_all_registered
7151
7306
  rm -f .loki/loki.pid .loki/PAUSE 2>/dev/null
7152
7307
  # Mark session.json as stopped
7153
7308
  if [ -f ".loki/session.json" ]; then
@@ -7335,6 +7490,7 @@ main() {
7335
7490
  LOKI_RUNNING_FROM_TEMP='' nohup "$original_script" "${cmd_args[@]}" > "$log_file" 2>&1 &
7336
7491
  local bg_pid=$!
7337
7492
  echo "$bg_pid" > "$pid_file"
7493
+ register_pid "$bg_pid" "background-session" "log=$log_file"
7338
7494
 
7339
7495
  echo ""
7340
7496
  echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
@@ -7457,6 +7613,14 @@ main() {
7457
7613
  # Write PID file for ALL modes (foreground + background)
7458
7614
  echo "$$" > "$pid_file"
7459
7615
 
7616
+ # Initialize PID registry and clean up orphans from previous sessions
7617
+ init_pid_registry
7618
+ local orphan_count
7619
+ orphan_count=$(cleanup_orphan_pids)
7620
+ if [ "$orphan_count" -gt 0 ]; then
7621
+ log_warn "Killed $orphan_count orphaned process(es) from previous session"
7622
+ fi
7623
+
7460
7624
  # Copy skill files to .loki/skills/ - makes CLI self-contained
7461
7625
  # No need to install Claude Code skill separately
7462
7626
  copy_skill_files
@@ -7536,10 +7700,12 @@ main() {
7536
7700
  run_autonomous "$PRD_PATH"
7537
7701
  ) &
7538
7702
  local main_pid=$!
7703
+ register_pid "$main_pid" "parallel-main" ""
7539
7704
 
7540
7705
  # Run parallel orchestrator
7541
7706
  run_parallel_orchestrator &
7542
7707
  local orchestrator_pid=$!
7708
+ register_pid "$orchestrator_pid" "parallel-orchestrator" ""
7543
7709
 
7544
7710
  # Wait for main session (orchestrator continues watching)
7545
7711
  wait $main_pid || result=$?
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "5.49.0"
10
+ __version__ = "5.49.1"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -404,7 +404,20 @@ async def get_status() -> StatusResponse:
404
404
  iteration = state.get("iteration", 0)
405
405
  complexity = state.get("complexity", "standard")
406
406
  mode = state.get("mode", "")
407
- running_agents = len(state.get("agents", []))
407
+ # Count only agents with alive PIDs (not raw array length)
408
+ agents_list = state.get("agents", [])
409
+ running_agents = 0
410
+ for agent in agents_list:
411
+ agent_pid = agent.get("pid")
412
+ if agent_pid:
413
+ try:
414
+ os.kill(int(agent_pid), 0)
415
+ running_agents += 1
416
+ except (OSError, ValueError, TypeError):
417
+ pass
418
+ else:
419
+ # No PID field -- count as running (legacy data)
420
+ running_agents += 1
408
421
 
409
422
  tasks = state.get("tasks", {})
410
423
  pending_tasks = len(tasks.get("pending", []))
@@ -3194,6 +3207,31 @@ async def get_process_health(token: Optional[dict] = Depends(auth.get_current_to
3194
3207
  except Exception:
3195
3208
  pass
3196
3209
 
3210
+ # PID registry (central process supervisor)
3211
+ pids_dir = loki_dir / "pids"
3212
+ registered: list[dict[str, Any]] = []
3213
+ if pids_dir.exists():
3214
+ for entry_file in sorted(pids_dir.glob("*.json")):
3215
+ try:
3216
+ pid_str = entry_file.stem
3217
+ pid = int(pid_str)
3218
+ entry = json.loads(entry_file.read_text())
3219
+ try:
3220
+ os.kill(pid, 0)
3221
+ status = "alive"
3222
+ except OSError:
3223
+ status = "dead"
3224
+ registered.append({
3225
+ "pid": pid,
3226
+ "label": entry.get("label", "unknown"),
3227
+ "started": entry.get("started", ""),
3228
+ "ppid": entry.get("ppid"),
3229
+ "status": status,
3230
+ })
3231
+ except (ValueError, json.JSONDecodeError, OSError):
3232
+ continue
3233
+ result["registered_processes"] = registered
3234
+
3197
3235
  watchdog_enabled = os.environ.get("LOKI_WATCHDOG", "false").lower() == "true"
3198
3236
  result["watchdog_enabled"] = watchdog_enabled
3199
3237
 
@@ -12,7 +12,7 @@
12
12
  | Feature | **Loki Mode** | **Zencoder** | **Devin** | **OpenAI Codex** | **Cursor** | **Claude Code** | **Kiro** | **Antigravity** | **Amazon Q** | **OpenCode** |
13
13
  |---------|--------------|--------------|-----------|-----------------|------------|-----------------|----------|-----------------|--------------|--------------|
14
14
  | **Type** | Skill/Framework | Enterprise Platform | Standalone Agent | Cloud Agent | AI IDE | CLI Agent | AI IDE | AI IDE | Cloud Agent | AI IDE (OSS) |
15
- | **Autonomy Level** | Full (zero human) | High | Full | High | Medium-High | High | High | High | High | High |
15
+ | **Autonomy Level** | High (minimal human) | High | Full | High | Medium-High | High | High | High | High | High |
16
16
  | **Max Runtime** | Unlimited | Async/Scheduled | Hours | Per-task | Session | Session | Days | Async | Per-task | Session |
17
17
  | **Pricing** | Free (OSS) | Enterprise | $20/mo | ChatGPT Plus | $20/mo | API costs | Free preview | Free preview | $19/mo | Free (OSS) |
18
18
  | **Open Source** | Yes | No | No | No | No | No | No | No | No | Yes |
@@ -24,7 +24,7 @@
24
24
 
25
25
  | Feature | **Loki Mode** | **Devin** | **Codex** | **Cursor** | **Kiro** | **Antigravity** | **Amazon Q** | **OpenCode** |
26
26
  |---------|--------------|-----------|-----------|------------|----------|-----------------|--------------|--------------|
27
- | **Multi-Agent** | 41 agents in 7 swarms | Single | Single | Up to 8 parallel | Background | Manager Surface | Multiple types | 4 built-in |
27
+ | **Multi-Agent** | 41 agents in 8 swarms | Single | Single | Up to 8 parallel | Background | Manager Surface | Multiple types | 4 built-in |
28
28
  | **Orchestration** | Full orchestrator | N/A | N/A | Git worktree | Hooks | Manager view | Workflow | Subagents |
29
29
  | **Parallel Exec** | 10+ Haiku, 4 impl (worktree) | No | No | 8 max | Yes | Yes | Yes | Yes |
30
30
  | **Agent Swarms** | Eng, Ops, Business, Data, Product, Growth, Review | N/A | N/A | N/A | N/A | N/A | 3 types | N/A |
@@ -180,9 +180,9 @@
180
180
 
181
181
  1. **Quality Control**: 7 explicit gates + blind review + devil's advocate vs built-in loops
182
182
  2. **Memory System**: 3-tier (episodic/semantic/procedural) with cross-project learning
183
- 3. **Agent Specialization**: 41 pre-defined specialized agents across 7 swarms
183
+ 3. **Agent Specialization**: 41 pre-defined specialized agents across 8 swarms
184
184
  4. **Anti-Sycophancy**: CONSENSAGENT patterns prevent reviewer groupthink
185
- 5. **Autonomy Design**: Zero human intervention from PRD to production
185
+ 5. **Autonomy Design**: Minimal human intervention from PRD to production
186
186
  6. **Research Foundation**: 10+ academic papers integrated vs proprietary
187
187
 
188
188
  ### Where Zencoder EXCEEDS Loki Mode
@@ -203,13 +203,13 @@
203
203
  |---------|--------------|---------|-----------------|------------|-----------------|---------------------|----------------|
204
204
  | **Stars** | 594 | 11,903 | 35K+ | 26K+ | 13.7K | N/A | N/A |
205
205
  | **npm/wk** | 6.1K | 21.4K | N/A | N/A | N/A | N/A | N/A |
206
- | **Agents** | 41 in 7 swarms | 11 agents | Fresh per task | 108 agents | Swarm-based | 32 agents | N/A |
206
+ | **Agents** | 41 in 8 swarms | 11 agents | Fresh per task | 108 agents | Swarm-based | 32 agents | N/A |
207
207
  | **Skills** | Progressive disclosure | 6 slash commands | N/A | 129 skills | N/A | 35 skills | Memory focus |
208
208
  | **Multi-Provider** | Yes (Claude/Codex/Gemini) | 3 CLIs (separate) | No | No | No | No | No |
209
209
  | **Memory System** | 3-tier (episodic/semantic/procedural) | None | N/A | N/A | Hybrid | N/A | SQLite+FTS5 |
210
210
  | **Quality Gates** | 7 gates + Completion Council | User verify only | Two-Stage Review | N/A | Consensus | Tiered | N/A |
211
211
  | **Context Mgmt** | Standard | Fresh per task (core innovation) | Fresh per task | N/A | N/A | N/A | Progressive |
212
- | **Autonomy** | Full (zero human) | Semi (checkpoints) | Human-guided | Human-guided | Orchestrated | Human-guided | N/A |
212
+ | **Autonomy** | High (minimal human) | Semi (checkpoints) | Human-guided | Human-guided | Orchestrated | Human-guided | N/A |
213
213
 
214
214
  ### What Loki Mode LACKS (Honest Assessment)
215
215
 
@@ -236,7 +236,7 @@ These are patterns from competing projects that are **practically and scientific
236
236
  | **Constitutional AI Integration** | Principles-based self-critique from Anthropic research | None have this |
237
237
  | **Anti-Sycophancy (CONSENSAGENT)** | Blind review + devil's advocate prevents groupthink | None have this |
238
238
  | **Provider Abstraction Layer** | Clean degradation from full-featured to sequential-only | Claude-only projects can't degrade |
239
- | **41 Specialized Agents** | Purpose-built agents in 7 swarms vs generic | agents (108) has more but less organized |
239
+ | **41 Specialized Agents** | Purpose-built agents in 8 swarms vs generic | agents (108) has more but less organized |
240
240
  | **Research Foundation** | 10+ academic papers integrated with citations | Most have no research backing |
241
241
 
242
242
  ### Superpowers Deep-Dive (35K+ Stars)
@@ -342,7 +342,7 @@ Tiered agent architecture with explicit escalation:
342
342
 
343
343
  | Agent | Killer Feature |
344
344
  |-------|---------------|
345
- | **Loki Mode** | Zero-human-intervention full SDLC, 41 agents in 7 swarms, Constitutional AI, anti-sycophancy, cross-project learning, code transformation, property-based testing |
345
+ | **Loki Mode** | Minimal-human-intervention full SDLC, 41 agents in 8 swarms, Constitutional AI, anti-sycophancy, cross-project learning, code transformation, property-based testing |
346
346
  | **Devin** | Full software engineer persona, Slack integration, 67% PR merge rate |
347
347
  | **OpenAI Codex** | Skills marketplace, $skill-creator, GPT-5.2-Codex, secure sandbox |
348
348
  | **Cursor** | 8 parallel agents, BugBot, Memories, $10B valuation, Composer model (250 tok/s) |
@@ -357,8 +357,8 @@ Tiered agent architecture with explicit escalation:
357
357
 
358
358
  | Dimension | Loki Mode Advantage |
359
359
  |-----------|-------------------|
360
- | **Autonomy** | Only agent designed for TRUE zero human intervention |
361
- | **Multi-Agent** | 41 specialized agents in 7 swarms vs 1-8 in competitors |
360
+ | **Autonomy** | Designed for high autonomy with minimal human intervention |
361
+ | **Multi-Agent** | 41 specialized agents in 8 swarms vs 1-8 in competitors |
362
362
  | **Quality** | 7 gates + blind review + devil's advocate + property-based testing |
363
363
  | **Research** | 10+ academic papers integrated vs proprietary/undisclosed |
364
364
  | **Anti-Sycophancy** | Only agent with CONSENSAGENT-based blind review |
@@ -37,9 +37,9 @@ GSD is the closest competitor -- a context engineering system that spawns fresh
37
37
  |---------|-----------|-------------|---------|--------|--------------|-------|
38
38
  | **GitHub Stars** | 594 | 13,700 | 62,400 | 25,000+ | N/A (Commercial) | N/A (Commercial) |
39
39
  | **Agent Count** | 41 types | 64+ agents | 5 roles | Unlimited | 8 parallel | 1 autonomous |
40
- | **Parallel Execution** | Yes (100+) | Yes (swarms) | Sequential | Yes (crews) | Yes (8 worktrees) | Yes (fleet) |
41
- | **Published Benchmarks** | **98.78% HumanEval (multi-agent)** | None | 85.9-87.7% HumanEval | None | ~250 tok/s | 15% complex tasks |
42
- | **SWE-bench Score** | **99.67% patch gen (299/300)** | Unknown | Unknown | Unknown | Unknown | 15% complex |
40
+ | **Parallel Execution** | Yes (multi-agent) | Yes (swarms) | Sequential | Yes (crews) | Yes (8 worktrees) | Yes (fleet) |
41
+ | **Published Benchmarks** | 98.78% HumanEval (self-reported, max 3 retries) | None | 85.9-87.7% HumanEval | None | ~250 tok/s | 15% complex tasks |
42
+ | **SWE-bench Score** | 99.67% patch gen (unevaluated, 299/300) | Unknown | Unknown | Unknown | Unknown | 15% complex |
43
43
  | **Full SDLC** | Yes (8 phases) | Yes | Partial | Partial | No | Partial |
44
44
  | **Business Ops** | **Yes (8 agents)** | No | No | No | No | No |
45
45
  | **Enterprise Security** | `--dangerously-skip-permissions` | MCP sandboxed | Sandboxed | Audit logs, RBAC | Staged autonomy | Sandboxed |
@@ -2,11 +2,11 @@
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:** v5.49.0
5
+ **Version:** v5.49.1
6
6
 
7
7
  ---
8
8
 
9
- ## What's New in v5.39.0
9
+ ## What's New in v5.49.1
10
10
 
11
11
  ### Enterprise Security (v5.36.0-v5.37.1)
12
12
  - TLS/HTTPS support for dashboard connections
@@ -63,7 +63,7 @@ npm install -g loki-mode
63
63
  brew tap asklokesh/tap && brew install loki-mode
64
64
 
65
65
  # Option C: Docker
66
- docker pull asklokesh/loki-mode:5.32.0
66
+ docker pull asklokesh/loki-mode:latest
67
67
 
68
68
  # Option D: Git clone
69
69
  git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
@@ -160,6 +160,10 @@ Install via npm for the easiest setup with automatic PATH configuration.
160
160
  npm install -g loki-mode
161
161
 
162
162
  # The skill is automatically installed to ~/.claude/skills/loki-mode
163
+
164
+ # Opt out of anonymous install telemetry:
165
+ # LOKI_TELEMETRY_DISABLED=true npm install -g loki-mode
166
+ # Or set DO_NOT_TRACK=1
163
167
  ```
164
168
 
165
169
  ### Usage
@@ -207,8 +211,8 @@ brew tap asklokesh/tap
207
211
  # Install Loki Mode
208
212
  brew install loki-mode
209
213
 
210
- # Set up Claude Code skill integration
211
- loki-mode-install-skill
214
+ # Set up Claude Code skill integration (manual symlink required)
215
+ ln -sf "$(brew --prefix)/opt/loki-mode/libexec" ~/.claude/skills/loki-mode
212
216
  ```
213
217
 
214
218
  ### Dependencies
@@ -254,7 +258,7 @@ Run Loki Mode in a container for isolated execution.
254
258
 
255
259
  ```bash
256
260
  # Pull the image
257
- docker pull asklokesh/loki-mode:5.32.0
261
+ docker pull asklokesh/loki-mode:latest
258
262
 
259
263
  # Or use docker-compose
260
264
  curl -o docker-compose.yml https://raw.githubusercontent.com/asklokesh/loki-mode/main/docker-compose.yml
@@ -264,10 +268,10 @@ curl -o docker-compose.yml https://raw.githubusercontent.com/asklokesh/loki-mode
264
268
 
265
269
  ```bash
266
270
  # Run with a PRD file
267
- docker run -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:5.32.0 start ./my-prd.md
271
+ docker run -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:latest start ./my-prd.md
268
272
 
269
273
  # Interactive mode
270
- docker run -it -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:5.32.0
274
+ docker run -it -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:latest
271
275
 
272
276
  # Using docker-compose
273
277
  docker-compose run loki start ./my-prd.md
@@ -280,7 +284,7 @@ Pass your configuration via environment variables:
280
284
  ```bash
281
285
  docker run -e LOKI_MAX_RETRIES=100 -e LOKI_BASE_WAIT=120 \
282
286
  -v $(pwd):/workspace -w /workspace \
283
- asklokesh/loki-mode:5.32.0 start ./my-prd.md
287
+ asklokesh/loki-mode:latest start ./my-prd.md
284
288
  ```
285
289
 
286
290
  ### Updating
@@ -396,12 +400,12 @@ Pass the provider as an environment variable:
396
400
  # Use Codex with Docker
397
401
  docker run -e LOKI_PROVIDER=codex \
398
402
  -v $(pwd):/workspace -w /workspace \
399
- asklokesh/loki-mode:5.32.0 start ./my-prd.md
403
+ asklokesh/loki-mode:latest start ./my-prd.md
400
404
 
401
405
  # Use Gemini with Docker
402
406
  docker run -e LOKI_PROVIDER=gemini \
403
407
  -v $(pwd):/workspace -w /workspace \
404
- asklokesh/loki-mode:5.32.0 start ./my-prd.md
408
+ asklokesh/loki-mode:latest start ./my-prd.md
405
409
  ```
406
410
 
407
411
  ### Degraded Mode
@@ -652,7 +656,11 @@ Add the source command to your startup file so completions load every time you o
652
656
  Add this line to your `~/.bashrc` (Linux) or `~/.bash_profile` (macOS):
653
657
 
654
658
  ```bash
655
- source /path/to/loki/completions/loki.bash
659
+ # npm install: use the npm package path
660
+ source "$(npm root -g)/loki-mode/completions/loki.bash"
661
+
662
+ # git clone: use the skills directory
663
+ source ~/.claude/skills/loki-mode/completions/loki.bash
656
664
  ```
657
665
 
658
666
  ---
@@ -169,7 +169,7 @@ Loki Mode:
169
169
  **Verdict: Loki Mode wins** - Simpler, lighter footprint.
170
170
 
171
171
  ### 10. Cursor Scale Patterns (v3.3.0)
172
- Loki Mode now incorporates proven patterns from Cursor's 100+ agent deployments:
172
+ Loki Mode now incorporates proven patterns from Cursor's large-scale agent deployments:
173
173
  - Recursive sub-planners
174
174
  - Judge agents for cycle decisions
175
175
  - Optimistic concurrency control
@@ -9,7 +9,7 @@
9
9
 
10
10
  | Dimension | Cursor | Loki Mode | Winner |
11
11
  |-----------|--------|-----------|--------|
12
- | **Proven Scale** | 1M+ LoC, 100+ agents | Benchmarks only | Cursor |
12
+ | **Proven Scale** | 1M+ LoC, large agent count | Benchmarks only | Cursor |
13
13
  | **Research Foundation** | Empirical iteration | 25+ academic citations | Loki Mode |
14
14
  | **Quality Assurance** | Workers self-manage | 7-gate system + anti-sycophancy | Loki Mode |
15
15
  | **Anti-Sycophancy** | Not mentioned | CONSENSAGENT blind review | Loki Mode |
@@ -122,7 +122,7 @@ BOOTSTRAP -> DISCOVERY -> ARCHITECTURE -> INFRASTRUCTURE
122
122
  -> DEVELOPMENT -> QA -> DEPLOYMENT -> GROWTH (continuous)
123
123
  ```
124
124
 
125
- **41 Specialized Agent Types across 7 swarms:**
125
+ **41 Specialized Agent Types across 8 swarms:**
126
126
  - Engineering (8 types)
127
127
  - Operations (8 types)
128
128
  - Business (8 types)
@@ -184,7 +184,7 @@ We incorporated Cursor's proven patterns:
184
184
 
185
185
  1. **Recursive Sub-Planners** - Planning scales horizontally
186
186
  2. **Judge Agents** - Explicit CONTINUE/COMPLETE/ESCALATE/PIVOT decisions
187
- 3. **Optimistic Concurrency** - No locks, scales to 100+ agents
187
+ 3. **Optimistic Concurrency** - No locks, scales horizontally
188
188
  4. **Scale-Aware Review** - Full review for high-risk only at scale
189
189
 
190
190
  ---
@@ -49,7 +49,7 @@ skills/
49
49
 
50
50
  references/ (unchanged)
51
51
  +-- 18 detailed reference files
52
- +-- agents.md (23KB) - Full 37 agent specs
52
+ +-- agents.md (23KB) - Full 41 agent specs
53
53
  +-- openai-patterns.md, lab-research-patterns.md, etc.
54
54
  ```
55
55
 
@@ -117,7 +117,7 @@ Content that didn't exist in v2.38.0:
117
117
  | Handoff message format | A2A specification | skills/agents.md |
118
118
  | Agentic patterns table | awesome-agentic-patterns | skills/agents.md |
119
119
  | "Ralph Wiggum Mode" insight | moridinamael | skills/agents.md |
120
- | Full 37 agent reference | references/agent-types.md | skills/agents.md (pointer) |
120
+ | Full 41 agent reference | references/agent-types.md | skills/agents.md (pointer) |
121
121
  | References directory listing | New | skills/00-index.md |
122
122
 
123
123
  ---
package/mcp/__init__.py CHANGED
@@ -21,4 +21,4 @@ try:
21
21
  except ImportError:
22
22
  __all__ = ['mcp']
23
23
 
24
- __version__ = '5.49.0'
24
+ __version__ = '5.49.1'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "5.49.0",
3
+ "version": "5.49.1",
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
  "autonomi",
@@ -6,7 +6,7 @@ Complete definitions and capabilities for all 41 specialized agent types.
6
6
 
7
7
  ## Overview
8
8
 
9
- Loki Mode has 41 predefined agent types organized into 7 specialized swarms (37 domain agents + 4 orchestration agents). The orchestrator spawns only the agents needed for your project - a simple app might use 5-10 agents, while a complex startup could spawn 100+ agents working in parallel.
9
+ Loki Mode has 41 predefined agent types organized into 8 specialized swarms (37 domain agents + 4 orchestration agents). The orchestrator spawns only the agents needed for your project -- typically 5-10 for simple projects, more for complex ones.
10
10
 
11
11
  ---
12
12
 
@@ -98,7 +98,7 @@ Loki Mode has 41 predefined agent types organized into 7 specialized swarms (37
98
98
 
99
99
  ## Orchestration Swarm (4 types)
100
100
 
101
- > **Source:** [Cursor Scaling Learnings](./cursor-learnings.md) - patterns proven at 100+ agent scale
101
+ > **Source:** [Cursor Scaling Learnings](./cursor-learnings.md) - patterns proven at large agent scale
102
102
 
103
103
  | Agent | Capabilities |
104
104
  |-------|-------------|
@@ -2,7 +2,7 @@
2
2
 
3
3
  Complete specifications for all 41 specialized agent types in the Loki Mode multi-agent system (37 domain agents + 4 orchestration agents).
4
4
 
5
- **Note:** These are agent TYPE definitions, not a fixed count. Loki Mode dynamically spawns agents based on project needs - a simple todo app might use 5-10 agents, while a complex startup could spawn 100+ agents working in parallel.
5
+ **Note:** These are agent TYPE definitions, not a fixed count. Loki Mode dynamically spawns agents based on project needs - a simple todo app might use 5-10 agents, while a complex startup spawns more as needed.
6
6
 
7
7
  ## Agent Role Prompt Template
8
8
 
@@ -182,7 +182,7 @@ Dexter shows value of domain specialization. Our 41 agent types follow this patt
182
182
  - Most haven't scaled across enterprise
183
183
 
184
184
  ### Loki Mode Alignment
185
- - Multi-agent architecture (41 types, 7 swarms)
185
+ - Multi-agent architecture (41 types, 8 swarms)
186
186
  - Plan Agents (orchestrator, planner)
187
187
  - Execution Agents (eng-*, ops-*, biz-*)
188
188
  - Security controls (LOKI_SANDBOX_MODE, LOKI_BLOCKED_COMMANDS)
package/skills/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Dispatch & Structured Prompting
2
2
 
3
- > **Full agent type definitions:** See `references/agent-types.md` for complete 41 agent role specifications across 7 swarms (Engineering, Operations, Business, Data, Product, Growth, Review, Orchestration).
3
+ > **Full agent type definitions:** See `references/agent-types.md` for complete 41 agent role specifications across 8 swarms (Engineering, Operations, Business, Data, Product, Growth, Review, Orchestration).
4
4
 
5
5
  ---
6
6
 
@@ -245,7 +245,7 @@ Priority order for context:
245
245
 
246
246
  ---
247
247
 
248
- ## The 37 Agent Roles
248
+ ## The 41 Agent Roles (37 Domain + 4 Orchestration)
249
249
 
250
250
  See `references/agent-types.md` for complete specifications. Summary:
251
251
 
@@ -259,4 +259,4 @@ See `references/agent-types.md` for complete specifications. Summary:
259
259
  | Growth | hacker, community, success, lifecycle | 4 |
260
260
  | Review | code, business, security | 3 |
261
261
 
262
- **Spawn only what you need.** Simple project: 5-10 agents. Complex startup: 100+.
262
+ **Spawn only what you need.** Simple project: 5-10 agents. Complex startup: more as needed.
@@ -427,7 +427,7 @@ optimistic_write:
427
427
  - No waiting for locks
428
428
  - No deadlock risk
429
429
  - Failed writes are cheap (just retry)
430
- - Scales to 100+ agents
430
+ - Scales horizontally with agent count
431
431
  ```
432
432
 
433
433
  ### Implementation
@@ -472,7 +472,7 @@ See `references/quality-control.md` for complete details.
472
472
 
473
473
  ## Scale Considerations
474
474
 
475
- > **Source:** [Cursor Scaling Learnings](../references/cursor-learnings.md) - integrators became bottlenecks at 100+ agents
475
+ > **Source:** [Cursor Scaling Learnings](../references/cursor-learnings.md) - integrators became bottlenecks at high agent counts
476
476
 
477
477
  ### Review Intensity Scaling
478
478