loki-mode 11.118.1 → 11.119.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.
- package/SKILL.md +3 -3
- package/VERSION +1 -1
- package/autonomy/route.sh +67 -22
- package/bin/loki +19 -78
- package/dashboard/__init__.py +1 -1
- package/docs/ARCHITECTURE.md +4 -4
- package/docs/CLI-INVENTORY.md +1 -1
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/air-gapped.md +1 -1
- package/docs/alternative-installations.md +1 -1
- package/docs/cost-controls.md +0 -1
- package/docs/dev/architecture-reference.md +2 -2
- package/docs/environment-variables.md +1 -1
- package/docs/exit-codes.md +3 -4
- package/loki-ts/dist/loki.js +1681 -1883
- package/mcp/__init__.py +1 -1
- package/package.json +2 -2
- package/packages/control-plane/dist/server.js +1 -1
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/references/sdk-mode.md +8 -10
- package/web-app/dist/assets/{AdminPage-Dl95kEpz.js → AdminPage-BI9sK7Ww.js} +1 -1
- package/web-app/dist/assets/{Avatar-CoMNZyZc.js → Avatar-CqStW3hh.js} +1 -1
- package/web-app/dist/assets/{Badge-DQ_maQj6.js → Badge-Sqo523qW.js} +1 -1
- package/web-app/dist/assets/{Button-xAjqoDGo.js → Button-65BGFYzo.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-DLS-kNOJ.js → CockpitPage-DLppS7i4.js} +1 -1
- package/web-app/dist/assets/{ComparePage-xWlmnGaY.js → ComparePage-y-To7RDW.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-BRbWbU8C.js → ErrorBoundary-BRfjLxKD.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-CNbbIGm3.js → EvidenceReceiptPanel-BZYXpZlj.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-DTjOTX07.js → GitHubIssuesPanel-D5VQeqef.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-B7OVy1iJ.js → GitHubPRsPanel-B-ZTugBP.js} +1 -1
- package/web-app/dist/assets/{HomePage-CETALbO9.js → HomePage-3O1Ixdaj.js} +2 -2
- package/web-app/dist/assets/{LoginPage-DwPyh-M5.js → LoginPage-D_c2Q5Yd.js} +1 -1
- package/web-app/dist/assets/{MagicPage-CmLl1poT.js → MagicPage-CWoBDJIL.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-CWQVihAs.js → MetricsPage-D_8_KsDG.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-D5c8BBZa.js → NotFoundPage-Ck7EB21i.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-DUbvjiAF.js → ProjectPage-DjzxAUpk.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-bBUlPEjC.js → ProjectsPage-IiL9eZZl.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-BpHpvLOi.js → SettingsPage-B21XsJXj.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-BCSWtWpO.js → ShowcasePage-Dw-qMqRX.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-CZMC1YjJ.js → SystemSettingsPage-DRKM2q7Y.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-wNI7lC4g.js → TeamsPage-cE3eF_mQ.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-BUXLMzDk.js → TemplatesPage-2m8EFD1w.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-Ci-OwQtT.js → TerminalOutput-BVj57oRn.js} +1 -1
- package/web-app/dist/assets/{activity-DrY_CBEj.js → activity--3RdDrr_.js} +1 -1
- package/web-app/dist/assets/{bell-zizLC58S.js → bell-Cf1aNwyn.js} +1 -1
- package/web-app/dist/assets/{bot-DEypgLT2.js → bot-C9eepiBo.js} +1 -1
- package/web-app/dist/assets/{check-gY52vWg_.js → check-C0eAyl30.js} +1 -1
- package/web-app/dist/assets/{chevron-left-DoDaUPzk.js → chevron-left-CQzEDgKz.js} +1 -1
- package/web-app/dist/assets/{circle-alert-Cfu5G_0b.js → circle-alert-C45LOFIn.js} +1 -1
- package/web-app/dist/assets/{clock-De708wI0.js → clock-DRQ4_6O5.js} +1 -1
- package/web-app/dist/assets/{cloud-EGwYhSkv.js → cloud-D2YwYtSX.js} +1 -1
- package/web-app/dist/assets/{code-xml-BJXvBR7V.js → code-xml-C0kAguzE.js} +1 -1
- package/web-app/dist/assets/{database-D4yAsGes.js → database-Dc-69TwF.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-BUAWk_hv.js → dollar-sign-D80FbCfO.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-DbVIY5Ui.js → file-code-corner-D0vcShuD.js} +1 -1
- package/web-app/dist/assets/{file-plus-TuU3vx6q.js → file-plus-D7P7v4hD.js} +1 -1
- package/web-app/dist/assets/{globe-Cf3pzF10.js → globe-DGnqby6a.js} +1 -1
- package/web-app/dist/assets/{hammer-CkFR5FA_.js → hammer-BvafjTXC.js} +1 -1
- package/web-app/dist/assets/{index-BOitSoSC.js → index-1Kvtppgn.js} +3 -3
- package/web-app/dist/assets/{layers-CaH8k11R.js → layers-7f3JxJPK.js} +1 -1
- package/web-app/dist/assets/{loader-circle-CS4D1KEz.js → loader-circle-Dsmov_Fj.js} +1 -1
- package/web-app/dist/assets/{lock-6XzWbWxF.js → lock-CYPcR4L9.js} +1 -1
- package/web-app/dist/assets/{package-BOuSIjSw.js → package-CDRe5Fid.js} +1 -1
- package/web-app/dist/assets/{plus-B3x53Byn.js → plus-BwmTPRgM.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-x8YMlGSU.js → refresh-cw-DxlbreLM.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-C783lZy1.js → rotate-ccw-CpTwximO.js} +1 -1
- package/web-app/dist/assets/{scroll-text-CUyhyoYB.js → scroll-text-CgcWfO8K.js} +1 -1
- package/web-app/dist/assets/{server-BgM5H1lS.js → server-CBVNgMbf.js} +1 -1
- package/web-app/dist/assets/{shield-alert-PhlB-cgX.js → shield-alert-CL8lOpTJ.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-BMv6-FAl.js → thumbs-up-B245iaZM.js} +1 -1
- package/web-app/dist/assets/{trash-2-cwv6_KMs.js → trash-2-D_LCAVug.js} +1 -1
- package/web-app/dist/assets/{trending-down-fh1-jf_B.js → trending-down-DQn3R8k7.js} +1 -1
- package/web-app/dist/assets/{trending-up-CBhpOjo8.js → trending-up-BuXPO-tN.js} +1 -1
- package/web-app/dist/assets/{upload-B6OTSfOn.js → upload-DNc_smXL.js} +1 -1
- package/web-app/dist/assets/{usePolling-EItfhxee.js → usePolling-CwMs9ya4.js} +1 -1
- package/web-app/dist/assets/{user-BW393wzp.js → user-DupXJP9t.js} +1 -1
- package/web-app/dist/index.html +1 -1
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Runs an autonomous software factory that knows what it is supposed to deliver and proves it did, with a signed receipt. Use when the user says Loki Mode or asks to build, fix or verify software autonomously.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v11.
|
|
6
|
+
# Loki Mode v11.119.0
|
|
7
7
|
|
|
8
8
|
**Current entry points (Loki 10 engine):** `loki "<task>"`, `loki owner/repo#N` and `loki quick "<task>"` run the Loki 10 engine and end with a signed receipt (`loki verify`). `loki backlog owner/repo --all` runs many issues in parallel. Guide: `docs/v10/GUIDE.md`. The skill instructions below, and `loki start`, describe the previous bash loop. PRD-file starts (`loki start ./prd.md`) and the opencode provider still run on it until FC38-SWEEP ports them; the legacy-engine command and the LOKI_ENGINE switch remain removed. Prefer `loki owner/repo#N` for issues.
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ description: Runs an autonomous software factory that knows what it is supposed
|
|
|
17
17
|
|
|
18
18
|
**Provider-agnostic (stable since v5.0.0):** runs on Claude/Codex/Cline/Aider with abstract model tiers and degraded mode for non-Claude providers; no vendor lock-in. Gemini deprecated v7.5.18. See `skills/providers.md`. **Legacy track (v8.0.0):** the Anthropic Agent SDK route (see below), spec-mode expansion for OpenAPI/GraphQL/Postman contracts, the runtime-boot and secret-leak evidence axes, and `loki steer` / `loki why` for mid-run control. Earlier tracks: LSP grounding as a first-class agent tool (v7.7.x) and Phase 1 RARV-C closure (real provider judges, gate-failure flock, synthetic PRD e2e, status `--json`).
|
|
19
19
|
|
|
20
|
-
**Runtime migration:** Bash-to-Bun migration. `bin/loki` is the router: the commands in its Bun-route `case` (read-only ones such as `version`, `status`, `stats`, `doctor`, `provider`, `memory`, plus stateful ones such as `rollback`, `trust`, `proof`/`receipt`, `control`, `answer`) run through `loki-ts/src/cli.ts` on Bun; the rest, and some flag forms (for example `doctor --airgap`, `trust detail`), run on Bash (`autonomy/loki`). `start`
|
|
20
|
+
**Runtime migration:** Bash-to-Bun migration. `bin/loki` is the router: the commands in its Bun-route `case` (read-only ones such as `version`, `status`, `stats`, `doctor`, `provider`, `memory`, plus stateful ones such as `rollback`, `trust`, `proof`/`receipt`, `control`, `answer`) run through `loki-ts/src/cli.ts` on Bun; the rest, and some flag forms (for example `doctor --airgap`, `trust detail`), run on Bash (`autonomy/loki`). `start` and `quick` are routed by `autonomy/route.sh` to the Loki 10 engine; the Bash loop runs only on `--engine legacy`. Read `bin/loki` and `cli.ts` for the exact set rather than trusting a list here. Rollback: `LOKI_LEGACY_BASH=1`. See `docs/architecture/ADR-001-runtime-migration.md`.
|
|
21
21
|
|
|
22
22
|
**Anthropic Agent SDK route (v8.0.0, opt-in, default-off):** a claude-binary-free path where the RARV loop runs on `@anthropic-ai/claude-agent-sdk` `query()` and judges run on the raw `@anthropic-ai/sdk`. One operator switch `LOKI_SDK_MODE` (`off` default / `judges` / `full`), mirrored byte-for-byte in bash (`autonomy/lib/sdk-mode.sh`) and TypeScript (`loki-ts/src/runner/sdk_mode.ts`). Unset = byte-identical to the claude-CLI route. See `references/sdk-mode.md`.
|
|
23
23
|
|
|
@@ -473,4 +473,4 @@ Implemented, planned and deprecated items, with the version each landed in: `CHA
|
|
|
473
473
|
|
|
474
474
|
---
|
|
475
475
|
|
|
476
|
-
**v11.
|
|
476
|
+
**v11.119.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.119.0
|
package/autonomy/route.sh
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
# order and input form never change the engine:
|
|
5
5
|
# engine10 is the default for a PRD file, an issue ref, a multi-word task and a
|
|
6
6
|
# one-word brief, whether the flags come first or last.
|
|
7
|
-
# The legacy engine runs only on --engine legacy / LOKI_ENGINE=legacy
|
|
8
|
-
#
|
|
7
|
+
# The legacy engine runs only on --engine legacy / LOKI_ENGINE=legacy or for a PRD over
|
|
8
|
+
# 100000 bytes, and is refused under SDK mode with claude. A flag never changes the engine.
|
|
9
9
|
# Pure functions: no exec, no side effects except R_* globals and the printers.
|
|
10
10
|
# Bash 3.2 compatible (no associative arrays, no ${var,,}).
|
|
11
11
|
|
|
@@ -20,6 +20,10 @@ _ROUTE_OPTVAL_FLAGS=" --mirofish "
|
|
|
20
20
|
_ROUTE_FRONT_FLAGS=" --workspace --deploy --health-url --health-match --auto-rollback --destination --canary --domain "
|
|
21
21
|
# Flags engine10 honors as-is.
|
|
22
22
|
_ROUTE_E10_FLAGS=" --no-pr --deep --json --verbose --quiet --resume --provider --max-cost --spec --attempts --seal-existing "
|
|
23
|
+
# The largest PRD engine10 takes: it carries the task in env vars and CLI arguments (with a context pack added under
|
|
24
|
+
# --session-model), and Linux caps one string at 128 KiB. A bigger PRD runs on the legacy engine, or is refused under
|
|
25
|
+
# SDK mode with claude (the legacy engine has no SDK path).
|
|
26
|
+
_ROUTE_PRD_MAX=100000
|
|
23
27
|
# The most a run cap can reach (capCeilingS(true) in loki-ts/src/util/run_cap.ts: the subscription ceiling).
|
|
24
28
|
_ROUTE_CAP_CEILING_S=3600
|
|
25
29
|
# Accepted and dropped (no-ops on a non-interactive run).
|
|
@@ -40,6 +44,22 @@ _route_refusal_hint() {
|
|
|
40
44
|
|
|
41
45
|
_route_has() { case "$1" in *" $2 "*) return 0 ;; esac; return 1; }
|
|
42
46
|
|
|
47
|
+
# _route_provider FLAG_VALUE: the provider a run would use (flag, LOKI_PROVIDER, .loki/state/provider, else claude).
|
|
48
|
+
_route_provider() {
|
|
49
|
+
local p="$1"
|
|
50
|
+
if [ -z "$p" ]; then p="${LOKI_PROVIDER:-}"; fi
|
|
51
|
+
if [ -z "$p" ] && [ -f "${PWD}/.loki/state/provider" ]; then p="$(sed -n '1p' "${PWD}/.loki/state/provider" 2>/dev/null || true)"; fi
|
|
52
|
+
printf '%s' "${p:-claude}"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
# _route_sdk_claude PROVIDER: true under SDK mode (LOKI_SDK_LOOP set, directly or by LOKI_SDK_MODE=full / LOKI_SDK=full)
|
|
56
|
+
# for the claude provider, where the legacy bash loop has no Agent SDK path to run on.
|
|
57
|
+
_route_sdk_claude() {
|
|
58
|
+
[ "$1" = "claude" ] || return 1
|
|
59
|
+
case "${LOKI_SDK_LOOP:-}" in 1|true) return 0 ;; esac
|
|
60
|
+
return 1
|
|
61
|
+
}
|
|
62
|
+
|
|
43
63
|
# _route_optval_consumes FLAG NEXT: whether an optional-value flag takes the next token as its value.
|
|
44
64
|
_route_optval_consumes() {
|
|
45
65
|
[ -n "$2" ] && [ "${2#--}" = "$2" ]
|
|
@@ -217,6 +237,10 @@ loki_route_resolve() {
|
|
|
217
237
|
engine10|e10|v10|10) engine_req=engine10 ;;
|
|
218
238
|
*) R_ERR="loki: unknown engine '$engine_req' (use --engine legacy or --engine engine10)"; R_DECIDED=1; return 0 ;;
|
|
219
239
|
esac
|
|
240
|
+
# The legacy bash loop has no Agent SDK path: under SDK mode with claude it would fail without a claude CLI or switch to it.
|
|
241
|
+
if [ "$engine_req" = "legacy" ] && _route_sdk_claude "$(_route_provider "$provider_flag")"; then
|
|
242
|
+
R_ERR="loki: the legacy engine has no Agent SDK path; drop --engine legacy (and LOKI_ENGINE=legacy) to run Loki 10 on the SDK, or unset LOKI_SDK_MODE, LOKI_SDK and LOKI_SDK_LOOP to run the legacy engine on a provider CLI"; R_DECIDED=1; return 0
|
|
243
|
+
fi
|
|
220
244
|
|
|
221
245
|
# Input. A bare `loki start` takes LOKI_PRD_FILE as its PRD (documented in `loki start --help`).
|
|
222
246
|
if [ "${#positionals[@]}" -eq 0 ] && [ "$verb" = "start" ] && [ -n "${LOKI_PRD_FILE:-}" ]; then
|
|
@@ -287,12 +311,7 @@ loki_route_resolve() {
|
|
|
287
311
|
fi
|
|
288
312
|
|
|
289
313
|
# Provider and model (display only; engine10 resolves its own at run time).
|
|
290
|
-
R_PROVIDER="$provider_flag"
|
|
291
|
-
if [ -z "$R_PROVIDER" ]; then R_PROVIDER="${LOKI_PROVIDER:-}"; fi
|
|
292
|
-
if [ -z "$R_PROVIDER" ] && [ -f "${PWD}/.loki/state/provider" ]; then
|
|
293
|
-
R_PROVIDER="$(sed -n '1p' "${PWD}/.loki/state/provider" 2>/dev/null || true)"
|
|
294
|
-
fi
|
|
295
|
-
if [ -z "$R_PROVIDER" ]; then R_PROVIDER=claude; fi
|
|
314
|
+
R_PROVIDER="$(_route_provider "$provider_flag")"
|
|
296
315
|
if [ -n "$session_model" ]; then
|
|
297
316
|
R_MODEL="$session_model"
|
|
298
317
|
elif [ -n "${LOKI_SESSION_MODEL:-}" ]; then
|
|
@@ -312,10 +331,15 @@ loki_route_resolve() {
|
|
|
312
331
|
fi
|
|
313
332
|
R_SESSION_MODEL="$session_model"
|
|
314
333
|
|
|
315
|
-
# Task text for engine10: a PRD file is read, anything else is the words.
|
|
316
|
-
local task
|
|
334
|
+
# Task text for engine10: a PRD file is read, anything else is the words. A PRD over _ROUTE_PRD_MAX never reaches engine10.
|
|
335
|
+
local task sz=0
|
|
317
336
|
if [ "$R_INPUT_TYPE" = "prd" ]; then
|
|
318
|
-
|
|
337
|
+
sz=$(wc -c < "${positionals[0]}" 2>/dev/null | tr -d ' ' || echo 0)
|
|
338
|
+
if [ "${sz:-0}" -gt "$_ROUTE_PRD_MAX" ]; then
|
|
339
|
+
task=""
|
|
340
|
+
else
|
|
341
|
+
task=$(cat "${positionals[0]}" 2>/dev/null || true)
|
|
342
|
+
fi
|
|
319
343
|
elif [ "$R_INPUT_TYPE" = "spec" ] || [ "$R_INPUT_TYPE" = "none" ]; then
|
|
320
344
|
task=""
|
|
321
345
|
else
|
|
@@ -362,9 +386,11 @@ loki_route_resolve() {
|
|
|
362
386
|
fi
|
|
363
387
|
# --dry-run (engine10 has no preview of its own for these inputs): print the route, then exit 0 without a run.
|
|
364
388
|
if [ "$dry" = "1" ] && [ "$engine_req" != "legacy" ]; then R_DRY=1; fi
|
|
365
|
-
local why=""
|
|
366
389
|
if [ "$engine_req" = "legacy" ]; then
|
|
367
390
|
R_ENGINE=legacy; R_REASON="explicit: --engine legacy or LOKI_ENGINE=legacy"
|
|
391
|
+
elif [ "$engine_req" = "engine10" ] && [ "${sz:-0}" -gt "$_ROUTE_PRD_MAX" ]; then
|
|
392
|
+
R_ERR="loki: this PRD is ${sz} bytes, over the ${_ROUTE_PRD_MAX}-byte limit of the Loki 10 engine; trim it below 100 KB, or drop --engine engine10 to run it on the legacy engine"
|
|
393
|
+
return 0
|
|
368
394
|
elif [ "$engine_req" = "engine10" ]; then
|
|
369
395
|
R_ENGINE=engine10; R_E10=1; R_HARD=1; R_REASON="explicit: --engine engine10"
|
|
370
396
|
else
|
|
@@ -373,14 +399,12 @@ loki_route_resolve() {
|
|
|
373
399
|
claude|codex|cline|aider|opencode) ;;
|
|
374
400
|
*) R_ERR="loki: provider $R_PROVIDER is not supported; use one of: claude, codex, cline, aider, opencode"; return 0 ;;
|
|
375
401
|
esac
|
|
376
|
-
if [ "$
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
R_ENGINE=legacy; R_REASON="$why"
|
|
383
|
-
R_NOTICE="loki: routing this call to the legacy engine: $why."
|
|
402
|
+
if [ "${sz:-0}" -gt "$_ROUTE_PRD_MAX" ] && _route_sdk_claude "$R_PROVIDER"; then
|
|
403
|
+
R_ERR="loki: this PRD is ${sz} bytes, over the ${_ROUTE_PRD_MAX}-byte limit of the Loki 10 engine, and the legacy engine has no Agent SDK path; trim the PRD below 100 KB, or unset LOKI_SDK_MODE, LOKI_SDK and LOKI_SDK_LOOP to run the legacy engine on a provider CLI"
|
|
404
|
+
return 0
|
|
405
|
+
elif [ "${sz:-0}" -gt "$_ROUTE_PRD_MAX" ]; then
|
|
406
|
+
R_ENGINE=legacy; R_REASON="PRD is larger than ${_ROUTE_PRD_MAX} bytes (engine10 carries the task in single strings, capped at 128 KiB on Linux)"
|
|
407
|
+
R_NOTICE="loki: routing this call to the legacy engine: $R_REASON."
|
|
384
408
|
else
|
|
385
409
|
R_ENGINE=engine10; R_E10=1
|
|
386
410
|
R_REASON="default: $R_INPUT_TYPE input runs on engine10 regardless of flag order"
|
|
@@ -471,7 +495,7 @@ loki_route_dispatch() {
|
|
|
471
495
|
fi
|
|
472
496
|
;;
|
|
473
497
|
esac
|
|
474
|
-
if [ "$R_DECIDED" != "1" ]; then return 0; fi
|
|
498
|
+
if [ "$R_DECIDED" != "1" ]; then _route_task_first "$verb" "$@"; return 0; fi
|
|
475
499
|
if [ -n "$R_ERR" ]; then echo "$R_ERR" >&2; return 8; fi
|
|
476
500
|
if [ "$R_EXPLAIN" = "1" ]; then loki_route_print; return 7; fi
|
|
477
501
|
if [ "$R_DRY" = "1" ]; then
|
|
@@ -482,6 +506,27 @@ loki_route_dispatch() {
|
|
|
482
506
|
if [ -n "$R_NOTICE" ]; then echo "$R_NOTICE" >&2; fi
|
|
483
507
|
R_VERB="$verb"
|
|
484
508
|
# A front-end call keeps its argv untouched: bin/loki hands it to autonomy/loki, which runs the workspace or deploy chain.
|
|
485
|
-
if [ "$R_FRONT" = "1" ]; then R_DECIDED=0; fi
|
|
509
|
+
if [ "$R_FRONT" = "1" ]; then R_DECIDED=0; _route_task_first "$verb" "$@"; fi
|
|
486
510
|
return 0
|
|
487
511
|
}
|
|
512
|
+
|
|
513
|
+
# _route_task_first VERB ARGS...: a start or quick call the resolver leaves to its own handler (--help, a front-end
|
|
514
|
+
# flag) still runs engine10 when its first argument is the task: `loki start "<task>" --help` shows the engine10 help.
|
|
515
|
+
# quick takes any first word; start takes a multi-word task or an issue ref, and never with --workspace or --deploy.
|
|
516
|
+
# The args go to engine10 as given. Sets R_DECIDED=1 and R_E10=1 on a match; leaves R_* alone otherwise.
|
|
517
|
+
# shellcheck disable=SC2034
|
|
518
|
+
_route_task_first() {
|
|
519
|
+
local verb="$1" a
|
|
520
|
+
shift
|
|
521
|
+
case "$verb:${1:-}" in start:|start:-*|quick:|quick:-*) return 0 ;; start:*|quick:*) ;; *) return 0 ;; esac
|
|
522
|
+
if [ "$verb" = "start" ]; then
|
|
523
|
+
for a in "$@"; do
|
|
524
|
+
case "$a" in --workspace|--workspace=*|--deploy) return 0 ;; esac
|
|
525
|
+
done
|
|
526
|
+
case "$1" in *" "*) ;; *) [ "$(_route_classify "$1")" = "issue" ] || return 0 ;; esac
|
|
527
|
+
R_E10_ARGS=("$@")
|
|
528
|
+
else
|
|
529
|
+
R_E10_ARGS=(--no-pr "$@")
|
|
530
|
+
fi
|
|
531
|
+
R_DECIDED=1; R_E10=1; R_HARD=0; R_ENGINE=engine10; R_VERB="$verb"; R_SESSION_MODEL=""; R_E10_CAP_S=""
|
|
532
|
+
}
|
package/bin/loki
CHANGED
|
@@ -66,12 +66,16 @@ case "${1:-}" in
|
|
|
66
66
|
esac
|
|
67
67
|
|
|
68
68
|
# v8.1: resolve the one-switch SDK mode (LOKI_SDK_MODE=off|judges|full) into the
|
|
69
|
-
# per-site LOKI_SDK_* flags HERE, in the outermost shim,
|
|
70
|
-
#
|
|
71
|
-
#
|
|
72
|
-
#
|
|
73
|
-
#
|
|
74
|
-
|
|
69
|
+
# per-site LOKI_SDK_* flags HERE, in the outermost shim, so every child (bash or
|
|
70
|
+
# Bun) reads the same resolved flags. Same idempotent lib all three entrypoints
|
|
71
|
+
# source. No-op when the mode is unset.
|
|
72
|
+
# LOKI_SDK_LOOP once routed `loki start` to a separate Bun loop; that loop is gone and every start runs
|
|
73
|
+
# the default engine. Read the user's own value before the mode resolver can set it.
|
|
74
|
+
if [ "${1:-}" = "start" ]; then
|
|
75
|
+
case "${LOKI_SDK_LOOP:-}" in
|
|
76
|
+
1|true) echo "loki: LOKI_SDK_LOOP no longer selects a separate loop; the default engine is Loki 10 (engine10)." >&2 ;;
|
|
77
|
+
esac
|
|
78
|
+
fi
|
|
75
79
|
if [ -f "$REPO_ROOT/autonomy/lib/sdk-mode.sh" ]; then
|
|
76
80
|
# shellcheck source=../autonomy/lib/sdk-mode.sh
|
|
77
81
|
source "$REPO_ROOT/autonomy/lib/sdk-mode.sh"
|
|
@@ -646,14 +650,19 @@ fi
|
|
|
646
650
|
|
|
647
651
|
# OC-ROUTE: normalize flags before the engine decision so argument order and input form
|
|
648
652
|
# never change the engine (autonomy/route.sh; `loki route ...` and --explain-route print it).
|
|
653
|
+
# route.sh is the only start and quick decision, `start --attempts 1` included (N=1 was stripped above).
|
|
649
654
|
_R_APPLIED=0
|
|
650
|
-
if [ -f "$REPO_ROOT/autonomy/route.sh" ]
|
|
655
|
+
if [ -f "$REPO_ROOT/autonomy/route.sh" ]; then
|
|
651
656
|
# shellcheck source=/dev/null
|
|
652
657
|
. "$REPO_ROOT/autonomy/route.sh"
|
|
653
658
|
_r_rc=0
|
|
654
659
|
loki_route_dispatch "$@" || _r_rc=$?
|
|
655
660
|
case "$_r_rc" in 7) exit 0 ;; 8) exit 2 ;; esac
|
|
656
661
|
if [ "$R_DECIDED" = "1" ]; then
|
|
662
|
+
if [ "$_LOKI_START_ATTEMPTS" = "1" ] && [ "$R_ENGINE" = "legacy" ]; then
|
|
663
|
+
echo "loki: --attempts runs only the Loki 10 engine, but this call routes to the legacy engine ($R_REASON); drop --attempts or the legacy request." >&2
|
|
664
|
+
exit 2
|
|
665
|
+
fi
|
|
657
666
|
_R_APPLIED=1
|
|
658
667
|
if [ -n "$R_SESSION_MODEL" ]; then
|
|
659
668
|
case "$R_SESSION_MODEL" in small) R_SESSION_MODEL=fast ;; medium) R_SESSION_MODEL=development ;; high) R_SESSION_MODEL=planning ;; esac
|
|
@@ -712,47 +721,6 @@ case "v10" in
|
|
|
712
721
|
unset _pa
|
|
713
722
|
;;
|
|
714
723
|
""|-*) _e10=0 ;;
|
|
715
|
-
# quick: the lean small path, no PR (legacy quick never opened one). A flag-first
|
|
716
|
-
# call (--help, -v) stays on the legacy quick.
|
|
717
|
-
quick)
|
|
718
|
-
case "${2:-}" in
|
|
719
|
-
""|-*) _e10=0 ;;
|
|
720
|
-
*) _e10=1; _e10_args=(--no-pr "${@:2}") ;;
|
|
721
|
-
esac
|
|
722
|
-
;;
|
|
723
|
-
# D58: `loki start <issue ref|issue URL|"multi-word task">` takes the same v10 path as
|
|
724
|
-
# `loki <ref>`. This arm decides only when autonomy/route.sh did not (--attempts, --help, the
|
|
725
|
-
# --workspace/--deploy front end); route.sh sends a PRD file, a brief and a bare start to engine10.
|
|
726
|
-
start)
|
|
727
|
-
# --workspace and --deploy (with its companions) are run by the bash front end around the engine; never glue them into an engine10 task.
|
|
728
|
-
_e10_front=0
|
|
729
|
-
for _e10_a in "${@:2}"; do
|
|
730
|
-
case "$_e10_a" in --workspace|--workspace=*|--deploy) _e10_front=1 ;; esac
|
|
731
|
-
done
|
|
732
|
-
unset _e10_a
|
|
733
|
-
case "${_e10_front}:${2:-}" in
|
|
734
|
-
1:*) _e10=0 ;;
|
|
735
|
-
0:*/*\#[0-9]*|0:http*://*/issues/*|0:http*://*/browse/*|0:jira:*|0:linear:*|0:https://linear.app/*/issue/*|0:*" "*)
|
|
736
|
-
_e10=1; _e10_args=("${@:2}")
|
|
737
|
-
if [ "$_LOKI_START_ATTEMPTS" = "1" ]; then
|
|
738
|
-
_e10_hard=1 # FC-38: --attempts never falls back to the legacy engine
|
|
739
|
-
# FC-37: engine10 has no --budget; unmapped it would be glued onto the task text. Its per-run cap is --max-cost.
|
|
740
|
-
_e10_args=(); _e10_bnext=0
|
|
741
|
-
for _e10_a in "${@:2}"; do
|
|
742
|
-
if [ "$_e10_bnext" = "1" ]; then _e10_args+=("$_e10_a"); _e10_bnext=0; continue; fi
|
|
743
|
-
case "$_e10_a" in
|
|
744
|
-
--budget|--budget-limit) _e10_args+=(--max-cost); _e10_bnext=1 ;;
|
|
745
|
-
--budget=*|--budget-limit=*) _e10_args+=("--max-cost=${_e10_a#*=}") ;;
|
|
746
|
-
*) _e10_args+=("$_e10_a") ;;
|
|
747
|
-
esac
|
|
748
|
-
done
|
|
749
|
-
unset _e10_a _e10_bnext
|
|
750
|
-
fi
|
|
751
|
-
;;
|
|
752
|
-
*) _e10=0 ;;
|
|
753
|
-
esac
|
|
754
|
-
unset _e10_front
|
|
755
|
-
;;
|
|
756
724
|
# http*://*/issues/* also covers GitLab's /-/issues/ URLs.
|
|
757
725
|
*/*\#[0-9]*|http*://*/issues/*|http*://*/browse/*|jira:*|linear:*|https://linear.app/*/issue/*) _e10=1 ;;
|
|
758
726
|
*" "*) _e10=1 ;;
|
|
@@ -817,40 +785,13 @@ if ! command -v bun &>/dev/null; then
|
|
|
817
785
|
exec "$BASH_CLI" "$@"
|
|
818
786
|
fi
|
|
819
787
|
|
|
820
|
-
#
|
|
821
|
-
#
|
|
822
|
-
#
|
|
823
|
-
# bash above) and AFTER the bun-presence check (a bun-less host already fell to
|
|
824
|
-
# bash). Accepts 1|true to match the flag's documented =1 usage; bash cannot
|
|
825
|
-
# cheaply reproduce truthy()'s yes/on spellings, so those are not honored here
|
|
826
|
-
# (documented divergence, same as other bin/loki bool guards). v8.1: LOKI_SDK_LOOP
|
|
827
|
-
# may also be set by the mode resolver above (LOKI_SDK_MODE=full -> LOOP=1), so
|
|
828
|
-
# `LOKI_SDK_MODE=full loki start` now correctly routes the loop to Bun here.
|
|
829
|
-
#
|
|
830
|
-
# RUN-25 iter 2 (T3(c) pre-flight): the Bun runAutonomous loop handles the RARV
|
|
831
|
-
# loop only. Orchestration flags that do pre-loop work the Bun loop does NOT do
|
|
832
|
-
# (git-worktree parallel streams, GitHub/issue import, Docker sandbox, the API
|
|
833
|
-
# server, backgrounding, alternate spec sources) must run on the bash route so the
|
|
834
|
-
# user gets FULL behavior even with the loop flag on. Scan the start args for any
|
|
835
|
-
# such flag (or an issue-ref positional) and, if present, DIVERT back to bash
|
|
836
|
-
# instead of taking the Bun fork. This is the "pre-loop handled, not rejected"
|
|
837
|
-
# guarantee that makes the eventual loop default-flip a no-regression. Runner
|
|
838
|
-
# flags (--simple, --allow-haiku, --regen-prd, --skip-memory, provider knobs) are
|
|
839
|
-
# handled by start.ts and do NOT divert. See artifacts/ITER1-FLAG-RECONCILE.md.
|
|
840
|
-
# FC-38 (scoped to --attempts; plain start keeps the 11.3.0 routing below): no `start --attempts` reaches the legacy loop (bash cmd_start, run.sh, runAutonomous).
|
|
841
|
-
# Issue refs and multi-word tasks were sent to engine10 above; every other start (PRD path, brief,
|
|
842
|
-
# flags) goes to the Bun start command, which runs engine10 and seals a receipt. A flag only the
|
|
843
|
-
# legacy route honored, or a provider engine10 cannot invoke, is refused loudly instead.
|
|
788
|
+
# `start --attempts 1` that route.sh left to its own handler (--help, the --workspace/--deploy front end, a bare
|
|
789
|
+
# start outside a repo) goes to the Bun start command, never the legacy loop (FC-38). An option only the legacy
|
|
790
|
+
# loop honored, or a provider engine10 cannot invoke, is refused loudly instead.
|
|
844
791
|
if [ "${1:-}" = "start" ] && [ "$_LOKI_START_ATTEMPTS" = "1" ]; then
|
|
845
792
|
_loki_attempts_refuse "${@:2}"
|
|
846
793
|
exec bun "${_LOKI_BUN_SAFE[@]}" "$BUN_CLI" "$@"
|
|
847
794
|
fi
|
|
848
|
-
if [ "${1:-}" = "start" ] && { [ "${LOKI_SDK_LOOP:-}" = "1" ] || [ "${LOKI_SDK_LOOP:-}" = "true" ]; }; then
|
|
849
|
-
if _loki_start_needs_bash "${@:2}"; then
|
|
850
|
-
exec "$BASH_CLI" "$@"
|
|
851
|
-
fi
|
|
852
|
-
exec bun "${_LOKI_BUN_SAFE[@]}" "$BUN_CLI" "$@"
|
|
853
|
-
fi
|
|
854
795
|
|
|
855
796
|
# CLI consolidation (Phase A): `trust detail` is the grouped form of the
|
|
856
797
|
# trust-metrics breakdown. The Bun `trust` handler only knows the trajectory
|
package/dashboard/__init__.py
CHANGED
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -126,10 +126,10 @@ same state, which is what makes runs resumable and independently verifiable.
|
|
|
126
126
|
|
|
127
127
|
A representative end-to-end flow:
|
|
128
128
|
|
|
129
|
-
1. **Entry.** `loki start ./prd.md` (
|
|
130
|
-
the
|
|
131
|
-
(`
|
|
132
|
-
`
|
|
129
|
+
1. **Entry.** `loki start ./prd.md` (`bin/loki`, which asks `autonomy/route.sh`
|
|
130
|
+
for the engine) runs the Loki 10 engine (`loki-ts/src/engine10`). The previous
|
|
131
|
+
bash loop (`autonomy/run.sh`) runs only on `--engine legacy` or
|
|
132
|
+
`LOKI_LEGACY_BASH=1`.
|
|
133
133
|
2. **Complexity and tier.** The engine detects complexity and maps the iteration
|
|
134
134
|
to a model tier (`rarv.ts` / `run.sh:get_rarv_tier`).
|
|
135
135
|
3. **Prompt construction.** `build_prompt.ts` (`run.sh:build_prompt`) assembles
|
package/docs/CLI-INVENTORY.md
CHANGED
|
@@ -37,7 +37,7 @@ Classes: KEEP-MODERN (v10-native or engine-neutral), UPDATE (live but needs mode
|
|
|
37
37
|
| trust | bun route, bash fallthrough | KEEP-MODERN | Trust trajectory surface |
|
|
38
38
|
| crash | bun route, bash fallthrough | KEEP-MODERN | Local-only crash plumbing |
|
|
39
39
|
| contract | loki-ts/src/cli.ts | KEEP-MODERN | v10 delivery contract |
|
|
40
|
-
| start | bun route, bash fallthrough | UPDATE |
|
|
40
|
+
| start | bun route, bash fallthrough | UPDATE | One engine (engine10); flags still legacy-shaped |
|
|
41
41
|
| slack | loki-ts/src/cli.ts | KEEP-MODERN | Bun-native integration |
|
|
42
42
|
| queue | loki-ts/src/cli.ts | KEEP-MODERN | Governor-aware batch of issue-mode runs |
|
|
43
43
|
| issues | loki-ts/src/cli.ts | KEEP-MODERN | Mass issue pickup on the T7 queue |
|
package/docs/CLI-REFERENCE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CLI reference
|
|
2
2
|
|
|
3
|
-
Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.
|
|
3
|
+
Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.119.0. Do not edit by hand.
|
|
4
4
|
Hidden and legacy-only commands are omitted; see `docs/CLI-INVENTORY.md` for the full inventory.
|
|
5
5
|
|
|
6
6
|
| Command | Description |
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Loki Mode, by [Autonomi](https://www.autonomi.dev/), turns a spec or an issue into a verified pull request with a receipt you can check. This page covers installing it, a first run, and the options around it.
|
|
4
4
|
|
|
5
|
-
**Version:** v11.
|
|
5
|
+
**Version:** v11.119.0
|
|
6
6
|
|
|
7
7
|
**Engine note:** `loki start` is the primary command. `loki start`, `loki "<task>"`, `loki owner/repo#N` and `loki quick` all run the Loki 10 engine, whatever the flag order or input form (PRD file, issue ref, task or one-word brief). The previous loop runs only on `--engine legacy`, `LOKI_ENGINE=legacy`, or for one call when a flag Loki 10 cannot honor is present. See the [user guide](v10/GUIDE.md) and the [5-minute quickstart](QUICKSTART.md).
|
|
8
8
|
|
package/docs/air-gapped.md
CHANGED
|
@@ -72,7 +72,7 @@ With a non-claude provider selected, `loki start` on the default (bash) route
|
|
|
72
72
|
and `loki quickstart` never prompt the `claude` CLI, even when one is
|
|
73
73
|
installed: PRD enrichment, done recognition, the council voters, the USAGE.md
|
|
74
74
|
refresh and the quickstart intent check fall back to their deterministic
|
|
75
|
-
paths.
|
|
75
|
+
paths.
|
|
76
76
|
`LOKI_ALLOW_CLAUDE_SIDECALLS=1` restores those claude calls, and the audit then lists them as REQUIRED egress, so it cannot read air-gap ready.
|
|
77
77
|
|
|
78
78
|
**We cannot run a build with no model at all.** Nobody can. What we can do is
|
|
@@ -136,7 +136,7 @@ A first task is ready when every required "All paths" item is present and at lea
|
|
|
136
136
|
### Execution paths
|
|
137
137
|
|
|
138
138
|
- Claude Code CLI path: the default. `loki start` runs the `claude` binary you installed and logged in with `claude auth login`. `loki chat` (with the claude provider) and `loki edit` call the `claude` CLI directly.
|
|
139
|
-
- Anthropic API-key path (Agent SDK, no `claude` CLI): `loki "<goal>"` needs only Anthropic credentials (for example `ANTHROPIC_API_KEY`), the bundled `@anthropic-ai/claude-agent-sdk` platform binary, and Bun. No `claude` CLI and no extra setting: the engine runs every session on the bundled SDK unless `LOKI_E10_INVOKER=cli`.
|
|
139
|
+
- Anthropic API-key path (Agent SDK, no `claude` CLI): `loki "<goal>"` needs only Anthropic credentials (for example `ANTHROPIC_API_KEY`), the bundled `@anthropic-ai/claude-agent-sdk` platform binary, and Bun. No `claude` CLI and no extra setting: the engine runs every session on the bundled SDK unless `LOKI_E10_INVOKER=cli`. `loki start ./prd.md` runs the same engine for a PRD up to 100000 bytes. A provider CLI on PATH is still needed by `loki demo` and `loki quickstart` (their provider check runs before the run starts), and by anything that reaches the bash loop: `loki start --engine legacy`, a PRD over 100000 bytes, and the `--workspace` / `--deploy` front end. Under `LOKI_SDK_MODE=full` with the claude provider, `--engine legacy` and a PRD over 100000 bytes are refused in one line instead.
|
|
140
140
|
- Other provider CLIs: `codex` (degraded), `cline`, `aider`, `opencode`. Any one of them replaces the `claude` CLI for `loki start --provider <name>`. Loki never silently substitutes a different provider than the one requested.
|
|
141
141
|
|
|
142
142
|
### Install methods
|
package/docs/cost-controls.md
CHANGED
|
@@ -63,7 +63,6 @@ Where the default applies:
|
|
|
63
63
|
| --- | --- | --- |
|
|
64
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. |
|
|
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
|
-
| Bun SDK loop (`LOKI_SDK_LOOP`) | No default. Opt in with `BUDGET_LIMIT`. | Stops the loop when the limit is reached. |
|
|
67
66
|
|
|
68
67
|
The README and the engine guide have shown different figures in the past (100 and
|
|
69
68
|
20). The figure above is the code's, and the two guides follow it.
|
|
@@ -112,8 +112,8 @@ Default-on in the Bun runner (see `CHANGELOG.md` v7.x entries; documented in `sk
|
|
|
112
112
|
|
|
113
113
|
- `LOKI_INJECT_FINDINGS` -- inject structured per-finding records into the next-iteration prompt; persists `.loki/state/findings-<iter>.json` after aggregation.
|
|
114
114
|
- `LOKI_OVERRIDE_COUNCIL` -- enable the 3-judge override council on a BLOCK verdict. Requires `LOKI_INJECT_FINDINGS=1` (operator setting only this var alone is a no-op).
|
|
115
|
-
**The BLOCK-LIFT arm
|
|
116
|
-
This fail-closed direction is DELIBERATE, not a bug: on the agent-authored route the gated agent writes its own counter-evidence, so mechanical verification is forgeable. On bash the only exits from a Critical/High BLOCK are to fix the finding or to use the human-escape path (`rm .loki/PAUSE`). Documented here because the heading above says "default-on" and, for this one knob's block-lift, that is true
|
|
115
|
+
**The BLOCK-LIFT arm never adjudicates on the bash loop.** The Bun loop that ran it was removed; on the bash loop (`--engine legacy`) the override lands in a stub that returns `REJECT_OVERRIDE` for every record (`loki-ts/src/commands/internal_phase1.ts:215-227`). Counter-evidence is still parsed and an `override-<iter>.json` transcript is still written, so the feature looks live in the artifacts while never being able to lift a BLOCK.
|
|
116
|
+
This fail-closed direction is DELIBERATE, not a bug: on the agent-authored route the gated agent writes its own counter-evidence, so mechanical verification is forgeable. On bash the only exits from a Critical/High BLOCK are to fix the finding or to use the human-escape path (`rm .loki/PAUSE`). Documented here because the heading above says "default-on" and, for this one knob's block-lift, that is not true.
|
|
117
117
|
- `LOKI_AUTO_LEARNINGS` -- auto-write structured learnings per code_review cycle. Optional `LOKI_AUTO_LEARNINGS_EPISODE=1` also writes the learning into the episode store.
|
|
118
118
|
**Bun route only.** This var has ZERO occurrences in `autonomy/run.sh` and `autonomy/loki` (measured; controls: `LOKI_HANDOFF_MD` returns 2, `LOKI_INJECT_FINDINGS` returns 3), so "set to `1` to force-enable on the bash route" does not apply to this knob -- there is nothing on bash to enable. The bash route DOES have a learnings store (`init_learnings_db`, `run.sh`); what is Bun-only is the automatic per-code_review-cycle write.
|
|
119
119
|
- `LOKI_HANDOFF_MD` -- write a structured handoff doc before iteration close.
|
|
@@ -226,7 +226,7 @@ banners you might expect. These variables control the remaining `[INFO]` and
|
|
|
226
226
|
| Variable | Default | Effect |
|
|
227
227
|
|---|---|---|
|
|
228
228
|
| `LOKI_DURABLE_STATE` | `0` | `1` enables durable state **and** the richer process-exit contract that lets Kubernetes distinguish a deterministic failure from a crash. See [exit codes](./exit-codes.md). |
|
|
229
|
-
| `LOKI_SDK_LOOP` | unset |
|
|
229
|
+
| `LOKI_SDK_LOOP` | unset | No longer selects a loop: `loki start` routes through `autonomy/route.sh` to the default engine (Loki 10), whose Claude sessions use the Agent SDK unless `LOKI_E10_INVOKER=cli`. Setting it prints a one-line notice. While it is set (directly, or by `LOKI_SDK_MODE=full` or `LOKI_SDK=full`) with the claude provider, `--engine legacy`, `LOKI_ENGINE=legacy` and a PRD over 100000 bytes exit 2 with one line, because the bash loop has no SDK path. |
|
|
230
230
|
| `LOKI_ALLOW_AGENT_GITHUB_TOKEN` | unset | By default `GH_TOKEN`, `GITHUB_TOKEN`, `GH_ENTERPRISE_TOKEN`, and `GITHUB_ENTERPRISE_TOKEN` are withheld from the agent's environment (the agent runs as the user, so OS keychain and credential files are not yet isolated; P9-ISOLATION is in design). The two routes differ: on the bash route (`autonomy/run.sh`) the withheld tokens are re-granted only for Loki's own trusted calls, namely the `gh()` CLI wrapper, the `_loki_net` helper used by the optional local-PR path in `on_run_complete()`, the session-end `create_session_pr` call, and `autonomy/lib/proof-check.sh`'s network probe. On the Bun route (`loki-ts/src/runner/github_token.ts`'s `withholdGithubTokens()`) the tokens are dropped from the process outright, with no re-grant and no push/PR step of its own. Exactly `1` lets the agent inherit the tokens as before, on either route; that is a Rule of Two exposure, and a one-line stderr warning is printed. |
|
|
231
231
|
| `LOKI_AI_MARKING` | unset (off) | `1` (exactly) adds machine-readable trailers to the Loki commit (`AI-Generated: true`, `AI-Provider`, `AI-Model`, `Loki-Receipt`, after `Loki-Run`) and one `AI-Generated: true (...)` marker line under the verdict in the PR body. Values are single-line and bounded. Off, the commit and PR body are byte-identical to before. |
|
|
232
232
|
|
package/docs/exit-codes.md
CHANGED
|
@@ -67,8 +67,7 @@ Helm wires this up for you: `worker.exitCodes.terminalFailure` (default 20)
|
|
|
67
67
|
feeds the Job's `podFailurePolicy`, so a deterministic failure fails the Job
|
|
68
68
|
immediately instead of burning `backoffLimit`. Requires Kubernetes 1.31+.
|
|
69
69
|
|
|
70
|
-
|
|
71
|
-
identically; a parity test asserts they agree status for status.
|
|
70
|
+
The bash runner implements this contract.
|
|
72
71
|
|
|
73
72
|
The default engine honors the same opt-in: with `LOKI_DURABLE_STATE=1` a run that
|
|
74
73
|
ends FAILED, PARTIAL, BUDGET_STOP, BLOCKED (spec conflict) or STALLED exits 20
|
|
@@ -441,7 +440,7 @@ The JSON carries `engine`, `adapter`, `provider`, `model`, `input_type`, `input`
|
|
|
441
440
|
|
|
442
441
|
- Argument order never changes the route: flags first or last, `--prd FILE` or a positional file, `--provider X` or `LOKI_PROVIDER=X`, `--engine X` or `LOKI_ENGINE=X` all resolve identically (the flag wins over the env var).
|
|
443
442
|
- Default engine is `engine10` for a PRD file (`.md`, `.json`, `.yaml`), an issue reference (`owner/repo#N` or an issue URL), a multi-word task and a one-word brief.
|
|
444
|
-
- The legacy engine runs only on `--engine legacy` or `LOKI_ENGINE=legacy`, or for a PRD larger than 100000 bytes. A flag engine10 does not support, a provider with no engine10 invoker, and a machine with no working bun each exit 2 with the fix. Inside a repository, `loki start` or `loki quick` with no task exits 64 with the `loki "<goal>"` usage (after offering to resume an interrupted run); outside one, a bare `loki start` shows the offline sample receipt and exits 0.
|
|
443
|
+
- The legacy engine runs only on `--engine legacy` or `LOKI_ENGINE=legacy`, or for a PRD larger than 100000 bytes (engine10 carries the task in single strings, capped at 128 KiB on Linux). Under `LOKI_SDK_MODE=full`, `LOKI_SDK=full` or `LOKI_SDK_LOOP=1` with the claude provider, each of these exits 2 with one line instead: the bash loop has no SDK path. A flag engine10 does not support, a provider with no engine10 invoker, and a machine with no working bun each exit 2 with the fix. Inside a repository, `loki start` or `loki quick` with no task exits 64 with the `loki "<goal>"` usage (after offering to resume an interrupted run); outside one, a bare `loki start` shows the offline sample receipt and exits 0.
|
|
445
444
|
- `--engine engine10` with an unsupported flag is refused (exit 2) instead of rerouted.
|
|
446
445
|
- A missing PRD file path is a usage error (exit 2).
|
|
447
446
|
- Adapter is `<engine>:<provider>`, with the legacy engine written `legacy-bash:<provider>`.
|
|
@@ -480,5 +479,5 @@ The table below is rendered from live `loki route --json` output.
|
|
|
480
479
|
| `LOKI_ENGINE=legacy start p.md` | legacy | legacy-bash:claude | 1 listed | explicit: --engine legacy or LOKI_ENGINE=legacy |
|
|
481
480
|
| `start p.md --engine engine10` | engine10 | engine10:claude | none | explicit: --engine engine10 |
|
|
482
481
|
| `LOKI_ENGINE=engine10 start p.md` | engine10 | engine10:claude | none | explicit: --engine engine10 |
|
|
483
|
-
| `start big.md` | legacy | legacy-bash:claude | 1 listed | PRD is larger than 100000 bytes (engine10
|
|
482
|
+
| `start big.md` | legacy | legacy-bash:claude | 1 listed | PRD is larger than 100000 bytes (engine10 carries the task in single strings, capped at 128 KiB on Linux) |
|
|
484
483
|
<!-- route-table:end -->
|