loki-mode 11.128.2 → 11.130.0

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 (94) hide show
  1. package/README.md +1 -0
  2. package/SKILL.md +3 -3
  3. package/VERSION +1 -1
  4. package/autonomy/lib/help-core.sh +30 -42
  5. package/autonomy/lib/workspace.py +292 -19
  6. package/autonomy/lib/workspace_comment.py +40 -11
  7. package/autonomy/loki +129 -159
  8. package/autonomy/route.sh +3 -2
  9. package/autonomy/trigger-server.py +373 -32
  10. package/bin/loki +139 -18
  11. package/completions/_loki +11 -142
  12. package/completions/loki.bash +4 -2
  13. package/dashboard/__init__.py +1 -1
  14. package/docs/CLI-CORE-VERBS.md +61 -37
  15. package/docs/CLI-INVENTORY.md +152 -153
  16. package/docs/CLI-REFERENCE.md +20 -166
  17. package/docs/DEPLOYMENT.md +38 -3
  18. package/docs/INSTALLATION.md +7 -1
  19. package/docs/KNOWN-ISSUES.md +1 -1
  20. package/docs/PROOF-PASSPORT.md +21 -0
  21. package/docs/TESTING.md +1 -1
  22. package/docs/WORKSPACES.md +27 -0
  23. package/docs/cost-controls.md +74 -12
  24. package/docs/dev/architecture-reference.md +2 -2
  25. package/docs/environment-variables.md +7 -0
  26. package/docs/exit-codes.md +7 -0
  27. package/docs/merge-queue.md +44 -3
  28. package/docs/sentry-intake.md +1 -1
  29. package/docs/slack.md +1 -1
  30. package/docs/v10/GUIDE.md +33 -4
  31. package/loki-ts/dist/loki.js +1695 -1649
  32. package/mcp/__init__.py +1 -1
  33. package/memory/knowledge_graph.py +442 -56
  34. package/package.json +3 -3
  35. package/packages/control-plane/dist/server.js +2166 -1633
  36. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  37. package/schemas/loki-yaml.schema.json +1 -0
  38. package/web-app/dist/assets/{AdminPage-B-9a_urH.js → AdminPage-CNxvd-uy.js} +1 -1
  39. package/web-app/dist/assets/{Avatar-DWFQPBje.js → Avatar-DdLoiZKv.js} +1 -1
  40. package/web-app/dist/assets/{Badge-CuLYjGKc.js → Badge-DrdPaBOH.js} +1 -1
  41. package/web-app/dist/assets/{Button-Cws5TOeA.js → Button-BQ0UyQAk.js} +1 -1
  42. package/web-app/dist/assets/{CockpitPage-CCT1U0rq.js → CockpitPage-BLFBjBZW.js} +1 -1
  43. package/web-app/dist/assets/{ComparePage-ChcsGaeo.js → ComparePage-NHaUjY-d.js} +1 -1
  44. package/web-app/dist/assets/{ErrorBoundary-C5Mz6Y_d.js → ErrorBoundary-ClaDCylr.js} +1 -1
  45. package/web-app/dist/assets/{EvidenceReceiptPanel-jXRFyeG-.js → EvidenceReceiptPanel-BBW0IhXb.js} +1 -1
  46. package/web-app/dist/assets/{GitHubIssuesPanel-C_YjFJSB.js → GitHubIssuesPanel-B_dAtNuN.js} +1 -1
  47. package/web-app/dist/assets/{GitHubPRsPanel-B3bRY_lb.js → GitHubPRsPanel-Tv3JF9E0.js} +1 -1
  48. package/web-app/dist/assets/{HomePage-JLwBDYu8.js → HomePage-8fLInImK.js} +2 -2
  49. package/web-app/dist/assets/{LoginPage-BcDvWJr1.js → LoginPage-BGL-xm0l.js} +1 -1
  50. package/web-app/dist/assets/{MagicPage-Bj3qzygY.js → MagicPage-D7nHpNuT.js} +1 -1
  51. package/web-app/dist/assets/{MetricsPage-9k0NVtge.js → MetricsPage-BZh8ZOug.js} +1 -1
  52. package/web-app/dist/assets/{NotFoundPage-D81Z_SCM.js → NotFoundPage-DJ5YwC3-.js} +1 -1
  53. package/web-app/dist/assets/{ProjectPage-D9CkJI0B.js → ProjectPage-DYaGNgFt.js} +3 -3
  54. package/web-app/dist/assets/{ProjectsPage-vxSmYYzh.js → ProjectsPage-9GbGTW3g.js} +1 -1
  55. package/web-app/dist/assets/{SettingsPage-Cd2AS1Sg.js → SettingsPage-DdRI8LZ5.js} +1 -1
  56. package/web-app/dist/assets/{ShowcasePage-DOZCRLg5.js → ShowcasePage-ClEeMHAu.js} +1 -1
  57. package/web-app/dist/assets/{SystemSettingsPage-wl2UO5DF.js → SystemSettingsPage-rqj2byaP.js} +1 -1
  58. package/web-app/dist/assets/{TeamsPage-CA9FPLPm.js → TeamsPage-OaJ999dm.js} +1 -1
  59. package/web-app/dist/assets/{TemplatesPage-DLRTBM8i.js → TemplatesPage-CrqXt5pd.js} +1 -1
  60. package/web-app/dist/assets/{TerminalOutput-RqmPEs4o.js → TerminalOutput-DzOk3P-J.js} +1 -1
  61. package/web-app/dist/assets/{activity-CoyjHBZ4.js → activity-C3XPvqFU.js} +1 -1
  62. package/web-app/dist/assets/{bell-Dn2BCsQu.js → bell-BADR28Ic.js} +1 -1
  63. package/web-app/dist/assets/{bot-CNqPuD8h.js → bot-BOfl_osT.js} +1 -1
  64. package/web-app/dist/assets/{check-BWAwFpe2.js → check-DyeRhpqt.js} +1 -1
  65. package/web-app/dist/assets/{chevron-left-BgTjvxLB.js → chevron-left-DytHCita.js} +1 -1
  66. package/web-app/dist/assets/{circle-alert-CIYxFeDp.js → circle-alert-ej7tR0w9.js} +1 -1
  67. package/web-app/dist/assets/{clock-Dj6DRvL7.js → clock-CMmgiaJ3.js} +1 -1
  68. package/web-app/dist/assets/{cloud-DZBvW6-f.js → cloud-BmoOA5GK.js} +1 -1
  69. package/web-app/dist/assets/{code-xml-B0sAmzAO.js → code-xml-DjcElMOx.js} +1 -1
  70. package/web-app/dist/assets/{database-BkO44OAR.js → database-BxK55gai.js} +1 -1
  71. package/web-app/dist/assets/{dollar-sign-ChTZgVxB.js → dollar-sign-MxE9EOHB.js} +1 -1
  72. package/web-app/dist/assets/{file-code-corner-CQSIiG1T.js → file-code-corner-BYQ975Vf.js} +1 -1
  73. package/web-app/dist/assets/{file-plus-BAV2KC_M.js → file-plus-C0_fKf6I.js} +1 -1
  74. package/web-app/dist/assets/{globe-TUNeqVA9.js → globe-C7iJxA9K.js} +1 -1
  75. package/web-app/dist/assets/{hammer-CMD4wrup.js → hammer-CuVGrR3Z.js} +1 -1
  76. package/web-app/dist/assets/{index-B5lRV-ZJ.js → index-DvGbCL2t.js} +3 -3
  77. package/web-app/dist/assets/{layers-BxXkAn6j.js → layers-BWmxXnEV.js} +1 -1
  78. package/web-app/dist/assets/{loader-circle-CE46Yvcr.js → loader-circle-BrsqCmNy.js} +1 -1
  79. package/web-app/dist/assets/{lock-3uBPp5eV.js → lock-Dl3UsTMr.js} +1 -1
  80. package/web-app/dist/assets/{package-DjPZ3DLs.js → package-CCiRYdmb.js} +1 -1
  81. package/web-app/dist/assets/{plus-D8v6ZCYM.js → plus-d5BugnNw.js} +1 -1
  82. package/web-app/dist/assets/{refresh-cw-BSPJHBul.js → refresh-cw-DIkE6C0k.js} +1 -1
  83. package/web-app/dist/assets/{rotate-ccw-D0u6PH4j.js → rotate-ccw-DDhYD9MA.js} +1 -1
  84. package/web-app/dist/assets/{scroll-text-Dcwu9apa.js → scroll-text-jAoSqO2O.js} +1 -1
  85. package/web-app/dist/assets/{server-pd5YWyJw.js → server-D16MyCdB.js} +1 -1
  86. package/web-app/dist/assets/{shield-alert-C3TqM2Xm.js → shield-alert-C8W_Qcb5.js} +1 -1
  87. package/web-app/dist/assets/{thumbs-up-U1Wkm_Rg.js → thumbs-up-DdTbl2Vo.js} +1 -1
  88. package/web-app/dist/assets/{trash-2-BspH7NSu.js → trash-2-R-2Gvy6B.js} +1 -1
  89. package/web-app/dist/assets/{trending-down-DNg_ybr3.js → trending-down-Dk08-nlD.js} +1 -1
  90. package/web-app/dist/assets/{trending-up-CYzIu-lq.js → trending-up-DX8yONXb.js} +1 -1
  91. package/web-app/dist/assets/{upload-ChhyDeon.js → upload-6oDG_uiK.js} +1 -1
  92. package/web-app/dist/assets/{usePolling-ClMveR0q.js → usePolling-Co4817xB.js} +1 -1
  93. package/web-app/dist/assets/{user-BlFXAv0-.js → user-CjbWWW1W.js} +1 -1
  94. package/web-app/dist/index.html +1 -1
@@ -4,7 +4,7 @@ Issues in the current release that are known and not yet fixed. Report new ones
4
4
 
5
5
  ## Which engine runs
6
6
 
7
- From 11.4.0, `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine whatever the flag order or input form. The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, for a provider with no Loki 10 invoker, for a PRD over 100000 bytes, or never because of a flag: a flag Loki 10 cannot honor (`--simple`, `--sandbox`, `--ship`, `--worktree`, `--detach`, `--parallel`, ...) is refused with exit 2 and names its replacement, and `--engine legacy` keeps it. `--pr` is accepted (Loki 10 opens the PR by default), `--quiet` and `--resume` are honored, and `--dry-run` prints the route, max-cost and run cap without starting. Check with `loki route start <args> --json`: it reports `engine`, `adapter`, `reason` and `capability_differences`. The full table is in the Routing contract section of `docs/exit-codes.md`.
7
+ From 11.4.0, `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine whatever the flag order or input form. The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, for a provider with no Loki 10 invoker, for a PRD over 100000 bytes, or never because of a flag: a flag Loki 10 cannot honor (`--simple`, `--sandbox`, `--ship`, `--worktree`, `--parallel`, ...) is refused with exit 2 and names its replacement, and `--engine legacy` keeps it. `--pr` is accepted (Loki 10 opens the PR by default), `--quiet` and `--resume` are honored, and `--dry-run` prints the route, max-cost and run cap without starting. Check with `loki route start <args> --json`: it reports `engine`, `adapter`, `reason` and `capability_differences`. The full table is in the Routing contract section of `docs/exit-codes.md`.
8
8
 
9
9
  ## Exit codes
10
10
 
@@ -143,3 +143,24 @@ The bare word `VERIFIED` therefore means: integrity not failed, no failed checks
143
143
  - Existing JSON fields are untouched. `verification` is additive.
144
144
  - Receipts written before this contract lack `facts.environment` and `facts.git.dirty`. They report environment `not recorded` and may report freshness `unknown`.
145
145
  - `loki proof show <id>` used to print the raw JSON. Scripts that parsed it must now pass `--json`.
146
+
147
+ ## Passport on every PR
148
+
149
+ A VERIFIED Loki 10 PR carries a portable proof passport in its receipt comment (the comment marked `<!-- loki-receipt -->`). It is the run receipt as a signed DSSE envelope (in-toto Statement v1, Ed25519 over the DSSE pre-authentication encoding, the same envelope `loki verify --export-dsse` writes) plus the public JWK of the signing key. The comment also prints the key id and the commit the receipt covers.
150
+
151
+ To check a PR offline, with no account and no network:
152
+
153
+ 1. Copy the two blocks under "Proof passport" in the comment into `receipt.dsse.json` and `pubkey.jwk`.
154
+ 2. Run `loki verify --pubkey pubkey.jwk receipt.dsse.json`. Expected: `verdict: VERIFIED`, exit 0. A changed byte reads TAMPERED (exit 1).
155
+ 3. Check that the commit printed in the comment is the PR's head commit.
156
+
157
+ Key trust: the key inside the comment proves integrity only. Anyone can sign a receipt with their own key and post it with their own matching key. Compare the key id with one you obtained out of band (`loki keys export` prints it), or run `loki verify` with a key file you already trust. `loki review queue` never trusts the embedded key: it checks passports only against `--pubkey FILE` or the local receipt key, and a passport from any other key reads `unchecked`.
158
+
159
+ What the passport does not cover:
160
+
161
+ - Draft and non-VERIFIED PRs get no passport; the comment says why (`not issued: run outcome PARTIAL`). Only VERIFIED and ALREADY_SATISFIED receipts are exported, the same policy as `--export-dsse`.
162
+ - `events.jsonl` is not in the envelope, so the event-log checks do not run on a passport. For the full evidence (receipt, event log, key) use `loki proof bundle <run-id>`.
163
+ - The envelope is a copy of the receipt predicate: checks, cost, toolchain, evidence and assumptions are visible to anyone who can read the PR. Two guards keep it from leaking local detail: a receipt that mentions the repository path, your home directory, `/Users/` or `/home/` gets no passport (`receipt holds local paths`), and a passport above 60000 characters is not posted (`passport too large`). In both cases use `loki proof bundle`.
164
+
165
+ `LOKI_PR_PASSPORT=0` turns the passport off; the comment then says `Passport: passport disabled`. See `docs/merge-queue.md` for `loki review queue`, which ranks open Loki PRs and marks the ones whose passport verifies.
166
+
package/docs/TESTING.md CHANGED
@@ -27,7 +27,7 @@ LOCAL_CI_ONLY=hygiene,pack-contents bash scripts/local-ci.sh # a subset
27
27
  | `redaction` | `redactSecrets` removes a GitHub token, an Anthropic key and an AWS key and stays linear (growth from 25k to 100k characters under 8x) |
28
28
  | `typecheck` | `bunx tsc --noEmit` in `loki-ts` is clean |
29
29
  | `detect-gates` | the five `tests/detect-*.sh` quality gates that `autonomy/run.sh` executes pass a clean fixture and fail a defective one |
30
- | `dist-freshness` | the committed `loki-ts/dist` bundles equal a fresh build of `loki-ts/src`; `web-app/dist/index.html` references only assets that exist |
30
+ | `dist-freshness` | `loki-ts` builds from source into `loki.js` and `cockpit.js` that embed VERSION, nothing under `loki-ts/dist` is tracked, and `web-app/dist/index.html` references only assets that exist |
31
31
  | `engine10-e2e-stub` | the real engine, end to end on a stub provider: VERIFIED run, tampered run reads TAMPERED, the agent session never receives the GitHub token |
32
32
  | `scope-and-fix` | implement and fix stages on the stub provider: an edit to a pre-existing test is restored (kept when the task names the file), an out-of-scope edit is listed on the receipt, a fix-round spec conflict starts no retry, a fix round with no progress stops fixing |
33
33
 
@@ -13,6 +13,7 @@ workspaces:
13
13
  integration: {command: "make e2e", timeout_s: 900, per_stage: false}
14
14
  concurrency: 2
15
15
  plan: false
16
+ affected: false
16
17
  ```
17
18
 
18
19
  The `workspaces:` block is validated and fails closed: a misspelled key (for example `afer`) or a wrong type exits 2 and names the key.
@@ -27,6 +28,7 @@ loki workspace show shop
27
28
  loki workspace run shop acme/api#12
28
29
  loki start --workspace shop "<brief>" # same runner, from the primary command
29
30
  loki workspace infer shop # print suggested after: edges
31
+ loki workspace affected shop "rename customer id" # print which repos the goal touches
30
32
  loki workspace status # every recorded run, one row per repo
31
33
  loki workspace status <run-id>
32
34
  ```
@@ -46,6 +48,31 @@ loki workspace status <run-id>
46
48
  - Verify a run: see "Verify a workspace run" below.
47
49
  - Backlog (`loki backlog`) and dashboard starts now share the workspace worktree prep: a per-repo lock, a clean start point and copied dependencies. `LOKI_WORKSPACES=0` restores the previous worktree creation (D51-B05, D51-B06).
48
50
 
51
+ ## Let the goal pick the repos
52
+
53
+ ```bash
54
+ loki workspace affected shop "rename customer id everywhere" # print-only, no model call, writes nothing
55
+ LOKI_WORKSPACE_AFFECTED=1 loki workspace run shop "rename customer id everywhere"
56
+ loki start --workspace shop "<goal>" # with LOKI_WORKSPACE_AFFECTED=1 or `affected: true`
57
+ ```
58
+
59
+ `affected` searches each repo's tracked files (`git grep`, skipping node_modules, dist, build, vendor and .loki) for terms taken from the goal and prints one row per repo: `selected` with the first `file:line (term)` hit, or `not selected (no match)`, then the run order. Add `--json` for the full selection (`terms`, `selected`, `not_selected`, `evidence`, `fallback`, `order`).
60
+
61
+ Terms are lexical and limited:
62
+ - Explicit identifiers are taken verbatim: backticked or quoted text, words containing `_`, camelCase words, and capitalised words that do not start the goal.
63
+ - Every run of 2 or 3 consecutive plain words (stopwords such as rename, all, the break a run) becomes spelling variants: `customer_id`, `customer-id`, `customerId`, `CustomerId`, `CUSTOMER_ID`, `customerid`, and `customerID` and `CustomerID` when the last word is 3 letters or fewer. A single plain word is never a term.
64
+ - A hit must sit on word boundaries: `customerId` matches `customerIdentity` no more than `id` matches `idle`.
65
+ - A synonym or abbreviation (`custId` for "customer id") is missed, and a mention in docs or a comment counts as a hit.
66
+ - With an `owner/repo#N` goal the issue owner is always selected and the issue title and body supply the terms (a `gh` failure prints `issue text unavailable` and uses no terms).
67
+
68
+ Fail-open cases, so a repo is never silently dropped on an error: a repo with no local checkout is included unscanned, a repo whose scan errors or exceeds 60 seconds is included, and when no repo matches at all every repo runs (`no repo matched the goal; running every repo`).
69
+
70
+ With `affected: true` or `LOKI_WORKSPACE_AFFECTED=1`, `run` runs only the selected repos. Their order is the declared `after` edges plus the edges `infer` computes (manifest, import and OpenAPI generator evidence), limited to the selected repos; an inferred cycle falls back to the declared edges and prints why. Unselected repos are not changed, but the integration command still sees their checkouts through `LOKI_WS_DIR_<OWNER>_<REPO>`. The selection (with evidence) is written to integration.json, so the signed composite.json also attests which repos were chosen and why.
71
+
72
+ Every repo PR comment now ends with a "Linked PRs" section naming each sibling PR (with `(this PR)` and `(draft)` markers), and the run summary prints each PR URL plus `linked PRs: K of N repos have an open PR (R ready, D draft)`. These need `gh`; without it the line reads 0 of N.
73
+
74
+ Pruning is off by default, because a lexical miss would leave a repo out of the linked set while the run exits 0. Turn it on per workspace with `affected: true`, or per run (including `loki start --workspace`) with `LOKI_WORKSPACE_AFFECTED=1`.
75
+
49
76
  ## Verify a workspace run
50
77
 
51
78
  After `loki workspace run <name> <ref>` finishes, check the evidence rather than trusting the exit code alone:
@@ -61,7 +61,7 @@ Where the default applies:
61
61
 
62
62
  | Route | Default applies | What the cap does |
63
63
  | --- | --- | --- |
64
- | engine10 (`loki "<task>"`, the Loki 10 engine) | Only when an API key is set (`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`). A subscription run (no key) has no dollar cap. | Ends the run `BUDGET_STOP`, exit 3. |
64
+ | engine10 (`loki "<task>"`, the Loki 10 engine) | Only when an API key is set (`ANTHROPIC_API_KEY` or `OPENAI_API_KEY`). A subscription run (no key) has no dollar cap. | Stops starting stages and seals what exists (see "What you keep at the cap"). |
65
65
  | Bash loop (`loki start`, `autonomy/run.sh`) | Always, key or not. | Pauses the run (writes `.loki/PAUSE` and `.loki/signals/BUDGET_EXCEEDED`); remove both to resume. |
66
66
 
67
67
  The README and the engine guide have shown different figures in the past (100 and
@@ -85,7 +85,8 @@ Every start prints the active cap and where it came from.
85
85
 
86
86
  - engine10: the start line ends the cap clause with `cap $X.XX (SOURCE)` where SOURCE
87
87
  is `--max-cost`, `env`, `loki.yaml` or `default`, or `no dollar cap (subscription)`.
88
- The default output stays within its 8-line limit.
88
+ The same line carries the cost and time quote (see "Preview the cost before
89
+ spending anything"). The default output stays within its 8-line limit.
89
90
  - bash route: `Budget limit set: $X.XX (source: flag|env|config|default)`.
90
91
 
91
92
  A cap set through the bash settings file is reported as `config`; the `--config`
@@ -107,14 +108,36 @@ file loader exports the variable, so it reports as `env`.
107
108
  ### Enforcement point and overshoot
108
109
 
109
110
  engine10 checks the cap before each stage starts (`machine.ts`, `capReached`), using
110
- the cost events recorded so far. A stage that is already running is not interrupted by
111
- the dollar cap. The documented overshoot is therefore up to the cost of the stages in
112
- flight when the cap is crossed (the plan and wall stages can run together). Time caps
113
- and the per-session time limit still apply inside a stage.
111
+ the cost events recorded so far, and each session is handed what is left of the cap
112
+ (`engine10/session.ts`, `childBudgetLimit`, exported as `LOKI_BUDGET_LIMIT` and passed to
113
+ Claude Code as `--max-budget-usd` by `loki-ts/src/providers/claude_flags.ts`). So a session that is
114
+ already running is bounded by the remaining cap, with a floor of $0.01, and the overshoot is
115
+ bounded per session. The plan and wall stages can run together, so up to two sessions can
116
+ be in flight when the cap is crossed. Time caps and the per-session time limit still apply
117
+ inside a stage. A provider that reports no cost (opencode) has no dollar enforcement; the
118
+ start line warns about it.
114
119
 
115
120
  The bash route checks after each iteration (`check_budget_limit`), so the overshoot is
116
121
  up to one iteration.
117
122
 
123
+ ### What you keep at the cap
124
+
125
+ When the cap is reached no later stage starts, but the closing stages (commit and seal)
126
+ still run, so the work done so far is kept and the run ends with a receipt that names the
127
+ cap:
128
+
129
+ - The edits are committed on `loki/<runId>` and your checkout returns to the branch you
130
+ started on, untouched. The run prints where the work is.
131
+ - If the cap is crossed while implement is running or after it, the outcome is `PARTIAL`
132
+ (exit 6) with `Reason: cost/time cap reached`. If it is crossed before any change exists,
133
+ the outcome is `FAILED` (exit 1) with the same reason and there is nothing to keep.
134
+ `tests/min/engine10-e2e-stub.sh` pins the first case.
135
+ - `BUDGET_STOP` (exit 3) is reserved for a run that ended without sealing a receipt.
136
+ Then `.loki/runs/<id>/budget.json` records the cap, the amount spent and the source,
137
+ and the next step reads "raise with --max-cost". A rerun of the same task starts from
138
+ that spend (see "A budget stop survives a rerun").
139
+ - To continue after a cap, raise it with `--max-cost` and rerun.
140
+
118
141
  ### Missing prices
119
142
 
120
143
  Cost is never reported as 0 when it was not measured.
@@ -174,14 +197,53 @@ See [exit codes](./exit-codes.md) for the full contract.
174
197
 
175
198
  ## Preview the cost before spending anything
176
199
 
177
- ```sh
178
- loki plan ./prd.md --json
200
+ Every `loki "<task>"` start line carries one quote, printed before any session starts:
201
+
202
+ ```
203
+ ... cap $5.00 (--max-cost); estimate: about $0.19 (range $0.12-$0.39), about 1 min (range 1-5 min), first run in this repo (benchmark prior, loki-default)
179
204
  ```
180
205
 
181
- Reports complexity, estimated iterations, token usage and cost **without
182
- executing**. No provider call, no spend. `LOKI_CONFIG_DUMP=1 loki start ./prd.md`
183
- prints the resolved configuration and exits, so you can confirm your caps are
184
- actually set before a real run.
206
+ `loki estimate` prints the same quote without starting a run (`--model M`, `--provider P`
207
+ and `--json` are accepted). Where the numbers come from:
208
+
209
+ - **First run in a repo, or fewer than 3 verified runs of the project shape.** The quote
210
+ is a benchmark prior: the p10 to p90 range and the median of the measured cost and wall
211
+ time of Loki runs in the committed citable head-to-head results
212
+ (`benchmarks/h2h/results`, the file list is `PRIOR_SOURCES` in
213
+ `loki-ts/src/runner/router/cost_preview.ts`, and `tests/min/outcome-metrics.sh`
214
+ recomputes every number from those files). A plain `loki start` quotes the
215
+ `loki-default` band (24 runs): about $0.19, range $0.12-$0.39, about 1 min, range 1-5 min.
216
+ `loki start --haiku` and `LOKI_ROUTER=auto` quote the `loki-haiku-flag` band (96 runs).
217
+ A pinned model quotes its own family band.
218
+ - **After 3 verified runs of the same project shape in this repo.** The quote is the
219
+ median and range of those runs' own cost and time, labelled "from K prior runs of shape S".
220
+ - **Never from task text.** A model with no benchmark row (an opencode model) prints
221
+ `NOT AVAILABLE (reason)`, never a guess.
222
+ - **Subscription runs.** The dollars are what the same usage would cost at API prices,
223
+ not an amount billed to you.
224
+
225
+ Switches: `LOKI_COST_PREVIEW=0` turns every quote surface off, `LOKI_COST_PRIOR=0` drops the
226
+ first-run prior (the line then reads NOT AVAILABLE until history exists), and
227
+ `LOKI_COST_CONFIRM=1` asks y/N before a run starts.
228
+
229
+ How accurate the quote was: `loki stats --outcomes` prints a `Quote accuracy` row, how many
230
+ of the last 50 sealed runs landed inside the quoted dollar range and the median error against
231
+ the quoted middle (`quote_accuracy` in `--json`).
232
+
233
+ What the quote is not:
234
+
235
+ - The prior comes from small benchmark tasks, so it under-quotes large real work until the
236
+ repo has its own history. The range is shown for that reason.
237
+ - The default band was measured on one account whose Claude Code default model is not
238
+ recorded (its cost tracks the Opus band, so a Sonnet-default or Pro user is over-quoted).
239
+ - Quote accuracy counts sealed runs only. A run that ended without a receipt has no
240
+ actual cost on a receipt and is not in the row, so the figure reads optimistic.
241
+ - It is not a cap. The cap is the separate `cap $X` clause on the same line.
242
+
243
+ For the older loop, `loki plan ./prd.md --json` reports complexity, estimated iterations,
244
+ token usage and cost without executing. No provider call, no spend.
245
+ `LOKI_CONFIG_DUMP=1 loki start ./prd.md` prints the resolved configuration and exits, so you
246
+ can confirm your caps are actually set before a real run.
185
247
 
186
248
  ## What you are charged for, stated plainly
187
249
 
@@ -35,7 +35,7 @@ explicitly rather than inheriting the session model.
35
35
  - **Progressive Disclosure**: 3-layer loading (index, timeline, full details)
36
36
  - **Token Economics**: Discovery vs read token tracking
37
37
  - **Vector Search**: Optional embedding-based similarity (sentence-transformers)
38
- - **Cross-project index + knowledge graph**: `memory/cross_project.py`, `memory/knowledge_graph.py` (added v7.x)
38
+ - **Cross-project index + knowledge graph**: `memory/cross_project.py`, `memory/knowledge_graph.py` (added v7.x; FR06: `ingest_repo`/`merge_repo` store per-repo services, CODEOWNERS rules and decision docs in graph.json, `org_context` renders them cited)
39
39
  - **Managed memory client**: `memory/managed_memory/` -- gated on `LOKI_MANAGED_MEMORY=true`. See `skills/memory.md`.
40
40
  - **CLI**: `loki memory index|timeline|consolidate|economics|retrieve|episode|pattern|skill|vectors`
41
41
  - **API**: REST endpoints at `/api/memory/*`
@@ -135,7 +135,7 @@ extract_learnings_from_session (autonomy/run.sh) mirrors learnings and decisions
135
135
  - Composite: `features/speed/seal_group.ts` composeComposite/verifyComposite (schema `loki.v10.composite/1`), sealed by `loki verify --seal-composite <run_dir>`, signed with the existing `signReceipt`, capped by `capGroupVerdict`. Workspace runs seal it after integration.json.
136
136
  - Autonomy ladder: `src/policies/engine.js` allowedActions(level) (propose = none, execute = pr, operate = pr + deploy; merge never). engine10 `supervisor.ts` prGate consults `src/policies/check.js`; `loki deploy --execute` consults it for `deploy` and fails closed. `loki trust` graduationAdvice is advisory and never writes the policy file.
137
137
  - Parallel units: `route.ts` maybeRunGroup defaults to `features/speed/run_group.ts`, which freezes per-unit acceptance (`features/contract.ts`), runs units, merges with `engine10/integrate.ts` and seals once via sealGroup.
138
- - Lessons: every sealed run appends a receipt fact (`LOKI_AUTO_LEARN_PR`, default on) outside the receipt body; `implement.ts` injects lessons and relevant learnings inside the untrusted-data fence; `loki memory brief --task T` prints the same block.
138
+ - Lessons: every sealed run appends a receipt fact (`LOKI_AUTO_LEARN_PR`, default on) outside the receipt body; `implement.ts` injects lessons and relevant learnings inside the untrusted-data fence; `loki memory brief --task T` prints the same block. With `LOKI_ORG_GRAPH=1` (off) `implement.ts` also appends `orgKnowledgeBlock` (util/pr_lessons.ts, python3 by file path, 10 s cap, 1500 bytes) and records org_bytes/org_lines in lessons-injected.json.
139
139
 
140
140
  - Wall publish (FC-VERIFIED-PR-WITHOUT-ITS-TEST): on a VERIFIED seal only, `publishWall` (`util/check_result.ts`, called from `stages/seal.ts`) makes ONE child commit (trailer `Loki-Wall-Publish: <runId>`) of the SEALED Wall bytes (`runDir/wall`, hash-checked against `wall.files[].sha256`) that verify ran and passed (`publishableWall`). Before writing, the realpath of each Wall file's parent directory must be inside the repo, and an existing file or symlink is removed first. The child commit runs with hooks and signing OFF (the default `git()` call, no `userHooks`), so a pre-commit hook cannot add files or rewrite the Wall bytes. Afterwards the commit must touch exactly the published paths and each committed blob must equal the blob hash of the sealed bytes (computed in process, never read from the worktree); on any mismatch the child is rolled back (`update-ref` HEAD to the product head plus `read-tree`), nothing is published and a NOT PROVEN note is added. The receipt binds the PRODUCT head (head_sha, tree, diff_sha256 are computed before the child commit). A re-seal binds `HEAD^` only when HEAD's message has the exact trailer line for this run, HEAD touches only paths of this run's `wall.files`, and every blob sha256 matches (`wallChild`); a forged trailer is not enough. `util/seal_drift.ts` accepts a moved HEAD after head_sha as benign only when every commit after it is such a Wall publish commit (linear, trailer line for the receipt's run_id, only `wall.files` paths, blob sha256 equal to the sealed one); any commit after head_sha that carries this run's trailer but fails that check is head drift (UNCHECKED). Later commits without the trailer stay under the TEN-GATES-16 sealed-path overlap rule. The PR body gains an "Acceptance tests" section. Commit stage and `backstopCommit` still drop Wall files. `LOKI_COMMIT_WALL=0` restores the old behavior (nothing published).
141
141
 
@@ -28,6 +28,7 @@ with nowhere to look them up.
28
28
  | `LOKI_AUTO_CONFIRM` | unset | `true`/`false` to control prompts. Takes precedence over `CI`. |
29
29
  | `LOKI_CONFIG_DUMP` | `0` | `1` prints the resolved configuration and exits **without starting a run or spending anything**. |
30
30
  | `LOKI_KEEP_RUN_BRANCH` | unset | When a Loki 10 run ends, Loki returns your checkout to the branch you started from (only when it has no uncommitted changes; otherwise it prints how to return), removes the run's leftover temporary worktrees, and deletes the `loki/e10-*` run branch. A branch that was pushed is simply deleted; an unpushed one is first saved as a git bundle in `.loki/runs/<run-id>/branch.bundle` (with `branch.json` holding the branch name and head SHA), and the summary prints the restore command `git fetch .loki/runs/<run-id>/branch.bundle <branch>:<branch>`. If the bundle cannot be written, the branch is kept. Run branches left by earlier runs are saved and removed the same way at the end of the next run (bundles without a run directory go to `.loki/runs/legacy-branches/`). A run that passed but published nothing (no remote, or `--no-pr`) keeps its branch checked out, a run you can still resume keeps its branch, and a live run's branch or a branch checked out in any worktree is never touched; branches not named `loki/e10-*` are never touched. `1` turns all of this off and keeps every run branch, as before. Independently of this setting, session id files are written in the run directory instead of loose in `.loki/`, and the next run moves older loose ones there. |
31
+ | `LOKI_EPIC_PARALLEL` | provider slots, at most 4 (claude 4, opencode 1) | How many slices of a split issue (`loki start owner/repo#N` on a large issue) run at once. Slices with no dependency run at the same time, each in its own worktree; a slice that depends on another waits for it and starts on its branch. `1` runs them one at a time. A failing or spec-conflicting slice skips only the slices that depend on it. Slices share one `--max-cost` cap, which can be passed by up to (slices in flight - 1) session costs because each running session sees the cap at its next cost event. |
31
32
 
32
33
  For a cost estimate before committing to a run, `loki plan <spec> --json` is
33
34
  the better tool: it reports complexity, iterations, tokens and cost without
@@ -40,6 +41,9 @@ interact and why hitting one is a failure rather than a success.
40
41
  |---|---|---|
41
42
  | `LOKI_PROVIDER` | `claude` | `claude` or `opencode`. `codex`, `cline`, `aider` and `gemini` were removed and exit 2 with a migration line. |
42
43
  | `LOKI_SESSION_MODEL` | `medium` | The capability tier for the run: `small`, `medium`, or `high`. See below. |
44
+ | `LOKI_DETACH_SETTLE_S` | `3` | Seconds `--detach` waits to see the run survive before it reports "Detached". An engine exit inside the window is reported with the log tail and the engine's exit code. |
45
+ | `LOKI_DETACH_CAFFEINATE` | `1` | On macOS, `--detach` holds `caffeinate -i` for the run (blocks idle sleep, not a closed lid). `0` turns it off. |
46
+ | `LOKI_DETACHED` | unset | Set to `1` on a detached run. Informational. |
43
47
  | `LOKI_MAX_TIER` | unlimited | Caps model tier, so a run cannot escalate past what you are willing to pay for. |
44
48
  | `LOKI_MODEL_OVERRIDE` | unset | Overrides the resolved model outright. A route spec (`ollama/<id>`) works too. |
45
49
  | `LOKI_MODEL_ROUTE` | unset | `<kind>/<id>` with kind `openrouter`, `ollama`, `lmstudio`, `llamacpp`, `vllm` or `custom`. Routes the Claude harness to that endpoint; `loki models` lists them, `loki models --local` discovers local runtimes. |
@@ -153,6 +157,9 @@ with no gain in pass rate. Set each to `1` to turn it on.
153
157
  | Variable | Default | Effect |
154
158
  |---|---|---|
155
159
  | `LOKI_REVIEW_DEFAULT` | off | With no reviewer configured, a medium risk run asks its own CLI for one code review before seal. Off, the receipt lists "one reviewer" as not proven. A high risk run gets that review by default either way, and a configured reviewer (`review:` in loki.yaml, `LOKI_REVIEW_PROVIDER`, a reviewer agent) always runs. |
160
+ | `LOKI_ORG_GRAPH` | off | Adds a short "Org knowledge" block to the implement brief on `loki start`: the services this repo defines, who owns the paths the task touches (CODEOWNERS), services in other ingested repos that depend on this one, and ADRs or decision docs that match the task, each line citing repo, path and line. At most 1500 bytes. This repo is re-ingested on every run; other repos are as fresh as their last `loki memory graph ingest`. The size and line count are recorded in `.loki/runs/<id>/lessons-injected.json`. The graph is per machine (not shared across a team) and does not yet read trackers or chat. Repos without an origin remote are keyed by directory name, so two such directories with the same name share facts. With the switch off nothing is spawned or written. |
161
+ | `LOKI_KNOWLEDGE_DIR` | `~/.loki/knowledge` | Directory of the org knowledge store (`graph.json`, `patterns.jsonl`). |
162
+ | `LOKI_PR_PASSPORT` | on | Set to `0` to leave the proof passport (signed DSSE receipt and public key) out of the PR receipt comment. Only VERIFIED runs get one, and never when the receipt holds local paths or is over 60000 characters. See `docs/PROOF-PASSPORT.md`. |
156
163
  | `LOKI_PR_LESSONS` | off | Adds lessons from earlier runs and merged PRs to the implement brief: only a failing check, a restored test edit or a spec conflict on a file this run will touch, one line each, at most 400 bytes. Each run's injected lessons are recorded in `.loki/runs/<id>/lessons-injected.json`. Lessons are recorded either way, including checks that blocked a session stop. |
157
164
  | `LOKI_WORKED_EXAMPLE` | off | Adds an earlier VERIFIED run as a short worked example to the implement brief, only when the new task is a near-duplicate of it. |
158
165
  | `LOKI_E10_ALREADY_DONE_CHECK` | off | Runs the separate already-done confirmation on a direct task too. Issue tasks always get it; on a direct task the implement session reports already-done itself. |
@@ -12,6 +12,13 @@ outcome ladder, where 6 (PARTIAL) is a milder result than 3, 4 and 5 and the
12
12
  only safe test is `[ $rc -eq 0 ]` for "verified". Elsewhere, a bigger number is
13
13
  never better news.
14
14
 
15
+ ## Removed commands
16
+
17
+ A command that was removed (for example `loki council`, `loki init`, `loki ship`)
18
+ exits 2 before any engine, provider check or model call, prints nothing on
19
+ stdout and one line on stderr: `loki: 'loki NAME' was removed in Loki Mode 11.N.
20
+ <replacement>.` The full list is the REMOVED class in `docs/CLI-INVENTORY.md`.
21
+
15
22
  ## `loki start`
16
23
 
17
24
  Two contracts, and which one you get depends on an environment variable. This
@@ -16,9 +16,14 @@ exits nonzero. Nothing is force-pushed and no check is bypassed.
16
16
 
17
17
  One PR through the same gate. It is refused (PR left open) when it is a draft,
18
18
  when `gh pr checks` is not green after polling, or, with --require-verified,
19
- when the run verdict is not VERIFIED. The refusal names the gate. `loki start
20
- --ship` auto-merge uses this command, so it cannot bypass red, pending or draft
21
- PRs or a non-VERIFIED run.
19
+ when the run is not VERIFIED for the PR's head commit. The refusal names the gate.
20
+ --require-verified accepts either a legacy proof in `.loki/proofs` whose head
21
+ commit is the PR head, or a Loki 10 receipt in `.loki/runs` whose `head_sha` is the
22
+ PR head and which `loki verify <run-id>` reports VERIFIED (a run outcome that is
23
+ not VERIFIED, or a receipt that does not verify, refuses with `gate: verdict`; no
24
+ receipt for that head refuses with `gate: head`). It reads local runs, so run it on
25
+ the machine that ran `loki start`. The merge passes `--match-head-commit`, so a
26
+ push after the gate cannot land unjudged.
22
27
 
23
28
  loki merge watch <pr|branch> [--require-verified] [--delete-branch]
24
29
 
@@ -30,3 +35,39 @@ Green goes through the same merge gate as `loki merge pr`. When attempts run out
30
35
  the PR is returned to draft, nothing merges, and the last failure log is printed.
31
36
  `loki start --ship --engine legacy` calls this after it opens the PR; `/merge watch <pr>` runs it
32
37
  from `loki chat`.
38
+
39
+ ## Review queue
40
+
41
+ loki review queue [--repo owner/repo] [--pubkey FILE] [--limit N] [--json] [--mark]
42
+
43
+ One list of every open Loki PR (head branch `loki/*`), ranked by risk. Read-only
44
+ unless `--mark` is given. It needs the Bun runtime and an authenticated `gh`.
45
+
46
+ A PR is READY only when all of these hold:
47
+
48
+ - it is not a draft;
49
+ - `gh pr checks` is green (no checks reported counts as not green);
50
+ - the risk tier is low. The tier is recomputed from the PR's live diff with the
51
+ same classifier the run used (`classifyRisk`); `LOKI_RISK_TIER` is ignored, so
52
+ nothing can lower it. This is not the `loki review --risk` score, which stays a
53
+ separate advisory view. Critical-path rules (CODEOWNERS, `.loki/config.json`)
54
+ are read at the PR's base commit when it is in the local clone, else from the
55
+ working tree;
56
+ - its proof passport (see `docs/PROOF-PASSPORT.md`) verifies against `--pubkey FILE`
57
+ or, without it, the local receipt key, and names the PR's exact head commit.
58
+ A teammate without the author's key sees every PR as unchecked until they pass
59
+ the author's public key (`loki keys export`).
60
+
61
+ Every other PR is listed as `NEEDS REVIEW` with each reason in plain words. Order:
62
+ READY rows first (fewest changed lines first), then needs-review rows by tier
63
+ (high, medium, low), then by lines changed. A READY row prints a short summary: the
64
+ changed files, the proof card (cost, time, checks run outside the model, fail-to-pass
65
+ line, receipt hash), what is not proven, the risk line, and the next step
66
+ `gh pr review N --approve && loki merge pr N --require-verified`.
67
+
68
+ `--json` prints one object per PR: number, url, title, head, branch, ready, rank,
69
+ reasons, risk, passport (status, outcome, receipt_sha256, kid), checks, lines, files.
70
+ `--mark` creates the `loki-ready` label, adds it to READY PRs and removes it from Loki
71
+ PRs that carry it but are not READY; a label failure is reported and never changes
72
+ the result. The command makes three `gh` calls per PR; `--limit` defaults to 50.
73
+
@@ -27,7 +27,7 @@ The output is a receipt-gated PR only, never a deploy. Whether the PR opens is s
27
27
 
28
28
  ## Slack, Linear, Jira and Teams delegation
29
29
 
30
- `loki trigger` server setup for delegating a job from chat or a tracker. Both routes enqueue through the same job queue and runner as `POST /jobs`; a completion summary goes back to the origin. Nothing unauthenticated can start a job or choose a reply URL.
30
+ `loki trigger` server setup for delegating a job from chat or a tracker. Both routes enqueue through the same job queue and runner as `POST /jobs`; a completion summary goes back to the origin. Nothing unauthenticated can start a job or choose a reply URL. Sentry, Slack, Linear, Jira and Teams runs each count toward their own source's auto-pause (see "Auto-pause and trigger health" in `docs/DEPLOYMENT.md`).
31
31
 
32
32
  Secrets are env only and must differ from each other, the GitHub webhook secret, the API token and the Sentry secret (an equal secret disables its route at startup). A missing secret answers 503 naming the variable, and the server logs a startup warning. None of them reach the `loki start` child environment.
33
33
 
package/docs/slack.md CHANGED
@@ -32,6 +32,6 @@ Bot token scopes: `app_mentions:read`, `chat:write`, `channels:history` (and `gr
32
32
 
33
33
  Subscribe to bot events: `app_mention`, `message.channels` (plus `message.groups` for private channels).
34
34
 
35
- Outbound notifications (PR opened, BLOCKED, finished) are separate and use `LOKI_SLACK_WEBHOOK_URL`.
35
+ Outbound notifications (PR opened, BLOCKED, finished) are separate and use `LOKI_SLACK_WEBHOOK_URL`. They are how a run started with `--detach` reports its outcome after the terminal is gone.
36
36
 
37
37
  Stuck-run alert: if a live run writes no event for `LOKI_STUCK_MIN` minutes (default 15), one alert names the last stage, its event time and a suggested action. It always prints to stderr and also goes to Slack when a webhook is set. A new event clears the alert, and a later silence can alert again. Checked on the 15-second supervisor beat. A value of 0, a negative number or a non-number falls back to 15.
package/docs/v10/GUIDE.md CHANGED
@@ -92,6 +92,17 @@ loki start "fix the login redirect loop" --no-pr
92
92
  `loki chat` is an interactive alternative that can start and join these runs
93
93
  (see Chat below).
94
94
 
95
+ The Wall session (a separate model session that writes acceptance tests from the
96
+ task alone) is off by default: in the 2026-11-05 measurement it raised the cost
97
+ per merge-ready change and lowered the merge-ready count. `LOKI_E10_WALL=1`
98
+ turns it back on. With it off, a run reads VERIFIED only on evidence the harness
99
+ produced itself: your repo's own tests all pass, a test exercises the changed
100
+ code, no existing test was weakened, and nothing regressed. A test the run wrote
101
+ or edited counts as that exercise only when the harness shows it fails on the
102
+ base commit and passes on the change (the receipt's proof line names the file);
103
+ otherwise the run reads PARTIAL and NOT PROVEN says "no test shown to fail on the
104
+ base commit and pass on the change".
105
+
95
106
  `loki quick "<task>"` is the small-task entry. It runs the same engine
96
107
  without opening a pull request (the legacy quick never opened one), and the
97
108
  engine's own sizing picks the lean path for a small task: Plan and Wall are
@@ -131,8 +142,22 @@ Issue refs work the same way:
131
142
  ```
132
143
  loki owner/repo#123
133
144
  loki https://github.com/owner/repo/issues/123
145
+ loki "fix #123"
146
+ loki "#123"
147
+ loki "<issue URL as copied, with ?query or #comment>"
148
+ loki https://github.com/o/r/pull/5 # verify-pr
134
149
  ```
135
150
 
151
+ A pasted goal that names one issue is read as that issue: a copied URL loses a
152
+ trailing slash, ?query or #fragment, and "#123", "fix #123" or "fix issue 123"
153
+ becomes owner/repo#123 from the checkout's origin ("#N" needs a GitHub origin;
154
+ quote it, since an unquoted # starts a shell comment). Loki prints a `goal:`
155
+ line when it read a ref. Extra words ("fix #123 and add a test") keep the goal
156
+ as text, and LOKI_GOAL_REF=0 turns the reading off. The run itself asks
157
+ nothing: headless intake records its assumptions in the receipt. The only
158
+ terminal prompt is the optional rating after VERIFIED (LOKI_SATISFACTION=0
159
+ turns it off). Models and --deep are not auto-picked yet.
160
+
136
161
  bin/loki routes GitHub, GitLab (`.../-/issues/N`) and Jira
137
162
  (`.../browse/KEY`) issue URLs to the v10 engine, and the issue-fetch step
138
163
  (autonomy/issue-providers.sh) fetches title/body/labels from all three.
@@ -163,9 +188,13 @@ Flags, from the engine's own `--help`:
163
188
  `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set, and no dollar cap on a
164
189
  subscription login (usage then counts against your plan limits). Source:
165
190
  `loki-ts/src/e10ext/budget_cap.ts`. The start line shows the cap in force,
166
- for example `cap $100.00 (default)` or `no dollar cap (subscription)`. Once
167
- priced cost reaches the cap the running stage is stopped, no later stage
168
- starts, and the run ends BUDGET_STOP with exit code 3. Sessions with no
191
+ for example `cap $100.00 (default)` or `no dollar cap (subscription)`, then
192
+ the cost and time quote, for example `estimate: about $0.19 (range
193
+ $0.12-$0.39), about 1 min (range 1-5 min), first run in this repo (benchmark
194
+ prior, loki-default)`. Once priced cost reaches the cap no later stage
195
+ starts and each session is limited to what is left; the closing stages seal
196
+ what exists (PARTIAL with the work on `loki/<runId>`, or BUDGET_STOP with exit
197
+ code 3 when no receipt was sealed; see docs/cost-controls.md). Sessions with no
169
198
  provider price never count toward the cap. On the previous loop the same cap
170
199
  is `LOKI_BUDGET_LIMIT` (default 100.00 USD; set it to an empty string for
171
200
  unlimited), and a breach pauses the run instead of killing it.
@@ -382,7 +411,7 @@ on:
382
411
 
383
412
  Before anything runs, `loki backlog` triages every issue into one of three classes, each printed with a one-line reason (`--dry-run` prints only this and launches nothing):
384
413
 
385
- - `implement`: a concrete target (a file, function, value or expected result), or a large issue. Only these run. Large has one definition, the same one `loki start owner/repo#N` uses: an epic label (`epic`, `umbrella`, `tracking` or `meta`), or at least two of 4 or more solution parts, 4 or more acceptance criteria, and both a backend and a frontend named. A large issue is split into slices that each run on their own (the reason says `runs split into slices`).
414
+ - `implement`: a concrete target (a file, function, value or expected result), or a large issue. Only these run. Large has one definition, the same one `loki start owner/repo#N` uses: an epic label (`epic`, `umbrella`, `tracking` or `meta`), or at least two of 4 or more solution parts, 4 or more acceptance criteria, and both a backend and a frontend named. A large issue is split into slices that each run on their own (the reason says `runs split into slices`). Slices that do not depend on each other run at the same time (up to 4; `LOKI_EPIC_PARALLEL=1` runs them one at a time), and a slice that fails or reports a spec conflict skips only the slices built on it. Each slice opens its own draft pull request, stacked on the slice it depends on.
386
415
  - `spec`: vague or ambiguous (no concrete target named, or an ambiguity score at the threshold). Loki drafts `.loki/specs/<slug>.md` with `loki plan --spec`, runs nothing, and prints `loki start --spec .loki/specs/<slug>.md` to run after you edit or approve it.
387
416
  - `human`: the issue touches secrets, production or a destructive operation. Never run headless; listed with the reason. Repos without tests, UI work and infra work still run: Loki writes its own tests and verifies once at the end.
388
417