loki-mode 5.51.0 → 5.52.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.
Files changed (44) hide show
  1. package/README.md +4 -56
  2. package/SKILL.md +2 -2
  3. package/VERSION +1 -1
  4. package/autonomy/hooks/validate-bash.sh +5 -2
  5. package/dashboard/__init__.py +1 -1
  6. package/dashboard/server.py +1 -1
  7. package/docs/INSTALLATION.md +1 -1
  8. package/docs/alternative-installations.md +3 -3
  9. package/docs/certification/01-core-concepts/lab.md +174 -0
  10. package/docs/certification/01-core-concepts/lesson.md +182 -0
  11. package/docs/certification/01-core-concepts/quiz.md +93 -0
  12. package/docs/certification/02-enterprise-features/lab.md +154 -0
  13. package/docs/certification/02-enterprise-features/lesson.md +202 -0
  14. package/docs/certification/02-enterprise-features/quiz.md +93 -0
  15. package/docs/certification/03-advanced-patterns/lab.md +138 -0
  16. package/docs/certification/03-advanced-patterns/lesson.md +199 -0
  17. package/docs/certification/03-advanced-patterns/quiz.md +93 -0
  18. package/docs/certification/04-production-deployment/lab.md +160 -0
  19. package/docs/certification/04-production-deployment/lesson.md +261 -0
  20. package/docs/certification/04-production-deployment/quiz.md +93 -0
  21. package/docs/certification/05-troubleshooting/lab.md +254 -0
  22. package/docs/certification/05-troubleshooting/lesson.md +266 -0
  23. package/docs/certification/05-troubleshooting/quiz.md +93 -0
  24. package/docs/certification/README.md +80 -0
  25. package/docs/certification/answer-key.md +117 -0
  26. package/docs/certification/certification-exam.md +471 -0
  27. package/docs/certification/sample-prds/microservices-platform.md +100 -0
  28. package/docs/certification/sample-prds/saas-dashboard.md +60 -0
  29. package/docs/certification/sample-prds/todo-app.md +44 -0
  30. package/mcp/__init__.py +1 -1
  31. package/mcp/server.py +230 -0
  32. package/package.json +1 -1
  33. package/src/plugins/agent-plugin.js +123 -0
  34. package/src/plugins/gate-plugin.js +153 -0
  35. package/src/plugins/index.js +116 -0
  36. package/src/plugins/integration-plugin.js +174 -0
  37. package/src/plugins/loader.js +275 -0
  38. package/src/plugins/mcp-plugin.js +190 -0
  39. package/src/plugins/schemas/agent.json +59 -0
  40. package/src/plugins/schemas/integration.json +62 -0
  41. package/src/plugins/schemas/mcp_tool.json +73 -0
  42. package/src/plugins/schemas/quality_gate.json +52 -0
  43. package/src/plugins/validator.js +297 -0
  44. /package/dashboard/{secrets.py → app_secrets.py} +0 -0
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
  [![Agent Types](https://img.shields.io/badge/Agent%20Types-41-blue)]()
12
12
  [![Benchmarks](https://img.shields.io/badge/Benchmarks-Infrastructure%20Ready-blue)](benchmarks/)
13
13
 
14
- **Current Version: v5.51.0**
14
+ **Current Version: v5.52.0**
15
15
 
16
16
  **[Autonomi](https://www.autonomi.dev/)** | **[Documentation](https://www.autonomi.dev/docs)** | **[GitHub](https://github.com/asklokesh/loki-mode)**
17
17
 
@@ -85,7 +85,7 @@ gemini
85
85
  ### Verify Installation
86
86
 
87
87
  ```bash
88
- loki --version # Should print 5.51.0
88
+ loki --version # Should print 5.52.0
89
89
  loki doctor # Check skill symlinks and provider availability
90
90
  ```
91
91
 
@@ -473,60 +473,8 @@ Go get coffee. It'll be deployed when you get back.
473
473
 
474
474
  ## Architecture
475
475
 
476
- ```mermaid
477
- graph TB
478
- PRD["PRD Document"] --> REASON
479
-
480
- subgraph RARVC["RARV+C Cycle"]
481
- direction TB
482
- REASON["1. Reason"] --> ACT["2. Act"]
483
- ACT --> REFLECT["3. Reflect"]
484
- REFLECT --> VERIFY["4. Verify"]
485
- VERIFY -->|"pass"| COMPOUND["5. Compound"]
486
- VERIFY -->|"fail"| REASON
487
- COMPOUND --> REASON
488
- end
489
-
490
- subgraph PROVIDERS["Provider Layer"]
491
- CLAUDE["Claude Code<br/>(full features)"]
492
- CODEX["Codex CLI<br/>(degraded)"]
493
- GEMINI["Gemini CLI<br/>(degraded)"]
494
- end
495
-
496
- ACT --> PROVIDERS
497
-
498
- subgraph AGENTS["Agent Swarms (41 types)"]
499
- ENG["Engineering (8)"]
500
- OPS["Operations (8)"]
501
- BIZ["Business (8)"]
502
- DATA["Data (3)"]
503
- PROD["Product (3)"]
504
- GROWTH["Growth (4)"]
505
- REVIEW["Review (3)"]
506
- ORCH["Orchestration (4)"]
507
- end
508
-
509
- PROVIDERS --> AGENTS
510
-
511
- subgraph INFRA["Infrastructure"]
512
- DASHBOARD["Dashboard<br/>(FastAPI + Web UI)<br/>TLS/HTTPS, OIDC, RBAC"]
513
- MEMORY["Memory System<br/>(Episodic/Semantic/Procedural)"]
514
- COUNCIL["Completion Council<br/>(3-member voting)"]
515
- QUEUE["Task Queue<br/>(.loki/queue/)"]
516
- METRICS["Metrics Export<br/>(Prometheus/OpenMetrics)"]
517
- AUDIT["Audit Trail<br/>(SHA-256 integrity chain)"]
518
- end
519
-
520
- AGENTS --> QUEUE
521
- VERIFY --> COUNCIL
522
- REFLECT --> MEMORY
523
- COMPOUND --> MEMORY
524
- AGENTS --> AUDIT
525
- DASHBOARD -.->|"reads"| QUEUE
526
- DASHBOARD -.->|"reads"| MEMORY
527
- DASHBOARD -.->|"reads"| AUDIT
528
- DASHBOARD -.->|"exposes"| METRICS
529
- ```
476
+ <img width="6961" height="6302" alt="architecture" src="https://github.com/user-attachments/assets/d9954dd2-5cb6-4b1c-8cd2-67f68141dffa" />
477
+
530
478
 
531
479
  **Key components:**
532
480
  - **RARV+C Cycle** -- Reason, Act, Reflect, Verify, Compound. Every iteration follows this loop. Failed verification triggers retry from Reason.
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 v5.51.0
6
+ # Loki Mode v5.52.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.51.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
266
+ **v5.52.1 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.51.0
1
+ 5.52.1
@@ -39,6 +39,9 @@ BLOCKED_PATTERNS=(
39
39
  "rm .*\.loki/session\.lock"
40
40
  "> \.loki/council/"
41
41
  "> \.loki/config\.yaml"
42
+ # Fork bomb patterns
43
+ ":\(\)\{.*\|.*&"
44
+ ":\(\) *\{.*\|.*&"
42
45
  )
43
46
 
44
47
  # Safe path patterns that override blocked pattern matches
@@ -59,7 +62,7 @@ for pattern in "${BLOCKED_PATTERNS[@]}"; do
59
62
  fi
60
63
  done
61
64
  "$is_safe" && continue
62
- printf '%s' '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"deny","permissionDecisionReason":"Blocked: potentially dangerous command pattern detected"}}'
65
+ printf '%s' '{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "deny", "permissionDecisionReason": "Blocked: potentially dangerous command pattern detected"}}'
63
66
  exit 2
64
67
  fi
65
68
  done
@@ -71,6 +74,6 @@ printf '%s' "{\"timestamp\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\"command\":$(ech
71
74
  echo >> "$LOG_DIR/bash-audit.jsonl"
72
75
 
73
76
  # Allow command
74
- printf '%s' '{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"allow"}}'
77
+ printf '%s' '{"hookSpecificOutput": {"hookEventName": "PreToolUse", "permissionDecision": "allow"}}'
75
78
 
76
79
  exit 0
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "5.51.0"
10
+ __version__ = "5.52.1"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -46,7 +46,7 @@ from .models import (
46
46
  from . import registry
47
47
  from . import auth
48
48
  from . import audit
49
- from . import secrets as secrets_mod
49
+ from . import app_secrets as secrets_mod
50
50
  from . import telemetry as _telemetry
51
51
  from .control import atomic_write_json
52
52
 
@@ -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:** v5.51.0
5
+ **Version:** v5.52.1
6
6
 
7
7
  ---
8
8
 
@@ -28,7 +28,7 @@ ln -sf ~/.claude/skills/loki-mode/autonomy/loki /usr/local/bin/loki
28
28
 
29
29
  ## Docker
30
30
 
31
- **Status:** Image exists on Docker Hub. Tags: `latest`, version-specific (e.g., `5.51.0`).
31
+ **Status:** Image exists on Docker Hub. Tags: `latest`, version-specific (e.g., `5.52.0`).
32
32
 
33
33
  ```bash
34
34
  docker pull asklokesh/loki-mode:latest
@@ -108,8 +108,8 @@ jobs:
108
108
 
109
109
  ```bash
110
110
  # Download and extract to skills directory
111
- curl -sL https://github.com/asklokesh/loki-mode/archive/refs/tags/v5.51.0.tar.gz | tar xz
112
- mv loki-mode-5.51.0 ~/.claude/skills/loki-mode
111
+ curl -sL https://github.com/asklokesh/loki-mode/archive/refs/tags/v5.52.0.tar.gz | tar xz
112
+ mv loki-mode-5.52.0 ~/.claude/skills/loki-mode
113
113
  ```
114
114
 
115
115
  **Best for:** Offline or air-gapped environments, pinned version deployments.
@@ -0,0 +1,174 @@
1
+ # Module 1 Lab: Install and Run Loki Mode
2
+
3
+ ## Objective
4
+
5
+ Install Loki Mode, verify the installation, create a simple PRD, run it, and examine the output directory structure.
6
+
7
+ ## Prerequisites
8
+
9
+ - Node.js 18+ installed
10
+ - npm available on your PATH
11
+ - A supported AI provider CLI installed (Claude Code, Codex CLI, or Gemini CLI)
12
+ - An active API key for your chosen provider
13
+
14
+ ## Step 1: Install Loki Mode
15
+
16
+ ```bash
17
+ npm install -g loki-mode
18
+ ```
19
+
20
+ Verify the installation:
21
+
22
+ ```bash
23
+ loki version
24
+ ```
25
+
26
+ You should see output like `5.51.0` (or the current version).
27
+
28
+ ## Step 2: Run the Doctor Check
29
+
30
+ The `loki doctor` command checks all system prerequisites:
31
+
32
+ ```bash
33
+ loki doctor
34
+ ```
35
+
36
+ This verifies:
37
+ - Node.js version
38
+ - Required CLI tools (git, jq, etc.)
39
+ - AI provider CLI availability
40
+ - Skill symlink configuration
41
+
42
+ Review the output and install any missing dependencies it reports.
43
+
44
+ For machine-readable output:
45
+
46
+ ```bash
47
+ loki doctor --json
48
+ ```
49
+
50
+ ## Step 3: Create a Simple PRD
51
+
52
+ Create a file called `simple-prd.md` with the following content:
53
+
54
+ ```markdown
55
+ # Simple Todo App
56
+
57
+ ## Overview
58
+ A command-line todo application written in Node.js.
59
+
60
+ ## Requirements
61
+ - Add a todo item with a title
62
+ - List all todo items
63
+ - Mark a todo item as complete
64
+ - Delete a todo item
65
+ - Store todos in a local JSON file
66
+
67
+ ## Tech Stack
68
+ - Node.js
69
+ - No external dependencies (use built-in fs module)
70
+
71
+ ## Success Criteria
72
+ - All CRUD operations work from the command line
73
+ - Data persists between runs via JSON file
74
+ - Unit tests pass with >80% coverage
75
+ ```
76
+
77
+ ## Step 4: Start Loki Mode
78
+
79
+ **Important:** Running `loki start` will invoke an AI provider and may incur API costs. Ensure you have a valid API key configured for your provider.
80
+
81
+ ```bash
82
+ loki start ./simple-prd.md
83
+ ```
84
+
85
+ Alternatively, if using a specific provider:
86
+
87
+ ```bash
88
+ loki start --provider claude ./simple-prd.md # Claude Code (default)
89
+ loki start --provider codex ./simple-prd.md # OpenAI Codex CLI
90
+ loki start --provider gemini ./simple-prd.md # Google Gemini CLI
91
+ ```
92
+
93
+ You can also force the simple complexity tier to limit the number of phases:
94
+
95
+ ```bash
96
+ loki start --simple ./simple-prd.md
97
+ ```
98
+
99
+ ## Step 5: Examine the Output
100
+
101
+ After Loki Mode starts (or after you pause it with `loki pause`), examine the `.loki/` directory:
102
+
103
+ ```bash
104
+ ls -la .loki/
105
+ ```
106
+
107
+ You should see a structure similar to:
108
+
109
+ ```
110
+ .loki/
111
+ session.json # Session metadata (pid, start time, provider, status)
112
+ state/
113
+ orchestrator.json # Current phase, task counts
114
+ queue/
115
+ pending.json # Tasks waiting to be executed
116
+ current-task.json # Task currently in progress
117
+ dead-letter.json # Failed tasks (if any)
118
+ memory/
119
+ index.json # Memory index
120
+ episodic/ # Task execution traces
121
+ semantic/ # Learned patterns
122
+ signals/ # Inter-process communication files
123
+ logs/ # Execution logs
124
+ ```
125
+
126
+ Inspect the orchestrator state:
127
+
128
+ ```bash
129
+ cat .loki/state/orchestrator.json | jq .
130
+ ```
131
+
132
+ Check the current session:
133
+
134
+ ```bash
135
+ loki status
136
+ ```
137
+
138
+ ## Step 6: Control Execution
139
+
140
+ Practice the control commands:
141
+
142
+ ```bash
143
+ # Pause after current iteration
144
+ loki pause
145
+
146
+ # Check status while paused
147
+ loki status
148
+
149
+ # Resume execution
150
+ loki resume
151
+
152
+ # Stop immediately
153
+ loki stop
154
+ ```
155
+
156
+ ## Verification Checklist
157
+
158
+ After completing this lab, confirm you can answer these questions:
159
+
160
+ - [ ] What version of Loki Mode is installed? (`loki version`)
161
+ - [ ] Does `loki doctor` report all checks passing?
162
+ - [ ] What files are created in the `.loki/` directory?
163
+ - [ ] What phase does the orchestrator start in?
164
+ - [ ] Can you pause and resume a Loki Mode session?
165
+
166
+ ## Cleanup
167
+
168
+ To clean up the lab environment:
169
+
170
+ ```bash
171
+ loki stop
172
+ rm -rf .loki/
173
+ rm simple-prd.md
174
+ ```
@@ -0,0 +1,182 @@
1
+ # Module 1: Core Concepts
2
+
3
+ ## What is Loki Mode?
4
+
5
+ Loki Mode is a multi-agent autonomous system created by [Autonomi](https://www.autonomi.dev/). It takes a Product Requirements Document (PRD) and builds a fully deployed product with minimal human intervention. It supports three AI provider CLIs: Claude Code (full features), OpenAI Codex CLI (degraded mode), and Google Gemini CLI (degraded mode).
6
+
7
+ Loki Mode is installed as an npm package and invoked through the `loki` CLI or directly within Claude Code as a skill.
8
+
9
+ ```bash
10
+ # Install
11
+ npm install -g loki-mode
12
+
13
+ # Verify installation
14
+ loki version
15
+
16
+ # Check system prerequisites
17
+ loki doctor
18
+
19
+ # Start with a PRD
20
+ loki start ./prd.md
21
+ ```
22
+
23
+ When started, Loki Mode creates a `.loki/` directory in your project root that holds all state: task queues, session data, memory, metrics, and signals.
24
+
25
+ ## The RARV Cycle
26
+
27
+ Every action in Loki Mode follows a strict four-step cycle called RARV:
28
+
29
+ 1. **Reason** -- Determine the highest priority unblocked task from `.loki/queue/pending.json`
30
+ 2. **Act** -- Execute the task: write code, run commands, commit atomically
31
+ 3. **Reflect** -- Evaluate the outcome, log results
32
+ 4. **Verify** -- Run tests, check build, validate against the specification
33
+
34
+ If verification passes, the task is marked complete and the cycle returns to Reason. If verification fails, the error is captured and the agent retries with a different approach. After 3 failures, it tries a simpler approach. After 5 failures, the task is moved to a dead-letter queue (`.loki/queue/dead-letter.json`) and the agent moves on.
35
+
36
+ ```
37
+ REASON --> ACT --> REFLECT --> VERIFY
38
+ ^ |
39
+ | [PASS] |
40
+ +-----------------------------+
41
+ | [FAIL]
42
+ +--- Retry (up to 5x) --> Dead Letter Queue
43
+ ```
44
+
45
+ ## Phase Transitions
46
+
47
+ Loki Mode organizes work into sequential phases. Each phase must pass all quality gates before the next begins:
48
+
49
+ ```
50
+ BOOTSTRAP --> DISCOVERY --> ARCHITECTURE --> DEEPEN_PLAN --> INFRASTRUCTURE
51
+ --> DEVELOPMENT --> QA --> DEPLOYMENT --> GROWTH
52
+ ```
53
+
54
+ Not all phases run for every project. Complexity tiers determine which phases execute:
55
+
56
+ | Tier | Phases | When Used |
57
+ |------|--------|-----------|
58
+ | **simple** | 3 | 1-2 files, UI fixes, text changes |
59
+ | **standard** | 6 | 3-10 files, features, bug fixes |
60
+ | **complex** | 8 | 10+ files, microservices, external integrations |
61
+
62
+ The tier is auto-detected from the PRD or can be forced with:
63
+
64
+ ```bash
65
+ loki start --simple ./prd.md # Force simple tier
66
+ loki start --complex ./prd.md # Force complex tier
67
+ ```
68
+
69
+ Or via the environment variable `LOKI_COMPLEXITY=simple|standard|complex`.
70
+
71
+ ## Agents
72
+
73
+ Loki Mode defines **41 specialized agent types** organized into **8 swarms**:
74
+
75
+ | Swarm | Agent Count | Examples |
76
+ |-------|-------------|----------|
77
+ | Engineering | 8 | frontend, backend, database, mobile, api, qa, perf, infra |
78
+ | Operations | 8 | devops, sre, security, monitor, incident, release, cost, compliance |
79
+ | Business | 8 | marketing, sales, finance, legal, support, hr, investor, partnerships |
80
+ | Data | 3 | ml, eng, analytics |
81
+ | Product | 3 | pm, design, techwriter |
82
+ | Growth | 4 | hacker, community, success, lifecycle |
83
+ | Review | 3 | code, business, security |
84
+ | Orchestration | 4 | (internal system agents) |
85
+
86
+ These agents are **roles defined through prompts**, not separate programs. They are implemented using the Claude Code Task tool with role-specific prompts:
87
+
88
+ ```python
89
+ # Example: Creating a security reviewer agent
90
+ Task(
91
+ subagent_type="general-purpose",
92
+ model="opus",
93
+ description="Security review: auth module",
94
+ prompt="""You are a security reviewer. Focus on:
95
+ - Authentication vulnerabilities
96
+ - Input validation gaps
97
+ - OWASP Top 10 issues
98
+ Review: src/auth/*.ts"""
99
+ )
100
+ ```
101
+
102
+ A simple project typically uses 5-10 agents. Complex projects use more as needed. The orchestrator spawns only the agents required for the current task.
103
+
104
+ Full agent type definitions are in `references/agent-types.md`.
105
+
106
+ ## Quality Gates
107
+
108
+ Loki Mode enforces a 9-gate quality system. Code must pass all applicable gates before moving forward:
109
+
110
+ | Gate | Name | Purpose |
111
+ |------|------|---------|
112
+ | 1 | Input Guardrails | Validate scope, detect injection, check constraints |
113
+ | 2 | Static Analysis | CodeQL, ESLint/Pylint, type checking |
114
+ | 3 | Blind Review System | 3 specialist reviewers in parallel, blind to each other |
115
+ | 4 | Anti-Sycophancy Check | If reviewers unanimously approve, run a Devil's Advocate reviewer |
116
+ | 5 | Output Guardrails | Validate code quality, spec compliance, no secrets |
117
+ | 6 | Severity-Based Blocking | Critical/High/Medium = BLOCK; Low/Cosmetic = TODO |
118
+ | 7 | Test Coverage Gates | Unit: 100% pass, >80% coverage; Integration: 100% pass |
119
+ | 8 | Mock Detector | Flags tests that mock internal modules instead of real code |
120
+ | 9 | Test Mutation Detector | Detects assertion value changes alongside implementation changes |
121
+
122
+ The blind review system (Gate 3) selects 3 reviewers from a pool of 5 named specialists:
123
+
124
+ - **security-sentinel** -- OWASP Top 10, injection, auth, secrets
125
+ - **performance-oracle** -- N+1 queries, memory leaks, caching
126
+ - **architecture-strategist** -- SOLID, coupling, patterns (always included)
127
+ - **test-coverage-auditor** -- Missing tests, edge cases, error paths
128
+ - **dependency-analyst** -- Outdated packages, CVEs, license issues
129
+
130
+ The architecture-strategist is always one of the 3. The other 2 are selected by matching trigger keywords in the diff. Full details are in `skills/quality-gates.md`.
131
+
132
+ ## Memory System
133
+
134
+ Loki Mode maintains three types of memory in the `.loki/memory/` directory:
135
+
136
+ - **Episodic** (`.loki/memory/episodic/`) -- Specific interaction traces. Records what happened during each task, including errors and decisions.
137
+ - **Semantic** (`.loki/memory/semantic/`) -- Generalized patterns and anti-patterns extracted from episodic memory. Includes `patterns.json` (what works) and `anti-patterns.json` (what to avoid).
138
+ - **Procedural** (`.loki/memory/skills/`) -- Learned skills and reusable solutions.
139
+
140
+ The memory system uses progressive disclosure with three layers: index (lightweight), timeline (moderate), and full details (heavy). This prevents loading the entire memory store into the context window.
141
+
142
+ Memory retrieval is task-aware, weighting different memory types based on the current activity:
143
+
144
+ | Task Type | Episodic Weight | Semantic Weight | Skills Weight |
145
+ |-----------|----------------|-----------------|---------------|
146
+ | Exploration | 0.6 | 0.3 | 0.1 |
147
+ | Implementation | 0.15 | 0.5 | 0.35 |
148
+ | Debugging | 0.4 | 0.2 | 0.0 (+ 0.4 anti-patterns) |
149
+
150
+ The memory engine is implemented in Python (`memory/engine.py`, `memory/retrieval.py`, `memory/storage.py`).
151
+
152
+ ## Model Selection
153
+
154
+ Loki Mode maps tasks to model tiers rather than specific model names:
155
+
156
+ | Task Type | Tier | Claude | Codex | Gemini |
157
+ |-----------|------|--------|-------|--------|
158
+ | Architecture, system design | planning | opus | effort=xhigh | thinking=high |
159
+ | Feature implementation, bugs | development | opus | effort=high | thinking=medium |
160
+ | Code review | development | opus (sonnet for reviewers) | effort=high | thinking=medium |
161
+ | Unit tests, linting, docs | fast | sonnet | effort=low | thinking=low |
162
+
163
+ Claude Code has full feature support: parallel agents (up to 10 simultaneous), the Task tool, and MCP integration. Codex and Gemini run in degraded mode: sequential execution only, no Task tool, no parallel agents.
164
+
165
+ ## Key Files
166
+
167
+ Every Loki Mode project uses these files in the `.loki/` directory:
168
+
169
+ | File | Purpose |
170
+ |------|---------|
171
+ | `session.json` | Current session state (pid, start time, provider, status) |
172
+ | `state/orchestrator.json` | Current phase, tasks completed/failed |
173
+ | `queue/pending.json` | Tasks waiting to be executed |
174
+ | `queue/current-task.json` | The task currently being worked on |
175
+ | `queue/dead-letter.json` | Tasks that failed 5+ times |
176
+ | `memory/index.json` | Lightweight memory index |
177
+ | `memory/timeline.json` | Memory timeline for context retrieval |
178
+ | `signals/` | Inter-process signals (PAUSE, STOP, DRIFT_DETECTED, etc.) |
179
+
180
+ ## Summary
181
+
182
+ Loki Mode is an autonomous multi-agent system that follows the RARV cycle to build software from PRDs. It uses 41 agent types organized into 8 swarms, enforces quality through 9 gates with blind peer review, and maintains episodic/semantic/procedural memory for continuous learning. Projects are classified into simple, standard, or complex tiers that determine the number of phases executed.
@@ -0,0 +1,93 @@
1
+ # Module 1 Quiz: Core Concepts
2
+
3
+ Answer each question by selecting the best option (A, B, C, or D).
4
+
5
+ ---
6
+
7
+ **Question 1:** What does the RARV cycle stand for?
8
+
9
+ A) Read, Analyze, Review, Validate
10
+ B) Reason, Act, Reflect, Verify
11
+ C) Request, Assign, Run, Verify
12
+ D) Review, Approve, Release, Validate
13
+
14
+ ---
15
+
16
+ **Question 2:** How many specialized agent types does Loki Mode define?
17
+
18
+ A) 8
19
+ B) 25
20
+ C) 41
21
+ D) 50
22
+
23
+ ---
24
+
25
+ **Question 3:** What happens when a task fails 5 times in the RARV cycle?
26
+
27
+ A) The entire session terminates
28
+ B) The task is moved to the dead-letter queue
29
+ C) The task is automatically deleted
30
+ D) The agent escalates to a more powerful model
31
+
32
+ ---
33
+
34
+ **Question 4:** Which specialist reviewer is ALWAYS included in the 3-reviewer blind review system?
35
+
36
+ A) security-sentinel
37
+ B) performance-oracle
38
+ C) architecture-strategist
39
+ D) test-coverage-auditor
40
+
41
+ ---
42
+
43
+ **Question 5:** How many quality gates does Loki Mode enforce?
44
+
45
+ A) 3
46
+ B) 5
47
+ C) 7
48
+ D) 9
49
+
50
+ ---
51
+
52
+ **Question 6:** What are the three types of memory in the Loki Mode memory system?
53
+
54
+ A) Short-term, long-term, working
55
+ B) Episodic, semantic, procedural
56
+ C) Cache, storage, archive
57
+ D) Input, processing, output
58
+
59
+ ---
60
+
61
+ **Question 7:** Which complexity tier uses 3 phases?
62
+
63
+ A) basic
64
+ B) simple
65
+ C) standard
66
+ D) complex
67
+
68
+ ---
69
+
70
+ **Question 8:** What is the minimum test coverage required by Gate 7 (Test Coverage Gates)?
71
+
72
+ A) 50%
73
+ B) 60%
74
+ C) 80%
75
+ D) 100%
76
+
77
+ ---
78
+
79
+ **Question 9:** Which AI provider supports full Loki Mode features including parallel agents and the Task tool?
80
+
81
+ A) OpenAI Codex CLI
82
+ B) Google Gemini CLI
83
+ C) Claude Code
84
+ D) All three providers equally
85
+
86
+ ---
87
+
88
+ **Question 10:** What does Gate 4 (Anti-Sycophancy Check) do?
89
+
90
+ A) Blocks all code that has any warnings
91
+ B) Runs a Devil's Advocate reviewer when all 3 reviewers unanimously approve
92
+ C) Requires human approval for every change
93
+ D) Checks for duplicate code across the project