loki-mode 11.3.0 → 11.3.2

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 (242) hide show
  1. package/README.md +68 -650
  2. package/SKILL.md +5 -5
  3. package/VERSION +1 -1
  4. package/autonomy/completion-council.sh +2 -2
  5. package/autonomy/context-tracker.py +4 -4
  6. package/autonomy/council-v2.sh +1 -1
  7. package/autonomy/grill.sh +1 -1
  8. package/autonomy/lib/done-recognition.sh +1 -1
  9. package/autonomy/lib/efficiency_cost.py +8 -0
  10. package/autonomy/lib/engine10-push.sh +22 -8
  11. package/autonomy/lib/prd-enrich.sh +1 -1
  12. package/autonomy/lib/voter-agents.sh +1 -1
  13. package/autonomy/loki +161 -105
  14. package/autonomy/run.sh +30 -18
  15. package/autonomy/sandbox.sh +1 -1
  16. package/autonomy/tui.sh +6 -5
  17. package/autonomy/verify.sh +1 -1
  18. package/bin/loki +195 -59
  19. package/completions/_loki +8 -0
  20. package/completions/loki.bash +3 -3
  21. package/dashboard/__init__.py +1 -1
  22. package/dashboard/server.py +47 -45
  23. package/docs/AGENT-CHANGE-RECEIPT.md +2 -2
  24. package/docs/ARCHITECTURE.md +337 -0
  25. package/docs/BRANDING.md +124 -0
  26. package/docs/CLI-REFERENCE.md +11 -1
  27. package/docs/COMPONENTS.md +447 -0
  28. package/docs/DEPLOYMENT.md +9 -9
  29. package/docs/DOCKER.md +469 -0
  30. package/docs/INSTALLATION.md +67 -1045
  31. package/docs/KNOWN-ISSUES.md +11 -35
  32. package/docs/OTEL-COLLECTOR.md +24 -0
  33. package/docs/ROUTING-EVIDENCE.md +32 -0
  34. package/docs/TESTING.md +161 -0
  35. package/docs/air-gapped.md +1 -2
  36. package/docs/alternative-installations.md +14 -24
  37. package/docs/architecture/DECISIONS.md +333 -0
  38. package/docs/audit-logging.md +7 -7
  39. package/docs/authentication.md +3 -3
  40. package/docs/authorization.md +1 -1
  41. package/docs/certification/04-production-deployment/lab.md +6 -6
  42. package/docs/certification/04-production-deployment/lesson.md +4 -4
  43. package/docs/certification/README.md +1 -1
  44. package/docs/control-plane-container.md +2 -2
  45. package/docs/dev/real-run.md +34 -0
  46. package/docs/dev/release-checklist.md +2 -2
  47. package/docs/environment-variables.md +1 -0
  48. package/docs/exit-codes.md +3 -3
  49. package/docs/git-workflow.md +3 -3
  50. package/docs/metrics.md +37 -55
  51. package/docs/network-security.md +1 -1
  52. package/docs/siem-integration.md +5 -5
  53. package/docs/spec-first-intent.md +28 -0
  54. package/docs/v10/CLI-MODERN.md +7 -3
  55. package/docs/v10/DECISIONS.md +59 -0
  56. package/docs/v10/DEPS.md +22 -22
  57. package/docs/v10/ENGINE.md +1 -1
  58. package/docs/v10/FAILURE-CLASSES.md +212 -1
  59. package/docs/v10/FOUNDER-QUEUE.md +1 -0
  60. package/docs/v10/GUARDS.md +31 -0
  61. package/docs/v10/GUIDE.md +7 -5
  62. package/docs/v10/LEGACY-REMOVAL.md +4 -6
  63. package/docs/v10/METRICS.md +14 -2
  64. package/docs/v10/MODERNIZE.md +1 -1
  65. package/docs/v10/OPERATING-MODEL.md +4 -3
  66. package/docs/v10/PROGRESS.md +35 -0
  67. package/docs/v11/COST-HALF.md +352 -0
  68. package/docs/v11/INTOTO-AGENT-CHANGE-PREDICATE.md +77 -0
  69. package/docs/v11/MARKET-SLICES.md +315 -0
  70. package/docs/v11/MCP-2026-07-28.md +55 -0
  71. package/docs/v11/REGISTRIES.md +730 -0
  72. package/docs/v11/VERIFY-PR-SANDBOX.md +41 -0
  73. package/loki-ts/data/model-pricing.json +52 -24
  74. package/loki-ts/dist/loki.js +1185 -945
  75. package/mcp/__init__.py +1 -1
  76. package/mcp/v10_tools.py +29 -0
  77. package/package.json +9 -11
  78. package/packages/control-plane/dist/ask-tools-server.js +8 -2
  79. package/packages/control-plane/dist/server.js +15832 -12361
  80. package/packages/control-plane/drizzle/0006_token_sessions.sql +1 -0
  81. package/packages/control-plane/drizzle/meta/0006_snapshot.json +807 -0
  82. package/packages/control-plane/drizzle/meta/_journal.json +7 -0
  83. package/packages/control-plane/src/db/schema.ts +1 -0
  84. package/packages/control-plane/src/server/routes/cost.ts +4 -3
  85. package/packages/control-plane/src/server/runs.ts +3 -3
  86. package/packages/control-plane/ui/dist/assets/index-DbLzr87u.js +190 -0
  87. package/packages/control-plane/ui/dist/index.html +1 -1
  88. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  89. package/providers/opencode.sh +2 -3
  90. package/src/observability/genai-spans.js +104 -0
  91. package/src/observability/otel-bridge.js +49 -1
  92. package/src/observability/otel.js +2 -2
  93. package/src/protocols/mcp-client.js +6 -2
  94. package/src/protocols/mcp-server.js +191 -6
  95. package/src/protocols/transport/sse.js +23 -2
  96. package/tools/audit-docs.py +1 -1
  97. package/web-app/dist/assets/{AdminPage-D_e45uTw.js → AdminPage-DuRQZsF9.js} +1 -1
  98. package/web-app/dist/assets/{Avatar-T3nIpoaf.js → Avatar-7GtOQvsO.js} +1 -1
  99. package/web-app/dist/assets/{Badge-BKqb59pP.js → Badge-CYgTnIxj.js} +1 -1
  100. package/web-app/dist/assets/{Button-DjVlkh8_.js → Button-rYSyIu7X.js} +1 -1
  101. package/web-app/dist/assets/{CockpitPage-DXJgLGmh.js → CockpitPage-9adANY4o.js} +1 -1
  102. package/web-app/dist/assets/{ComparePage-BRP_eVc_.js → ComparePage-DEG2oA-R.js} +1 -1
  103. package/web-app/dist/assets/{ErrorBoundary-CLjpGLjC.js → ErrorBoundary-CwtvY4xs.js} +1 -1
  104. package/web-app/dist/assets/{EvidenceReceiptPanel-DX-vb4Xy.js → EvidenceReceiptPanel-DTT73pPB.js} +1 -1
  105. package/web-app/dist/assets/{GitHubIssuesPanel-214HVHtX.js → GitHubIssuesPanel-CpWZLz2x.js} +1 -1
  106. package/web-app/dist/assets/{GitHubPRsPanel-BEiZKc4t.js → GitHubPRsPanel-H293R7E2.js} +1 -1
  107. package/web-app/dist/assets/{HomePage-VvMHS5ga.js → HomePage-B11Imp9k.js} +2 -2
  108. package/web-app/dist/assets/{LoginPage-5WD-v7n3.js → LoginPage-BZBgx5Jr.js} +1 -1
  109. package/web-app/dist/assets/{MagicPage-DUQT_Jye.js → MagicPage-B27S4_X8.js} +1 -1
  110. package/web-app/dist/assets/{MetricsPage-lga-z79v.js → MetricsPage-CfbJWNDG.js} +1 -1
  111. package/web-app/dist/assets/{NotFoundPage-CGhBX3G1.js → NotFoundPage-Tp_4zMSm.js} +1 -1
  112. package/web-app/dist/assets/{ProjectPage-CdzF2GzZ.js → ProjectPage-CM4fgMsV.js} +3 -3
  113. package/web-app/dist/assets/{ProjectsPage-DRG64N8s.js → ProjectsPage-DP2Fvsrd.js} +1 -1
  114. package/web-app/dist/assets/{SettingsPage-5fzW9Frb.js → SettingsPage-C4G9-EAy.js} +1 -1
  115. package/web-app/dist/assets/{ShowcasePage-DrTdxO4y.js → ShowcasePage-Dj-n4dwu.js} +1 -1
  116. package/web-app/dist/assets/{SystemSettingsPage-C9Mqs6Rd.js → SystemSettingsPage-BqMLpuGt.js} +1 -1
  117. package/web-app/dist/assets/{TeamsPage-CUGPdSWo.js → TeamsPage-mIH8H96m.js} +1 -1
  118. package/web-app/dist/assets/{TemplatesPage-CNraDY0F.js → TemplatesPage-BagW-v4n.js} +1 -1
  119. package/web-app/dist/assets/{TerminalOutput-BIu_6Pea.js → TerminalOutput-CTQRHhnK.js} +1 -1
  120. package/web-app/dist/assets/{activity-Bk-kgqaf.js → activity-DNQiBDDL.js} +1 -1
  121. package/web-app/dist/assets/{bell-BXmUdmo8.js → bell-Coiwdad1.js} +1 -1
  122. package/web-app/dist/assets/{bot-CiuzXxUR.js → bot-Cou-rTgR.js} +1 -1
  123. package/web-app/dist/assets/{check-BEzjXppd.js → check-CsF-XtQp.js} +1 -1
  124. package/web-app/dist/assets/{chevron-left-AYWCXHf8.js → chevron-left-BJiy55Ht.js} +1 -1
  125. package/web-app/dist/assets/{circle-alert-BNg2uSRq.js → circle-alert-D6-pQQWq.js} +1 -1
  126. package/web-app/dist/assets/{clock-DTj0kkGT.js → clock-BOGqwgt9.js} +1 -1
  127. package/web-app/dist/assets/{cloud-x4nTDBLT.js → cloud-DsxhTtf5.js} +1 -1
  128. package/web-app/dist/assets/{code-xml-BVh_MLrk.js → code-xml-CxJDHUlE.js} +1 -1
  129. package/web-app/dist/assets/{database-DdfBaowG.js → database-BJePscl_.js} +1 -1
  130. package/web-app/dist/assets/{dollar-sign-XuYFmAOY.js → dollar-sign-6qWGAkZo.js} +1 -1
  131. package/web-app/dist/assets/{file-code-corner-D4cRnmeL.js → file-code-corner-DcOtYeDb.js} +1 -1
  132. package/web-app/dist/assets/{file-plus-CyoVlHc_.js → file-plus-WuRyLFo0.js} +1 -1
  133. package/web-app/dist/assets/{globe-Y6IK2RPW.js → globe-r-xCP4DE.js} +1 -1
  134. package/web-app/dist/assets/{hammer-BKzr9VZI.js → hammer-DTt0SsCB.js} +1 -1
  135. package/web-app/dist/assets/{index-B20cSx5G.js → index-BkbXyH8y.js} +3 -3
  136. package/web-app/dist/assets/{layers-DebNOhGS.js → layers-BvZhvSMY.js} +1 -1
  137. package/web-app/dist/assets/{loader-circle-DyGbrEgd.js → loader-circle-3gosTei9.js} +1 -1
  138. package/web-app/dist/assets/{lock-BKPpyt20.js → lock-CZZMxP0U.js} +1 -1
  139. package/web-app/dist/assets/{package-egF5Wi4y.js → package-C5A8CkJr.js} +1 -1
  140. package/web-app/dist/assets/{plus-OiEgKIc-.js → plus-Btv7tTIF.js} +1 -1
  141. package/web-app/dist/assets/{refresh-cw-CzKvrONq.js → refresh-cw-DsWLXgs_.js} +1 -1
  142. package/web-app/dist/assets/{rotate-ccw-Bu2mII0p.js → rotate-ccw-DOVDjway.js} +1 -1
  143. package/web-app/dist/assets/{scroll-text-CSkiyax8.js → scroll-text-smySzlrX.js} +1 -1
  144. package/web-app/dist/assets/{server-DlPthJFw.js → server-b5PHsqAU.js} +1 -1
  145. package/web-app/dist/assets/{shield-alert-CbpHWQQX.js → shield-alert-BD7FDlh-.js} +1 -1
  146. package/web-app/dist/assets/{thumbs-up-DgGpZe-Q.js → thumbs-up-CAsFzbyE.js} +1 -1
  147. package/web-app/dist/assets/{trash-2-BV3GlCB-.js → trash-2-BJ35qHgl.js} +1 -1
  148. package/web-app/dist/assets/{trending-down-Y4TJtXhD.js → trending-down-Ozrd26cZ.js} +1 -1
  149. package/web-app/dist/assets/{trending-up-DsDNoHZY.js → trending-up-BhnMcM32.js} +1 -1
  150. package/web-app/dist/assets/{upload-gkThrc_I.js → upload-JVHfdwoA.js} +1 -1
  151. package/web-app/dist/assets/{usePolling-jpNSeNAe.js → usePolling-CTzbDV-e.js} +1 -1
  152. package/web-app/dist/assets/{user-3Zez1WOK.js → user-Bks3-GYv.js} +1 -1
  153. package/web-app/dist/index.html +1 -1
  154. package/docs/ARCHITECTURE-OVERVIEW.md +0 -209
  155. package/docs/AUTONOMI-ECOSYSTEM.md +0 -107
  156. package/docs/COCKPIT-SPEC.md +0 -72
  157. package/docs/COCKPIT-UX-MANDATE.md +0 -53
  158. package/docs/COMPETITIVE-ANALYSIS.md +0 -303
  159. package/docs/COMPETITIVE-NEXT-10.md +0 -316
  160. package/docs/COMPETITIVE-RALPH-ZEROSHOT-2026-07-08.md +0 -81
  161. package/docs/DASHBOARD-9.12-EVIDENCE.md +0 -97
  162. package/docs/DASHBOARD-ARCHITECTURE.md +0 -425
  163. package/docs/DASHBOARD_V2_CHECKLIST.md +0 -243
  164. package/docs/DEMOS.md +0 -63
  165. package/docs/ENTERPRISE-IDENTITY-ROADMAP.md +0 -206
  166. package/docs/EVIDENCE-RECEIPT-BUILD-APPLICABILITY.md +0 -79
  167. package/docs/FEAT-PRDREUSE-DOCKER-PLAN.md +0 -144
  168. package/docs/GATE-FAILURE-TRIAGE.md +0 -254
  169. package/docs/HANDOFF-2026-08-03.md +0 -439
  170. package/docs/LOOP-CANDIDATE-PROPOSAL-v1.md +0 -167
  171. package/docs/LOOP-HARNESS-AUDIT.md +0 -684
  172. package/docs/MERGE-DEDUP-MAP.md +0 -420
  173. package/docs/MERGE-ROUTE-MAP.md +0 -139
  174. package/docs/MODEL-REGISTRY-PLAN.md +0 -155
  175. package/docs/OUTCOME-FRONTIER.md +0 -536
  176. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +0 -192
  177. package/docs/PLANS-INDEX.md +0 -32
  178. package/docs/PRD-REUSE-DONE-RECOGNITION-PLAN.md +0 -536
  179. package/docs/PROMPT-ABLATION-RESULT.md +0 -97
  180. package/docs/R4-TRUST-TRAJECTORY-DESIGN.md +0 -127
  181. package/docs/R5-AUTO-WIKI-DESIGN.md +0 -137
  182. package/docs/R6-ROLLBACK-CHECKPOINT-PLAN.md +0 -107
  183. package/docs/R7-ZERO-CONFIG-FIRST-RUN-PLAN.md +0 -137
  184. package/docs/R8-SHAREABLE-TEAM-ASSETS-PLAN.md +0 -129
  185. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +0 -113
  186. package/docs/RARV-C-100X-PLAN.md +0 -286
  187. package/docs/RARV-C-LOOP-EFFICIENCY-PLAN.md +0 -470
  188. package/docs/SHAREABLE-PROOF-PLAN.md +0 -194
  189. package/docs/SONNET5-DEFAULT-PLAN.md +0 -157
  190. package/docs/SPEED-AND-FIRST-PASS-PLAN.md +0 -281
  191. package/docs/STALE-STATE-AUDIT.md +0 -174
  192. package/docs/SYNERGY-TASKS.md +0 -143
  193. package/docs/TASKLIST-ACCURACY-PLAN.md +0 -355
  194. package/docs/TOP-100-BACKLOG.md +0 -159
  195. package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +0 -114
  196. package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +0 -45
  197. package/docs/V8-MAJOR-RELEASE-PLAN.md +0 -137
  198. package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +0 -82
  199. package/docs/V8-SDK-RESEARCH-RAW.md +0 -129
  200. package/docs/WELCOME-OPENER-PLAN.md +0 -106
  201. package/docs/adoption-baseline-2026-07-31.md +0 -84
  202. package/docs/architecture/bmad-integration-epic.md +0 -271
  203. package/docs/architecture/bmad-integration-review.md +0 -86
  204. package/docs/architecture/bmad-integration-validation.md +0 -249
  205. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +0 -61
  206. package/docs/auto-claude-comparison.md +0 -250
  207. package/docs/bug-fixes/agent-01-cli-fixes.md +0 -101
  208. package/docs/bug-fixes/agent-02-purplelab-fixes.md +0 -88
  209. package/docs/bug-fixes/agent-03-dashboard-fixes.md +0 -119
  210. package/docs/bug-fixes/agent-04-memory-fixes.md +0 -105
  211. package/docs/bug-fixes/agent-05-provider-fixes.md +0 -86
  212. package/docs/bug-fixes/agent-06-integration-fixes.md +0 -101
  213. package/docs/bug-fixes/agent-07-dash-run-fixes.md +0 -101
  214. package/docs/bug-fixes/agent-08-docker-fixes.md +0 -164
  215. package/docs/bug-fixes/agent-09-e2e-build-fixes.md +0 -69
  216. package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +0 -102
  217. package/docs/bug-fixes/agent-11-e2e-session-fixes.md +0 -70
  218. package/docs/bug-fixes/agent-12-scenario-fixes.md +0 -120
  219. package/docs/bug-fixes/agent-13-enterprise-fixes.md +0 -143
  220. package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +0 -88
  221. package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +0 -132
  222. package/docs/bug-fixes/agent-19-code-review.md +0 -316
  223. package/docs/bug-fixes/agent-20-architecture-review.md +0 -331
  224. package/docs/competitive/bolt-new-analysis.md +0 -579
  225. package/docs/competitive/emergence-others-analysis.md +0 -605
  226. package/docs/competitive/replit-lovable-analysis.md +0 -622
  227. package/docs/dashboard-guide.md +0 -487
  228. package/docs/enterprise/migration.md +0 -265
  229. package/docs/history/one-run-audit.md +0 -304
  230. package/docs/plans/FORGE-AUTONOMOUS-QUEUE.md +0 -312
  231. package/docs/plans/ULTRAPLAN-FORGE-BAAS.md +0 -612
  232. package/docs/plans/UT2-6-LSP-DIAGNOSTIC-BROADCAST.md +0 -394
  233. package/docs/prd-purple-lab-ide.md +0 -152
  234. package/docs/prd-purple-lab-platform-v2.md +0 -223
  235. package/docs/prd-purple-lab-platform.md +0 -319
  236. package/docs/retrospectives/v7.5.15-fleet-postmortem.md +0 -325
  237. package/docs/retrospectives/v7.5.15-honesty-audit.md +0 -136
  238. package/docs/retrospectives/v7.5.15-llm-failure-modes.md +0 -49
  239. package/docs/show-hn-post.md +0 -46
  240. package/docs/test-scenarios/enterprise-scenarios.md +0 -732
  241. package/docs/thick2thin.md +0 -173
  242. package/packages/control-plane/ui/dist/assets/index-DcBJXjCJ.js +0 -190
@@ -1,41 +1,17 @@
1
+ # Known issues
1
2
 
2
- ## doctor --json writes 108 bytes to stderr on a provider-less host
3
+ Issues in the current release that are known and not yet fixed. Report new ones with `loki crash` or at https://github.com/asklokesh/loki-mode/issues.
3
4
 
4
- `bash autonomy/loki doctor --json` on a host with NO provider CLI emits:
5
+ ## `loki verify` exit codes differ from the target table in three cases
5
6
 
6
- ```
7
- autonomy/loki: line 14066: required: command not found
8
- autonomy/loki: line 14066: status: command not found
9
- ```
7
+ | Input | Command | Exit today | Target |
8
+ |---|---|---|---|
9
+ | Empty diff (a git repo with no changes vs base) | `loki verify` | 1 (CONCERNS) | 3 |
10
+ | Not a git directory | `loki verify` | 1 (CONCERNS) | 2 |
11
+ | Unknown flag | `loki verify` with a flag it does not know | 3 | 64 |
10
12
 
11
- **Not user-affecting, and not a JSON defect.** stdout is 5176 bytes of valid
12
- JSON; only stderr is polluted. Every `doctor --json` assertion in the repo
13
- discards stderr (`tests/test-airgap-commands.sh:50`,
14
- `tests/test-doctor-ci-gateable.sh:46,84,86`).
15
- `tests/test-e2e-features.sh:104` was the lone outlier using `2>&1` and has been
16
- brought into line.
13
+ Changing these is a breaking change for CI gates, so it waits for a planned release. Details: [exit-codes.md](exit-codes.md#known-gaps).
17
14
 
18
- **Attribution:** introduced this session. `git show 0416810d:autonomy/loki`
19
- (v9.48.2) emits 0 bytes on the same host; HEAD emits 108. The region was last
20
- touched by `56e03374 feat(doctor): show provider availability`.
21
-
22
- **Six hypotheses tested and REFUTED, so the next person does not repeat them:**
23
-
24
- 1. Word-splitting of `$_provider_availability` at `:14066` -- the assignment is
25
- correctly quoted; reproduced in isolation as OK.
26
- 2. `provider_availability_json` emitting to stderr -- 0 bytes, clean 353-byte
27
- JSON in isolation.
28
- 3. Its callees `auto_detect_provider` / `check_provider_installed` -- both
29
- silent.
30
- 4. The JSON value's content -- `required` and `status` appear 0 times in it.
31
- 5. The value being multi-line and breaking the env-assignment chain -- forcing
32
- `LOKI_PROVIDER_AVAILABILITY=""` as a literal STILL reproduces.
33
- 6. `render_provider_availability` -- silent in isolation, and disabling the call
34
- still reproduces.
35
-
36
- **Also known:** `bash -n` parses the file clean; sourcing the file and calling
37
- `cmd_doctor_json` directly emits 0 bytes, while executing the file emits 108.
38
- That difference (streaming read vs single parse) is the strongest remaining
39
- lead. The words `required` and `status` are python identifiers at `:14085-14098`
40
- inside the `python3 -c "` string that opens at `:14069`.
15
+ ## `loki start` uses the older engine
41
16
 
17
+ `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine. `loki start ./prd.md` still routes to the older engine, which is being removed. Prefer `loki owner/repo#N` or `loki "<task>"`.
@@ -0,0 +1,24 @@
1
+ # Loki traces in Grafana, Honeycomb and Datadog
2
+
3
+ Loki exports OTLP/HTTP JSON traces to `LOKI_OTEL_ENDPOINT` (path `/v1/traces`). With `LOKI_OTEL_GENAI=1` the engine10 events map to `gen_ai` spans: `invoke_agent loki` for the run, `stage <name>` per stage, `execute_tool <name>` per tool call. Prompt and completion content never reach a span, and unknown token usage is absent, not 0.
4
+
5
+ The collector config `config/otel-collector/loki-collector.yaml` fans those spans out to three backends.
6
+
7
+ ## Use it
8
+
9
+ 1. Set the credentials for the vendors you use (the config reads them from the environment, nothing is stored in the file):
10
+ - Grafana Cloud: `GRAFANA_OTLP_ENDPOINT`, `GRAFANA_OTLP_AUTH` (the full header value, `Basic <base64 instanceId:token>`).
11
+ - Honeycomb: `HONEYCOMB_API_KEY` (ingest key).
12
+ - Datadog: `DD_API_KEY`, `DD_SITE` (for example `datadoghq.com`). Needs a collector build that includes the Datadog exporter (collector-contrib).
13
+ 2. Start the collector: `otelcol-contrib --config config/otel-collector/loki-collector.yaml`.
14
+ 3. Point Loki at it: `LOKI_OTEL_ENDPOINT=http://localhost:4318 LOKI_OTEL_GENAI=1 loki start ...`.
15
+
16
+ To use a subset of vendors, edit only `service.pipelines.traces.exporters` and list the vendors you use. The collector validates every defined exporter even when it is not listed, so the required fields of the other vendors carry inert defaults (`https://unset.invalid` for the Grafana endpoint, `unset` for the Datadog key, `datadoghq.com` for the Datadog site). Those defaults are never used by a vendor that is not in the list, and are not credentials. A listed vendor with its variables unset sends to the inert default and fails at export time, so set the variables for every vendor you list.
17
+
18
+ ## Receipt link
19
+
20
+ When tracing was on, the receipt carries a signed `trace_id` (see `docs/AGENT-CHANGE-RECEIPT.md`). Search for that id in the backend to open the run's trace.
21
+
22
+ ## Offline check
23
+
24
+ `bash tests/test-otel-collector-config.sh` parses the config, asserts the receiver, processor, exporters and traces pipeline, asserts every credential is an `${env:NAME}` placeholder (an optional `:-default` is allowed and must not be key-shaped), asserts that every required field still resolves to a non-empty default when a vendor's variables are unset, and maps the deterministic fixture in `tests/fixtures/otel/` (fixed run id and timestamps) to the golden span list. It makes no network call. When `otelcol-contrib` is on PATH it also runs `otelcol-contrib validate` with only `HONEYCOMB_API_KEY` set; that step is skipped, not passed, when the binary is absent. It does not contact a vendor; import into each vendor UI is not tested.
@@ -0,0 +1,32 @@
1
+ # Routing evidence
2
+
3
+ Measurements cited by provider and routing code. Each entry records the number,
4
+ its source and the date it was taken. Code comments point here instead of
5
+ carrying the figures.
6
+
7
+ ## Cost parity: MiniMax M2.5 vs Claude Opus 4.6
8
+
9
+ Status: a SINGLE internal run, not re-measured. Do not use it to drive routing
10
+ or in any external claim until it is re-derived (issue 210).
11
+
12
+ - Benchmark: SWE-bench, uniform scaffold.
13
+ - Harness: mini-swe-agent v2.0.0.
14
+ - Date: 2026-02-17.
15
+ - MiniMax M2.5: resolved 75.8 at $36.64 total.
16
+ - Claude Opus 4.6: resolved 75.6 at $275.76 total.
17
+ - Derived: an open model matching frontier accuracy at ~7.5x lower cost.
18
+ - Source: cited from the cost-context comment that previously lived in
19
+ providers/opencode.sh; competitive context in docs/COMPETITIVE-INTEL-2026-09.md
20
+ item 3.
21
+
22
+ ## opencode viability
23
+
24
+ Date verified: 2026-07-29/30.
25
+
26
+ - Source opencode.ai/docs/providers documents 75+ providers and custom
27
+ OpenAI-compatible endpoints.
28
+ - Source anomalyco/opencode: 190,871 stars, release v1.18.9 (2026-07-28),
29
+ pushed the same week.
30
+ - Source aider: last release v0.86.0 from 2025-08-09.
31
+ - Roo Code is archived; Continue is read-only.
32
+ - CLI surface checked against the installed opencode v1.17.9.
@@ -0,0 +1,161 @@
1
+ # Testing
2
+
3
+ This document describes the test strategy, test types, and how to run and configure tests for Loki Mode.
4
+
5
+ Loki Mode is a polyglot codebase. Tests span three languages and runtimes:
6
+
7
+ - Bash (orchestration engine, CLI, councils, hooks)
8
+ - Python (dashboard API, memory system, benchmarks, MCP server)
9
+ - TypeScript / JavaScript (the Bun runner under `loki-ts/`, the Deno/Node API under `api/`, dashboard UI checks)
10
+
11
+ Because the product's central promise is verified completion ("Loki does not lie about done"), the test suite is treated as a trust layer, not a formality. Trust-surface code (completion councils, quality gates, evidence receipts, the Bun runner, memory integrity) is held to a higher bar: mutation testing, parity checks, and adversarial detectors back the standard unit and integration tests.
12
+
13
+ ## Test Strategy
14
+
15
+ 1. Test the trust surface hardest. Completion detection, override councils, the verified-completion evidence gate, and the RARV-C closure loop are the highest-risk paths. They get unit tests plus mutation testing plus cross-route parity checks.
16
+ 2. Cross-route parity is a first-class concern. Behavior must match between the legacy Bash route and the Bun (`loki-ts`) route. Parity is checked by `tests/test-bash-bun-parity.sh` and the per-command parity suites under `tests/` (for example, doctor-output text drift); there is no continuous parity workflow.
17
+ 3. Prefer real verification over mocked assertions. Dedicated detectors (`tests/detect-mock-problems.sh`, `tests/detect-semantic-test-problems.sh`, `tests/detect-test-mutations.sh`, `tests/detect-invariant-violations.sh`) flag tests that pass without exercising real logic.
18
+ 4. Local CI is the canonical pre-push gate. `scripts/local-ci.sh` mirrors the GitHub Actions workflows so failures are discovered on the developer machine, not after push. GitHub Actions is the post-push verifier.
19
+ 5. Run tests in matrices. Python runs across 3.10 through 3.13; the Node suite runs across the supported Node versions. Version-specific breakage (for example, a Python 3.13-only inode race) must be caught by the matrix.
20
+
21
+ ## Test Types
22
+
23
+ ### Unit tests
24
+
25
+ - Bash unit tests live under `tests/` (for example `tests/cli/`, `tests/council/`, `tests/memory/`) and are orchestrated by `tests/run-all-tests.sh`. They cover bootstrap, task queue, circuit breaker, agent timeout, state recovery, and the memory engine, among others. Several use function extraction: a helper is sourced out of `run.sh` and exercised in isolation. When a helper gains a new dependency, the extraction test must extract that dependency too, or the logic is silently skipped.
26
+ - Python unit tests are `tests/test_*.py` files (120+ modules) covering the classifier, composer, calibration, embeddings edge cases, event bus, compose port selection, app-runner PID recycling, and more. They run under `pytest`.
27
+ - TypeScript unit tests live under `loki-ts/tests/` (70+ `*.test.ts` files) and run under `bun test`. They cover the runner internals: state, prompt building, providers, budget, checkpoint, and shell utilities.
28
+ - Node/Deno unit tests are `*_test.ts` and `*.test.js` files under `api/` and `tests/` (protocols, observability, policies, audit, integrations), run with `node --test`.
29
+
30
+ ### Integration tests
31
+
32
+ - `tests/integration/` holds the integration suite, run via `bash tests/integration/run_integration_suite.sh` (also exposed as `npm run test:integration`).
33
+ - `tests/integrations/` covers external system integrations (GitHub, Jira, Slack), run with `node --test`.
34
+ - Managed-memory integration is gated behind flags and covered by `tests/managed_memory/` (flag matrix, SDK isolation, kill switch, shadow-write, retrieve).
35
+
36
+ ### End-to-end tests
37
+
38
+ - `tests/e2e/` and `tests/live/` contain end-to-end and live-path scenarios.
39
+ - Control Plane UI E2E lives in `packages/control-plane/test/e2e/` (Playwright, headless, loopback stub API).
40
+ - Docker E2E lives under `tests/docker/` with the `docker/Dockerfile.sandbox` image.
41
+ - Post-release distribution E2E is run after a release ships: install from the npm tarball, pull the Docker image, and exercise both the Bun and legacy-Bash routes on each channel.
42
+
43
+ ### Specialized test layers
44
+
45
+ - Mutation testing (`loki-ts`): Stryker mutates trust-surface modules (`src/runner/state.ts`, `build_prompt.ts`, `providers.ts`, `budget.ts`, `checkpoint.ts`, `src/util/shell.ts`). Config: `loki-ts/stryker.config.json`. Thresholds: break 50%, low 60%, high 80%.
46
+ - Parity tests: `tests/test-bash-bun-parity.sh` and the per-command parity suites verify the Bun and Bash routes agree.
47
+ - Integrity and quality detectors: shell scripts under `tests/` that detect mock-only tests, semantic test problems, test mutations, and invariant violations.
48
+
49
+ ## How to Run Tests
50
+
51
+ ### Quick start
52
+
53
+ ```bash
54
+ # Full default suite (bash syntax checks + node --test suites + managed-memory)
55
+ npm test
56
+
57
+ # Pre-push gate: mirrors every CI workflow. Run this before every git push.
58
+ bash scripts/local-ci.sh
59
+ ```
60
+
61
+ If `local-ci.sh` reports "DO NOT PUSH", do not push. Fix the failures and re-run.
62
+
63
+ ### By language and layer
64
+
65
+ ```bash
66
+ # Bash shell test suite
67
+ bash tests/run-all-tests.sh
68
+
69
+ # Python tests (all)
70
+ python3 -m pytest
71
+
72
+ # Python tests (single module)
73
+ python3 -m pytest tests/test_classifier.py -v
74
+
75
+ # TypeScript / Bun runner tests
76
+ cd loki-ts && bun test
77
+
78
+ # Bun runner type check
79
+ cd loki-ts && bun run typecheck
80
+
81
+ # Integration suite
82
+ npm run test:integration
83
+ # or
84
+ bash tests/integration/run_integration_suite.sh
85
+
86
+ # Control Plane tests
87
+ cd packages/control-plane && bun test ./test/
88
+ ```
89
+
90
+ ### Mutation testing (local)
91
+
92
+ ```bash
93
+ cd loki-ts && npx stryker run
94
+ ```
95
+
96
+ ### Syntax-only validation (fast smoke)
97
+
98
+ ```bash
99
+ bash -n autonomy/run.sh
100
+ bash -n autonomy/loki
101
+ bash -n autonomy/completion-council.sh
102
+ python3 -c "import ast, os; [ast.parse(open(f'dashboard/{f}').read()) for f in os.listdir('dashboard') if f.endswith('.py')]"
103
+ ```
104
+
105
+ ### Cleanup after test runs (mandatory)
106
+
107
+ Spawned processes and temp files must be cleaned up after any run that starts a server or test runner:
108
+
109
+ ```bash
110
+ lsof -ti:57374 | xargs kill -9 2>/dev/null || true
111
+ pkill -f "loki-run-" 2>/dev/null || true
112
+ rm -rf /tmp/loki-* /tmp/test-* /tmp/package /tmp/*.tgz 2>/dev/null || true
113
+
114
+ # Verify
115
+ ps -ef | grep -E "(loki|test)" | grep -v grep || echo "Clean"
116
+ ```
117
+
118
+ Note: never run `rm -rf /tmp/loki-*` while a live `loki` run is in progress; the orchestrator stages its run script at `/tmp/loki-run-*.sh`. Check `pgrep -f loki-run-` first.
119
+
120
+ ## Test Configuration
121
+
122
+ | Area | Tool | Config / entry point |
123
+ |---|---|---|
124
+ | Default test command | mixed (bash, node) | `package.json` `test` script |
125
+ | Bash suite | bash | `tests/run-all-tests.sh` |
126
+ | Python | pytest | invoked via `python3 -m pytest`; deps: `pytest`, `pytest-asyncio` |
127
+ | Bun runner | bun test | `loki-ts/package.json`, `loki-ts/bunfig.toml` |
128
+ | Node/Deno | `node --test` | `*_test.ts`, `*.test.js` |
129
+ | Mutation | Stryker | `loki-ts/stryker.config.json` |
130
+ | Control Plane UI E2E | Playwright | `packages/control-plane/test/e2e/` |
131
+ | Pre-push gate | bash | `scripts/local-ci.sh` |
132
+
133
+ Python test dependencies commonly required: `fastapi`, `httpx`, `pydantic`, `sqlalchemy[asyncio]`, `aiosqlite`, `uvicorn`. Install with pip before running the Python suite.
134
+
135
+ ## Coverage Goals
136
+
137
+ - No CI workflow collects or enforces a numeric line-coverage percentage. `bun test --coverage` can be run locally in `loki-ts`.
138
+ - Mutation-score thresholds for trust-surface modules: break at 50%, low at 60%, high at 80% (`loki-ts/stryker.config.json`).
139
+ - The Bash, Python and Bun suites do not currently enforce a numeric coverage percentage. Coverage of trust-surface logic is asserted through targeted unit tests, parity checks, and the mock/semantic/mutation detectors rather than a global percentage.
140
+
141
+ ## CI Integration
142
+
143
+ GitHub Actions workflows (under `.github/workflows/`) run on push and pull request:
144
+
145
+ | Workflow | File | What it runs |
146
+ |---|---|---|
147
+ | Tests | `test.yml` | Node suite (`npm test`), Python suite (`pytest`) across 3.10-3.13, shell suite (`tests/run-all-tests.sh`), Helm lint |
148
+ | Integrity audit | `integrity-audit.yml` | Repository and artifact integrity checks |
149
+ | Post-release smoke | `post-release-smoke.yml` | Smoke tests against published artifacts after a release |
150
+ | Security audit | `security-audit.yml` | Dependency and security scanning |
151
+ | SBOM | `sbom.yml` | Software bill of materials generation |
152
+
153
+ ### Local CI mirrors GitHub Actions
154
+
155
+ `scripts/local-ci.sh` is the canonical pre-push gate. It mirrors every GitHub Actions workflow: bun typecheck/test, the full `tests/run-all-tests.sh` shell suite (matching CI exactly, not a cherry-picked subset), npm pack contents, SBOM, license audit, npm audit, shellcheck, YAML parse, the no-emoji check, the no-`git add -A` check, and a cleanup probe.
156
+
157
+ Run it before every push. The Mac (developer machine) is the discovery channel; GitHub Actions is the post-push verifier. Distinguish real failures from local-environment false alarms (for example a missing `pytest-asyncio` in a Homebrew Python) before acting on a red result.
158
+
159
+ ### Release-time validation
160
+
161
+ Before a release is committed, the npm tarball is verified to contain the built dashboard and web-app artifacts, and a fresh global install is exercised end to end (`loki --version`, `loki web`, `/api/status`). After a release ships, post-release distribution validation runs across npm, Docker, and Homebrew on both the Bun and legacy-Bash routes.
@@ -90,8 +90,7 @@ your network, but the audit still counts it as required egress.
90
90
  Telemetry is ON by default for an individual interactive install and auto-off
91
91
  in CI, non-interactive, `LOKI_ENTERPRISE=true` and `LOKI_AIRGAP=true`
92
92
  contexts. The audit shows its real state. Every opt-out wins (`DO_NOT_TRACK=1`,
93
- `LOKI_TELEMETRY=off`, `loki telemetry off`). The adoption instrumentation added
94
- in v8.6.0 requires a second explicit opt-in on top of that -- see
93
+ `LOKI_TELEMETRY=off`, `loki telemetry off`). The adoption instrumentation requires a second explicit opt-in on top of that -- see
95
94
  [PRIVACY.md](./PRIVACY.md).
96
95
 
97
96
  ## Why `unknown` is the right answer offline
@@ -1,6 +1,6 @@
1
1
  # Alternative Installation Methods
2
2
 
3
- The recommended installation is via npm or Homebrew (see [README](../README.md#get-started-in-30-seconds)). These alternatives serve specific use cases.
3
+ The recommended installation is via npm or Homebrew (see [INSTALLATION.md](INSTALLATION.md)). These alternatives serve specific use cases.
4
4
 
5
5
  ---
6
6
 
@@ -16,7 +16,7 @@ git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
16
16
  ln -sf ~/.claude/skills/loki-mode ~/.codex/skills/loki-mode
17
17
 
18
18
  # Optionally add CLI to PATH:
19
- ln -sf ~/.claude/skills/loki-mode/autonomy/loki /usr/local/bin/loki
19
+ ln -sf ~/.claude/skills/loki-mode/bin/loki /usr/local/bin/loki
20
20
  ```
21
21
 
22
22
  **Update:** `cd ~/.claude/skills/loki-mode && git pull`
@@ -27,21 +27,21 @@ ln -sf ~/.claude/skills/loki-mode/autonomy/loki /usr/local/bin/loki
27
27
 
28
28
  ## Docker
29
29
 
30
- **Status:** Image exists on Docker Hub. Tags: `latest`, version-specific (e.g., `9.8.0`).
30
+ **Status:** Image exists on Docker Hub. Tags: `latest`, one per release version (for example `X.Y.Z`, matching the npm version).
31
31
 
32
32
  ```bash
33
33
  docker pull asklokesh/loki-mode:latest
34
34
  ```
35
35
 
36
- **Limitation:** Claude Code is an interactive CLI that requires API keys and terminal access. Running it inside a Docker container is not the standard workflow. Docker is useful for:
36
+ **Limitation:** The image ships the Claude Code CLI. Docker is useful for:
37
37
 
38
38
  - CI/CD sandbox execution (running `loki` in isolated environments)
39
39
  - Testing Loki Mode without modifying your local system
40
40
  - Air-gapped environments with pre-built images
41
41
 
42
- **Not recommended for:** Interactive Claude Code sessions. Use npm or Homebrew instead.
42
+ `loki docker <command>` runs any loki command in the image with the current folder mounted, so `.loki/` state and resume behave like the local CLI.
43
43
 
44
- See [DOCKER_README.md](../DOCKER_README.md) for Docker-specific usage instructions.
44
+ See [DOCKER.md](DOCKER.md) for Docker-specific usage instructions.
45
45
 
46
46
  ---
47
47
 
@@ -63,7 +63,7 @@ jobs:
63
63
  runs-on: ubuntu-latest
64
64
  steps:
65
65
  - uses: actions/checkout@v4
66
- - uses: asklokesh/loki-mode@v8.0.0
66
+ - uses: asklokesh/loki-mode@vX.Y.Z # pin a release tag
67
67
  with:
68
68
  github_token: ${{ secrets.GITHUB_TOKEN }}
69
69
  mode: review
@@ -75,7 +75,7 @@ jobs:
75
75
  ```
76
76
 
77
77
  **Prerequisites:**
78
- - API key for your provider (set as repository secret): `ANTHROPIC_API_KEY` (Claude, recommended) or `OPENAI_API_KEY` (Codex). `GOOGLE_API_KEY` was for the Gemini provider, which is DEPRECATED as of v7.5.18.
78
+ - API key for your provider (set as repository secret): `ANTHROPIC_API_KEY` (Claude, recommended) or `OPENAI_API_KEY` (Codex).
79
79
  - The action auto-installs `loki-mode` and `@anthropic-ai/claude-code`
80
80
 
81
81
  **Action Inputs:**
@@ -83,13 +83,13 @@ jobs:
83
83
  | Input | Default | Description |
84
84
  |-------|---------|-------------|
85
85
  | `mode` | `review` | `review`, `fix`, or `test` |
86
- | `provider` | `claude` | `claude` (recommended), `cline`, `codex`, `aider`, or `opencode`. `gemini` was REMOVED in v7.5.18. |
86
+ | `provider` | `claude` | `claude` (recommended), `cline`, `codex`, `aider`, or `opencode`. |
87
87
  | `budget_limit` | `5.00` | Max cost in USD (passed to the Loki 10 engine as `--max-cost`) |
88
88
  | `max_iterations` | `3` | Max RARV cycles |
89
89
  | `github_token` | (required) | GitHub token for PR comments |
90
90
  | `prd_file` | | Path to PRD file (for fix/test modes) |
91
91
 
92
- **Engine:** every mode runs the Loki 10 engine through `loki start "<task>" --no-pr --provider <name> --max-cost <usd>` (the same path as `loki start owner/repo#N`). The PRD file or PR diff is folded into the task text. The action never opens a PR itself (Rule of Two). A run that crosses the cap ends BUDGET_STOP (exit 3). The legacy `--simple` path is no longer used.
92
+ **Engine:** every mode runs the Loki 10 engine through `loki start "<task>" --no-pr --provider <name> --max-cost <usd>` (the same path as `loki start owner/repo#N`). The PRD file or PR diff is folded into the task text. The action never opens a PR itself (Rule of Two). A run that crosses the cap ends BUDGET_STOP (exit 3).
93
93
 
94
94
  **Modes:**
95
95
 
@@ -108,20 +108,10 @@ jobs:
108
108
  **Status:** Working. Release assets available for each version.
109
109
 
110
110
  ```bash
111
- # Download and extract to skills directory
112
- curl -sL https://github.com/asklokesh/loki-mode/archive/refs/tags/v8.0.0.tar.gz | tar xz
113
- mv loki-mode-8.0.0 ~/.claude/skills/loki-mode
111
+ # Download the latest release and extract to the skills directory
112
+ VERSION=$(npm view loki-mode version)
113
+ curl -sL https://github.com/asklokesh/loki-mode/archive/refs/tags/v${VERSION}.tar.gz | tar xz
114
+ mv loki-mode-${VERSION} ~/.claude/skills/loki-mode
114
115
  ```
115
116
 
116
117
  **Best for:** Offline or air-gapped environments, pinned version deployments.
117
-
118
- ---
119
-
120
- ## VS Code Extension (Deprecated)
121
-
122
- > **DEPRECATED as of v7.2.0.** The Loki Mode VS Code extension is no longer
123
- > maintained and is no longer published to the VS Code Marketplace. Use the
124
- > Control Plane instead (`loki dashboard`).
125
- > The `vscode-extension/` source remains in the repository for contributors who
126
- > want to build it locally. See
127
- > [INSTALLATION.md](INSTALLATION.md#vs-code-extension-deprecated) for details.