loki-mode 11.3.0 → 11.3.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 (215) hide show
  1. package/README.md +68 -650
  2. package/SKILL.md +4 -4
  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/prd-enrich.sh +1 -1
  10. package/autonomy/lib/voter-agents.sh +1 -1
  11. package/autonomy/loki +99 -75
  12. package/autonomy/run.sh +30 -18
  13. package/autonomy/sandbox.sh +1 -1
  14. package/autonomy/tui.sh +6 -5
  15. package/autonomy/verify.sh +1 -1
  16. package/bin/loki +166 -59
  17. package/completions/_loki +2 -0
  18. package/completions/loki.bash +2 -2
  19. package/dashboard/__init__.py +1 -1
  20. package/dashboard/server.py +25 -31
  21. package/docs/ARCHITECTURE.md +337 -0
  22. package/docs/BRANDING.md +124 -0
  23. package/docs/CLI-REFERENCE.md +7 -1
  24. package/docs/COMPONENTS.md +447 -0
  25. package/docs/DEPLOYMENT.md +9 -9
  26. package/docs/DOCKER.md +469 -0
  27. package/docs/INSTALLATION.md +67 -1045
  28. package/docs/KNOWN-ISSUES.md +11 -35
  29. package/docs/TESTING.md +161 -0
  30. package/docs/air-gapped.md +1 -2
  31. package/docs/alternative-installations.md +14 -24
  32. package/docs/architecture/DECISIONS.md +333 -0
  33. package/docs/audit-logging.md +7 -7
  34. package/docs/authentication.md +3 -3
  35. package/docs/authorization.md +1 -1
  36. package/docs/certification/04-production-deployment/lab.md +6 -6
  37. package/docs/certification/04-production-deployment/lesson.md +4 -4
  38. package/docs/certification/README.md +1 -1
  39. package/docs/control-plane-container.md +2 -2
  40. package/docs/dev/real-run.md +34 -0
  41. package/docs/dev/release-checklist.md +2 -2
  42. package/docs/exit-codes.md +3 -3
  43. package/docs/git-workflow.md +3 -3
  44. package/docs/metrics.md +37 -55
  45. package/docs/network-security.md +1 -1
  46. package/docs/siem-integration.md +5 -5
  47. package/docs/v10/CLI-MODERN.md +4 -3
  48. package/docs/v10/DECISIONS.md +44 -0
  49. package/docs/v10/DEPS.md +22 -22
  50. package/docs/v10/ENGINE.md +1 -1
  51. package/docs/v10/FAILURE-CLASSES.md +118 -1
  52. package/docs/v10/FOUNDER-QUEUE.md +1 -0
  53. package/docs/v10/GUARDS.md +13 -0
  54. package/docs/v10/LEGACY-REMOVAL.md +4 -6
  55. package/docs/v10/METRICS.md +2 -2
  56. package/docs/v10/MODERNIZE.md +1 -1
  57. package/docs/v10/OPERATING-MODEL.md +2 -1
  58. package/docs/v10/PROGRESS.md +29 -0
  59. package/docs/v11/COST-HALF.md +352 -0
  60. package/docs/v11/MARKET-SLICES.md +315 -0
  61. package/docs/v11/REGISTRIES.md +730 -0
  62. package/loki-ts/data/model-pricing.json +52 -24
  63. package/loki-ts/dist/loki.js +1036 -957
  64. package/mcp/__init__.py +1 -1
  65. package/package.json +1 -1
  66. package/packages/control-plane/dist/server.js +2467 -736
  67. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  68. package/src/protocols/mcp-client.js +6 -2
  69. package/src/protocols/mcp-server.js +13 -3
  70. package/tools/audit-docs.py +1 -1
  71. package/web-app/dist/assets/{AdminPage-D_e45uTw.js → AdminPage-CMkHNJbF.js} +1 -1
  72. package/web-app/dist/assets/{Avatar-T3nIpoaf.js → Avatar-BJyjV7Zi.js} +1 -1
  73. package/web-app/dist/assets/{Badge-BKqb59pP.js → Badge-D572l0uq.js} +1 -1
  74. package/web-app/dist/assets/{Button-DjVlkh8_.js → Button-T4BnOZgl.js} +1 -1
  75. package/web-app/dist/assets/{CockpitPage-DXJgLGmh.js → CockpitPage-Cj_GFsNn.js} +1 -1
  76. package/web-app/dist/assets/{ComparePage-BRP_eVc_.js → ComparePage-A8m4ZXak.js} +1 -1
  77. package/web-app/dist/assets/{ErrorBoundary-CLjpGLjC.js → ErrorBoundary-hugCg5yg.js} +1 -1
  78. package/web-app/dist/assets/{EvidenceReceiptPanel-DX-vb4Xy.js → EvidenceReceiptPanel-CuJKDC2G.js} +1 -1
  79. package/web-app/dist/assets/{GitHubIssuesPanel-214HVHtX.js → GitHubIssuesPanel-BYGKjarC.js} +1 -1
  80. package/web-app/dist/assets/{GitHubPRsPanel-BEiZKc4t.js → GitHubPRsPanel-c7sFIJlf.js} +1 -1
  81. package/web-app/dist/assets/{HomePage-VvMHS5ga.js → HomePage-A1MIkG2P.js} +2 -2
  82. package/web-app/dist/assets/{LoginPage-5WD-v7n3.js → LoginPage-8KQMRhtR.js} +1 -1
  83. package/web-app/dist/assets/{MagicPage-DUQT_Jye.js → MagicPage-C05QW2Lx.js} +1 -1
  84. package/web-app/dist/assets/{MetricsPage-lga-z79v.js → MetricsPage-Oukv5hme.js} +1 -1
  85. package/web-app/dist/assets/{NotFoundPage-CGhBX3G1.js → NotFoundPage-DKIwsawz.js} +1 -1
  86. package/web-app/dist/assets/{ProjectPage-CdzF2GzZ.js → ProjectPage-DwFRPLCG.js} +3 -3
  87. package/web-app/dist/assets/{ProjectsPage-DRG64N8s.js → ProjectsPage-CgY4YYDX.js} +1 -1
  88. package/web-app/dist/assets/{SettingsPage-5fzW9Frb.js → SettingsPage-BpfcSjUA.js} +1 -1
  89. package/web-app/dist/assets/{ShowcasePage-DrTdxO4y.js → ShowcasePage-BqBakC4K.js} +1 -1
  90. package/web-app/dist/assets/{SystemSettingsPage-C9Mqs6Rd.js → SystemSettingsPage-CZLu5VB0.js} +1 -1
  91. package/web-app/dist/assets/{TeamsPage-CUGPdSWo.js → TeamsPage-D55S1jKz.js} +1 -1
  92. package/web-app/dist/assets/{TemplatesPage-CNraDY0F.js → TemplatesPage-D3SydvxN.js} +1 -1
  93. package/web-app/dist/assets/{TerminalOutput-BIu_6Pea.js → TerminalOutput-hNg8G1-e.js} +1 -1
  94. package/web-app/dist/assets/{activity-Bk-kgqaf.js → activity-D2C0VagO.js} +1 -1
  95. package/web-app/dist/assets/{bell-BXmUdmo8.js → bell-CMvYi36w.js} +1 -1
  96. package/web-app/dist/assets/{bot-CiuzXxUR.js → bot-BvtQ6lmo.js} +1 -1
  97. package/web-app/dist/assets/{check-BEzjXppd.js → check-B13xkXed.js} +1 -1
  98. package/web-app/dist/assets/{chevron-left-AYWCXHf8.js → chevron-left-emu6r49E.js} +1 -1
  99. package/web-app/dist/assets/{circle-alert-BNg2uSRq.js → circle-alert-CExlwjuy.js} +1 -1
  100. package/web-app/dist/assets/{clock-DTj0kkGT.js → clock-D7Uas3oL.js} +1 -1
  101. package/web-app/dist/assets/{cloud-x4nTDBLT.js → cloud-CkB4S86C.js} +1 -1
  102. package/web-app/dist/assets/{code-xml-BVh_MLrk.js → code-xml-SL9IIWIn.js} +1 -1
  103. package/web-app/dist/assets/{database-DdfBaowG.js → database-BQFkd7t1.js} +1 -1
  104. package/web-app/dist/assets/{dollar-sign-XuYFmAOY.js → dollar-sign-qHmnNYsU.js} +1 -1
  105. package/web-app/dist/assets/{file-code-corner-D4cRnmeL.js → file-code-corner-C2YUDP0K.js} +1 -1
  106. package/web-app/dist/assets/{file-plus-CyoVlHc_.js → file-plus-C_ooIkDe.js} +1 -1
  107. package/web-app/dist/assets/{globe-Y6IK2RPW.js → globe-CQ-GL485.js} +1 -1
  108. package/web-app/dist/assets/{hammer-BKzr9VZI.js → hammer-U05L_D7V.js} +1 -1
  109. package/web-app/dist/assets/{index-B20cSx5G.js → index-CooHd7I-.js} +3 -3
  110. package/web-app/dist/assets/{layers-DebNOhGS.js → layers-Buo17rjW.js} +1 -1
  111. package/web-app/dist/assets/{loader-circle-DyGbrEgd.js → loader-circle-15vK3oV1.js} +1 -1
  112. package/web-app/dist/assets/{lock-BKPpyt20.js → lock-BeXLebuJ.js} +1 -1
  113. package/web-app/dist/assets/{package-egF5Wi4y.js → package-MVh_6-6R.js} +1 -1
  114. package/web-app/dist/assets/{plus-OiEgKIc-.js → plus-Dh_nd9vS.js} +1 -1
  115. package/web-app/dist/assets/{refresh-cw-CzKvrONq.js → refresh-cw-C9cBJEAT.js} +1 -1
  116. package/web-app/dist/assets/{rotate-ccw-Bu2mII0p.js → rotate-ccw-D3PAtzST.js} +1 -1
  117. package/web-app/dist/assets/{scroll-text-CSkiyax8.js → scroll-text-DZCoXQjo.js} +1 -1
  118. package/web-app/dist/assets/{server-DlPthJFw.js → server-OCOLI5J_.js} +1 -1
  119. package/web-app/dist/assets/{shield-alert-CbpHWQQX.js → shield-alert-oVhmf1_h.js} +1 -1
  120. package/web-app/dist/assets/{thumbs-up-DgGpZe-Q.js → thumbs-up-B-kbX4vN.js} +1 -1
  121. package/web-app/dist/assets/{trash-2-BV3GlCB-.js → trash-2-EL6moveW.js} +1 -1
  122. package/web-app/dist/assets/{trending-down-Y4TJtXhD.js → trending-down-Cl3kjpsx.js} +1 -1
  123. package/web-app/dist/assets/{trending-up-DsDNoHZY.js → trending-up-DST7I6M2.js} +1 -1
  124. package/web-app/dist/assets/{upload-gkThrc_I.js → upload-CUOT780G.js} +1 -1
  125. package/web-app/dist/assets/{usePolling-jpNSeNAe.js → usePolling-Djmt90eb.js} +1 -1
  126. package/web-app/dist/assets/{user-3Zez1WOK.js → user-BRBohA6J.js} +1 -1
  127. package/web-app/dist/index.html +1 -1
  128. package/docs/ARCHITECTURE-OVERVIEW.md +0 -209
  129. package/docs/AUTONOMI-ECOSYSTEM.md +0 -107
  130. package/docs/COCKPIT-SPEC.md +0 -72
  131. package/docs/COCKPIT-UX-MANDATE.md +0 -53
  132. package/docs/COMPETITIVE-ANALYSIS.md +0 -303
  133. package/docs/COMPETITIVE-NEXT-10.md +0 -316
  134. package/docs/COMPETITIVE-RALPH-ZEROSHOT-2026-07-08.md +0 -81
  135. package/docs/DASHBOARD-9.12-EVIDENCE.md +0 -97
  136. package/docs/DASHBOARD-ARCHITECTURE.md +0 -425
  137. package/docs/DASHBOARD_V2_CHECKLIST.md +0 -243
  138. package/docs/DEMOS.md +0 -63
  139. package/docs/ENTERPRISE-IDENTITY-ROADMAP.md +0 -206
  140. package/docs/EVIDENCE-RECEIPT-BUILD-APPLICABILITY.md +0 -79
  141. package/docs/FEAT-PRDREUSE-DOCKER-PLAN.md +0 -144
  142. package/docs/GATE-FAILURE-TRIAGE.md +0 -254
  143. package/docs/HANDOFF-2026-08-03.md +0 -439
  144. package/docs/LOOP-CANDIDATE-PROPOSAL-v1.md +0 -167
  145. package/docs/LOOP-HARNESS-AUDIT.md +0 -684
  146. package/docs/MERGE-DEDUP-MAP.md +0 -420
  147. package/docs/MERGE-ROUTE-MAP.md +0 -139
  148. package/docs/MODEL-REGISTRY-PLAN.md +0 -155
  149. package/docs/OUTCOME-FRONTIER.md +0 -536
  150. package/docs/P2-SPEC-ROBUSTNESS-PLAN.md +0 -192
  151. package/docs/PLANS-INDEX.md +0 -32
  152. package/docs/PRD-REUSE-DONE-RECOGNITION-PLAN.md +0 -536
  153. package/docs/PROMPT-ABLATION-RESULT.md +0 -97
  154. package/docs/R4-TRUST-TRAJECTORY-DESIGN.md +0 -127
  155. package/docs/R5-AUTO-WIKI-DESIGN.md +0 -137
  156. package/docs/R6-ROLLBACK-CHECKPOINT-PLAN.md +0 -107
  157. package/docs/R7-ZERO-CONFIG-FIRST-RUN-PLAN.md +0 -137
  158. package/docs/R8-SHAREABLE-TEAM-ASSETS-PLAN.md +0 -129
  159. package/docs/R9-OPEN-CORE-HOOKS-PLAN.md +0 -113
  160. package/docs/RARV-C-100X-PLAN.md +0 -286
  161. package/docs/RARV-C-LOOP-EFFICIENCY-PLAN.md +0 -470
  162. package/docs/SHAREABLE-PROOF-PLAN.md +0 -194
  163. package/docs/SONNET5-DEFAULT-PLAN.md +0 -157
  164. package/docs/SPEED-AND-FIRST-PASS-PLAN.md +0 -281
  165. package/docs/STALE-STATE-AUDIT.md +0 -174
  166. package/docs/SYNERGY-TASKS.md +0 -143
  167. package/docs/TASKLIST-ACCURACY-PLAN.md +0 -355
  168. package/docs/TOP-100-BACKLOG.md +0 -159
  169. package/docs/V8-ACCEPTANCE-TRIAGE-2026-07-24.md +0 -114
  170. package/docs/V8-COMPLEXITY-AUDIT-2026-07-24.md +0 -45
  171. package/docs/V8-MAJOR-RELEASE-PLAN.md +0 -137
  172. package/docs/V8-OVERNIGHT-PLAN-2026-07-25.md +0 -82
  173. package/docs/V8-SDK-RESEARCH-RAW.md +0 -129
  174. package/docs/WELCOME-OPENER-PLAN.md +0 -106
  175. package/docs/adoption-baseline-2026-07-31.md +0 -84
  176. package/docs/architecture/bmad-integration-epic.md +0 -271
  177. package/docs/architecture/bmad-integration-review.md +0 -86
  178. package/docs/architecture/bmad-integration-validation.md +0 -249
  179. package/docs/architecture/bmad-loki-voice-agent-council-analysis.md +0 -61
  180. package/docs/auto-claude-comparison.md +0 -250
  181. package/docs/bug-fixes/agent-01-cli-fixes.md +0 -101
  182. package/docs/bug-fixes/agent-02-purplelab-fixes.md +0 -88
  183. package/docs/bug-fixes/agent-03-dashboard-fixes.md +0 -119
  184. package/docs/bug-fixes/agent-04-memory-fixes.md +0 -105
  185. package/docs/bug-fixes/agent-05-provider-fixes.md +0 -86
  186. package/docs/bug-fixes/agent-06-integration-fixes.md +0 -101
  187. package/docs/bug-fixes/agent-07-dash-run-fixes.md +0 -101
  188. package/docs/bug-fixes/agent-08-docker-fixes.md +0 -164
  189. package/docs/bug-fixes/agent-09-e2e-build-fixes.md +0 -69
  190. package/docs/bug-fixes/agent-10-e2e-fullstack-fixes.md +0 -102
  191. package/docs/bug-fixes/agent-11-e2e-session-fixes.md +0 -70
  192. package/docs/bug-fixes/agent-12-scenario-fixes.md +0 -120
  193. package/docs/bug-fixes/agent-13-enterprise-fixes.md +0 -143
  194. package/docs/bug-fixes/agent-14-uat-newuser-fixes.md +0 -88
  195. package/docs/bug-fixes/agent-15-uat-poweruser-fixes.md +0 -132
  196. package/docs/bug-fixes/agent-19-code-review.md +0 -316
  197. package/docs/bug-fixes/agent-20-architecture-review.md +0 -331
  198. package/docs/competitive/bolt-new-analysis.md +0 -579
  199. package/docs/competitive/emergence-others-analysis.md +0 -605
  200. package/docs/competitive/replit-lovable-analysis.md +0 -622
  201. package/docs/dashboard-guide.md +0 -487
  202. package/docs/enterprise/migration.md +0 -265
  203. package/docs/history/one-run-audit.md +0 -304
  204. package/docs/plans/FORGE-AUTONOMOUS-QUEUE.md +0 -312
  205. package/docs/plans/ULTRAPLAN-FORGE-BAAS.md +0 -612
  206. package/docs/plans/UT2-6-LSP-DIAGNOSTIC-BROADCAST.md +0 -394
  207. package/docs/prd-purple-lab-ide.md +0 -152
  208. package/docs/prd-purple-lab-platform-v2.md +0 -223
  209. package/docs/prd-purple-lab-platform.md +0 -319
  210. package/docs/retrospectives/v7.5.15-fleet-postmortem.md +0 -325
  211. package/docs/retrospectives/v7.5.15-honesty-audit.md +0 -136
  212. package/docs/retrospectives/v7.5.15-llm-failure-modes.md +0 -49
  213. package/docs/show-hn-post.md +0 -46
  214. package/docs/test-scenarios/enterprise-scenarios.md +0 -732
  215. package/docs/thick2thin.md +0 -173
@@ -6,7 +6,7 @@ Audit trails for Loki Mode operations.
6
6
 
7
7
  ## Overview
8
8
 
9
- Audit logging captures significant events for security monitoring, debugging, and usage analytics. Audit logging is **enabled by default** as of v5.37.0.
9
+ Audit logging captures significant events for security monitoring, debugging, and usage analytics. Audit logging is **enabled by default**.
10
10
 
11
11
  ## Configuration
12
12
 
@@ -31,7 +31,7 @@ enterprise:
31
31
  retention_days: 90 # Days to keep logs
32
32
  max_file_size: 100 # MB per file before rotation
33
33
  compress: true # Compress rotated files
34
- integrity_check: true # Enable SHA-256 chain hashing (v5.38.0)
34
+ integrity_check: true # Enable SHA-256 chain hashing
35
35
  syslog_enabled: false # Forward to external syslog
36
36
  exclude_events: # Events to exclude
37
37
  - api.request
@@ -123,7 +123,7 @@ Audit logs use JSON Lines format (one JSON object per line):
123
123
  "metadata": {
124
124
  "hostname": "dev-machine",
125
125
  "pid": 12345,
126
- "version": "5.42.2"
126
+ "version": "X.Y.Z"
127
127
  }
128
128
  }
129
129
  ```
@@ -139,7 +139,7 @@ Audit logs use JSON Lines format (one JSON object per line):
139
139
  | `resource` | string | Resource affected (optional) |
140
140
  | `details` | object | Event-specific details |
141
141
  | `metadata` | object | System metadata (hostname, PID, version) |
142
- | `chain_hash` | string | SHA-256 chain hash for integrity (v5.38.0) |
142
+ | `chain_hash` | string | SHA-256 chain hash for integrity |
143
143
 
144
144
  ## Log Location
145
145
 
@@ -278,7 +278,7 @@ Response:
278
278
  }
279
279
  ```
280
280
 
281
- ## Log Integrity (v5.38.0)
281
+ ## Log Integrity
282
282
 
283
283
  Audit entries are chain-hashed with SHA-256 for tamper detection.
284
284
 
@@ -325,7 +325,7 @@ empty chain.
325
325
  export LOKI_AUDIT_NO_INTEGRITY=true
326
326
  ```
327
327
 
328
- ## SIEM Integration (v5.38.0)
328
+ ## SIEM Integration
329
329
 
330
330
  ### Syslog Forwarding
331
331
 
@@ -392,7 +392,7 @@ EOF
392
392
  systemctl restart filebeat
393
393
  ```
394
394
 
395
- ## Agent Action Audit (v5.38.0)
395
+ ## Agent Action Audit
396
396
 
397
397
  In addition to dashboard audit logs, agent actions are tracked separately.
398
398
 
@@ -9,7 +9,7 @@ Authentication and access control for Loki Mode dashboard and API.
9
9
  Loki Mode supports two authentication methods:
10
10
 
11
11
  1. **Token-based authentication** - API tokens with scopes and expiration
12
- 2. **OIDC/SSO integration** (v5.36.0) - Google, Azure AD, Okta
12
+ 2. **OIDC/SSO integration** - Google, Azure AD, Okta
13
13
 
14
14
  Both methods can be enabled simultaneously and provide access to the dashboard API at `http://localhost:57374` (or `https://` with TLS enabled).
15
15
 
@@ -97,7 +97,7 @@ Scope hierarchy:
97
97
  - `control` includes `write` and `read`
98
98
  - `write` includes `read`
99
99
 
100
- ### Roles (v5.37.0)
100
+ ### Roles
101
101
 
102
102
  Predefined roles map to common access patterns:
103
103
 
@@ -120,7 +120,7 @@ Generate token with custom scopes:
120
120
  loki enterprise token generate custom-bot --scopes "read,audit" --expires 30
121
121
  ```
122
122
 
123
- ## OIDC/SSO Authentication (v5.36.0)
123
+ ## OIDC/SSO Authentication
124
124
 
125
125
  Enterprise identity provider integration for centralized authentication.
126
126
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  > **Control Plane migration:** the classic dashboard UI and port 57374 are removed in Loki Mode 10.8; the UI is the Control Plane (`loki dashboard`, default port 47821). Examples below that use port 57374 or `/api/*` describe the legacy API server. See [control-plane-migration.md](control-plane-migration.md) for the `/v1/*` mapping and what is not yet available.
4
4
 
5
- Role-based access control (RBAC) for Loki Mode (v5.37.0).
5
+ Role-based access control (RBAC) for Loki Mode.
6
6
 
7
7
  ## Overview
8
8
 
@@ -14,10 +14,10 @@ Deploy Loki Mode using Docker Compose, verify the dashboard is accessible, and c
14
14
 
15
15
  ## Step 1: Review the Docker Compose Configuration
16
16
 
17
- Examine the `docker-compose.yml` at the repository root:
17
+ Examine `docker/docker-compose.yml`:
18
18
 
19
19
  ```bash
20
- cat docker-compose.yml
20
+ cat docker/docker-compose.yml
21
21
  ```
22
22
 
23
23
  Key elements to note:
@@ -32,7 +32,7 @@ Key elements to note:
32
32
  docker-compose build
33
33
  ```
34
34
 
35
- This builds from the `Dockerfile` which installs:
35
+ This builds from `docker/Dockerfile`, which installs:
36
36
  - Ubuntu 24.04 base
37
37
  - Node.js 20 LTS
38
38
  - Python 3 with venv support
@@ -68,7 +68,7 @@ Start the container (this will invoke the AI provider and may incur costs):
68
68
 
69
69
  ```bash
70
70
  # Pass your API key through to the container
71
- ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY docker-compose run \
71
+ ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY docker compose -f docker/docker-compose.yml run \
72
72
  -e ANTHROPIC_API_KEY \
73
73
  loki start ./prd.md
74
74
  ```
@@ -96,7 +96,7 @@ Test resource configuration by modifying environment variables:
96
96
 
97
97
  ```bash
98
98
  # Run with budget limit and reduced parallel agents
99
- docker-compose run \
99
+ docker compose -f docker/docker-compose.yml run \
100
100
  -e ANTHROPIC_API_KEY \
101
101
  -e LOKI_BUDGET_LIMIT=5.00 \
102
102
  -e LOKI_MAX_PARALLEL_AGENTS=3 \
@@ -141,7 +141,7 @@ loki secrets status
141
141
  ## Verification Checklist
142
142
 
143
143
  - [ ] `docker-compose build` completes without errors
144
- - [ ] `docker-compose run loki version` outputs the correct version
144
+ - [ ] `docker compose -f docker/docker-compose.yml run loki version` outputs the correct version
145
145
  - [ ] The dashboard is accessible at `http://localhost:57374`
146
146
  - [ ] You can pass environment variables to configure resource limits
147
147
  - [ ] `loki sandbox` commands work (build, start, status, stop)
@@ -28,11 +28,11 @@ docker pull asklokesh/loki-mode:5.52.0
28
28
  docker run -it -v $(pwd):/workspace asklokesh/loki-mode:latest
29
29
  ```
30
30
 
31
- The Dockerfile is at the repository root (`Dockerfile`). A separate `Dockerfile.sandbox` exists for sandboxed execution.
31
+ The Dockerfile is `docker/Dockerfile`. A separate `docker/Dockerfile.sandbox` exists for sandboxed execution.
32
32
 
33
33
  ### Docker Compose
34
34
 
35
- The `docker-compose.yml` at the repository root provides a ready-to-use configuration:
35
+ `docker/docker-compose.yml` provides a ready-to-use configuration:
36
36
 
37
37
  ```yaml
38
38
  services:
@@ -59,7 +59,7 @@ services:
59
59
  Start with:
60
60
 
61
61
  ```bash
62
- docker-compose run loki start ./prd.md
62
+ docker compose -f docker/docker-compose.yml run loki start ./prd.md
63
63
  ```
64
64
 
65
65
  Key volume mounts:
@@ -86,7 +86,7 @@ Or pass `--sandbox` to the start command:
86
86
  loki start --sandbox ./prd.md
87
87
  ```
88
88
 
89
- The sandbox uses `Dockerfile.sandbox` which adds additional isolation constraints.
89
+ The sandbox uses `docker/Dockerfile.sandbox` which adds additional isolation constraints.
90
90
 
91
91
  ## Security Hardening
92
92
 
@@ -26,7 +26,7 @@ The Autonomi Certified Developer certification validates your knowledge of Loki
26
26
 
27
27
  - Familiarity with command-line tools (bash, git, npm)
28
28
  - Basic understanding of AI/LLM concepts (prompts, models, tokens)
29
- - Node.js 18+ installed
29
+ - Node.js 20+ installed
30
30
  - A supported AI provider CLI installed (Claude Code, Cline, Codex CLI, Aider, or opencode)
31
31
 
32
32
  ## How to Use This Program
@@ -1,7 +1,7 @@
1
1
  # Run the Control Plane in a container
2
2
 
3
3
  The Control Plane (run ingest API plus UI) ships as its own small image built
4
- from `Dockerfile.control-plane`. It serves on port 47821, stores its SQLite
4
+ from `docker/Dockerfile.control-plane`. It serves on port 47821, stores its SQLite
5
5
  database under `/data`, runs as a non-root user and contains no secrets.
6
6
 
7
7
  The image binds 0.0.0.0, so `LOKI_CONTROL_TOKEN` is required at run time. Without
@@ -13,7 +13,7 @@ server prints a warning when you do.
13
13
  ## Docker
14
14
 
15
15
  ```bash
16
- docker build -f Dockerfile.control-plane -t loki-control-plane .
16
+ docker build -f docker/Dockerfile.control-plane -t loki-control-plane .
17
17
  docker run -d -p 47821:47821 -e LOKI_CONTROL_TOKEN="$(openssl rand -hex 32)" -v loki-control:/data loki-control-plane
18
18
  LOKI_CONTROL_URL=http://localhost:47821 loki control status
19
19
  ```
@@ -0,0 +1,34 @@
1
+ # real-run: real scenarios against the installed tarball
2
+
3
+ `scripts/real-run.sh <scenario>` exists because every real bug found in the D91 push came from a real run, not a fixture. It never touches the repo checkout: it runs `npm pack --ignore-scripts` (so the committed `loki-ts/dist` is what ships), installs the tarball into a temp prefix under a run-owned temp dir, and runs the scenario with `LOKI_NO_SKILL_LINK_HEAL=1 LOKI_NO_BROWSER=1` against that installed `loki`.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ bash scripts/real-run.sh --dry trivial-sum # pack + install + fixture, no model call (CI-safe)
9
+ bash scripts/real-run.sh --validate router-on # parse the scenario file only
10
+ bash scripts/real-run.sh --check-receipt R.json trivial-sum # apply receipt assertions to a file
11
+ bash scripts/real-run.sh --tsv-out results.tsv trivial-sum # BILLED: real model run
12
+ ```
13
+
14
+ Env: `REAL_RUN_TARBALL` reuses a tarball, `REAL_RUN_TIMEOUT` (default 1200s) bounds the loki call, `REAL_RUN_SCENARIO_DIR` overrides the scenario directory, `REAL_RUN_TSV` is the default for `--tsv-out`.
15
+
16
+ ## Scenarios
17
+
18
+ Files `tests/real-run/scenarios/<name>.sh`, sourced by the script. Shipped: `trivial-sum` (about $0.10), `two-bug`, `attempts-2`, `router-on`, `issues-dry-run` (needs network, no model).
19
+
20
+ | Variable | Meaning |
21
+ | --- | --- |
22
+ | `SC_DESC` | one line description |
23
+ | `SC_BILLED` | 1 if the scenario calls a model |
24
+ | `SC_FIXTURE` | generator name under `scripts/b9-fixtures/` (`trivial-sum`, `two-bug`) |
25
+ | `SC_ARGS` | array of loki arguments |
26
+ | `SC_ENV` | array of `NAME=value` entries |
27
+ | `SC_RECEIPT` | array of assertions on the newest `.loki/runs/*/receipt.json`: `path == v`, `!=`, `<=`, `>=`, or `path exists` (dotted path, for example `cost.usd`) |
28
+ | `SC_CONSOLE` | array of extended regexes that must match the console output |
29
+
30
+ ## Output
31
+
32
+ One `PASS`/`FAIL` line per assertion; exit 1 on any FAIL, 2 on usage or scenario errors. A TSV line is printed (and appended with `--tsv-out`): `ts scenario verdict wall_s cost_usd input_tokens output_tokens result`. Fields the receipt does not carry are `NA`, never 0. B9 and the 10x metrics can reuse the TSV.
33
+
34
+ `tests/test-real-run.sh` covers scenario parsing, the `--dry` install from the packed tarball, and assertion failure on a doctored receipt.
@@ -45,7 +45,7 @@ VERSION # Single line: X.Y.Z
45
45
  package.json # "version": "X.Y.Z"
46
46
  SKILL.md # Header (line ~6) AND footer (last line)
47
47
  Dockerfile # LABEL version= AND org.opencontainers.image.version (both, or it drifts)
48
- Dockerfile.sandbox # Same two labels
48
+ docker/Dockerfile.sandbox # Same two labels
49
49
  plugins/loki-mode/.claude-plugin/plugin.json # "version": "X.Y.Z" (marketplace.json carries no version)
50
50
  server.json # "version" AND packages[loki-mode].version (MCP registry manifest; enforced by tests/test-server-json-current.sh)
51
51
  vscode-extension/package.json # DEPRECATED v7.2.0, no longer published; bump only if vendoring
@@ -55,7 +55,7 @@ mcp/__init__.py # __version__ = "X.Y.Z"
55
55
  CHANGELOG.md # Add new version entry at top
56
56
  docs/INSTALLATION.md # Version header
57
57
  wiki/Home.md, wiki/_Sidebar.md, wiki/API-Reference.md
58
- README.md, docker-compose.yml # Docker image tags (MAJOR/MINOR bumps)
58
+ README.md, docker/docker-compose.yml # Docker image tags (MAJOR/MINOR bumps)
59
59
  ```
60
60
 
61
61
  The CHANGELOG.md entry must be a full section, not a one-line placeholder
@@ -142,7 +142,7 @@ An early draft spec listed `1=BLOCKED, 2=CONCERNS`. That ordering was rejected:
142
142
  it is not used anywhere, it has no consumers, and it inverts the
143
143
  severity-rises-with-the-code rule that every other command follows.
144
144
 
145
- ### Known gaps until v10.0.0
145
+ ### Known gaps
146
146
 
147
147
  The table above is the target. On the current release, three inputs do not
148
148
  return what it implies. Measured on this checkout:
@@ -153,8 +153,8 @@ return what it implies. Measured on this checkout:
153
153
  | Not a git directory | `loki verify` | 1 (CONCERNS) | 2 |
154
154
  | Unknown flag | `loki verify --no-such-flag` | 3 | 64 |
155
155
 
156
- The gap is tracked as the pending moat case P2.verify-exit-contract,
157
- milestone v10.0.0, in `tests/moat/pending.txt`.
156
+ The gap is tracked as the pending moat case P2.verify-exit-contract in
157
+ `tests/moat/pending.txt`.
158
158
 
159
159
  ### `loki verify --fast`
160
160
 
@@ -1,12 +1,12 @@
1
1
  # Git Workflow
2
2
 
3
- Branch protection and Git best practices for Loki Mode (v5.37.0).
3
+ Branch protection and Git best practices for Loki Mode.
4
4
 
5
5
  ## Overview
6
6
 
7
7
  Loki Mode includes branch protection features that prevent direct commits to main/master branches and enforce a clean PR-based workflow. This ensures code review, quality gates, and audit trails for all changes made by autonomous agents.
8
8
 
9
- ## Branch Protection (v5.37.0)
9
+ ## Branch Protection
10
10
 
11
11
  ### Enable Branch Protection
12
12
 
@@ -388,4 +388,4 @@ git log --show-signature
388
388
  - [Audit Logging](audit-logging.md) - Track Git operations
389
389
  - [GitHub Integration](../skills/github-integration.md) - Issue import and PR creation
390
390
  - [Enterprise Features](../wiki/Enterprise-Features.md) - Branch protection setup
391
- - [Contributing](../CONTRIBUTING.md) - Contribution guidelines
391
+ - [Contributing](../.github/CONTRIBUTING.md) - Contribution guidelines
package/docs/metrics.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Metrics Guide
2
2
 
3
- Prometheus and OpenMetrics monitoring for Loki Mode (v5.38.0).
3
+ Prometheus and OpenMetrics monitoring for Loki Mode.
4
4
 
5
5
  ## Overview
6
6
 
@@ -15,28 +15,28 @@ Loki Mode exposes a `/metrics` endpoint that returns production-ready metrics in
15
15
 
16
16
  ## Quick Start
17
17
 
18
- The `/metrics` endpoint is served by the dashboard and needs no enabling flag.
19
- Start the dashboard and scrape it.
18
+ The metrics endpoint is served by the Control Plane and needs no enabling flag.
19
+ Start the Control Plane and scrape it.
20
20
 
21
21
  ```bash
22
- # Start the dashboard (serves /metrics)
23
- loki dashboard start
22
+ # Start the Control Plane (serves /v1/metrics, and /metrics for older scrapers)
23
+ loki control serve
24
24
 
25
25
  # View metrics
26
- curl http://localhost:57374/metrics
26
+ curl http://127.0.0.1:47821/v1/metrics
27
27
 
28
- # Or use CLI
29
- loki metrics
28
+ # Or use the CLI session report
29
+ loki report metrics
30
30
  ```
31
31
 
32
32
  ## Metrics Endpoint
33
33
 
34
34
  ```
35
- GET http://localhost:57374/metrics
35
+ GET http://127.0.0.1:47821/v1/metrics
36
36
  Content-Type: text/plain; version=0.0.4
37
37
  ```
38
38
 
39
- Returns metrics in OpenMetrics text format. No authentication required by default (configure reverse proxy auth for production).
39
+ Returns metrics in OpenMetrics text format. Without `LOKI_CONTROL_TOKEN` the endpoint answers loopback requests only (403 otherwise); with a token set, send it as a bearer token.
40
40
 
41
41
  ## Available Metrics
42
42
 
@@ -121,19 +121,15 @@ Metrics are derived from `.loki/` flat files:
121
121
  ## CLI Usage
122
122
 
123
123
  ```bash
124
- # Fetch all metrics
125
- loki metrics
124
+ # Fetch all metrics from a running Control Plane
125
+ curl -s http://127.0.0.1:47821/v1/metrics
126
126
 
127
- # Filter specific metric
128
- loki metrics | grep loki_cost_usd
129
-
130
- # Watch metrics in real-time
131
- watch -n 5 loki metrics
132
-
133
- # Custom dashboard host/port
134
- loki metrics --host 192.168.1.100 --port 8080
127
+ # Filter one metric
128
+ curl -s http://127.0.0.1:47821/v1/metrics | grep loki_cost_usd
135
129
  ```
136
130
 
131
+ `loki report metrics` is a separate session productivity report, not the Prometheus text.
132
+
137
133
  ## Prometheus Configuration
138
134
 
139
135
  ### Basic Scrape Config
@@ -145,7 +141,7 @@ scrape_configs:
145
141
  - job_name: 'loki-mode'
146
142
  scrape_interval: 15s
147
143
  static_configs:
148
- - targets: ['localhost:57374']
144
+ - targets: ['127.0.0.1:47821']
149
145
  labels:
150
146
  environment: 'production'
151
147
  project: 'my-app'
@@ -160,7 +156,7 @@ scrape_configs:
160
156
  tls_config:
161
157
  insecure_skip_verify: true # For self-signed certs
162
158
  static_configs:
163
- - targets: ['localhost:57374']
159
+ - targets: ['127.0.0.1:47821']
164
160
  ```
165
161
 
166
162
  ### With Authentication (via reverse proxy)
@@ -190,7 +186,7 @@ scrape_configs:
190
186
  regex: loki-mode
191
187
  - source_labels: [__meta_kubernetes_pod_ip]
192
188
  target_label: __address__
193
- replacement: $1:57374
189
+ replacement: $1:47821
194
190
  ```
195
191
 
196
192
  ## Grafana Integration
@@ -287,7 +283,7 @@ Create `/etc/datadog-agent/conf.d/openmetrics.d/loki_mode.yaml`:
287
283
 
288
284
  ```yaml
289
285
  instances:
290
- - prometheus_url: http://localhost:57374/metrics
286
+ - prometheus_url: http://127.0.0.1:47821/v1/metrics
291
287
  namespace: loki
292
288
  metrics:
293
289
  - loki_session_status
@@ -394,15 +390,10 @@ Configure alerts in Grafana panels:
394
390
 
395
391
  ## Environment Variables
396
392
 
397
- There are none. `/metrics` is an unconditional route on the dashboard app
398
- (`dashboard/server.py:9637`), served at the dashboard's own port and path. An
399
- earlier version of this page listed `LOKI_METRICS_ENABLED`,
400
- `LOKI_METRICS_PORT`, and `LOKI_METRICS_PATH`; none of the three is read by any
401
- code, so the endpoint cannot be turned off, moved, or re-pathed by environment.
402
-
403
- To change the port, change the dashboard port. To restrict access, put the
404
- dashboard behind a reverse proxy: unlike the `/api/*` routes, `/metrics` has no
405
- auth scope dependency, so anything that can reach the port can read it.
393
+ There are none specific to metrics. The endpoint follows the Control Plane
394
+ port (`LOKI_CONTROL_PORT`, default 47821) and its token (`LOKI_CONTROL_TOKEN`).
395
+ `LOKI_METRICS_ENABLED`, `LOKI_METRICS_PORT` and `LOKI_METRICS_PATH` are not read
396
+ by any code.
406
397
 
407
398
  ## Best Practices
408
399
 
@@ -434,19 +425,13 @@ auth scope dependency, so anything that can reach the port can read it.
434
425
  ### Metrics Endpoint Returns Empty
435
426
 
436
427
  ```bash
437
- # Check LOKI_METRICS_ENABLED is set
438
- echo $LOKI_METRICS_ENABLED
439
-
440
- # Verify LOKI_DIR is set (required for dashboard)
441
- echo $LOKI_DIR
442
-
443
428
  # Check dashboard-state.json exists and is updating
444
429
  ls -la .loki/dashboard-state.json
445
430
  watch -n 2 cat .loki/dashboard-state.json
446
431
 
447
- # Check dashboard is running
448
- loki dashboard status
449
- curl http://localhost:57374/health
432
+ # Check the Control Plane is running
433
+ loki control status
434
+ curl http://127.0.0.1:47821/health
450
435
  ```
451
436
 
452
437
  ### Metrics Show Zero Values
@@ -468,27 +453,24 @@ ls -la .loki/events.jsonl
468
453
  ### Connection Refused
469
454
 
470
455
  ```bash
471
- # Verify dashboard is running on expected port
472
- curl http://localhost:57374/health
473
-
474
- # Check if another process is using port 57374
475
- lsof -ti:57374
456
+ # Verify the Control Plane is running on the expected port
457
+ curl http://127.0.0.1:47821/health
458
+ loki control status
476
459
 
477
- # Restart dashboard
478
- loki dashboard stop
479
- loki dashboard start
460
+ # Start it (an explicit --port never falls back to another port)
461
+ loki control serve --port 47821
480
462
  ```
481
463
 
482
464
  ### Prometheus Cannot Scrape
483
465
 
484
466
  ```bash
485
467
  # Test endpoint manually
486
- curl http://localhost:57374/metrics
468
+ curl http://127.0.0.1:47821/v1/metrics
487
469
 
488
470
  # Check Prometheus targets page
489
471
  open http://prometheus-server:9090/targets
490
472
 
491
- # Verify network connectivity from Prometheus to Loki dashboard
473
+ # Verify network connectivity from Prometheus to the Control Plane
492
474
  # (firewall, security groups, etc.)
493
475
 
494
476
  # Check Prometheus logs
@@ -503,7 +485,7 @@ kubectl logs -f prometheus-server-xyz
503
485
  # Set up budget alert
504
486
  cat > /tmp/budget_check.sh <<'EOF'
505
487
  #!/bin/bash
506
- COST=$(curl -s http://localhost:57374/metrics | grep loki_cost_usd | awk '{print $2}')
488
+ COST=$(curl -s http://127.0.0.1:47821/v1/metrics | grep loki_cost_usd | awk '{print $2}')
507
489
  if (( $(echo "$COST > 4.5" | bc -l) )); then
508
490
  echo "CRITICAL: Cost $COST exceeds budget!"
509
491
  loki stop
@@ -522,7 +504,7 @@ import requests
522
504
  import json
523
505
 
524
506
  def get_loki_metrics():
525
- response = requests.get("http://localhost:57374/metrics")
507
+ response = requests.get("http://127.0.0.1:47821/v1/metrics")
526
508
  metrics = {}
527
509
  for line in response.text.splitlines():
528
510
  if line.startswith("loki_"):
@@ -553,6 +535,6 @@ EOF
553
535
  ## See Also
554
536
 
555
537
  - [Audit Logging](audit-logging.md) - Track agent actions
556
- - [Dashboard Guide](dashboard-guide.md) - Web dashboard
538
+ - [Control Plane](control-plane-migration.md) - The local UI and `/v1/*` API
557
539
  - [Enterprise Features](../wiki/Enterprise-Features.md) - Complete enterprise guide
558
540
  - [Prometheus Metrics](../wiki/Prometheus-Metrics.md) - Detailed wiki documentation
@@ -174,7 +174,7 @@ spec:
174
174
  sizeLimit: 256Mi
175
175
  ```
176
176
 
177
- ## TLS/HTTPS for Dashboard (v5.36.0)
177
+ ## TLS/HTTPS for Dashboard
178
178
 
179
179
  Enable encrypted dashboard connections:
180
180
 
@@ -21,7 +21,7 @@ Supported SIEM platforms:
21
21
  - LogRhythm
22
22
  - SumoLogic
23
23
 
24
- ## Syslog Forwarding (v5.38.0)
24
+ ## Syslog Forwarding
25
25
 
26
26
  ### Enable Syslog
27
27
 
@@ -108,7 +108,7 @@ spec, so events cannot break the record framing. Failed events
108
108
  (`success: false`) are elevated to severity 8.
109
109
 
110
110
  ```
111
- CEF:0|Autonomi|Loki Mode|7.49.0|revoke_token|revoke_token|8|rt=2026-02-15T14:30:00.000Z suser=alice src=10.0.0.4 cs1=token cs1Label=resourceType outcome=failure msg=expired credential loki.provider=claude loki.cost=4.25
111
+ CEF:0|Autonomi|Loki Mode|X.Y.Z|revoke_token|revoke_token|8|rt=2026-02-15T14:30:00.000Z suser=alice src=10.0.0.4 cs1=token cs1Label=resourceType outcome=failure msg=expired credential loki.provider=claude loki.cost=4.25
112
112
  ```
113
113
 
114
114
  Nested `details` are flattened under the `loki.` namespace. Standard CEF keys
@@ -326,7 +326,7 @@ export LOKI_CEF_VENDOR=Autonomi
326
326
  export LOKI_CEF_PRODUCT="Loki Mode"
327
327
 
328
328
  # CEF message example:
329
- # CEF:0|Autonomi|Loki Mode|5.42.2|session.start|Session Started|3|
329
+ # CEF:0|Autonomi|Loki Mode|X.Y.Z|session.start|Session Started|3|
330
330
  # rt=2026-02-15T14:30:00Z suser=user cs1=claude cs1Label=Provider
331
331
  ```
332
332
 
@@ -428,13 +428,13 @@ Notifications: PagerDuty, Slack #incidents
428
428
  ### CEF (Common Event Format)
429
429
 
430
430
  ```
431
- CEF:0|Autonomi|Loki Mode|5.42.2|session.start|Session Started|3|rt=2026-02-15T14:30:00Z suser=user cs1=claude cs1Label=Provider
431
+ CEF:0|Autonomi|Loki Mode|X.Y.Z|session.start|Session Started|3|rt=2026-02-15T14:30:00Z suser=user cs1=claude cs1Label=Provider
432
432
  ```
433
433
 
434
434
  ### LEEF (Log Event Extended Format)
435
435
 
436
436
  ```
437
- LEEF:1.0|Autonomi|Loki Mode|5.42.2|session.start|devTime=2026-02-15T14:30:00Z usrName=user provider=claude
437
+ LEEF:1.0|Autonomi|Loki Mode|X.Y.Z|session.start|devTime=2026-02-15T14:30:00Z usrName=user provider=claude
438
438
  ```
439
439
 
440
440
  ## Event Correlation
@@ -6,12 +6,12 @@ Classes: KEEP-MODERN (v10-native or engine-neutral), UPDATE (live but needs mode
6
6
 
7
7
  ## Counts
8
8
 
9
- - KEEP-MODERN: 60
9
+ - KEEP-MODERN: 61
10
10
  - UPDATE: 22
11
11
  - DROP-LEGACY: 31
12
12
  - DELETE: 14
13
- - Total rows: 127
14
- - Registry paths (commands and nested subcommands): 171
13
+ - Total rows: 128
14
+ - Registry paths (commands and nested subcommands): 177
15
15
 
16
16
  ## Commands
17
17
 
@@ -35,6 +35,7 @@ Classes: KEEP-MODERN (v10-native or engine-neutral), UPDATE (live but needs mode
35
35
  | contract | loki-ts/src/cli.ts | KEEP-MODERN | v10 delivery contract |
36
36
  | start | bun route, bash fallthrough | UPDATE | Forks between v10 and the SDK loop; flags still legacy-shaped |
37
37
  | slack | loki-ts/src/cli.ts | KEEP-MODERN | Bun-native integration |
38
+ | queue | loki-ts/src/cli.ts | KEEP-MODERN | Governor-aware batch of issue-mode runs |
38
39
  | answer | loki-ts/src/cli.ts | KEEP-MODERN | v10 blocked-run flow |
39
40
  | engine10 | loki-ts/src/cli.ts | KEEP-MODERN | The v10 engine |
40
41
  | internal (hidden) | loki-ts/src/cli.ts | KEEP-MODERN | Hidden plumbing |
@@ -733,3 +733,47 @@ PROGRESS.md (the FC-25 P9 entry) cites a D88 CI waiver that was never recorded i
733
733
  Amendment to D89 (2026-10-07 21:40Z, CTO decision, refined by the founder at 21:45Z, CoS records). This amends only R1-19, the default-on flip that follows the CTO gate; 11.1.0 and 11.2.0 still ship the router OFF. (1) The default executor is Sonnet 5.5; Haiku 5.5 per work unit when Opus assigns it. (2) Roles: Opus 5.5 is the architect, router and advisor, plans and assigns each unit, and is consulted on hard calls. Sonnet is the senior engineer and the default for implementation and fixes. Haiku does tests, docs and small low-risk changes only when Opus assigns them in the plan. Haiku is never the blanket default. (3) L0 holds: the harness never routes by task type or path regex; it only executes, verifies and escalates. (4) The route schema is `units: [{id, kind, executor, reason}]` plus a run default of sonnet; a missing or invalid unit route goes to sonnet with NOT PROVEN. A haiku unit that fails a code-owned check is redone on sonnet, then escalates to opus; a Wall assigned to haiku gets an Opus review before implement. The receipt lists the executor, assigner and reason per unit. The per-unit schema lands in 11.2.0 or 11.2.1 depending on what is merged. (5) Escalation stays evidence-gated (haiku -> sonnet -> opus, and sonnet -> opus), and `LOKI_ROUTER=0` equals pre-router behavior exactly (the R1-21 golden). (6) The R1-16 shape-defaults semantics are inverted (a shape is listed as `haiku` once it has earned it; an absent listing means Sonnet), and R1-16 history is an input to Opus, not a harness rule. Rationale: a wrong PR costs the user far more than the token savings, B9 covers only about 5 of 14 shapes (item 10), and under L0 a model earns the cheaper tier with evidence. Items 3, 5, 7 and 9 above are read with this amendment; their text is kept as recorded. See docs/v11/ROUTER-1.md sections 4.1, 4.3 and 4.6.
734
734
 
735
735
  Amendment 2 to D89 (2026-10-08 00:15Z, steering finding, CoS records; tightens a gate, so it binds until the CTO relaxes it). R1-19 gains one more gate line: on the trivial fixture (the steering Node off-by-one fixture), router-on cost must be <= router-off cost x 1.05, measured with n>=3 per arm and recorded per arm as cache-read input tokens, fresh input tokens, output tokens, dollars and wall time (R1-17 B9). Evidence that prompted it (n=1, may be variance): 11.2.0 smoke, router on cost +15% tokens, +27% dollars and +38s with zero advisor calls and no route change. If the advisor tool definition costs tokens on sessions that never consult it, the advisor is enabled only on the sessions Opus marks as needing it (plan and fix rounds), not on every stage. Measure before changing code.
736
+
737
+ ## D90 (2026-10-08, founder directive, CoS records; CTO approved): the push and release gate is the fast gate, full suites run nightly
738
+ Founder directive, verbatim: "why tests take 15 to 20min? cut it down to only needed ones and keep only less than 2min total in git".
739
+
740
+ 1. This supersedes D55 for the release gate. D55 required a full Tier B verdict on the exact tree of every main commit. The blocking gate on slice-*, train/**, main and PRs (test.yml, name "Tests") is now: tsc plus the dist build once (reused as an artifact), the moat P9 case only (tests/moat/p9-rule-of-two.sh, with every registered P9 id required to PASS), the structural guards, and the impacted bun and shell suites selected from the diff since the last release tag by scripts/ci/fast-gate.sh (it wraps scripts/select-tests.sh and adds path-to-guard mapping for the paths the selector sends to R0: workflows, Dockerfiles, package manifests, tests/lib, dist, VERSION). Shards are packed to stay under 90s each.
741
+ 2. Fail safe: if the diff cannot be computed, the planner selects the FULL set (test.yml calls full-suite.yml).
742
+ 3. Deferral: any selected suite estimated over 80s (from tests/shard-durations.tsv) is not run in the push gate; it is listed in deferred.tsv and covered by the nightly.
743
+ 4. Backstop: full-suite.yml (all 8 shell shards, full bun, python matrix, helm, Node 20/24, the full moat registry) runs from nightly.yml on a schedule and by workflow_dispatch. It is non-blocking for the push. A red nightly opens a FAILURE-CLASSES fix slice and blocks the NEXT release: release.yml required-ci fails while the latest completed nightly on main is red and newer than the previous release tag, until a newer nightly is green. The block fails closed if the API cannot be read.
744
+ 5. Removed as duplicates: tier-a.yml (its job is now the fast gate in test.yml, same triggers), first-run-gate.yml (moved to a continue-on-error job in nightly.yml; promote.yml and the post-release smoke already run an installed first-run check), and tests/test-tier-a-r0-timeout-budget.sh (its workflow no longer exists).
745
+ 6. Release: publish-npm packs once, verifies the PACKED tarball, uploads it and publishes that tarball with no second prepack build; the registry-visibility wait is its own job (npm-visible) so the publish job ends when the publish does. Post-Release Smoke npm leg shrinks to a fresh install plus loki version plus the doctor assertion with a short backoff.
746
+ 7. Not done here, tracked as deferred: publishing the tarball built by the Tests run across workflows, the stubbed-run smoke step, and the full moat registry ratchet in the push gate (kept nightly).
747
+ 8. Risks accepted: selected tests are an estimate of impact, not proof; the nightly is the proof, and the NEXT release pays for a miss. Timings are estimates until measured on push.
748
+
749
+ ## D91 (2026-10-08, founder directive relayed by the CTO at 04:35Z, CoS records): releases by clock, continuous merge, hotspot registries
750
+ Founder directive, verbatim: "faster faster, increase velocity and releases and feature count in each release and updates/enhancements/bug-fixes in each release, strategize and steer that way".
751
+
752
+ 1. Releases by clock, not scope (amends D25 and D37). From 11.3.2 on, the Release Manager cuts a release every 45 minutes from whatever is approved and green on main. No cut waits for a slice; a slice that misses a cut takes the next one. Each release targets at least 3 user-visible features plus at least 5 enhancements or fixes, with a user-facing CHANGELOG. A cut short of that target still ships what is green; the shortfall is recorded in METRICS.md and the backlog is refilled.
753
+ 2. Continuous merge to main. An approved slice rebases and merges right away behind tsc, its impacted tests, the always-run global guards and moat P9. Long-lived train branches end after 11.3.1. Risky features merge flag-gated and default off, never held.
754
+ 3. Hotspot registries (pure refactor, goldens byte-identical). The seal verdict chain, the PR body, the supervisor start line, plan output and start dispatch each become a registry of contributors, so a new feature adds one file plus one registry line. One Opus architect plus 2 engineers own it.
755
+ 4. Pipeline budget: push to npm latest under 10 minutes; publish-npm under 1 minute; smoke plus promote under 3 minutes. Measured on every release and reported to steering.
756
+ 5. Backlog: at least 30 specced ready slices at all times, split evenly between features, enhancements and fixes, each with acceptance tests. Seat cap 14 while weekly usage is under 50%.
757
+ 6. Dogfood: once MASS-1 ships, Loki runs `loki issues run --label bug --draft` against asklokesh/loki-mode's own issues; each VERIFIED PR is a candidate fix for the next cut, reviewed like any slice.
758
+ 7. Host: local gates are tsc, impacted tests and global guards; remote CI is the authority. Worktrees stay under 40, pruned by recorded path on every merge (never by timestamp).
759
+ 8. Reviews keep the bar (D12/D13) and run in pair mode for every HIGH slice: the reviewer reviews live as commits land, not serially after the build. Unchanged: moat > Seal accuracy, a moat regression still blocks a cut (it is never waived by the clock), and Tier B on the release SHA is still required (D90).
760
+ 9. Amendments relayed by steering, 04:40Z to 04:55Z. The cadence drops to 30 minutes once CI-FAST is live (from 11.3.2), and each cut carries 3+ features and 8+ enhancements or fixes. The seat cap rises to 20 once the hotspot registries land. Acceptance-first: an Opus-written acceptance test is committed before the code of every feature slice. Real-run harness: `scripts/real-run.sh <scenario>` installs the packed tarball into a temp prefix and asserts on receipt.json plus the console contract; Post-Release Smoke runs trivial-sum. Finding-to-guard: every review finding becomes an FC row plus an automated guard test.
761
+ 10. 10x rule. Each release names one headline metric measured 10x better than a named competitor baseline, and publishes it only when measured: 11.3.2 unattended throughput (MASS-1), 11.3.3 cost per verified fix, 11.3.4 human review time, 11.3.5 babysitting interventions, 11.3.6 time to first verified PR.
762
+ 11. COST-HALF. Loki's dollars per VERIFIED task must be at most 0.5x raw `claude -p` on the B9 set (n>=3, with intervals), measured and published every release. Levers: one warm session, model-decided stage skipping (verify and seal never skip), per-unit Haiku, the advisor only where Opus marks it, a context diet under 100K, a byte-identical cache prefix with a test, and harness prefetch of the repomap, test command and failing output. B9 gains a raw arm and a loki arm.
763
+
764
+ ## D92 (2026-10-08, founder directive relayed by steering at 05:00Z, CoS records): 40x efficiency in 12 hours
765
+ Founder directive, verbatim: "research and update all things in loki mode per latest docs, features, updates in the industry, latest standards and much better ways of doing things so our efficiency increases by 40 times overall by tomorrow morning, all should complete in 12hrs, run everything like a software company including researchers and scientists ... consider us to become the best for next 5yrs right now".
766
+
767
+ 1. Definition: EFFICIENCY = verified tasks / (dollars x wall-minutes x human-minutes), measured with B9 raw-vs-loki on a fixed set (trivial-sum, two-bug, one medium real issue, a 10-issue mass run). Baseline is 11.3.1, measured the moment it ships. Target by about 17:00Z: 40x, as a product of factors (about 2x cost, 2x wall time, 10x human-minutes), each reported separately in METRICS.md every release.
768
+ 2. Organization: a research division (paper-scout, docs-scout, market-scout; Opus with web access) feeds slice specs through steering. Engineering programs with named owners: COST-HALF, SPEED, HUMAN-TIME, REGISTRIES, ACCURACY, PLATFORM-UPDATE, STANDARDS. One measurement owner runs the B9 raw arm and the 40x scoreboard script. Seat cap 20 while weekly usage is under 50%.
769
+ 3. Cadence and bar: a release every 30 minutes once CI-FAST is live, each with 3+ features, 8+ fixes or enhancements and a scoreboard row. A moat regression blocks a cut, P9 is never waived, and nothing unmeasured is claimed.
770
+
771
+ ## D93 (2026-10-08, CTO amendment relayed by the CoS, Architect records): the router plan becomes a routing call; the full plan is conditional
772
+ Amends FC-35 (the router-on plan no longer skips small tasks) and D89 Amendment 2 for COST-HALF (D91 item 11).
773
+
774
+ 1. Under LOKI_ROUTER=1, Opus ALWAYS makes the routing decision, as one short structured-output call: cache-stable prefix (COST-HALF CP-01), effort low, output {size: trivial|small|medium|large, units[], needs_full_plan: bool}. Measured target cost: under $0.01 per run.
775
+ 2. The full Opus plan session runs only when needs_full_plan is true. Trivial and small tasks go straight to the routed executor on the lean path.
776
+ 3. One plan gate. The implement session's LOKI_NEED_PLAN marker is a second input to the same gate: it can raise it (plan runs once, implement resumes), never lower it. With the router off, the gate's inputs are the marker and the Project Model. The receipt records the reason: route_call, marker, project_model or skipped.
777
+ 4. FC-35 R-B holds unchanged: always emit a route or a recorded reason. A failed, timed-out or malformed routing call writes routed:false with the reason to route.json and runs the full plan as before (fail-safe toward more planning, never less). Wall, verify, commit, seal and pr never skip.
778
+ 5. Measurement gate: the B9 row on trivial-sum shows the routing call below 10% of total run cost (n>=3), and router-on cost at most 1.05x router-off (D89 Amendment 2). Router-off output stays byte-identical with the flags off.
779
+ 6. Slices: COST-HALF LD-01 (gate plus routing call) and LD-02 (marker as a late input), HIGH tier.