loki-mode 11.161.0 → 11.162.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 (73) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/loki +24 -1
  4. package/autonomy/route.sh +12 -5
  5. package/bin/loki +1 -0
  6. package/dashboard/__init__.py +1 -1
  7. package/docs/CLI-REFERENCE.md +1 -1
  8. package/docs/INSTALLATION.md +1 -1
  9. package/docs/cost-controls.md +26 -2
  10. package/docs/dev/architecture-reference.md +1 -0
  11. package/docs/environment-variables.md +9 -1
  12. package/loki-ts/dist/loki.js +1969 -1952
  13. package/mcp/__init__.py +1 -1
  14. package/package.json +2 -2
  15. package/packages/control-plane/dist/server.js +354 -146
  16. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  17. package/web-app/dist/assets/{AdminPage-CuV3jwO8.js → AdminPage-BizDHgWk.js} +1 -1
  18. package/web-app/dist/assets/{Avatar-fwxJYmU0.js → Avatar-EPfQ4V79.js} +1 -1
  19. package/web-app/dist/assets/{Badge-C-16U-fv.js → Badge-BOcJREUY.js} +1 -1
  20. package/web-app/dist/assets/{Button-DFjWZzwM.js → Button-BL7oJ3SX.js} +1 -1
  21. package/web-app/dist/assets/{CockpitPage-BMe0TFba.js → CockpitPage-CCjh7fQ3.js} +1 -1
  22. package/web-app/dist/assets/{ComparePage-BGNs7d0W.js → ComparePage-D5v3QbiF.js} +1 -1
  23. package/web-app/dist/assets/{ErrorBoundary-Dg4jYVbI.js → ErrorBoundary-BPaT8HE3.js} +1 -1
  24. package/web-app/dist/assets/{EvidenceReceiptPanel-BPiK4shg.js → EvidenceReceiptPanel-DPjXfVE0.js} +1 -1
  25. package/web-app/dist/assets/{GitHubIssuesPanel-Bj73V3QA.js → GitHubIssuesPanel-TbALzECx.js} +1 -1
  26. package/web-app/dist/assets/{GitHubPRsPanel-BbmTPafH.js → GitHubPRsPanel-C-L_BSIr.js} +1 -1
  27. package/web-app/dist/assets/{HomePage-_kzSwCXX.js → HomePage-1mYJaASp.js} +2 -2
  28. package/web-app/dist/assets/{LoginPage-D3guOsi2.js → LoginPage-B6idMnV-.js} +1 -1
  29. package/web-app/dist/assets/{MagicPage-SWoVP7OY.js → MagicPage-DeNkeYa6.js} +1 -1
  30. package/web-app/dist/assets/{MetricsPage-BogKy2pu.js → MetricsPage-Dgz1xd96.js} +1 -1
  31. package/web-app/dist/assets/{NotFoundPage-CQiT_FXs.js → NotFoundPage-BcpJkVEt.js} +1 -1
  32. package/web-app/dist/assets/{ProjectPage-CZ_hFP38.js → ProjectPage-BghMVwZJ.js} +3 -3
  33. package/web-app/dist/assets/{ProjectsPage-Bq-oT_Pe.js → ProjectsPage-CYi1AWYT.js} +1 -1
  34. package/web-app/dist/assets/{SettingsPage-DSr6lHmq.js → SettingsPage-CY2F-s-3.js} +1 -1
  35. package/web-app/dist/assets/{ShowcasePage-Dqjj3rgJ.js → ShowcasePage-CnGVGvsv.js} +1 -1
  36. package/web-app/dist/assets/{SystemSettingsPage-scRs0fQ3.js → SystemSettingsPage-ZJA4D4Cr.js} +1 -1
  37. package/web-app/dist/assets/{TeamsPage-BhLTiTJf.js → TeamsPage-D-ubF63c.js} +1 -1
  38. package/web-app/dist/assets/{TemplatesPage-CfLqFEwD.js → TemplatesPage-DU5ExG6U.js} +1 -1
  39. package/web-app/dist/assets/{TerminalOutput-LEdtHTdQ.js → TerminalOutput-CxWrY53G.js} +1 -1
  40. package/web-app/dist/assets/{activity-CIE6E4sw.js → activity-B0hVt7sG.js} +1 -1
  41. package/web-app/dist/assets/{bell-CbXNt0VT.js → bell-D70EABSP.js} +1 -1
  42. package/web-app/dist/assets/{bot-DBilu5by.js → bot-D0lhJgAo.js} +1 -1
  43. package/web-app/dist/assets/{check-ByCaYntD.js → check-CvK2c4aF.js} +1 -1
  44. package/web-app/dist/assets/{chevron-left-lmByeTlW.js → chevron-left-5nepkZ1R.js} +1 -1
  45. package/web-app/dist/assets/{circle-alert-DKEPsx9y.js → circle-alert-COWxxc9Q.js} +1 -1
  46. package/web-app/dist/assets/{clock-t4QPQ9P1.js → clock-DVruSW-w.js} +1 -1
  47. package/web-app/dist/assets/{cloud-YfbBdG9Y.js → cloud-BLxWirmZ.js} +1 -1
  48. package/web-app/dist/assets/{code-xml-DUdvGh42.js → code-xml-DTR0iFkj.js} +1 -1
  49. package/web-app/dist/assets/{database-DMsUwuu7.js → database-BDk9p0n4.js} +1 -1
  50. package/web-app/dist/assets/{dollar-sign-CQj8ulH4.js → dollar-sign-BZNzvnXk.js} +1 -1
  51. package/web-app/dist/assets/{file-code-corner-Dcun8Ito.js → file-code-corner-BnUFhCvL.js} +1 -1
  52. package/web-app/dist/assets/{file-plus-BipK8vSI.js → file-plus-COXu7-j_.js} +1 -1
  53. package/web-app/dist/assets/{globe-0GE20vx4.js → globe-lyZQ67pp.js} +1 -1
  54. package/web-app/dist/assets/{hammer-BSCC-aCx.js → hammer-DCl4Kayz.js} +1 -1
  55. package/web-app/dist/assets/{index-uBPpPPl7.js → index-DPOae9m_.js} +3 -3
  56. package/web-app/dist/assets/{layers-BT6Akh8A.js → layers-jBOzzVOq.js} +1 -1
  57. package/web-app/dist/assets/{loader-circle-BSF5o6lv.js → loader-circle-BFjr0bf_.js} +1 -1
  58. package/web-app/dist/assets/{lock-DhvY9ErS.js → lock-CY4mlLs5.js} +1 -1
  59. package/web-app/dist/assets/{package-BMUewVpu.js → package-eZT5xC4c.js} +1 -1
  60. package/web-app/dist/assets/{plus-JcYGK4QC.js → plus-DuykLjQt.js} +1 -1
  61. package/web-app/dist/assets/{refresh-cw-BSMX6sVQ.js → refresh-cw-G7q9T3RR.js} +1 -1
  62. package/web-app/dist/assets/{rotate-ccw-I5qSLfsL.js → rotate-ccw-Bokg6RqC.js} +1 -1
  63. package/web-app/dist/assets/{scroll-text-DQ8wk3hX.js → scroll-text-DOds11-k.js} +1 -1
  64. package/web-app/dist/assets/{server-P6nlJ6_y.js → server-C8algKl_.js} +1 -1
  65. package/web-app/dist/assets/{shield-alert-DJXz2Y6G.js → shield-alert-BiKSiXeT.js} +1 -1
  66. package/web-app/dist/assets/{thumbs-up-BlLS0TcM.js → thumbs-up-DbgJ8_nk.js} +1 -1
  67. package/web-app/dist/assets/{trash-2-2-LU0vyX.js → trash-2-CzORwdJm.js} +1 -1
  68. package/web-app/dist/assets/{trending-down-DBVjyJy7.js → trending-down-jQ86erDF.js} +1 -1
  69. package/web-app/dist/assets/{trending-up-Dbz8-n-y.js → trending-up-C9JVhiBK.js} +1 -1
  70. package/web-app/dist/assets/{upload-CbP9Qhau.js → upload-OV-MfCE6.js} +1 -1
  71. package/web-app/dist/assets/{usePolling-Br1am1Wv.js → usePolling-C2jjhfd7.js} +1 -1
  72. package/web-app/dist/assets/{user-B43gT1q9.js → user-CNnDlDog.js} +1 -1
  73. 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.161.0
6
+ # Loki Mode v11.162.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
 
@@ -461,4 +461,4 @@ Implemented, planned and deprecated items, with the version each landed in: `CHA
461
461
 
462
462
  ---
463
463
 
464
- **v11.161.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
464
+ **v11.162.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.161.0
1
+ 11.162.0
package/autonomy/loki CHANGED
@@ -2553,7 +2553,7 @@ _loki_start_handoff() {
2553
2553
  _loki_start_flag_kind() {
2554
2554
  _LOKI_START_FLAG_KIND=""
2555
2555
  case "${1%%=*}" in
2556
- --provider|--brief|--budget|--cost|--prd|--issue|--isolation|--compliance|--max-duration|--log-level|--bmad-project|--openspec|--mirofish-rounds|--mirofish-timeout|--output|--config|--vars|--env-file|--remote|--attempts|--mirofish-docker) _LOKI_START_FLAG_KIND=value ;;
2556
+ --provider|--brief|--budget|--cost|--prd|--issue|--isolation|--compliance|--max-duration|--max-time|--log-level|--bmad-project|--openspec|--mirofish-rounds|--mirofish-timeout|--output|--config|--vars|--env-file|--remote|--attempts|--mirofish-docker) _LOKI_START_FLAG_KIND=value ;;
2557
2557
  --mirofish) _LOKI_START_FLAG_KIND=optional ;;
2558
2558
  --parallel|--allow-haiku|--haiku|--regen-prd|--regenerate-prd|--regen|--fresh-prd|--bg|--background|--simple|--complex|--github|--no-dashboard|--api|--sandbox|--skip-memory|--yes|-y|--quiet|--mirofish-bg|--no-mirofish|--no-plan|--fast|--repo-fast|--full|--repo-full|--dry-run|--no-start|--worktree|-w|--pr|--prepare-pr|--ship|--detach|-d|--help|-h|--resume|--) _LOKI_START_FLAG_KIND=bool ;;
2559
2559
  *) return 1 ;;
@@ -2943,6 +2943,8 @@ cmd_start() {
2943
2943
  echo " --quiet Suppress [INFO]/[STEP]; warnings and errors still print"
2944
2944
  echo " --log-level LEVEL debug | info | warn | error (default: info)"
2945
2945
  echo " --max-duration DUR Wall-clock cap: seconds, or 90m / 2h (default: none)"
2946
+ echo " --max-time DUR Outer time limit the run finishes inside, sealing what is done (LOKI_RUN_DEADLINE_S): seconds, or 90m / 2h."
2947
+ echo " Default: none. With no limit the run stops when it is done or makes no progress."
2946
2948
  echo " --deploy After a start that exits 0, run the gated loki deploy --execute. Deploy flags:"
2947
2949
  echo " --destination preview|staging|production, --canary, --domain HOST,"
2948
2950
  echo " --env-file FILE (the deploy env file, not config, when --deploy is set),"
@@ -3175,6 +3177,27 @@ cmd_start() {
3175
3177
  return 1
3176
3178
  fi
3177
3179
  ;;
3180
+ # NO-DEFAULT-BUDGET: an opt-in outer time limit (LOKI_RUN_DEADLINE_S); same duration forms as --max-duration.
3181
+ --max-time)
3182
+ if [[ -n "${2:-}" ]]; then
3183
+ local _mt="$2" _mtn _mtmul=1
3184
+ case "$_mt" in
3185
+ *s) _mtn="${_mt%s}" ;;
3186
+ *m) _mtn="${_mt%m}"; _mtmul=60 ;;
3187
+ *h) _mtn="${_mt%h}"; _mtmul=3600 ;;
3188
+ *) _mtn="$_mt" ;;
3189
+ esac
3190
+ if ! [[ "$_mtn" =~ ^[0-9]+$ ]] || [ "$_mtn" -eq 0 ]; then
3191
+ echo "Error: --max-time must be a positive duration (e.g. 5400, 90m, 2h); got '$2'" >&2
3192
+ return 1
3193
+ fi
3194
+ export LOKI_RUN_DEADLINE_S=$(( _mtn * _mtmul ))
3195
+ shift 2
3196
+ else
3197
+ echo "Error: --max-time requires a value (e.g. 90m)" >&2
3198
+ return 1
3199
+ fi
3200
+ ;;
3178
3201
  # Verbosity. --quiet suppresses [INFO]/[STEP]; warnings and errors
3179
3202
  # always print, so a quiet run can still say why it failed.
3180
3203
  --quiet)
package/autonomy/route.sh CHANGED
@@ -10,7 +10,7 @@
10
10
  # Bash 3.2 compatible (no associative arrays, no ${var,,}).
11
11
 
12
12
  # Flags that take a separate value token.
13
- _ROUTE_VALUE_FLAGS=" --provider --budget --budget-limit --max-cost --max-iterations --max-retries --session-model --completion-promise --base-wait --max-wait --prd --brief --attempts --spec --isolation --output --engine --mirofish-rounds --mirofish-timeout --max-duration --log-level --compliance --cost --remote --issue --bmad-project --openspec --mirofish-docker --destination --domain --env-file --health-url --health-match --workspace --config --vars --seal-existing --label "
13
+ _ROUTE_VALUE_FLAGS=" --provider --budget --budget-limit --max-cost --max-time --max-iterations --max-retries --session-model --completion-promise --base-wait --max-wait --prd --brief --attempts --spec --isolation --output --engine --mirofish-rounds --mirofish-timeout --max-duration --log-level --compliance --cost --remote --issue --bmad-project --openspec --mirofish-docker --destination --domain --env-file --health-url --health-match --workspace --config --vars --seal-existing --label "
14
14
  # Flags whose value is optional (cmd_start reads one only when it is present): --mirofish takes a URL (a token that does not
15
15
  # start with --, as _loki_start_optval_consumes). Declared here so a refused one still consumes its value. --parallel is NOT
16
16
  # here: cmd_start treats it as a plain boolean (_loki_start_flag_kind), so "--parallel 3" leaves 3 as a positional.
@@ -157,10 +157,10 @@ loki_route_resolve() {
157
157
  local verb="$1"; shift
158
158
  R_DECIDED=0; R_E10=0; R_HARD=0; R_ENGINE=""; R_REASON=""; R_INPUT_TYPE=""; R_INPUT=""
159
159
  R_PROVIDER=""; R_MODEL=""; R_NOTICE=""; R_ERR=""; R_EXPLAIN=0; R_JSON=0; R_SESSION_MODEL=""; R_VERB=""
160
- R_FRONT=0; R_E10_ARGS=(); R_CLEAN=(); R_ADAPTER=""; R_CAPDIFF=(); R_E10_CAP_S=""; R_DRY=0; R_MAXCOST=""; R_PR_ARGS=()
160
+ R_FRONT=0; R_E10_ARGS=(); R_CLEAN=(); R_ADAPTER=""; R_CAPDIFF=(); R_E10_CAP_S=""; R_DEADLINE_S=""; R_DRY=0; R_MAXCOST=""; R_PR_ARGS=()
161
161
  if [ "$verb" = "start" ] && _route_pr_mode "$@"; then return 0; fi
162
162
 
163
- local a engine_req="" dry=0 help=0 front_flag="" legacy_flag="" session_model="" provider_flag="" max_duration="" cap_err="" input_flag=""
163
+ local a engine_req="" dry=0 help=0 front_flag="" legacy_flag="" session_model="" provider_flag="" max_duration="" max_time="" cap_err="" input_flag=""
164
164
  local -a positionals=() passthru=()
165
165
  local i=0 n=$#
166
166
  local -a argv=("$@")
@@ -213,6 +213,12 @@ loki_route_resolve() {
213
213
  cap_err="loki: --max-duration '$val' is not a duration (use seconds, or 90m / 2h)"
214
214
  fi
215
215
  continue ;;
216
+ --max-time) # NO-DEFAULT-BUDGET: an outer wall-clock limit the run finishes inside (LOKI_RUN_DEADLINE_S); no limit is set by default
217
+ max_time="$(_route_duration_s "$val")"
218
+ if [ -z "$max_time" ] && [ -z "$cap_err" ]; then
219
+ cap_err="loki: --max-time '$val' is not a duration (use seconds, or 90m / 2h)"
220
+ fi
221
+ continue ;;
216
222
  esac
217
223
  if _route_has "$_ROUTE_NOOP_FLAGS" "$name"; then continue; fi
218
224
  if _route_has "$_ROUTE_E10_FLAGS" "$name"; then passthru+=("$name"); continue; fi
@@ -395,6 +401,7 @@ $(loki_removed_saved_provider_hint "$R_PROVIDER")"
395
401
  R_NOTICE="loki: --max-duration $max_duration s is above the engine10 run-cap ceiling; using ${_ROUTE_CAP_CEILING_S}s."
396
402
  fi
397
403
  fi
404
+ if [ -n "$max_time" ] && [ "$engine_req" != "legacy" ]; then R_DEADLINE_S="$max_time"; fi
398
405
  if [ -n "$provider_flag" ] && [ "$engine_req" != "legacy" ]; then
399
406
  if ! validate_provider "$provider_flag"; then
400
407
  R_ERR="loki: --provider $provider_flag has no Loki 10 engine invoker (use $(loki_supported_providers_joined " or "), or pass --engine legacy)"
@@ -521,7 +528,7 @@ loki_route_dispatch() {
521
528
  if [ "$R_EXPLAIN" = "1" ]; then loki_route_print; return 7; fi
522
529
  if [ "$R_DRY" = "1" ]; then
523
530
  loki_route_print
524
- printf 'max-cost: %s\nrun-cap: %ss\ndry-run: nothing was started\n' "${R_MAXCOST:-default (engine10 resolves its own)}" "${R_E10_CAP_S:-$_ROUTE_CAP_CEILING_S}"
531
+ printf 'max-cost: %s\nrun-cap: %s\ndry-run: nothing was started\n' "${R_MAXCOST:-none (engine10 resolves loki.yaml and LOKI_BUDGET_LIMIT)}" "$(if [ -n "$R_E10_CAP_S" ]; then printf '%ss' "$R_E10_CAP_S"; elif [ -n "$R_DEADLINE_S" ]; then printf '%ss (--max-time)' "$R_DEADLINE_S"; else printf 'none (the run stops when it is done or makes no progress)'; fi)"
525
532
  return 7
526
533
  fi
527
534
  if [ -n "$R_NOTICE" ]; then echo "$R_NOTICE" >&2; fi
@@ -549,5 +556,5 @@ _route_task_first() {
549
556
  else
550
557
  R_E10_ARGS=(--no-pr "$@")
551
558
  fi
552
- R_DECIDED=1; R_E10=1; R_HARD=0; R_ENGINE=engine10; R_VERB="$verb"; R_SESSION_MODEL=""; R_E10_CAP_S=""
559
+ R_DECIDED=1; R_E10=1; R_HARD=0; R_ENGINE=engine10; R_VERB="$verb"; R_SESSION_MODEL=""; R_E10_CAP_S=""; R_DEADLINE_S=""
553
560
  }
package/bin/loki CHANGED
@@ -793,6 +793,7 @@ if [ -f "$REPO_ROOT/autonomy/route.sh" ]; then
793
793
  export LOKI_SESSION_MODEL="$R_SESSION_MODEL"
794
794
  fi
795
795
  if [ "$R_E10" = "1" ] && [ -n "${R_E10_CAP_S:-}" ]; then export LOKI_E10_CAP_S="$R_E10_CAP_S"; fi
796
+ if [ "$R_E10" = "1" ] && [ -n "${R_DEADLINE_S:-}" ]; then export LOKI_RUN_DEADLINE_S="$R_DEADLINE_S"; fi # --max-time
796
797
  if [ "$R_ENGINE" = "verify-pr" ]; then
797
798
  set -- verify-pr "${R_PR_ARGS[@]}"
798
799
  elif [ "$R_E10" != "1" ]; then
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.161.0"
10
+ __version__ = "11.162.0"
11
11
 
12
12
  __all__ = ["__version__"]
@@ -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.161.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.162.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 |
@@ -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.161.0
5
+ **Version:** v11.162.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
 
@@ -35,6 +35,23 @@ while spending almost nothing and completing no iteration, so neither of those
35
35
  breakers ever trips. The wall-clock cap is the one that catches it. We added it
36
36
  after a run burned $34 reaching an external timeout.
37
37
 
38
+ ## Time and progress (Loki 10 engine)
39
+
40
+ There is no default time limit. `--max-time 90m` (or `LOKI_RUN_DEADLINE_S`) sets an outer limit the run finishes
41
+ inside; `--max-duration`, `LOKI_E10_CAP_S` and `budgets.run_cap_s` set a run cap. With any of them the engine budgets
42
+ every stage as before. With none, the run stops on no progress:
43
+
44
+ | Guard | Ends | Default |
45
+ |---|---|---|
46
+ | No-progress rounds | fix rounds, proof re-runs, continues that do not improve on the best round | 2 in a row (`LOKI_E10_NO_PROGRESS_ROUNDS`) |
47
+ | Silent session | a session with no output and no tree change | 1800 s (`LOKI_E10_STALL_KILL_S`) |
48
+ | Looping session | a session that prints but changes nothing in the tree | 3600 s (`LOKI_E10_LOOP_KILL_S`) |
49
+ | Silent command | a test or check with no output | 1800 s (`LOKI_E10_CMD_SILENCE_S`) |
50
+ | Hung worker | no event and no running process | 1800 s (`LOKI_E10_HANG_SILENCE_S`) |
51
+
52
+ Each ends the run with commit, seal and a draft PR of what is done. `LOKI_E10_DEFAULT_BUDGETS=1` restores the old
53
+ default budgets.
54
+
38
55
  ## Budget contract
39
56
 
40
57
  The per-run spend cap: its default, how it is chosen, what it covers, where it is
@@ -44,7 +61,14 @@ section must agree; tests pin them.
44
61
 
45
62
  ### Default
46
63
 
47
- The default cap is **100 USD per run**.
64
+ **Loki 10 engine (the default route): no default cap.** Since the no-default-budget change (founder, 2026-11-18), the
65
+ engine sets no dollar cap, with an API key or on a subscription, and no time, round, turn or test-count budget either. A
66
+ run ends when it is done or makes no progress (see "Time and progress" below), always with a draft PR of what is done.
67
+ An API-key run prints: "no cost limit is set: the run stops when it is done or makes no progress (--max-cost <usd> sets
68
+ one)". A limit you set (`--max-cost`, `LOKI_BUDGET_LIMIT`, `budgets.per_run`) is enforced exactly as before, and an
69
+ unusable value fails closed.
70
+
71
+ **Previous loop (`autonomy/run.sh`): 100 USD per run.**
48
72
 
49
73
  The number lives in one file, `loki-ts/data/model-pricing.json`
50
74
  (`default_max_cost_usd`). Both routes read it:
@@ -61,7 +85,7 @@ Where the default applies:
61
85
 
62
86
  | Route | Default applies | What the cap does |
63
87
  | --- | --- | --- |
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"). |
88
+ | engine10 (`loki "<task>"`, the Loki 10 engine) | Never: no default dollar cap, with or without an API key. A cap you set stops starting stages and seals what exists. | Stops starting stages and seals what exists (see "What you keep at the cap"). |
65
89
  | 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
90
 
67
91
  The README and the engine guide have shown different figures in the past (100 and
@@ -188,6 +188,7 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
188
188
  - `LOKI_E10_BACKSTOP_SEAL` -- on by default, `0` opts out (`loki-ts/src/engine10/supervisor.ts` after the first worker; `worker.ts` LOKI_E10_SEAL_ONLY; `stages/seal.ts` sealOnlyPass). A worker the backstop killed before it sealed gets one seal pass: a resumed worker runs only commit and seal, bounded by min(45 s, ceiling + 25 s - elapsed) and skipped below 10 s. The receipt is never VERIFIED and carries the time-ran-out NOT PROVEN line. `LOKI_E10_TEST_BLOCK_AFTER_SESSION_MS` is a test-only hook that blocks the worker's event loop after its implement session.
189
189
  - `LOKI_E10_SUITE_TIMEOUT_NOT_RUN` -- on by default, `0` opts out (`loki-ts/src/project_model/package_suite.ts` runPackageSuites and `loki-ts/src/engine10/stages/deep.ts` runFullSuite; `util/shell.ts` run reports `timedOut`). A full suite stopped by its timeout is not_run "timed out after N s" and runs in its own process group.
190
190
  - `LOKI_E10_LINT_UNTOUCHED` -- off by default, `1` opts in (acc-174; off because it changed no label on 150 stored bench runs and has not fired on a real run; `loki-ts/src/engine10/stages/verify.ts` tscUntouchedOnly in runLintChecks, seal lists `lint_untouched`). A failed project-wide tsc whose every diagnostic is in an untouched, unnamed file, with no compiler or linter config changed, no changed symbol in the output, and every diagnostic line also in the same tsc run on the base snapshot (tscOnBase; no base output refuses), is not blocking and is disclosed on the receipt.
191
+ - `LOKI_E10_DEFAULT_BUDGETS` -- off by default (NO-DEFAULT-BUDGET, founder 2026-11-18; `loki-ts/src/engine10/types.ts` defaultBudgetsOn, budgetsOn, armTimer and the no-progress constants; `util/run_cap.ts` resolveRunCapS; consumers marked `NO-DEFAULT-BUDGET` in machine.ts, session.ts, supervisor.ts, worker_proc.ts, stages/verify.ts, stages/deep.ts, stages/implement.ts, util/conflict_resume.ts, util/shell.ts, util/check_result.ts). With no user time limit (LOKI_E10_CAP_S, budgets.run_cap_s, LOKI_RUN_DEADLINE_S or `--max-time`) the worker's capS is Infinity: no soft cap, stage limit, verify maximum, suite or check timeout, fix-round, proof, continue or turn count, Haiku session cap, 20-file dependents cap or backstop. Loops end after LOKI_E10_NO_PROGRESS_ROUNDS (2) rounds without progress; a session ends on 1800 s silence or 3600 s of output with no tree change; a command with no limit on 1800 s without output; the supervisor stops a worker with no event and no child process for 1800 s and seals. Never arm a timer with Infinity or more than 2^31-1 ms (Bun fires it after 1 ms): use armTimer. `1` restores every old default. A user time limit bounds the run through the cap alone: implement and verify are sized from the time left, and no Loki stage limit, verify maximum (900 s), round count or turn cap applies unless the user sets it (`--verify-max-time` / LOKI_E10_VERIFY_MAX_S). LIMIT-NOT-FAILED (`stages/seal.ts` unattributedRed): a verify Loki stopped at its limit or the cap seals PARTIAL on an unattributed pre-existing test failure, never FAILED. Not changed: intake baselines (300 s per command), the prove stage's internal 600 s, the NRD 120 s differential, the prove listing session's 3-turn cap, `--deep` (2700 s), `--verified` bounds, and the bash route's $100 default.
191
192
  - `LOKI_RUN_DEADLINE_S` -- unset by default (off); a number of seconds turns it on (`loki-ts/src/util/run_cap.ts` deadlineCapS, used by resolveRunCapS and, for deep runs, the supervisor). The run cap is fixed at the deadline minus the process's uptime minus 30 s (at least 60 s), and never above another fixed cap, so the soft cap seals before the deadline.
192
193
  - `LOKI_E10_TIMEOUT_CARRY` -- on by default, `0` opts out (`loki-ts/src/engine10/stages/verify.ts` carriedTimeouts in runTests). A test check that timed out in the previous verify of the run, in a file the change did not touch and not a Wall, task-named or held-out check, is carried as not_run instead of rerun. Separately, runOnce SIGKILLs a check KILL_AFTER_MS (5 s) after its timeout or abort.
193
194
  - `LOKI_E10_WATCHDOG_SILENT_S` -- 120 by default, `0` turns it off (`loki-ts/src/engine10/supervisor.ts` silenceWatch, descendantNames, on the supervisor's 15 s alive beat). After that many seconds with no worker event, the supervisor appends `watchdog.silent` {silent_s, last_event, processes} (executable basenames under the supervisor, no arguments), again each further interval of silence.
@@ -23,7 +23,15 @@ with nowhere to look them up.
23
23
  |---|---|---|
24
24
  | `LOKI_PRD_FILE` | none | Path to a spec file, as an alternative to the positional argument. |
25
25
  | `LOKI_MAX_ITERATIONS` | `1000` | Hard cap on iterations. Reaching it is a deterministic terminal failure, not a success. Also in `config schema`. |
26
- | `LOKI_BUDGET_LIMIT` | `100.00` | Spend cap in USD on the previous loop (the Loki 10 engine uses `--max-cost`, `budgets.per_run` or a default of $100 only when `ANTHROPIC_API_KEY` or `OPENAI_API_KEY` is set; none on a subscription). Also enforced by kill on opencode in the Loki 10 engine. Breaching it **pauses** the run (writes `.loki/PAUSE` and saves state); it never kills work or discards a deliverable. Remove `.loki/PAUSE` to resume, or raise the cap. Set to `""` for no cap. A warning is logged at 80%. |
26
+ | `LOKI_BUDGET_LIMIT` | `100.00` on the previous loop; none on the Loki 10 engine | Spend cap in USD. The previous loop (`autonomy/run.sh`) defaults to $100. The Loki 10 engine sets no dollar cap by default, with an API key or on a subscription; `--max-cost`, this variable or `budgets.per_run` sets one, and an unusable value fails closed. |
27
+ | `LOKI_RUN_DEADLINE_S` | unset (no limit) | Loki 10 engine: an outer wall-clock limit the run finishes inside, sealing what is done with a draft PR. `loki start --max-time 90m` sets it. |
28
+ | `LOKI_E10_DEFAULT_BUDGETS` | unset (off) | `1` restores the Loki 10 engine's old default budgets (900 s run cap sized up to 3600 s, stage limits, 2 fix rounds, 3 proof re-runs, 4 continues and $5 continue line, turn caps, the 20-file dependents cap). Without it, and with no user time limit, a run has no budget and ends when it is done or makes no progress. |
29
+ | `LOKI_E10_VERIFY_MAX_S` | unset (no maximum) | Time limit in seconds for one verify stage; `loki start --verify-max-time 20m` sets it. Without it verify is bounded only by a run time limit you set. |
30
+ | `LOKI_E10_NO_PROGRESS_ROUNDS` | `2` | With no budget: fix rounds, proof re-runs and continues end after this many rounds in a row without progress (fewer failing checks or unmet acceptance lines than the best round so far, a check that now ran, a plan file that now exists, or new outstanding work named). |
31
+ | `LOKI_E10_STALL_KILL_S` | `1800` with no time limit, else off | A session with no new output and no tree change for this many seconds is ended. |
32
+ | `LOKI_E10_LOOP_KILL_S` | `3600` | With no time limit: a session that keeps printing but changes nothing in the tree for this long is ended. |
33
+ | `LOKI_E10_CMD_SILENCE_S` | `1800` | A test or check command with no time limit is stopped after this long with no output, reported as not run. |
34
+ | `LOKI_E10_HANG_SILENCE_S` | `1800` | With no time limit: the supervisor stops a worker that sent no event and runs no process for this long, and seals what is done. |
27
35
  | `LOKI_MAX_DURATION` | unset (no cap) | Wall-clock cap in seconds. Stops cleanly at the next iteration boundary with a `max_duration_reached` terminal status. `loki start --max-duration` also accepts `90m` / `2h`. |
28
36
  | `LOKI_AUTO_CONFIRM` | unset | `true`/`false` to control prompts. Takes precedence over `CI`. |
29
37
  | `LOKI_CONFIG_DUMP` | `0` | `1` prints the resolved configuration and exits **without starting a run or spending anything**. |