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
@@ -0,0 +1,80 @@
1
+ # Autonomi Certified Developer Program
2
+
3
+ ## Overview
4
+
5
+ The Autonomi Certified Developer certification validates your knowledge of Loki Mode, the multi-agent autonomous system by [Autonomi](https://www.autonomi.dev/). This program covers core concepts, enterprise features, advanced patterns, production deployment, and troubleshooting.
6
+
7
+ ## Program Structure
8
+
9
+ | Module | Topic | Questions |
10
+ |--------|-------|-----------|
11
+ | 1 | Core Concepts | 10 |
12
+ | 2 | Enterprise Features | 10 |
13
+ | 3 | Advanced Patterns | 10 |
14
+ | 4 | Production Deployment | 10 |
15
+ | 5 | Troubleshooting | 10 |
16
+ | **Final Exam** | **All Modules** | **50** |
17
+
18
+ ## Passing Criteria
19
+
20
+ - **Score required:** 80% (40 out of 50 questions)
21
+ - **Format:** Multiple choice (A/B/C/D)
22
+ - **Open book:** You may reference the Loki Mode documentation during the exam
23
+ - **Self-paced:** No time limit
24
+
25
+ ## Prerequisites
26
+
27
+ - Familiarity with command-line tools (bash, git, npm)
28
+ - Basic understanding of AI/LLM concepts (prompts, models, tokens)
29
+ - Node.js 18+ installed
30
+ - A supported AI provider CLI installed (Claude Code, Codex CLI, or Gemini CLI)
31
+
32
+ ## How to Use This Program
33
+
34
+ 1. Work through each module in order (Module 1 through Module 5)
35
+ 2. Read the `lesson.md` in each module directory
36
+ 3. Complete the `quiz.md` to test your understanding
37
+ 4. Do the hands-on `lab.md` exercise
38
+ 5. When ready, take the final `certification-exam.md`
39
+ 6. Check your answers against `answer-key.md`
40
+
41
+ ## Directory Structure
42
+
43
+ ```
44
+ docs/certification/
45
+ README.md # This file
46
+ 01-core-concepts/
47
+ lesson.md # RARV cycle, agents, quality gates, memory
48
+ quiz.md # 10 questions
49
+ lab.md # Hands-on: install and run Loki Mode
50
+ 02-enterprise-features/
51
+ lesson.md # Audit, OTEL, auth, SIEM integration
52
+ quiz.md # 10 questions
53
+ lab.md # Configure enterprise features
54
+ 03-advanced-patterns/
55
+ lesson.md # Agent composition, quality plugins
56
+ quiz.md # 10 questions
57
+ lab.md # Create a custom quality gate
58
+ 04-production-deployment/
59
+ lesson.md # Docker, deployment, security hardening
60
+ quiz.md # 10 questions
61
+ lab.md # Deploy with Docker Compose
62
+ 05-troubleshooting/
63
+ lesson.md # Debugging, recovery, circuit breakers
64
+ quiz.md # 10 questions
65
+ lab.md # Diagnose failures
66
+ sample-prds/
67
+ todo-app.md # Simple tier example
68
+ saas-dashboard.md # Standard tier example
69
+ microservices-platform.md # Complex tier example
70
+ certification-exam.md # 50-question final exam
71
+ answer-key.md # Answers for all quizzes and exam
72
+ ```
73
+
74
+ ## Cost and Licensing
75
+
76
+ This certification program is **free and open source**, released under the same license as Loki Mode. No registration or payment is required.
77
+
78
+ ## Version
79
+
80
+ This certification is based on **Loki Mode v5.52.0**. Content may be updated as new versions are released.
@@ -0,0 +1,117 @@
1
+ # Answer Key
2
+
3
+ This file contains answers for all module quizzes and the final certification exam.
4
+
5
+ ---
6
+
7
+ ## Module 1: Core Concepts Quiz
8
+
9
+ | Question | Answer | Explanation |
10
+ |----------|--------|-------------|
11
+ | 1 | B | RARV = Reason, Act, Reflect, Verify |
12
+ | 2 | C | 41 agent types: 37 domain + 4 orchestration |
13
+ | 3 | B | After 5 failures, the task moves to `.loki/queue/dead-letter.json` |
14
+ | 4 | C | architecture-strategist is always one of the 3 selected reviewers |
15
+ | 5 | D | 9 quality gates (Input Guardrails through Test Mutation Detector) |
16
+ | 6 | B | Episodic, semantic, and procedural memory |
17
+ | 7 | B | Simple tier uses 3 phases |
18
+ | 8 | C | Gate 7 requires >80% unit test coverage |
19
+ | 9 | C | Claude Code supports full features; Codex and Gemini run in degraded mode |
20
+ | 10 | B | If all 3 reviewers unanimously approve, a Devil's Advocate reviewer runs |
21
+
22
+ ---
23
+
24
+ ## Module 2: Enterprise Features Quiz
25
+
26
+ | Question | Answer | Explanation |
27
+ |----------|--------|-------------|
28
+ | 1 | A | Audit logging is enabled by default since v5.38.0 |
29
+ | 2 | C | OTEL activates when `LOKI_OTEL_ENDPOINT` is set to an OTLP endpoint |
30
+ | 3 | C | Default dashboard port is 57374 |
31
+ | 4 | A | `LOKI_ENTERPRISE_AUTH=true` enables token authentication |
32
+ | 5 | D | Syslog supports UDP and TCP via `LOKI_AUDIT_SYSLOG_PROTO` |
33
+ | 6 | D | Without the endpoint set, OTEL uses no-op stubs with zero overhead |
34
+ | 7 | A | `loki enterprise token generate my-token` creates an API token |
35
+ | 8 | D | Set `LOKI_TLS_CERT` and `LOKI_TLS_KEY` to PEM file paths |
36
+ | 9 | A | Controls whether `HUMAN_INPUT.md` can inject directives (disabled by default for security) |
37
+ | 10 | A | `loki enterprise status` shows all enterprise feature states |
38
+
39
+ ---
40
+
41
+ ## Module 3: Advanced Patterns Quiz
42
+
43
+ | Question | Answer | Explanation |
44
+ |----------|--------|-------------|
45
+ | 1 | B | Goal, Constraints, Context, Output (documented in `skills/agents.md`) |
46
+ | 2 | D | Confidence below 0.40 triggers human decision flag |
47
+ | 3 | C | Each verification runs independently without seeing the original response |
48
+ | 4 | A | security-sentinel > test-coverage-auditor > performance-oracle > dependency-analyst |
49
+ | 5 | A | Prevents "technically correct but wrong feature" by separating spec and quality reviews |
50
+ | 6 | D | Extraction triggers on novel insights: bug fixes, non-obvious solutions, reusable patterns |
51
+ | 7 | C | 4 parallel research agents enhance the plan in the deepen-plan phase |
52
+ | 8 | D | on_file_write triggers lint, typecheck, and secrets scan immediately after writes |
53
+ | 9 | C | Stage 1 failure returns to implementation; Stage 2 does not start |
54
+ | 10 | B | Handoffs include completed work, files modified, decisions, open questions, and mistakes |
55
+
56
+ ---
57
+
58
+ ## Module 4: Production Deployment Quiz
59
+
60
+ | Question | Answer | Explanation |
61
+ |----------|--------|-------------|
62
+ | 1 | C | Dockerfile uses Ubuntu 24.04 as the base image |
63
+ | 2 | B | `.:/workspace:rw` mounts the current directory read-write |
64
+ | 3 | A | Staged autonomy requires human approval before execution |
65
+ | 4 | C | Default `LOKI_MAX_PARALLEL_AGENTS` is 10 |
66
+ | 5 | A | `loki start --budget 10.00 ./prd.md` or `LOKI_BUDGET_LIMIT=10.00` |
67
+ | 6 | D | The council votes on project completion to prevent premature termination |
68
+ | 7 | B | The session auto-pauses when budget is exceeded |
69
+ | 8 | B | `LOKI_TLS_CERT` and `LOKI_TLS_KEY` environment variables |
70
+ | 9 | A | Stagnation limit flags when N iterations pass with no git changes |
71
+ | 10 | A | `LOKI_ALLOWED_PATHS` restricts which directories agents can modify |
72
+
73
+ ---
74
+
75
+ ## Final Certification Exam
76
+
77
+ | Question | Answer | Question | Answer |
78
+ |----------|--------|----------|--------|
79
+ | 1 | B | 26 | D |
80
+ | 2 | C | 27 | C |
81
+ | 3 | B | 28 | D |
82
+ | 4 | C | 29 | C |
83
+ | 5 | D | 30 | B |
84
+ | 6 | B | 31 | C |
85
+ | 7 | B | 32 | B |
86
+ | 8 | C | 33 | A |
87
+ | 9 | C | 34 | C |
88
+ | 10 | B | 35 | A |
89
+ | 11 | A | 36 | D |
90
+ | 12 | C | 37 | B |
91
+ | 13 | C | 38 | B |
92
+ | 14 | A | 39 | A |
93
+ | 15 | D | 40 | A |
94
+ | 16 | D | 41 | D |
95
+ | 17 | A | 42 | D |
96
+ | 18 | D | 43 | D |
97
+ | 19 | A | 44 | A |
98
+ | 20 | A | 45 | B |
99
+ | 21 | B | 46 | B |
100
+ | 22 | D | 47 | C |
101
+ | 23 | C | 48 | A |
102
+ | 24 | A | 49 | C |
103
+ | 25 | A | 50 | D |
104
+
105
+ ---
106
+
107
+ ## Scoring
108
+
109
+ - **50 questions total**
110
+ - **Passing score: 40 correct (80%)**
111
+ - Count your correct answers and divide by 50 to get your percentage
112
+
113
+ | Score Range | Result |
114
+ |-------------|--------|
115
+ | 40-50 (80-100%) | PASS -- Autonomi Certified Developer |
116
+ | 35-39 (70-79%) | FAIL -- Review weak areas and retake |
117
+ | Below 35 (<70%) | FAIL -- Complete all modules before retaking |
@@ -0,0 +1,471 @@
1
+ # Autonomi Certified Developer -- Final Exam
2
+
3
+ **Total Questions:** 50
4
+ **Passing Score:** 80% (40 correct)
5
+ **Format:** Multiple choice (A/B/C/D)
6
+
7
+ ---
8
+
9
+ ## Section 1: Core Concepts (Questions 1-10)
10
+
11
+ **Question 1:** What does the RARV cycle stand for?
12
+
13
+ A) Read, Analyze, Review, Validate
14
+ B) Reason, Act, Reflect, Verify
15
+ C) Request, Assign, Run, Verify
16
+ D) Review, Approve, Release, Validate
17
+
18
+ ---
19
+
20
+ **Question 2:** How many specialized agent types does Loki Mode define?
21
+
22
+ A) 8
23
+ B) 25
24
+ C) 41
25
+ D) 50
26
+
27
+ ---
28
+
29
+ **Question 3:** What happens when a task fails 5 times in the RARV cycle?
30
+
31
+ A) The entire session terminates
32
+ B) The task is moved to the dead-letter queue
33
+ C) The task is automatically deleted
34
+ D) The agent escalates to a more powerful model
35
+
36
+ ---
37
+
38
+ **Question 4:** Which specialist reviewer is ALWAYS included in the 3-reviewer blind review system?
39
+
40
+ A) security-sentinel
41
+ B) performance-oracle
42
+ C) architecture-strategist
43
+ D) test-coverage-auditor
44
+
45
+ ---
46
+
47
+ **Question 5:** How many quality gates does Loki Mode enforce?
48
+
49
+ A) 3
50
+ B) 5
51
+ C) 7
52
+ D) 9
53
+
54
+ ---
55
+
56
+ **Question 6:** What are the three types of memory in the Loki Mode memory system?
57
+
58
+ A) Short-term, long-term, working
59
+ B) Episodic, semantic, procedural
60
+ C) Cache, storage, archive
61
+ D) Input, processing, output
62
+
63
+ ---
64
+
65
+ **Question 7:** Which complexity tier uses 3 phases?
66
+
67
+ A) basic
68
+ B) simple
69
+ C) standard
70
+ D) complex
71
+
72
+ ---
73
+
74
+ **Question 8:** What is the minimum test coverage required by Gate 7?
75
+
76
+ A) 50%
77
+ B) 60%
78
+ C) 80%
79
+ D) 100%
80
+
81
+ ---
82
+
83
+ **Question 9:** Which AI provider supports full Loki Mode features including parallel agents and the Task tool?
84
+
85
+ A) OpenAI Codex CLI
86
+ B) Google Gemini CLI
87
+ C) Claude Code
88
+ D) All three providers equally
89
+
90
+ ---
91
+
92
+ **Question 10:** What does Gate 4 (Anti-Sycophancy Check) do?
93
+
94
+ A) Blocks all code that has any warnings
95
+ B) Runs a Devil's Advocate reviewer when all 3 reviewers unanimously approve
96
+ C) Requires human approval for every change
97
+ D) Checks for duplicate code across the project
98
+
99
+ ---
100
+
101
+ ## Section 2: Enterprise Features (Questions 11-20)
102
+
103
+ **Question 11:** What is the default state of audit logging in Loki Mode (v5.38.0+)?
104
+
105
+ A) Enabled by default, can be disabled with `LOKI_AUDIT_DISABLED=true`
106
+ B) Disabled, must be explicitly enabled
107
+ C) Only enabled when running in Docker sandbox
108
+ D) Only enabled when `LOKI_ENTERPRISE_AUDIT=true` is set
109
+
110
+ ---
111
+
112
+ **Question 12:** Which environment variable enables OpenTelemetry in Loki Mode?
113
+
114
+ A) `LOKI_OTEL_ENABLED=true`
115
+ B) `LOKI_TELEMETRY=true`
116
+ C) `LOKI_OTEL_ENDPOINT=http://localhost:4318`
117
+ D) `OTEL_EXPORTER_ENDPOINT=http://localhost:4318`
118
+
119
+ ---
120
+
121
+ **Question 13:** What is the default port for the Loki Mode dashboard?
122
+
123
+ A) 3000
124
+ B) 8080
125
+ C) 57374
126
+ D) 9090
127
+
128
+ ---
129
+
130
+ **Question 14:** Which environment variable enables token-based API authentication?
131
+
132
+ A) `LOKI_ENTERPRISE_AUTH=true`
133
+ B) `LOKI_AUTH_ENABLED=true`
134
+ C) `LOKI_TOKEN_AUTH=true`
135
+ D) `LOKI_API_AUTH=true`
136
+
137
+ ---
138
+
139
+ **Question 15:** What protocol options does Loki Mode support for syslog forwarding?
140
+
141
+ A) HTTP and HTTPS only
142
+ B) MQTT and AMQP
143
+ C) gRPC and HTTP
144
+ D) UDP and TCP
145
+
146
+ ---
147
+
148
+ **Question 16:** What happens when `LOKI_OTEL_ENDPOINT` is NOT set?
149
+
150
+ A) Loki Mode refuses to start
151
+ B) OTEL uses a default localhost endpoint
152
+ C) OTEL data is written to a local file
153
+ D) Loki Mode uses no-op stubs with zero overhead
154
+
155
+ ---
156
+
157
+ **Question 17:** Which command generates an API token for the dashboard?
158
+
159
+ A) `loki enterprise token generate my-token`
160
+ B) `loki auth token create`
161
+ C) `loki dashboard auth --new-token`
162
+ D) `loki config auth token`
163
+
164
+ ---
165
+
166
+ **Question 18:** How do you enable TLS for the Loki Mode dashboard?
167
+
168
+ A) Set `LOKI_DASHBOARD_TLS=true`
169
+ B) TLS is always enabled by default
170
+ C) Pass `--tls` flag to `loki dashboard start`
171
+ D) Set `LOKI_TLS_CERT` and `LOKI_TLS_KEY` to PEM file paths
172
+
173
+ ---
174
+
175
+ **Question 19:** What does `LOKI_PROMPT_INJECTION` control?
176
+
177
+ A) Whether the `HUMAN_INPUT.md` file can inject directives into a running session
178
+ B) Whether agents can execute shell commands
179
+ C) Whether API tokens expire automatically
180
+ D) Whether OTEL traces include prompt content
181
+
182
+ ---
183
+
184
+ **Question 20:** Which command checks the status of all enterprise features?
185
+
186
+ A) `loki enterprise status`
187
+ B) `loki config show`
188
+ C) `loki doctor --enterprise`
189
+ D) `loki status --enterprise`
190
+
191
+ ---
192
+
193
+ ## Section 3: Advanced Patterns (Questions 21-30)
194
+
195
+ **Question 21:** What are the four required sections in a structured agent prompt?
196
+
197
+ A) Task, Input, Process, Output
198
+ B) Goal, Constraints, Context, Output
199
+ C) Objective, Scope, Resources, Deliverables
200
+ D) Summary, Details, Requirements, Acceptance
201
+
202
+ ---
203
+
204
+ **Question 22:** In confidence-based routing, what happens when a task's confidence score is below 0.40?
205
+
206
+ A) The task is executed with the cheapest model
207
+ B) The task is automatically retried 3 times
208
+ C) The task is split into smaller subtasks
209
+ D) The task is flagged for human decision
210
+
211
+ ---
212
+
213
+ **Question 23:** What is the critical feature of Step 3 (Execute) in the Chain-of-Verification process?
214
+
215
+ A) All verifications run sequentially in the same context
216
+ B) The verifier has full access to the original response for comparison
217
+ C) Each verification runs independently with NO access to the original response
218
+ D) A human must approve each verification question
219
+
220
+ ---
221
+
222
+ **Question 24:** In the specialist review pool, what is the tie-breaker priority order?
223
+
224
+ A) security-sentinel > test-coverage-auditor > performance-oracle > dependency-analyst
225
+ B) performance-oracle > dependency-analyst > security-sentinel > test-coverage-auditor
226
+ C) test-coverage-auditor > security-sentinel > dependency-analyst > performance-oracle
227
+ D) dependency-analyst > performance-oracle > test-coverage-auditor > security-sentinel
228
+
229
+ ---
230
+
231
+ **Question 25:** Why is code review split into two stages?
232
+
233
+ A) To prevent approving well-written code that implements the wrong feature
234
+ B) To reduce the number of reviewers needed
235
+ C) To allow junior developers to handle Stage 1
236
+ D) To make the review process faster
237
+
238
+ ---
239
+
240
+ **Question 26:** What triggers the compound learning knowledge extraction phase?
241
+
242
+ A) Every task completion regardless of outcome
243
+ B) Only when manually invoked with `loki compound run`
244
+ C) Only when the project reaches the DEPLOYMENT phase
245
+ D) Only when a task produces a novel insight (bug fix, non-obvious solution, reusable pattern)
246
+
247
+ ---
248
+
249
+ **Question 27:** How many parallel research agents run during the deepen-plan phase?
250
+
251
+ A) 2
252
+ B) 3
253
+ C) 4
254
+ D) 5
255
+
256
+ ---
257
+
258
+ **Question 28:** What is the purpose of the `on_file_write` hook trigger?
259
+
260
+ A) To back up files before they are modified
261
+ B) To prevent agents from writing to protected files
262
+ C) To log all file changes to the audit trail
263
+ D) To run lint, typecheck, and secrets scanning immediately after a file is written
264
+
265
+ ---
266
+
267
+ **Question 29:** In the two-stage review protocol, what happens if Stage 1 (spec compliance) fails?
268
+
269
+ A) The code goes directly to Stage 2 for quality feedback
270
+ B) The review is cancelled and a new agent is assigned
271
+ C) The code returns to implementation; Stage 2 is NOT started
272
+ D) Both stages run in parallel anyway to save time
273
+
274
+ ---
275
+
276
+ **Question 30:** What information is included in a structured agent handoff?
277
+
278
+ A) Only the list of files modified
279
+ B) Completed work, files modified, decisions made, open questions, and mistakes learned
280
+ C) Only the task ID and completion status
281
+ D) A full copy of the agent's conversation history
282
+
283
+ ---
284
+
285
+ ## Section 4: Production Deployment (Questions 31-40)
286
+
287
+ **Question 31:** What base image does the Loki Mode Dockerfile use?
288
+
289
+ A) Alpine Linux 3.19
290
+ B) Node.js 20 official image
291
+ C) Ubuntu 24.04
292
+ D) Debian Bookworm
293
+
294
+ ---
295
+
296
+ **Question 32:** Which volume mount in docker-compose.yml gives the container read-write access?
297
+
298
+ A) `~/.gitconfig:/home/loki/.gitconfig`
299
+ B) `.:/workspace:rw`
300
+ C) `~/.ssh:/home/loki/.ssh`
301
+ D) `~/.config/gh:/home/loki/.config/gh`
302
+
303
+ ---
304
+
305
+ **Question 33:** What does `LOKI_STAGED_AUTONOMY=true` do?
306
+
307
+ A) Requires human approval before execution
308
+ B) Enables parallel agent execution in stages
309
+ C) Stages deployment across multiple environments
310
+ D) Enables incremental feature rollout
311
+
312
+ ---
313
+
314
+ **Question 34:** What is the default maximum number of parallel agents?
315
+
316
+ A) 3
317
+ B) 5
318
+ C) 10
319
+ D) 20
320
+
321
+ ---
322
+
323
+ **Question 35:** How do you set a cost budget limit for a Loki Mode session?
324
+
325
+ A) `loki start --budget 10.00 ./prd.md`
326
+ B) `loki start --max-cost 10`
327
+ C) `LOKI_COST_LIMIT=10 loki start`
328
+ D) `loki config set budget 10.00`
329
+
330
+ ---
331
+
332
+ **Question 36:** What does the completion council do?
333
+
334
+ A) Reviews all code changes before they are committed
335
+ B) Assigns tasks to available agents
336
+ C) Manages the deployment pipeline approval process
337
+ D) Votes on whether the project is truly complete to prevent premature termination
338
+
339
+ ---
340
+
341
+ **Question 37:** What happens when the budget limit set by `LOKI_BUDGET_LIMIT` is exceeded?
342
+
343
+ A) The session continues but logs a warning
344
+ B) The session auto-pauses
345
+ C) The session terminates immediately with an error
346
+ D) The budget is automatically doubled
347
+
348
+ ---
349
+
350
+ **Question 38:** Which environment variables enable TLS for the dashboard?
351
+
352
+ A) `LOKI_HTTPS=true` and `LOKI_HTTPS_PORT=443`
353
+ B) `LOKI_TLS_CERT` and `LOKI_TLS_KEY`
354
+ C) `LOKI_SSL_CERT` and `LOKI_SSL_KEY`
355
+ D) `LOKI_DASHBOARD_TLS=true`
356
+
357
+ ---
358
+
359
+ **Question 39:** What does `LOKI_COUNCIL_STAGNATION_LIMIT=5` mean?
360
+
361
+ A) After 5 iterations with no git changes, stagnation is flagged
362
+ B) The council can only reject completion 5 times
363
+ C) The council checks every 5 minutes
364
+ D) Maximum 5 council members can vote
365
+
366
+ ---
367
+
368
+ **Question 40:** How do you restrict which directories agents can modify?
369
+
370
+ A) `LOKI_ALLOWED_PATHS=/workspace/src,/workspace/tests`
371
+ B) `LOKI_READ_ONLY_PATHS=/etc,/usr`
372
+ C) `LOKI_SANDBOX_PATHS=/safe/dir`
373
+ D) `LOKI_WRITE_DIRS=src,tests`
374
+
375
+ ---
376
+
377
+ ## Section 5: Troubleshooting (Questions 41-50)
378
+
379
+ **Question 41:** What are the three states of the circuit breaker system?
380
+
381
+ A) Active, Inactive, Standby
382
+ B) Green, Yellow, Red
383
+ C) Running, Paused, Stopped
384
+ D) Closed, Open, Half-Open
385
+
386
+ ---
387
+
388
+ **Question 42:** How many failures within 60 seconds trigger a circuit breaker to OPEN?
389
+
390
+ A) 1
391
+ B) 2
392
+ C) 5
393
+ D) 3
394
+
395
+ ---
396
+
397
+ **Question 43:** What is the default cooldown period when a circuit breaker is in the OPEN state?
398
+
399
+ A) 30 seconds
400
+ B) 60 seconds
401
+ C) 600 seconds (10 minutes)
402
+ D) 300 seconds (5 minutes)
403
+
404
+ ---
405
+
406
+ **Question 44:** After how many failures is a task moved to the dead-letter queue?
407
+
408
+ A) 5
409
+ B) 3
410
+ C) 7
411
+ D) 10
412
+
413
+ ---
414
+
415
+ **Question 45:** What happens when 3 or more DRIFT_DETECTED signals accumulate?
416
+
417
+ A) The session terminates immediately
418
+ B) A context clear is triggered and state is reloaded from scratch
419
+ C) The task is moved to the dead-letter queue
420
+ D) All agents are stopped and restarted
421
+
422
+ ---
423
+
424
+ **Question 46:** Which file should an agent read first when recovering from context loss?
425
+
426
+ A) `.loki/queue/pending.json`
427
+ B) `.loki/CONTINUITY.md`
428
+ C) `.loki/session.json`
429
+ D) `.loki/memory/index.json`
430
+
431
+ ---
432
+
433
+ **Question 47:** What does the `loki reset retries` command do?
434
+
435
+ A) Deletes all tasks from the queue
436
+ B) Restarts the AI provider CLI
437
+ C) Resets retry counters only
438
+ D) Removes the entire `.loki/` directory
439
+
440
+ ---
441
+
442
+ **Question 48:** Which environment variable disables Gate 8 (Mock Detector)?
443
+
444
+ A) `LOKI_GATE_MOCK_DETECTOR=false`
445
+ B) `LOKI_SKIP_MOCK_CHECK=true`
446
+ C) `LOKI_DISABLE_GATE_8=true`
447
+ D) `LOKI_NO_MOCK_DETECTION=true`
448
+
449
+ ---
450
+
451
+ **Question 49:** When should a dead-letter task be permanently abandoned?
452
+
453
+ A) After 3 failed attempts
454
+ B) After 5 failed attempts
455
+ C) After 10+ total attempts, or same error with 3 different approaches
456
+ D) Only when manually deleted by the user
457
+
458
+ ---
459
+
460
+ **Question 50:** What is a red flag indication that an agent is rationalizing a failure?
461
+
462
+ A) The agent requests a model upgrade
463
+ B) The agent runs additional tests
464
+ C) The agent creates a new branch for the fix
465
+ D) The agent uses language like "probably", "should be fine", or "just a small change"
466
+
467
+ ---
468
+
469
+ **End of Exam**
470
+
471
+ Check your answers against `answer-key.md`. You need 40 or more correct answers (80%) to pass.