loki-mode 10.6.0 → 10.6.7

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 (107) hide show
  1. package/.github/actions/issue-to-pr/action.yml +25 -11
  2. package/.github/workflows/loki-issue-to-pr.yml +21 -10
  3. package/README.md +113 -356
  4. package/SKILL.md +11 -8
  5. package/VERSION +1 -1
  6. package/autonomy/loki +77 -6
  7. package/autonomy/run.sh +26 -1
  8. package/autonomy/telemetry.sh +1 -1
  9. package/bin/loki +9 -1
  10. package/completions/_loki +1 -0
  11. package/completions/loki.bash +2 -2
  12. package/dashboard/__init__.py +1 -1
  13. package/docs/AUDIT-CHAIN-THREAT-MODEL.md +1 -1
  14. package/docs/DEMOS.md +11 -26
  15. package/docs/EVALUATING.md +2 -3
  16. package/docs/INSTALLATION.md +6 -5
  17. package/docs/TOOLS.md +1 -1
  18. package/docs/air-gapped.md +1 -1
  19. package/docs/dashboard-guide.md +2 -0
  20. package/docs/dev/project-structure.md +1 -1
  21. package/docs/dev/release-checklist.md +1 -2
  22. package/docs/enterprise/architecture.md +1 -1
  23. package/docs/siem-integration.md +2 -2
  24. package/docs/v10/CONTROL-PLANE.md +1 -1
  25. package/docs/v10/D61-SPEED.md +78 -0
  26. package/docs/v10/DECISIONS.md +12 -0
  27. package/docs/v10/DEPS.md +16 -0
  28. package/docs/v10/GUIDE.md +63 -1
  29. package/docs/v10/HANDOFF-NEXT-WEEK.md +34 -0
  30. package/loki-ts/dist/loki.js +571 -563
  31. package/mcp/__init__.py +1 -1
  32. package/package.json +7 -2
  33. package/packages/control-plane/dist/server.js +5919 -0
  34. package/packages/control-plane/drizzle/0000_new_maelstrom.sql +49 -0
  35. package/packages/control-plane/drizzle/meta/0000_snapshot.json +343 -0
  36. package/packages/control-plane/drizzle/meta/_journal.json +13 -0
  37. package/packages/control-plane/package.json +20 -0
  38. package/packages/control-plane/src/db/migrate.ts +20 -0
  39. package/packages/control-plane/src/db/schema.ts +54 -0
  40. package/packages/control-plane/src/server/app.ts +63 -0
  41. package/packages/control-plane/src/server/ingest.ts +52 -0
  42. package/packages/control-plane/src/server/runs.ts +116 -0
  43. package/packages/control-plane/src/server/serve.ts +15 -0
  44. package/packages/control-plane/src/shipper/backfill.ts +40 -0
  45. package/packages/control-plane/src/shipper/ship.ts +95 -0
  46. package/packages/control-plane/ui/dist/assets/index-B6EiyukW.js +114 -0
  47. package/packages/control-plane/ui/dist/assets/index-BH3LtKcG.css +1 -0
  48. package/packages/control-plane/ui/dist/index.html +13 -0
  49. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  50. package/web-app/dist/assets/{AdminPage-B8LTaWIa.js → AdminPage-DyjnUcaP.js} +1 -1
  51. package/web-app/dist/assets/{Avatar-BbxCTNns.js → Avatar-CY0sQNao.js} +1 -1
  52. package/web-app/dist/assets/{Badge-DIjrBQFC.js → Badge-BmwTRu72.js} +1 -1
  53. package/web-app/dist/assets/{Button-LgRYqCHv.js → Button-BRf5aTlb.js} +1 -1
  54. package/web-app/dist/assets/{CockpitPage-BgEdvdXX.js → CockpitPage-RR94HuxS.js} +1 -1
  55. package/web-app/dist/assets/{ComparePage-BPttVkSu.js → ComparePage-CFWAuPRO.js} +1 -1
  56. package/web-app/dist/assets/{ErrorBoundary-DCPrb7ec.js → ErrorBoundary-4cDADrG-.js} +1 -1
  57. package/web-app/dist/assets/{EvidenceReceiptPanel-BLqfCaoK.js → EvidenceReceiptPanel-ChPFx2eM.js} +1 -1
  58. package/web-app/dist/assets/{GitHubIssuesPanel-Ch61Yw6v.js → GitHubIssuesPanel-B0TAjyeW.js} +1 -1
  59. package/web-app/dist/assets/{GitHubPRsPanel-Cju9OEP1.js → GitHubPRsPanel-BbszEwW9.js} +1 -1
  60. package/web-app/dist/assets/{HomePage-BSt5tg3Z.js → HomePage-DrBgzs1d.js} +2 -2
  61. package/web-app/dist/assets/{LoginPage-Cj9xl0pH.js → LoginPage-Bu7b2DGz.js} +1 -1
  62. package/web-app/dist/assets/{MagicPage-CyfrX553.js → MagicPage-BFEYp631.js} +1 -1
  63. package/web-app/dist/assets/{MetricsPage-Ck6jFgAN.js → MetricsPage-eIe2naVR.js} +1 -1
  64. package/web-app/dist/assets/{NotFoundPage-CA_HlCgz.js → NotFoundPage-BVWYkNt9.js} +1 -1
  65. package/web-app/dist/assets/{ProjectPage-BkpztOmm.js → ProjectPage-zmxyu732.js} +3 -3
  66. package/web-app/dist/assets/{ProjectsPage-urTkLe8m.js → ProjectsPage-Dq5NdCak.js} +1 -1
  67. package/web-app/dist/assets/{SettingsPage-COvHhevh.js → SettingsPage-CCrJOMe0.js} +1 -1
  68. package/web-app/dist/assets/{ShowcasePage-BNIiqhqk.js → ShowcasePage-n-Ipzp01.js} +1 -1
  69. package/web-app/dist/assets/{SystemSettingsPage-CBPa5u-v.js → SystemSettingsPage-CP_rjYXK.js} +1 -1
  70. package/web-app/dist/assets/{TeamsPage-DuuHXfkP.js → TeamsPage-B_P9DepW.js} +1 -1
  71. package/web-app/dist/assets/{TemplatesPage-C8tRhU8-.js → TemplatesPage-h-3A6PQT.js} +1 -1
  72. package/web-app/dist/assets/{TerminalOutput-BOL99fiQ.js → TerminalOutput-pD0nJ1BU.js} +1 -1
  73. package/web-app/dist/assets/{activity-92O1sR3_.js → activity-ChFwzT-d.js} +1 -1
  74. package/web-app/dist/assets/{bell-CeWSKe4w.js → bell-BX-eK8Gu.js} +1 -1
  75. package/web-app/dist/assets/{bot-n8nzxbS2.js → bot-fj5PkPtR.js} +1 -1
  76. package/web-app/dist/assets/{check-C-8ho0t2.js → check-BGAbHlvD.js} +1 -1
  77. package/web-app/dist/assets/{chevron-left-D4UQrt8-.js → chevron-left-BzFUxHgb.js} +1 -1
  78. package/web-app/dist/assets/{circle-alert-BnxgnWHv.js → circle-alert-BQrg5DWl.js} +1 -1
  79. package/web-app/dist/assets/{clock-DgbJFbcN.js → clock-CTu9lkVo.js} +1 -1
  80. package/web-app/dist/assets/{cloud-BSEYN8y8.js → cloud-DrIENRiE.js} +1 -1
  81. package/web-app/dist/assets/{code-xml-CFYOlC1u.js → code-xml-PaoVpfur.js} +1 -1
  82. package/web-app/dist/assets/{database-DNJ4cz62.js → database-DMmkAotn.js} +1 -1
  83. package/web-app/dist/assets/{dollar-sign-DZ1zEfep.js → dollar-sign-B2LQdBoX.js} +1 -1
  84. package/web-app/dist/assets/{file-code-corner-D9vIN2Ru.js → file-code-corner-Dfv1XXeR.js} +1 -1
  85. package/web-app/dist/assets/{file-plus-B4TugJYw.js → file-plus-D2Wzf2wd.js} +1 -1
  86. package/web-app/dist/assets/{globe-BPNU50l7.js → globe-DxotVWt8.js} +1 -1
  87. package/web-app/dist/assets/{hammer-CwVF_APh.js → hammer-Brfy5ZrJ.js} +1 -1
  88. package/web-app/dist/assets/{index-DnAhEaY4.js → index-BfhHMwi8.js} +3 -3
  89. package/web-app/dist/assets/{layers-DNBXP7Gs.js → layers-DfxSWDvp.js} +1 -1
  90. package/web-app/dist/assets/{loader-circle-bh-SWjhS.js → loader-circle-CxIrzNwx.js} +1 -1
  91. package/web-app/dist/assets/{lock-CpbXWrBs.js → lock-m6nzhtpU.js} +1 -1
  92. package/web-app/dist/assets/{package-3NG8Vkod.js → package-ri9oE9Jc.js} +1 -1
  93. package/web-app/dist/assets/{plus-C1DPukhG.js → plus-DWeTAMVV.js} +1 -1
  94. package/web-app/dist/assets/{refresh-cw-Cgl65iQ2.js → refresh-cw-BGMSpaMh.js} +1 -1
  95. package/web-app/dist/assets/{rotate-ccw-BS5sMMYV.js → rotate-ccw-DD1xBD_b.js} +1 -1
  96. package/web-app/dist/assets/{scroll-text-BpvzZAZR.js → scroll-text-BCCR_AN9.js} +1 -1
  97. package/web-app/dist/assets/{server-DSLFedy_.js → server-CmMWPIjS.js} +1 -1
  98. package/web-app/dist/assets/{shield-alert-BlG8AkvF.js → shield-alert-BZZmBVEJ.js} +1 -1
  99. package/web-app/dist/assets/{thumbs-up-BJcYgjRU.js → thumbs-up-OaxbNRXu.js} +1 -1
  100. package/web-app/dist/assets/{trash-2-CScLwgFk.js → trash-2-DmcSzTfr.js} +1 -1
  101. package/web-app/dist/assets/{trending-down-BPRGGG_g.js → trending-down-BmfXLykz.js} +1 -1
  102. package/web-app/dist/assets/{trending-up-BpLBFaZo.js → trending-up-Djec3jIq.js} +1 -1
  103. package/web-app/dist/assets/{upload-LgGE0PEa.js → upload-BN8dXIlF.js} +1 -1
  104. package/web-app/dist/assets/{usePolling-0W4sMm7u.js → usePolling-Cu4yi04I.js} +1 -1
  105. package/web-app/dist/assets/{user-D4KBUK1Z.js → user-IBI-k10o.js} +1 -1
  106. package/web-app/dist/index.html +1 -1
  107. package/docs/walkthrough/README.md +0 -44
package/README.md CHANGED
@@ -24,7 +24,6 @@ Before a build counts as done, a review council selects reviewers from a special
24
24
  - [loki doctor](#loki-doctor)
25
25
  - [Modernization: status of loki modernize](#modernization-status-of-loki-modernize)
26
26
  - [Providers](#providers)
27
- - [Legacy engine reference](#legacy-engine-reference) (the engine `loki` runs by default today)
28
27
 
29
28
  ## Install
30
29
 
@@ -43,12 +42,14 @@ loki doctor # checks your setup, names any blocker
43
42
 
44
43
  Upgrade with `loki self-update`. Long form: [Installation Guide](docs/INSTALLATION.md). `npm install -g loki-mode` installs the `latest` dist-tag; see [Release channels](#release-channels-next-and-latest) for `next`.
45
44
 
46
- **Loki needs a model to drive.** An `ANTHROPIC_API_KEY` alone is enough (the Claude Agent SDK ships inside Loki; on the default engine this path needs Bun and `LOKI_SDK_MODE=full`, see Setup details below), or point it at Claude Code, Cline, Codex, Aider or opencode. `loki doctor` tells you exactly what is missing.
45
+ **Loki needs a model to drive.** An `ANTHROPIC_API_KEY` alone is enough (the Claude Agent SDK ships inside Loki; on the legacy engine this path needs Bun and `LOKI_SDK_MODE=full`, see Setup details below), or point it at Claude Code, Cline, Codex, Aider or opencode. `loki doctor` tells you exactly what is missing.
47
46
 
48
47
  ```bash
49
48
  export ANTHROPIC_API_KEY=sk-...
50
49
  loki doctor
51
- loki quick "fix the login bug" # one small task on the Loki 10 engine
50
+ loki quick "fix the login bug" # one small task on the Loki 10 engine, no PR
51
+ loki "fix the login redirect loop" --no-pr # any task, Loki 10 engine
52
+ loki owner/repo#123 # one GitHub, GitLab or Jira issue to a pull request, Loki 10 engine
52
53
  ```
53
54
 
54
55
  <details>
@@ -72,19 +73,21 @@ loki-seal is a Claude Code Stop hook that runs your repo's real test suite when
72
73
 
73
74
  ## Loki 10 engine
74
75
 
75
- Default: Loki 10 engine for `loki "<task>"`, `loki owner/repo#N` and `loki quick "<task>"`. Set LOKI_ENGINE=legacy or run `loki legacy <args>` for the previous engine. <!-- loki10-default -->
76
+ Loki 10 is the default engine for `loki "<task>"`, `loki owner/repo#N` and `loki quick "<task>"`. <!-- loki10-default -->
76
77
 
77
- Loki 10 is the rewritten engine and the default for tasks, issue mode and `quick`; `status`, `verify` and `dashboard` use it when `LOKI_ENGINE=v10` is set. Guide, provider table and summary format: [docs/v10/GUIDE.md](docs/v10/GUIDE.md).
78
+ Guide, provider table and summary format: [docs/v10/GUIDE.md](docs/v10/GUIDE.md).
78
79
 
79
80
  ```
80
- LOKI_ENGINE=v10 loki "fix the login redirect loop" --no-pr
81
+ loki "fix the login redirect loop" --no-pr
81
82
  ```
82
83
 
83
84
  ```
84
- LOKI_ENGINE=v10 loki owner/repo#123
85
+ loki owner/repo#123
85
86
  ```
86
87
 
87
- The router sends a quoted multi-word task, a GitHub, GitLab or Jira issue reference, and the `status`, `verify` and `dashboard` subcommands to the v10 engine. A one-word argument that is not an issue ref, or any first argument starting with `-`, stays on the legacy CLI. Flags (`loki-ts/src/engine10/cli.ts` USAGE): `--no-pr` builds and verifies without opening a pull request, `--deep` requests the deep verify pass and a longer implement budget, `--provider <name>` picks the coding provider (`--json` and `--verbose` are also parsed by the supervisor, see [Quiet output](#quiet-output)). The v10 engine needs Bun; without it the command exits 1 with a message.
88
+ The v10 engine accepts a quoted multi-word task, a GitHub, GitLab or Jira issue reference, `status`, `verify`, `dashboard`, and other subcommands. Flags (`loki-ts/src/engine10/cli.ts` USAGE): `--no-pr` builds and verifies without opening a pull request, `--deep` requests the deep verify pass and a longer implement budget, `--provider <name>` picks the coding provider, `--max-cost <usd>` sets the per-run cost cap (default $20.00, or `budgets.per_run` in `loki.yaml`; the flag wins; the start line prints it as `cap $20.00 (default)`; reaching it ends the run BUDGET_STOP, exit 3) (`--json` and `--verbose` are also parsed by the supervisor, see [Quiet output](#quiet-output)). The engine needs Bun; without it the command exits 1 with a message and installation instructions.
89
+
90
+ **Legacy engine (being removed).** The previous engine still ships in 10.6.6 and is reachable with `LOKI_ENGINE=legacy` or `loki legacy <args>`. `loki start owner/repo#N`, `loki start <issue URL>` and `loki start "<multi-word task>"` run on Loki 10, the same as `loki owner/repo#N` and `loki "<task>"`; `loki start ./prd.md`, a flag-first call and a one-word start stay on the legacy engine. For many issues use `loki backlog owner/repo --all|--label X|--issues N,N` (many issues, N in parallel, each on a `loki/backlog-N` worktree branch) instead. Legacy removal is planned and resumes on 2026-10-07; see [docs/v10/LEGACY-REMOVAL.md](docs/v10/LEGACY-REMOVAL.md). Sections below marked "legacy" describe features that run only on that engine.
88
91
 
89
92
  ### The state machine
90
93
 
@@ -114,14 +117,58 @@ flowchart TD
114
117
  | implement | A provider session makes the change, under a time budget (480s default, 1800s with `--deep`). |
115
118
  | verify and fix | Runs the checks. Failures feed up to 2 fix rounds (`MAX_FIX_ROUNDS`). The same failures three verifies running end the run as STALLED. |
116
119
  | commit and seal | Commits the diff, then writes `.loki/runs/<run-id>/receipt.json` and `receipt.md`, signed by default. |
117
- | pr | Opened by the supervisor, not the worker (the worker never holds a GitHub token). A non-VERIFIED run opens a draft PR. |
120
+ | pr | Opened by the supervisor, not the worker (the worker never holds a GitHub token). A non-VERIFIED run opens a draft PR. The body is written for a 60-second review: what the issue asked, what changed, how it was tested, NOT PROVEN, then the receipt digest and `loki verify`. Data the run did not record prints "not recorded". |
118
121
  | deep verify | Detached, started after the PR opens (so not with `--no-pr`): full suite, app-boot probe, council, secret scan. A check that is refused or unavailable is reported as NOT PROVEN, never as red. `--deep` is a separate flag that raises the implement and run budgets. |
119
122
 
123
+ PR body sample (`loki-ts/src/e10ext/reviewer_body.ts`):
124
+
125
+ ```
126
+ ## What the issue asked
127
+ - handles empty input
128
+ - rejects bad tokens
129
+
130
+ ## What changed and why
131
+ - Why: Fix the parser
132
+ - src/parser.ts
133
+ - tests/parser.test.ts
134
+
135
+ ## How it was tested
136
+ - Verdict: VERIFIED
137
+ - Checks: 2 passed, 0 failed, 0 not run, 0 flaky (4 individual tests counted)
138
+ - Command: `bun test tests/parser.test.ts` -> pass
139
+ - Target tests (written before the fix): parser.test.ts
140
+ - Before the fix: 2 failing, 0 passing on base; after: pass
141
+
142
+ ## NOT PROVEN
143
+ - none
144
+
145
+ ## Receipt
146
+ - Digest: sha256:ab12... (signed)
147
+ - Verify: `loki verify run-1`
148
+ ```
149
+
120
150
  The run cap is 900s (2700s with `--deep`, `DEFAULT_CAP_S` and `DEEP_CAP_S` in `types.ts`); commit, seal and pr still run after the cap fires. A run whose cap fired and which did not verify exits BUDGET_STOP.
121
151
 
122
152
  A finished run prints a short summary (see [Quiet output](#quiet-output), which also shows an example) whose `NOT PROVEN` line is never empty by omission: deep checks deferred to the deep-verify pass are always listed there.
123
153
 
124
- `loki status [run-id]`, `loki verify [run-id]` and `loki dashboard` are built on the v10 path. Slack notifications are not part of the v10 engine surface yet.
154
+ `loki status [run-id]` and `loki verify [run-id]` are built on the v10 path (bare `loki verify` follows the newest run, v10 or legacy). `loki dashboard` and `loki status` reach the v10 commands with `LOKI_ENGINE=v10`. Slack notifications are not part of the v10 engine surface yet.
155
+
156
+ ## Triggers without a cloud
157
+
158
+ Both run on your own GitHub Actions minutes; there is no hosted service.
159
+
160
+ - Issue to PR: copy `.github/workflows/loki-issue-to-pr.yml` into your repository. Label an issue `loki`, or comment `/loki` as an owner, member or collaborator, and it runs `loki owner/repo#N` (the Loki 10 engine) and opens a pull request with an evidence receipt. The agent job holds a read-only token; a separate publish job opens the PR. Set `ANTHROPIC_API_KEY` in repository secrets.
161
+ - Nightly backlog: copy `examples/loki-nightly-backlog.yml` into `.github/workflows/`. Its `schedule:` trigger runs `loki backlog owner/repo --label loki`, one Loki 10 run per labeled open issue:
162
+
163
+ ```yaml
164
+ on:
165
+ schedule:
166
+ - cron: '17 3 * * *' # nightly, 03:17 UTC
167
+ # ...
168
+ - run: loki backlog "${GITHUB_REPOSITORY}" --label loki --concurrency 2
169
+ ```
170
+
171
+ `loki backlog` also takes `--all`, `--issues 1,2,3` and `--dry-run`. The nightly job runs the agent and a write token together, so label only issues you trust.
125
172
 
126
173
  ## Outcomes and exit codes
127
174
 
@@ -133,7 +180,7 @@ A v10 run ends in exactly one outcome. The mapping is `EXIT` in `loki-ts/src/eng
133
180
  | 0 | ALREADY_SATISFIED | The work was already done; evidence is recorded. |
134
181
  | 1 | FAILED | A check failed, the stage failed, or the event log was modified outside the engine. |
135
182
  | 2 | (usage) | No task given, not inside a git repository, or a preflight refusal. Nothing ran. |
136
- | 3 | BUDGET_STOP | The cost or time cap fired before the work finished. |
183
+ | 3 | BUDGET_STOP | The cost cap (`--max-cost`, `budgets.per_run`, default $20.00) or the time cap fired before the work finished. |
137
184
  | 4 | BLOCKED | Spec conflict: the contract cannot be satisfied as written. The summary names the conflict (`spec conflict: <reason>`); the run never guesses and calls it done. |
138
185
  | 5 | STALLED | The same failures three verifies in a row. |
139
186
 
@@ -148,10 +195,10 @@ Every sealed v10 run writes a receipt to `.loki/runs/<run-id>/receipt.json`. `re
148
195
  Receipts are signed by default. On the first run Loki generates an Ed25519 key at `~/.loki/keys/receipt-ed25519.pem` (mode 0600, directory 0700), or you supply your own with `LOKI_RECEIPT_SIGNING_KEY` or `LOKI_RECEIPT_SIGNING_KEY_FILE`. See [docs/SIGNED-RECEIPTS.md](docs/SIGNED-RECEIPTS.md).
149
196
 
150
197
  ```
151
- LOKI_ENGINE=v10 loki verify
198
+ loki verify
152
199
  ```
153
200
 
154
- `loki verify [run-id]` (latest run by default) re-hashes the receipt, checks the signature against your local key (and retired keys listed in `LOKI_RECEIPT_RETIRED_PUBKEYS`), and checks the receipt against the event log. Verdicts and exit codes on the v10 path (`loki-ts/src/engine10/verify_cmd.ts`):
201
+ `loki verify [run-id]` (latest run by default) re-hashes the receipt, checks the signature against your local key (and retired keys listed in `LOKI_RECEIPT_RETIRED_PUBKEYS`), and checks the receipt against the event log. Verdicts and exit codes (`loki-ts/src/engine10/verify_cmd.ts`):
155
202
 
156
203
  | Verdict | Exit | Meaning |
157
204
  |---------|------|---------|
@@ -163,8 +210,6 @@ LOKI_ENGINE=v10 loki verify
163
210
 
164
211
  A verified receipt is bound to the run's event log, so a receipt lifted out of its run, or a log edited after sealing, does not verify. Signing proves the receipt came from the key holder; it does not prove the generated code is bug-free. A receipt only claims what its checks ran, and states what they did not.
165
212
 
166
- On the legacy engine, receipts live under `.loki/proofs/<run_id>/` and are inspected with `loki proof list`, `loki proof show <id>` and `loki proof verify <id>` (exit 0 clean, 1 on tamper or drift, 2 could not check).
167
-
168
213
  ## Quiet output
169
214
 
170
215
  The v10 run is quiet by default: no stage chatter, only the final summary. `--verbose` tails the event stream live (one line per finished stage and a heartbeat with elapsed time and the running diff size). `--json` prints one JSON object (`ok`, `outcome`, `stop`, `run_id`, `receipt_sha256`) instead of text.
@@ -190,17 +235,6 @@ The first-run gate runs the README's default entry point for a new user on a thr
190
235
 
191
236
  Policy (D49): every green release is promoted to `latest` after the automated first-run gate. The promote workflow runs automatically after Post-Release Smoke succeeds; a failed smoke or gate leaves the version on `next`. `workflow_dispatch` remains for manual runs of an exact version.
192
237
 
193
- ```mermaid
194
- flowchart LR
195
- S[Slice: one engineer, own tests] --> M[Merge when green]
196
- M --> T[Train: batch pushed once]
197
- T --> CI[Full CI on the exact SHA]
198
- CI --> N[npm next]
199
- N --> G[Automated first-run gate on the installed version]
200
- G -- pass --> L[npm latest, Docker latest, Homebrew]
201
- G -- fail --> X[Stays on next, fix-forward slice]
202
- ```
203
-
204
238
  ## loki doctor
205
239
 
206
240
  ```bash
@@ -213,10 +247,19 @@ Exit 0 when every required check passes; optional warnings (an absent provider C
213
247
 
214
248
  ## Modernization: status of loki modernize
215
249
 
216
- There are two different things behind the name today.
250
+ Migration: `loki modernize heal <repo> --assess` was a legacy command for read-only analysis. The v10 path `loki modernize <repo> --to <target>` is not yet finished: only `--dry-run` works (inventory, dependency graph, unit clustering, cost, time and risk estimate). A real run stops after the estimate and prints `modernize: oracle capture and execution are not built yet; use --dry-run`. Targets `python3` and `java21` exist; the Java dependency graph is not wired in yet. Design: [docs/v10/MODERNIZE.md](docs/v10/MODERNIZE.md), user summary: [docs/v10/GUIDE-MODERNIZE.md](docs/v10/GUIDE-MODERNIZE.md).
251
+
252
+ ## Control Plane v0 (preview)
217
253
 
218
- - `loki modernize heal <path>` and `loki modernize migrate <path>` are the shipped legacy commands (agent-driven phases). `loki modernize heal <path> --assess` is read-only. See [Already have a codebase](#already-have-a-codebase-start-read-only).
219
- - `loki modernize <repo> --to <target>` is the new v10 command with behavior-captured equivalence. It is routed to the v10 engine whatever `LOKI_ENGINE` says, but it is not finished: only the `--dry-run` estimate works (inventory, dependency graph, unit clustering, cost, time and risk estimate, no model spend). A real run stops after the estimate and prints `modernize: oracle capture and execution are not built yet; use --dry-run`. Targets `python3` and `java21` exist; the Java dependency graph is not wired in yet. Nothing in v10 modernize claims a unit is proven equivalent today. Design: [docs/v10/MODERNIZE.md](docs/v10/MODERNIZE.md), user summary: [docs/v10/GUIDE-MODERNIZE.md](docs/v10/GUIDE-MODERNIZE.md).
254
+ A local control plane and UI for many runs, off by default. Enable it with `LOKI_CONTROL=1`:
255
+
256
+ ```bash
257
+ LOKI_CONTROL=1 loki control serve # 127.0.0.1, default port 47821 (--port N, --db PATH)
258
+ LOKI_CONTROL=1 loki control backfill . # ship ./.loki/runs to the control plane
259
+ LOKI_CONTROL=1 loki control status # reachable? how many runs held?
260
+ ```
261
+
262
+ The URL comes from `LOKI_CONTROL_URL`, else `http://127.0.0.1:${LOKI_CONTROL_PORT:-47821}`. Set `LOKI_CONTROL_URL` on a run to ship it live. See [docs/v10/CONTROL-PLANE.md](docs/v10/CONTROL-PLANE.md).
220
263
 
221
264
  ## Providers
222
265
 
@@ -234,98 +277,6 @@ Claude Code is the provider Loki is built for and the one that is run end to end
234
277
 
235
278
  ---
236
279
 
237
- # Legacy engine reference
238
-
239
- Everything below describes the legacy engine, which `loki` still runs by default (and which stays reachable when Loki 10 is made the default). The long-form commands, `loki start`, `loki quick`, `loki quickstart` and `loki proof` all live here.
240
-
241
- ## Use it
242
-
243
- ```bash
244
- loki quickstart # guided first build: asks a few questions, quotes cost, builds
245
- ```
246
-
247
- That is the whole happy path. It asks for a one-line idea, picks a template,
248
- shows the real cost and time estimate before spending anything, then builds.
249
- Press Enter through every step and you get a sample Todo app.
250
-
251
- One command, no prompts (CI, scripts, containers, any shell without a terminal):
252
-
253
- ```bash
254
- loki quickstart "a todo app with user accounts" --yes
255
- ```
256
-
257
- Both halves are required with no terminal: an idea (or a path to a PRD file)
258
- and an explicit `--yes`. Given both, Loki picks the top-ranked template
259
- automatically, prints the same honest cost and time estimate, and starts the
260
- build without asking anything. Missing either half exits 2 with the
261
- needs-a-terminal message and writes nothing, so an ambient `LOKI_AUTO_CONFIRM`
262
- or a stray argument in CI can never start a paid build on its own. Existing
263
- files are never overwritten: if `prd.md` is present the PRD lands at
264
- `prd-quickstart.md`, then numbered suffixes as needed.
265
-
266
- Choose an exact shipped starter when the top-ranked match is not the one you
267
- want:
268
-
269
- ```bash
270
- loki quickstart --list-templates
271
- loki quickstart --list-templates --json # schema-v1 automation output
272
- loki quickstart "an internal reporting workspace" --template dashboard --yes
273
- ```
274
-
275
- Template discovery works without a terminal or provider and lists every shipped
276
- starter's stable name and purpose in catalog order. It returns before estimation,
277
- consent, PRD writes, or build execution. Positional input and execution/preview
278
- flags are intentionally incompatible; `--json` is the only optional modifier.
279
-
280
- `--template` accepts an exact template name for idea inputs and works the same
281
- way with interactive use or `--dry-run` (including JSON preview). Unknown
282
- templates, duplicate flags, and combinations with a PRD path refuse before
283
- provider discovery, estimation, writes, or build execution.
284
-
285
- Preview the same deterministic template choice and estimator-backed plan with
286
- zero writes or execution:
287
-
288
- ```bash
289
- loki quickstart "a todo app with user accounts" --dry-run
290
- ```
291
-
292
- Preview requires an idea or readable PRD path, works without a terminal or AI
293
- provider, and exits before creating a PRD or starting a build. `--dry-run` and
294
- `--yes` are mutually exclusive so execution intent is never ambiguous.
295
-
296
- For scripts and local dashboards, add `--json` to receive one versioned JSON
297
- object instead of terminal text:
298
-
299
- ```bash
300
- loki quickstart "a todo app with user accounts" --dry-run --json > preview.json
301
- loki quickstart --verify-preview preview.json --json
302
- loki quickstart --from-preview preview.json --yes
303
- ```
304
-
305
- The object contains the input kind, deterministic selected template (or `null`
306
- for an existing PRD), the exact estimator response under `plan`, and a bounded
307
- continuation containing the exact idea/template or the PRD path and SHA-256.
308
- `--verify-preview` validates the same bounded duplicate-key-rejecting schema and
309
- requires either a currently shipped idea template or the unchanged digest-bound
310
- PRD, while emitting no idea or PRD path. It accepts a file or piped stdin and
311
- returns before provider discovery, estimation, writes, or build execution.
312
- `--from-preview` requires explicit argv `--yes`, rejects malformed, conflicting,
313
- symlinked, or changed inputs before provider and build boundaries, then uses the
314
- existing no-clobber quickstart path. The saved plan is evidence rather than
315
- execution authority: Loki recomputes and displays the current estimate before
316
- starting. `--json` requires `--dry-run`; invalid input or estimator failure
317
- writes no JSON, and preview still exits before provider discovery, file writes,
318
- or build execution.
319
-
320
- Or go straight at it:
321
-
322
- ```bash
323
- loki quick "build a landing page with a signup form" # one-shot task
324
- loki start prd.md # build from a spec you wrote
325
- loki modernize heal ./your-repo --assess # existing codebase, read-only
326
- ```
327
-
328
-
329
280
  ## Try it first, without installing
330
281
 
331
282
  ```bash
@@ -346,121 +297,7 @@ Headline: VERIFIED WITH GAPS
346
297
  | Cost | $10.3218 |
347
298
  ```
348
299
 
349
- **"WITH GAPS" is the point.** Build was not run, security has findings, and the
350
- receipt says so on its own front page. Recompute the diff hash yourself and
351
- check it matches -- you are not asked to trust the agent's self-report.
352
-
353
- ## How the legacy engine works
354
-
355
- Drop a spec: a PRD, GitHub issue, OpenAPI/JSON/YAML, or a one-line brief. Loki Mode classifies complexity (`run.sh:detect_complexity()`), selects reviewers from a specialist pool (`agents/types.json` ships the role definitions; 10 are keyword-scored by the review selector at `run.sh:FOCUS_KEYWORDS`, alongside the mandatory reviewers, and the rest are role descriptions in `references/agents.md` that the orchestrator adopts per phase rather than separate processes), with a blind review council and optional git-worktree streams on Claude Code, sequential on most other providers, and runs autonomous RARV cycles (Reason, Act, Reflect, Verify; see `run.sh:run_autonomous()`) with 8 quality gates (see `skills/quality-gates.md`). Code is not "done" until it passes automated verification. Output is a Git repo with source, tests, configs and audit logs.
356
-
357
- **Why verified completion matters.** Self-reported completion is the failure users actually hit: the agent says it is done and the work is not. Loki treats "done" as a claim to be checked. [docs/EVALUATING.md](docs/EVALUATING.md) puts a runnable command next to every claim we make, and states plainly what we do not have (no enterprise case studies, no independent benchmark placement, and generation is not air-gapped). `bash tests/test-competitor-verify-surface.sh` reruns our check of which local agent CLIs expose a command that verifies their own output.
358
-
359
- ## Already have a codebase? Start read-only.
360
-
361
- Most agents are built to create new apps. The harder, more valuable problem is
362
- the ten-year-old repo that pays the bills. Loki works on both, and on an
363
- existing codebase it starts by **changing nothing**:
364
-
365
- ```bash
366
- loki modernize heal ./your-repo --assess # read-only. no writes, no commits.
367
- loki modernize heal ./your-repo --assess --json # same, machine-readable
368
- ```
369
-
370
- You get a modernization readiness report: language mix, a 4-level maturity
371
- rating, technical-debt signals (test coverage, TODO density, oversized files,
372
- dependency staleness), and a **ranked list of where to start** -- ordered by
373
- blast radius, so the first change is the one least likely to break something.
374
-
375
- Then, if you want it to act:
376
-
377
- ```bash
378
- loki modernize heal ./your-repo --strict # block ALL behavioral change without approval
379
- loki modernize heal ./your-repo --phase archaeology # extract knowledge only
380
- loki modernize heal ./your-repo --compliance healthcare # preset flag: healthcare, fintech or government (not a certification)
381
- ```
382
-
383
- The healing pipeline runs in phases -- archaeology, stabilize, isolate,
384
- modernize, validate -- and the validate phase checks **behavioral equivalence
385
- against the pre-change baseline**, not just that the tests are green. Friction
386
- points (the weird code that exists for a reason nobody remembers) are cataloged
387
- before anything touches them, because in a legacy system the strange code is
388
- usually load-bearing.
389
-
390
- ## The Evidence Receipt: don't trust the agent, check it
391
-
392
- Every coding agent tells you it finished. Loki hands you something you can
393
- check yourself.
394
-
395
- **We are not the only tool that checks its own work, and you should be
396
- suspicious of anyone who claims to be.** Lovable runs a security scan on every
397
- publish and can block the publish outright. Claude Code's review has a step that
398
- checks findings against actual code behavior. Replit says its agent tests its
399
- own work.
400
-
401
- The difference is what you are left holding. Their output lives in their
402
- dashboard: a findings count in a dialog, a check run that by design never blocks
403
- a merge. Ours is a **file**. It is bound to a specific diff by `diff_sha256`, it
404
- records what was NOT proven as prominently as what was, and someone who has
405
- never installed Loki can re-verify it from the repository alone. Commit it,
406
- attach it to the PR, hand it to an auditor.
407
-
408
- Portable, diff-bound, and honest about its gaps -- that is the claim, and it is
409
- the one worth checking.
410
-
411
- Each run writes a receipt to `.loki/proofs/<run_id>/` that separates
412
- **deterministic FACTS** (the git diff with base and head SHAs plus a
413
- `diff_sha256`, the test command and its exit code, the build command and its
414
- exit code, each gate verdict) from **AI ASSESSMENTS** (the council verdict,
415
- labeled as judgment, never as proof). The headline is computed from the facts
416
- alone:
417
-
418
- | Headline | Means |
419
- |---|---|
420
- | VERIFIED | tests ran a real command and exited 0, diff non-empty, nothing skipped |
421
- | VERIFIED WITH GAPS | each gap listed by name |
422
- | NOT VERIFIED | a check ran and failed |
423
-
424
- ```bash
425
- loki proof list # every receipt from this project
426
- loki proof show <id> # the facts, the assessments, and the headline
427
- loki proof verify <id> # re-hash the receipt and re-derive the diff
428
- ```
429
-
430
- `loki proof verify` exits 0 clean, 1 on tamper or drift, 2 when it could not check
431
- (full table: [docs/exit-codes.md](docs/exit-codes.md)). Receipts are attached
432
- to pull requests automatically (`LOKI_PROVEN_PR=0` to opt out), so a reviewer
433
- sees the evidence next to the code.
434
-
435
- **What the receipt does NOT claim.** On the unsigned path the generator is
436
- trusted: someone who rewrites both the facts and the headline into a mutually
437
- consistent lie and recomputes the hash will still pass verification. That is
438
- defense-in-depth, not non-forgeability, and neutral non-forgeability needs the
439
- signed record. We tested for exactly this and locked the limitation into the
440
- suite (`tests/test-proof-forgery-defense.sh`), and in v7.111.0 we removed our
441
- own earlier "non-forgeable" claim once we found it was false on that path. An
442
- honest boundary you can verify beats a marketing claim you cannot.
443
-
444
- To close that gap, receipts are signed automatically with an Ed25519 key
445
- generated on first run (or your own via `LOKI_RECEIPT_SIGNING_KEY_FILE`; this needs the
446
- Python `cryptography` package, otherwise the receipt stays unsigned). See [docs/SIGNED-RECEIPTS.md](docs/SIGNED-RECEIPTS.md).
447
-
448
- ## What the legacy engine guarantees
449
-
450
- - **Verified completion** - the evidence gate (`skills/quality-gates.md`) refuses a "done" claim on an empty git diff against the run-start commit, blocks completion when tests run red, blocks when a serveable app is confirmed unhealthy (opt out `LOKI_EVIDENCE_BOOT_GATE=0`) or a credential is detected in the changed files (opt out `LOKI_EVIDENCE_SECRET_GATE=0`).
451
- - **An honest checklist verifier** - each completion checklist item is checked deterministically before the completion council accepts "done". A check that cannot be established is reported as inconclusive (pending), never as a false pass or a false failure. `rc == 0` alone is not a pass: a test check goes green only on a real "N passed" signal from the runner.
452
- - **Quality gates and review** - 8 quality gates (`skills/quality-gates.md`), blind 3-reviewer code review (`run.sh:run_code_review()`), anti-sycophancy checks.
453
- - **Standalone verification: `loki verify`** - runs the deterministic gates (build, tests, static analysis, secret scan, dependency audit) against any branch or PR diff, including code written by other agents or humans. Exit codes 0 VERIFIED, 1 CONCERNS, 2 BLOCKED, 3 verifier error; machine-readable evidence at `.loki/verify/evidence.json`. Inconclusive evidence is reported as CONCERNS; see [docs/exit-codes.md](docs/exit-codes.md) for the known gaps, including `--fast`, which can exit 0 when nothing was scanned.
454
- - **Living spec and pre-build interrogation** - `loki spec` locks a spec and detects drift; `loki grill` runs a Devil's-Advocate interrogation of the spec before you build.
455
- - **Confidence is not evidence** - when the agent's self-reported confidence spikes to near-certainty, Loki forces an extra verification pass (opt out `LOKI_CONFIDENCE_SPIKE=0`).
456
- - **Stops paying for failures that cannot succeed** - a positively identified permanent failure (bad credentials, unknown model, exhausted quota) exits instead of burning the retry budget; an unrecognized error still retries (opt out `LOKI_SMART_RETRY=0`).
457
- - **Cross-project memory** - episodic, semantic and procedural memory with optional vector search (`memory/engine.py`).
458
- - **Guided first build** - `loki quickstart` quotes the real cost and time estimate before anything is spent. `loki preview` prints the running app URL.
459
- - **MCP server** - 36 tools plus 3 resources and 2 prompts (`mcp/server.py`, magic tools from `mcp/magic_tools.py`, the managed-memory tool from `mcp/managed_tools.py`). Of the 36, 35 are always available; `loki_memory_redact` only succeeds when `LOKI_MANAGED_AGENTS=true` and `LOKI_MANAGED_MEMORY=true`. Launch with `loki mcp`.
460
- - **Legacy system healing** - `loki modernize heal` runs archaeology, stabilize, isolate, modernize and validate phases (`skills/healing.md`).
461
- - **Self-hosted and source-available (BUSL-1.1)** - your keys, your infrastructure. Free for personal, internal and academic use.
462
-
463
- ---
300
+ **"WITH GAPS" is the point.** Build was not run, security has findings, and the receipt says so on its own front page. Recompute the diff hash yourself and check it matches.
464
301
 
465
302
  ## Loki does not lie about "done"
466
303
 
@@ -494,88 +331,13 @@ completion claim is backed by deterministic evidence and is independently
494
331
  re-checkable; it does not claim the generated code is bug-free.
495
332
 
496
333
  <details>
497
- <summary><strong>Verify a receipt yourself -- <code>loki proof</code> commands, tamper/drift checks, proven PRs (advanced)</strong></summary>
498
-
499
- ### Verify it yourself
334
+ <summary><b>Setup details: providers, other models, what loki doctor checks (PRD-file examples use the legacy `loki start`)</b></summary>
500
335
 
501
- Receipts are written to `.loki/proofs/<run_id>/` automatically at run completion
502
- (opt out with `LOKI_PROOF=0`). Inspect and re-check them with `loki proof`
503
- (aliased as `loki receipt`):
504
-
505
- ```bash
506
- loki proof list # every receipt: run id, time, council verdict, cost, files
507
- loki proof show <id> # the full proof.json (facts, assessments, honesty)
508
- loki proof verify <id> # re-check the receipt against the repo (exit 0 clean, 1 tamper/drift, 2 could not check)
509
- ```
510
-
511
- `loki proof verify` does two independent checks and prints the result as JSON:
512
-
513
- - **Tamper check** -- recomputes the receipt's integrity hash and compares it to
514
- the recorded one. If anyone edited the receipt after it was written, `hash_ok`
515
- is `false`.
516
- - **Drift check** -- re-runs the diff from the recorded base SHA against the
517
- current repo and compares the file/insertion/deletion counts and `diff_sha256`
518
- to what the receipt recorded. If the repo no longer matches, `diff_drift` is
519
- `true`.
520
-
521
- A clean receipt prints `"ok": true` and exits 0. A tampered or drifted receipt
522
- exits 1. When a check cannot run (for example a receipt with no recorded base
523
- SHA), the verifier reports it as unverifiable rather than passing it silently.
524
-
525
- ```json
526
- {
527
- "hash_ok": true,
528
- "diff_drift": false,
529
- "gpg_ok": "n/a",
530
- "degraded": [],
531
- "reason": "",
532
- "ok": true
533
- }
534
- ```
535
-
536
- You can share a receipt as a self-contained HTML page (`loki proof open <id>`),
537
- or publish it as a GitHub Gist with `loki proof share <id>` (opt-in; the page is
538
- redacted before it leaves your machine). Receipts carry an Ed25519
539
- attestation (`LOKI_RECEIPT_SIGNING_KEY_FILE` to use your own key).
540
-
541
- ### Proven PR
542
-
543
- When Loki opens a pull request, the PR body includes the Evidence Receipt
544
- summary, so a reviewer does not have to take the agent on faith. It shows the
545
- honest verdict (VERIFIED / VERIFIED WITH GAPS / NOT VERIFIED), the key facts
546
- (diff hash, tests, secure-gate, cost), and a "verify this yourself" line:
547
- `loki proof verify <id>` against the recorded base SHA. A green claim appears
548
- only when the receipt's own headline is VERIFIED. This is on by default whenever
549
- Loki opens or advises a PR; opt out with `LOKI_PROVEN_PR=0`.
550
-
551
- For a review-before-publish workflow, preparation and GitHub mutation are two
552
- explicit steps:
553
-
554
- ```bash
555
- loki start owner/repo#42 --prepare-pr # builds and writes exact title/body locally
556
- loki ship --publish # pushes that issue branch and opens the PR
557
- ```
558
-
559
- The second command consumes `.loki/state/pr-title.txt` and
560
- `.loki/state/pr-body.md` byte-for-byte. Plain `loki ship`, previews, and default
561
- start paths remain non-publishing. A failed PR creation preserves both files and
562
- prints the exact remote-branch rollback command.
563
-
564
- An optional advisory status check (`loki: verified-completion`) maps the verdict
565
- to a GitHub check-run. It is opt-in (`LOKI_PROVEN_PR_CHECK=1`) and can never block
566
- a merge on its own. To make verified-completion blocking, add it as a required
567
- status check in your repository's branch-protection settings.
568
-
569
- </details>
570
-
571
- <details>
572
- <summary><b>Setup details: providers, other models, what loki doctor checks</b></summary>
573
-
574
- Other spec sources work the same way:
336
+ The `loki start <file>` examples below run on the legacy engine (being removed). A `loki start` call with an issue ref, an issue URL or a quoted multi-word task runs on Loki 10; the provider and model variables apply to both engines. Other spec sources on the legacy engine:
575
337
 
576
338
  ```bash
577
339
  loki init my-app --template simple-todo-app # scaffold a starter PRD
578
- loki start owner/repo#123 # a GitHub issue
340
+ loki start owner/repo#123 # a GitHub issue (Loki 10; same as: loki owner/repo#123)
579
341
  loki start ./openapi.yaml # an OpenAPI/YAML spec
580
342
  loki demo --offline # replay a sample receipt, no key, no spend
581
343
  ```
@@ -666,7 +428,7 @@ Required:
666
428
 
667
429
  - An agent provider CLI: [Claude Code](https://docs.claude.com/en/docs/claude-code) (`claude`, Tier 1, recommended and E2E-verified - the provider Loki Mode is built for). Cline, Codex, Aider, and opencode are supported as experimental providers (wiring in place; not yet E2E-verified by us). Loki cannot run a build without one of these installed and authenticated.
668
430
  - Python 3.8+ (`python3`) for the dashboard, memory system, and orchestration helpers.
669
- - Node.js 18+ (`node`) for the npm install path and the bundled runtime.
431
+ - Node.js 20+ (`node`) for the npm install path and the bundled runtime.
670
432
  - `jq` for the JSON that the shell flows and the quality gates parse.
671
433
  - Git 2.x (`git`) for checkpoints and worktrees.
672
434
  - `curl` for installation and network calls.
@@ -699,22 +461,22 @@ See the [Installation Guide](docs/INSTALLATION.md) for the long form.
699
461
  ---
700
462
 
701
463
  <details>
702
- <summary><strong>Runtime architecture: dual Bash/Bun runtime and the rollback flag</strong></summary>
464
+ <summary><strong>Runtime architecture: dual Bash/Bun runtime</strong></summary>
703
465
 
704
- Loki Mode runs a dual runtime by design: the Bash engine is the stable core (the autonomous loop, quality gates and completion council), and newer product surfaces are TypeScript/Bun modules that wrap it. Bash support is not going away.
466
+ The Loki 10 engine runs on the Bun runtime. The legacy engine is Bash (`autonomy/loki`) and is being removed.
705
467
 
706
- - Commands routed to the Bun runtime when `bun` is on `PATH` (the router is `bin/loki`): `version`, `--version`, `-v`, `status`, `stats`, `doctor`, `provider`, `memory`, `rollback`, `kpis`, `trust`, `proof`, `receipt`, `wiki`, `crash`, `internal`, and `report kpis`. Every other command runs on the Bash CLI (`autonomy/loki`), including the autonomous `loki start` loop (`autonomy/run.sh`), unless `LOKI_SDK_LOOP` or `LOKI_SDK_MODE=full` selects the Bun loop.
707
- - If `bun` is not on `PATH`, the shim falls through to Bash silently.
708
- - Force every command onto the Bash path with `LOKI_LEGACY_BASH=1 loki <cmd>`. This is a rollback flag for the Bun route; it is not the same as the legacy engine switch.
468
+ - Commands that require Bun: `version`, `--version`, `-v`, `status`, `stats`, `doctor`, `provider`, `memory`, `rollback`, `kpis`, `trust`, `wiki`, `crash`, `internal`, and `report kpis`.
469
+ - If `bun` is not on `PATH`, commands exit 1 with installation instructions.
470
+ - For troubleshooting, force commands onto alternate paths with environment variables; see `loki doctor` for available options.
709
471
 
710
472
  See [UPGRADING.md](UPGRADING.md) and [ADR-001: Runtime Migration](docs/architecture/ADR-001-runtime-migration.md).
711
473
 
712
474
  </details>
713
475
 
714
476
  <details>
715
- <summary><strong>Supported spec formats</strong></summary>
477
+ <summary><strong>Supported spec formats (legacy engine, being removed)</strong></summary>
716
478
 
717
- A "spec" is whatever you hand `loki start`. Loki auto-detects the format and normalises it before the RARV loop. A Markdown PRD is one form of spec; the table below lists every input the CLI accepts.
479
+ Loki 10 takes a quoted task or an issue reference (GitHub, GitLab or Jira), also through `loki start`. The table below describes the legacy `loki start`, which accepts files too; rows for an issue ref or an issue URL run on Loki 10. A "spec" is whatever you hand `loki start`. Loki auto-detects the format and normalises it before the RARV loop. A Markdown PRD is one form of spec; the table below lists every input the CLI accepts.
718
480
 
719
481
  | Format | Example | Notes |
720
482
  |--------|---------|-------|
@@ -736,14 +498,6 @@ All formats land in the same RARV pipeline and pass the same 8 quality gates (`s
736
498
 
737
499
  ---
738
500
 
739
- ## Internal architecture (legacy engine)
740
-
741
- - **RARV cycle** - every iteration: Reason (read state), Act (execute, commit), Reflect (update context), Verify (run tests, check spec). Failures trigger self-correction. [Core Workflow](references/core-workflow.md)
742
- - **8 quality gates** - static analysis, test suite (pass/fail), blind 3-reviewer code review with severity blocking, anti-sycophancy Devil's Advocate, mock-integrity detection, test-mutation detection, documentation coverage, and Magic Modules debate. Backward compatibility is a conditional healing-mode auditor, not one of the 8. [Quality Gates](skills/quality-gates.md)
743
- - **Memory** - episodic (interaction traces), semantic (generalized patterns), procedural (learned skills). Vector search optional. [Memory Architecture](references/memory-system.md)
744
- - **Dashboard** - real-time monitoring, task queue, WebSocket streaming and a Live App Preview. Starts at `localhost:57374`. [Dashboard Guide](docs/dashboard-guide.md)
745
- - **Enterprise layer** - TLS, OIDC bearer-token validation (the foundation for SSO; browser SAML login is roadmap), scoped RBAC, OTEL tracing and audit logs, activated via env vars. See [Enterprise Identity Roadmap](docs/ENTERPRISE-IDENTITY-ROADMAP.md) and [Enterprise Guide](docs/enterprise/architecture.md).
746
-
747
501
  For how Loki compares with other tools, see [docs/COMPARISON.md](docs/COMPARISON.md) and [docs/EVALUATING.md](docs/EVALUATING.md).
748
502
 
749
503
  ---
@@ -753,31 +507,34 @@ For how Loki compares with other tools, see [docs/COMPARISON.md](docs/COMPARISON
753
507
  <details>
754
508
  <summary><strong>All commands</strong></summary>
755
509
 
510
+ Loki 10 engine:
511
+
756
512
  | Command | Description |
757
513
  |---------|-------------|
758
- | `loki start [PRD]` | Start with optional PRD file (also accepts an issue ref; replaces deprecated `loki run`). Auto-opens the dashboard in the browser for interactive runs and passes native `--effort`/`--max-budget-usd`/`--fallback-model` for resilience (v7.25.0) |
759
- | `loki stop` | Stop execution |
760
- | `loki modernize heal <path>` | Legacy system healing (archaeology, stabilize, isolate, modernize, validate -- v6.67.0; was: `loki heal`) |
761
- | `loki pause` / `resume` | Pause/resume after current session |
762
- | `loki steer "<note>"` | Nudge a running build with a directive (writes `.loki/HUMAN_INPUT.md`; the loop reads it when `LOKI_PROMPT_INJECTION=1`) (v8.0.0) |
763
- | `loki status` | Show current status |
764
- | `loki why` | Explain the last outcome; on a stalled run names the real stall reason (proactive stuck-detector + convergence signal) and suggests `loki steer` (v8.0.0) |
765
- | `loki cockpit` | Live multi-repo status as an inline terminal image (Kitty/iTerm2/WezTerm/Ghostty); text + dashboard fallback elsewhere (v7.126.0) |
766
- | `loki dashboard` | Open web dashboard |
767
- | `loki preview` | Print running app URL and open in browser (Live App Preview, v7.24.0; was: `loki open`) |
768
- | `loki web` | Launch Purple Lab web UI [DEPRECATED in v7.44.0 -- use `loki start` which auto-opens the dashboard at http://localhost:57374] |
769
- | `loki doctor` | Check environment and dependencies |
770
- | `loki plan [PRD]` | Pre-execution analysis: complexity, cost, iterations |
771
- | `loki review [--staged\|--diff]` | AI-powered code review with severity filtering |
772
- | `loki test [--file\|--dir\|--changed]` | AI test generation |
773
- | `loki analyze onboard [path]` | Project analysis and CLAUDE.md generation (was: `loki onboard`) |
774
- | `loki import` | Import GitHub issues as tasks |
775
- | `loki ci` | CI/CD quality gate integration |
776
- | `loki failover` | Cross-provider auto-failover management |
777
- | `loki memory <cmd>` | Memory system: index, timeline, search, consolidate |
778
- | `loki enterprise` | Enterprise feature management |
514
+ | `loki "<task>" [--no-pr] [--deep] [--provider NAME] [--max-cost USD]` | Build a task, verify it, seal a signed receipt, open a PR |
515
+ | `loki owner/repo#N` | Same, from a GitHub, GitLab or Jira issue |
516
+ | `loki quick "<task>"` | Small task, lean path, no PR |
517
+ | `loki backlog owner/repo --all\|--label X\|--issues N,N` | Run every matching open issue, N in parallel (`--concurrency N`, `--dry-run`) |
518
+ | `loki status [--json]` | Current status |
519
+ | `loki verify [run-id]` | Re-check a sealed receipt (exit codes above) |
520
+ | `loki doctor [--json] [--airgap]` | Check environment and providers |
521
+ | `LOKI_CONTROL=1 loki control serve\|backfill\|status` | Control Plane v0 preview |
522
+ | `loki modernize <repo> --to <target> --dry-run` | Estimate only |
523
+ | `loki plan [PRD]` | Dry-run analysis: complexity, cost, execution plan |
779
524
  | `loki version` | Show version |
780
525
 
526
+ Legacy engine, being removed (these run on the previous engine; `loki --help` still lists them):
527
+
528
+ | Command | Description |
529
+ |---------|-------------|
530
+ | `loki start [PRD\|ISSUE-REF\|"TASK"]` | An issue ref, an issue URL or a quoted multi-word task runs on Loki 10 (same as `loki owner/repo#N`); a PRD file, a flag-first call or a one-word start runs the legacy build |
531
+ | `loki stop`, `pause`, `resume` | Control a legacy run |
532
+ | `loki steer "<note>"` | Nudge a legacy run (needs `LOKI_PROMPT_INJECTION=1`) |
533
+ | `loki why`, `loki next` | Explain or continue a legacy run |
534
+ | `loki dashboard` | Operations UI server (`start\|stop\|status\|url\|open`) |
535
+ | `loki review`, `loki test`, `loki analyze`, `loki memory`, `loki failover`, `loki enterprise`, `loki import`, `loki ci` | Review, test generation, codebase analysis, memory, failover, enterprise, issue import, CI gate |
536
+ | `loki modernize heal <path>` | Legacy system healing |
537
+
781
538
  </details>
782
539
 
783
540
  Run `loki --help` for all options. Full reference: [CLI Reference](wiki/CLI-Reference.md) | Config: [config.example.yaml](autonomy/config.example.yaml)
@@ -788,7 +545,7 @@ Pass a config file to `loki start` with `--config <path>` (aliases `--env-file`,
788
545
  ---
789
546
 
790
547
  <details>
791
- <summary><strong>Configuration env vars (intelligent defaults, opt-out knobs)</strong></summary>
548
+ <summary><strong>Configuration env vars (legacy engine knobs, opt-out)</strong></summary>
792
549
 
793
550
  Loki Mode's accuracy and autonomy behaviors are default-on. Each is an opt-out escape hatch, not a setting you have to discover. The most relevant knobs from the v7.41.x accuracy/autonomy hardening:
794
551
 
@@ -809,7 +566,7 @@ This is a subset. See the [wiki](wiki/Home.md) for the full env-var reference an
809
566
  </details>
810
567
 
811
568
  <details>
812
- <summary><strong>BMAD Method Integration</strong></summary>
569
+ <summary><strong>BMAD Method Integration (legacy engine, being removed)</strong></summary>
813
570
 
814
571
  Loki Mode integrates with the [BMAD Method](https://github.com/bmad-code-org/BMAD-METHOD), a structured AI-driven agile methodology. If your project uses BMAD for requirements elicitation, Loki Mode can consume those artifacts directly:
815
572
 
@@ -826,7 +583,7 @@ See [BMAD Integration Validation](docs/architecture/bmad-integration-validation.
826
583
  <details>
827
584
  <summary><strong>Enterprise Features</strong></summary>
828
585
 
829
- Enterprise features are included but require env var activation.
586
+ Enterprise features are free, included, and need no license key. They are activated with env vars. (Legacy engine surface, being removed with it.)
830
587
 
831
588
  ```bash
832
589
  export LOKI_ENTERPRISE_AUTH=true # token auth (dashboard/auth.py)
@@ -854,7 +611,7 @@ loki enterprise status
854
611
  | **Testing** | 8 automated quality gates | Test quality depends on AI assertions |
855
612
  | **Providers** | Claude, Cline, Codex, Aider and opencode | Non-Claude providers are experimental and mostly sequential |
856
613
  | **Dashboard** | Real-time single-machine monitoring | No multi-node clustering |
857
- | **Loki 10** | The v10 run, `status`, `verify`, `dashboard` | Not the default yet; `loki modernize <repo> --to` runs `--dry-run` only; Slack is not wired in |
614
+ | **Loki 10** | The v10 run (`loki "<task>"`, `loki owner/repo#N`, `loki quick`), `status`, `verify`, `backlog` | `loki start <issue ref|issue URL|"task">` runs Loki 10, `loki start <file>` stays legacy; `loki modernize <repo> --to` runs `--dry-run` only; Slack is not wired in; Control Plane v0 is a preview |
858
615
 
859
616
  > **What "autonomous" means:** the system runs RARV cycles without prompting. It does NOT access your cloud accounts, payment systems or external services unless you provide credentials. Human oversight is expected for deployment, API keys and critical decisions.
860
617
 
@@ -896,7 +653,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
896
653
 
897
654
  ## License
898
655
 
899
- [Business Source License 1.1](LICENSE) -- Free for personal, internal, academic, and non-commercial use. Converts to Apache 2.0 on March 19, 2030. Contact founder@autonomi.dev for commercial licensing.
656
+ [Business Source License 1.1](LICENSE) -- Free for personal, internal, academic, and non-commercial use. Converts to Apache 2.0 on March 19, 2030. Contact founder@autonomi.dev for other licensing arrangements.
900
657
 
901
658
  ---
902
659