loki-mode 11.114.0 → 11.115.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 +30 -129
  4. package/autonomy/quickstart.sh +25 -42
  5. package/autonomy/route.sh +42 -9
  6. package/bin/loki +38 -24
  7. package/dashboard/__init__.py +1 -1
  8. package/docs/CLI-REFERENCE.md +1 -1
  9. package/docs/INSTALLATION.md +2 -2
  10. package/docs/exit-codes.md +1 -1
  11. package/docs/v10/GUIDE.md +15 -12
  12. package/loki-ts/dist/loki.js +513 -512
  13. package/mcp/__init__.py +1 -1
  14. package/package.json +2 -2
  15. package/packages/control-plane/dist/server.js +396 -373
  16. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  17. package/web-app/dist/assets/{AdminPage-DHD5YwZO.js → AdminPage-CLt-wTEW.js} +1 -1
  18. package/web-app/dist/assets/{Avatar-DbmXZYj_.js → Avatar-_AmCl55M.js} +1 -1
  19. package/web-app/dist/assets/{Badge-Nq9IlKbi.js → Badge-C_jPseM2.js} +1 -1
  20. package/web-app/dist/assets/{Button-BB29bg4G.js → Button-CWos7s9a.js} +1 -1
  21. package/web-app/dist/assets/{CockpitPage-D3WGuYal.js → CockpitPage-BLOWb4S2.js} +1 -1
  22. package/web-app/dist/assets/{ComparePage-Dc7txTbc.js → ComparePage-Bc-WNJaw.js} +1 -1
  23. package/web-app/dist/assets/{ErrorBoundary-DO85OYYt.js → ErrorBoundary-Ct1mDa90.js} +1 -1
  24. package/web-app/dist/assets/{EvidenceReceiptPanel-BX36iUDO.js → EvidenceReceiptPanel-pza0n1ty.js} +1 -1
  25. package/web-app/dist/assets/{GitHubIssuesPanel-BC-rWDVk.js → GitHubIssuesPanel-nMFy01T7.js} +1 -1
  26. package/web-app/dist/assets/{GitHubPRsPanel-DozNklyN.js → GitHubPRsPanel-CMSBADNj.js} +1 -1
  27. package/web-app/dist/assets/{HomePage-CvlpZnMF.js → HomePage-ehqhrsQe.js} +2 -2
  28. package/web-app/dist/assets/{LoginPage-D8triQep.js → LoginPage-CQp6lhty.js} +1 -1
  29. package/web-app/dist/assets/{MagicPage-CJ3w-QA1.js → MagicPage-BTYQWXyU.js} +1 -1
  30. package/web-app/dist/assets/{MetricsPage-DkeWF6w_.js → MetricsPage-ikIhWjPC.js} +1 -1
  31. package/web-app/dist/assets/{NotFoundPage-C6ug2gpC.js → NotFoundPage-CS3l-ChX.js} +1 -1
  32. package/web-app/dist/assets/{ProjectPage-DW2tYr2l.js → ProjectPage-CVfRF_Ct.js} +3 -3
  33. package/web-app/dist/assets/{ProjectsPage-BdFBxCoq.js → ProjectsPage-CIWMxVP_.js} +1 -1
  34. package/web-app/dist/assets/{SettingsPage-DXfa2-qh.js → SettingsPage-B9KU5D2w.js} +1 -1
  35. package/web-app/dist/assets/{ShowcasePage-BYHFTJCy.js → ShowcasePage-Dg6OGSEF.js} +1 -1
  36. package/web-app/dist/assets/{SystemSettingsPage-3XJw6IrI.js → SystemSettingsPage-BIOv4rVr.js} +1 -1
  37. package/web-app/dist/assets/{TeamsPage-TeTfhM1F.js → TeamsPage-Dejcxxlu.js} +1 -1
  38. package/web-app/dist/assets/{TemplatesPage-D43YOPTJ.js → TemplatesPage-CCysEWaz.js} +1 -1
  39. package/web-app/dist/assets/{TerminalOutput-BPnAqK64.js → TerminalOutput-RQsssvJM.js} +1 -1
  40. package/web-app/dist/assets/{activity-DCCAY929.js → activity-DdLAQ_51.js} +1 -1
  41. package/web-app/dist/assets/{bell-BsVsHi3h.js → bell-BxZyZdvO.js} +1 -1
  42. package/web-app/dist/assets/{bot-BbN7wMZX.js → bot-YV3xWoPK.js} +1 -1
  43. package/web-app/dist/assets/{check-Tyk1mrdH.js → check-B0nOO-9W.js} +1 -1
  44. package/web-app/dist/assets/{chevron-left-DBBD8bZs.js → chevron-left-ByTE-Q8f.js} +1 -1
  45. package/web-app/dist/assets/{circle-alert-BFBU13St.js → circle-alert-DQNaOXIO.js} +1 -1
  46. package/web-app/dist/assets/{clock-Bkk7v3pN.js → clock-D_XB7W8n.js} +1 -1
  47. package/web-app/dist/assets/{cloud-DdxKGfzC.js → cloud-BSzLDv2y.js} +1 -1
  48. package/web-app/dist/assets/{code-xml--6j3vK62.js → code-xml-BqRjDgg5.js} +1 -1
  49. package/web-app/dist/assets/{database-wgf6WWvv.js → database-Bv5v49-U.js} +1 -1
  50. package/web-app/dist/assets/{dollar-sign-CRCXoq4I.js → dollar-sign-NeoXzalo.js} +1 -1
  51. package/web-app/dist/assets/{file-code-corner-D6IDMxIq.js → file-code-corner-Byb9oE9e.js} +1 -1
  52. package/web-app/dist/assets/{file-plus-DLz_nZaL.js → file-plus-BjrNsgqg.js} +1 -1
  53. package/web-app/dist/assets/{globe-DXXv2npn.js → globe-7nXBAnf5.js} +1 -1
  54. package/web-app/dist/assets/{hammer-DgV8WFmY.js → hammer-BSzyJNYG.js} +1 -1
  55. package/web-app/dist/assets/{index-CuuEG3hc.js → index-BDE396DT.js} +3 -3
  56. package/web-app/dist/assets/{layers-BtKE0z6S.js → layers-Las0Giv2.js} +1 -1
  57. package/web-app/dist/assets/{loader-circle-DhmVhPNf.js → loader-circle-DMZ-MAqB.js} +1 -1
  58. package/web-app/dist/assets/{lock-BJZysQgx.js → lock-BtWTiBTH.js} +1 -1
  59. package/web-app/dist/assets/{package-BFAOCws4.js → package-DP0GgNkB.js} +1 -1
  60. package/web-app/dist/assets/{plus-C8NOHg9l.js → plus-4917sY-l.js} +1 -1
  61. package/web-app/dist/assets/{refresh-cw-97PjfXPq.js → refresh-cw-wuIoLSNK.js} +1 -1
  62. package/web-app/dist/assets/{rotate-ccw-Dpq_tfhl.js → rotate-ccw-BRDEqchX.js} +1 -1
  63. package/web-app/dist/assets/{scroll-text-CxXHbR8d.js → scroll-text-B8VYlm45.js} +1 -1
  64. package/web-app/dist/assets/{server-BcsDNKwP.js → server-DYmIcf8d.js} +1 -1
  65. package/web-app/dist/assets/{shield-alert-jSGg7ywe.js → shield-alert-CXDJ30r1.js} +1 -1
  66. package/web-app/dist/assets/{thumbs-up-CVARZVuU.js → thumbs-up-X863JNkQ.js} +1 -1
  67. package/web-app/dist/assets/{trash-2-DUYZejSc.js → trash-2-bok8gFGB.js} +1 -1
  68. package/web-app/dist/assets/{trending-down-DoEuZ_uI.js → trending-down-B_gtPxRQ.js} +1 -1
  69. package/web-app/dist/assets/{trending-up-DSC8EGV3.js → trending-up-CNIXijLQ.js} +1 -1
  70. package/web-app/dist/assets/{upload-D2k1cwYw.js → upload-ihiK-592.js} +1 -1
  71. package/web-app/dist/assets/{usePolling-DMhCgxhw.js → usePolling-C0VEkwmx.js} +1 -1
  72. package/web-app/dist/assets/{user-CfFpJKIA.js → user-BK4TYpOC.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.114.0
6
+ # Loki Mode v11.115.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
 
@@ -473,4 +473,4 @@ Implemented, planned and deprecated items, with the version each landed in: `CHA
473
473
 
474
474
  ---
475
475
 
476
- **v11.114.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
476
+ **v11.115.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.114.0
1
+ 11.115.0
package/autonomy/loki CHANGED
@@ -5610,9 +5610,10 @@ print('\t'.join([
5610
5610
  # The spec path is what makes the command RESUME this run rather than start a
5611
5611
  # different one, so only interpolate it when it still exists on disk. A stale
5612
5612
  # path would produce a command that fails on paste.
5613
- local resume_cmd="loki start"
5613
+ # This state belongs to the previous loop, so the command names it (a plain `loki start` runs engine10).
5614
+ local resume_cmd="loki start --engine legacy"
5614
5615
  if [ -n "$prd_path" ] && [ -f "$prd_path" ]; then
5615
- resume_cmd="loki start \"$prd_path\""
5616
+ resume_cmd="loki start --engine legacy \"$prd_path\""
5616
5617
  fi
5617
5618
 
5618
5619
  # A capped run needs DIFFERENT advice than an interrupted one: re-running it
@@ -17054,77 +17055,6 @@ cmd_sandbox() {
17054
17055
  exec "$SANDBOX_SH" "$subcommand" "$@"
17055
17056
  }
17056
17057
 
17057
- # v7.29.0 (feature #4): print the SIMPLE-tier cost/time/iteration estimate for
17058
- # the demo PRD, parsed from the single estimator source (show_prd_plan JSON).
17059
- # Because `loki demo` always runs `loki start --simple` (which exports
17060
- # LOKI_COMPLEXITY=simple), the estimate is computed with LOKI_COMPLEXITY=simple
17061
- # so the quoted figures are the ones the demo will actually incur -- honest by
17062
- # construction (the keystone fix makes show_prd_plan honor LOKI_COMPLEXITY).
17063
- # Returns 0 when a real estimate was printed, 1 when the estimator failed (the
17064
- # caller then falls back to a no-number confirm). Never fabricates a number.
17065
- emit_demo_estimate() {
17066
- local prd_path="$1"
17067
- # v7.30.0 (item 5): the demo estimate always prints before spending, incl.
17068
- # non-TTY (--dry-run / --yes piped), so gate color on a TTY here too (the
17069
- # global vars are only blanked on NO_COLOR). Mirrors provider-offer.sh and
17070
- # quickstart.sh. Local overrides only.
17071
- local BOLD="$BOLD" YELLOW="$YELLOW" DIM="$DIM" NC="$NC"
17072
- if [ ! -t 1 ]; then
17073
- BOLD=''; YELLOW=''; DIM=''; NC=''
17074
- fi
17075
- local plan_json=""
17076
- plan_json=$(LOKI_COMPLEXITY=simple show_prd_plan "$prd_path" "true" "false" 2>/dev/null) || plan_json=""
17077
-
17078
- if [ -z "$plan_json" ]; then
17079
- echo -e "${YELLOW}Could not compute a cost estimate (the estimator did not return a result).${NC}"
17080
- return 1
17081
- fi
17082
-
17083
- local parsed
17084
- parsed=$(printf '%s' "$plan_json" | python3 -c "
17085
- import json, sys
17086
- try:
17087
- d = json.load(sys.stdin)
17088
- except Exception:
17089
- sys.exit(1)
17090
- cost = d.get('cost', {}).get('total_usd')
17091
- time_est = d.get('time', {}).get('estimated')
17092
- iters = d.get('iterations', {}).get('estimated')
17093
- rng = d.get('iterations', {}).get('range', [])
17094
- tier = d.get('complexity', {}).get('tier', 'simple')
17095
- if cost is None or time_est is None or iters is None:
17096
- sys.exit(1)
17097
- rng_str = ''
17098
- if isinstance(rng, list) and len(rng) == 2:
17099
- rng_str = ' (range {}-{})'.format(rng[0], rng[1])
17100
- print(tier.upper())
17101
- print('{:.2f}'.format(float(cost)))
17102
- print(time_est)
17103
- print('{}{}'.format(iters, rng_str))
17104
- " 2>/dev/null) || parsed=""
17105
-
17106
- if [ -z "$parsed" ]; then
17107
- echo -e "${YELLOW}Could not compute a cost estimate (the estimator did not return a result).${NC}"
17108
- return 1
17109
- fi
17110
-
17111
- local tier_u cost_u time_u iter_u
17112
- tier_u=$(printf '%s' "$parsed" | sed -n '1p')
17113
- cost_u=$(printf '%s' "$parsed" | sed -n '2p')
17114
- time_u=$(printf '%s' "$parsed" | sed -n '3p')
17115
- iter_u=$(printf '%s' "$parsed" | sed -n '4p')
17116
-
17117
- echo -e "${BOLD}Estimate (${tier_u} tier, the path this demo actually runs):${NC}"
17118
- printf ' Cost: ~$%s\n' "$cost_u"
17119
- echo " Time: ~$time_u"
17120
- echo " Iterations: $iter_u"
17121
- echo ""
17122
- echo -e "${DIM}This is an estimate. Actual usage depends on PRD complexity,"
17123
- echo -e "code review cycles, and test failures.${NC}"
17124
- echo ""
17125
- return 0
17126
- }
17127
-
17128
17058
  # loki wow: a tiny real Loki 10 task in a temp repo, or the offline tour when no provider is ready.
17129
17059
  wow_offline_finish() {
17130
17060
  echo "No live provider for this run. Showing the offline sample (no key, no spend)."
@@ -17444,7 +17374,6 @@ cmd_demo() {
17444
17374
  local provider=""
17445
17375
  local dry_run=false
17446
17376
  local offline=false
17447
- local start_args=()
17448
17377
  # v7.29.0 (feature #4): demo now shows the FORCED-simple cost estimate
17449
17378
  # before spending and asks for confirmation. --yes / LOKI_ASSUME_YES skip
17450
17379
  # the prompt but still print the estimate (the spend is never hidden).
@@ -17627,6 +17556,14 @@ cmd_demo() {
17627
17556
  else
17628
17557
  # Expand ~ if present
17629
17558
  demo_dir="${demo_dir/#\~/$HOME}"
17559
+ # Refuse a folder inside someone else's repository: the engine would run on that repository's checkout.
17560
+ local demo_probe="$demo_dir" demo_top=""
17561
+ while [ ! -d "$demo_probe" ] && [ "$demo_probe" != "/" ] && [ "$demo_probe" != "." ]; do demo_probe="$(dirname "$demo_probe")"; done
17562
+ demo_top="$(git -C "$demo_probe" rev-parse --show-toplevel 2>/dev/null || true)"
17563
+ if [ -n "$demo_top" ] && { [ ! -d "$demo_dir" ] || [ "$demo_top" != "$(cd "$demo_dir" && pwd -P)" ]; }; then
17564
+ echo "loki demo: $demo_dir is inside the git repository $demo_top; pass a --dir outside it, or omit --dir for a temp folder." >&2
17565
+ return 2
17566
+ fi
17630
17567
  mkdir -p "$demo_dir"
17631
17568
  fi
17632
17569
 
@@ -17644,84 +17581,48 @@ cmd_demo() {
17644
17581
  # Copy PRD into demo directory
17645
17582
  cp "$demo_prd" "$demo_dir/prd.md"
17646
17583
 
17647
- # Initialize git repo if not already one
17648
- if [ ! -d "$demo_dir/.git" ]; then
17649
- git -C "$demo_dir" init -q 2>/dev/null || true
17584
+ # L009: the demo runs on the default engine (loki start prd.md -> engine10), never the legacy loop.
17585
+ # The engine's first-run init (loki-ts/src/util/first_run_repo.ts) makes the folder a repo, committing the
17586
+ # PRD named in LOKI_FIRST_RUN_FILES, with a repo-local identity when git has none.
17587
+ local run_args=(start prd.md)
17588
+ if [ -n "$provider" ]; then
17589
+ run_args+=(--provider "$provider")
17650
17590
  fi
17651
17591
 
17652
17592
  if [ "$dry_run" = true ]; then
17653
- # v7.29.0: dry-run is now a genuine cost preview -- show the estimate,
17654
- # no prompt, no spend.
17655
- emit_demo_estimate "$demo_dir/prd.md" || true
17656
17593
  echo -e "${YELLOW}[dry-run] Would run:${NC}"
17657
17594
  echo " cd $demo_dir"
17658
- echo -n " loki start prd.md --simple --yes"
17659
- [ -n "$provider" ] && echo -n " --provider $provider"
17660
- echo ""
17595
+ echo " loki ${run_args[*]}"
17661
17596
  echo ""
17662
17597
  echo -e "${DIM}PRD copied to: $demo_dir/prd.md${NC}"
17663
17598
  return 0
17664
17599
  fi
17665
17600
 
17666
- # v7.29.0 (feature #4): cost confirm before any spend. The estimate ALWAYS
17667
- # prints (even with --yes), so the spend is never hidden. The prompt is
17668
- # shown only on a TTY without --yes; non-TTY without --yes refuses (exit 2)
17669
- # rather than hanging on read -- the project's "never hang in CI" idiom.
17670
- local estimate_ok=true
17671
- emit_demo_estimate "$demo_dir/prd.md" || estimate_ok=false
17672
-
17673
- # Interactive only when stdin is a real TTY and CI is not forcing
17674
- # non-interactive (matches the project's first-run gate semantics).
17675
- local demo_interactive=true
17676
- if [ ! -t 0 ] || [ -n "${CI:-}" ]; then
17677
- demo_interactive=false
17678
- fi
17679
-
17601
+ # Confirm before any spend: the run prints its own cost estimate on its first line. The prompt is
17602
+ # shown only on a TTY without --yes; non-TTY without --yes refuses (exit 2) rather than hang.
17680
17603
  if [ "$assume_yes" != true ]; then
17681
- if [ "$demo_interactive" = true ]; then
17604
+ if [ -t 0 ] && [ -z "${CI:-}" ]; then
17682
17605
  local demo_answer=""
17683
- if [ "$estimate_ok" = true ]; then
17684
- # Default YES: Enter proceeds.
17685
- echo -n "Build the Todo app now? [Y/n] "
17686
- read -r demo_answer </dev/tty 2>/dev/null || demo_answer=""
17687
- if [[ -n "$demo_answer" && ! "$demo_answer" =~ ^[Yy] ]]; then
17688
- echo ""
17689
- echo -e "Cancelled. Nothing was spent. The demo PRD is at:"
17690
- echo -e " ${CYAN}$demo_dir/prd.md${NC}"
17691
- echo -e "Run 'loki plan ${demo_dir}/prd.md' for the full breakdown."
17692
- return 0
17693
- fi
17694
- else
17695
- # No honest number available: default NO (the safe direction).
17696
- echo -n "Proceed with the demo build anyway? [y/N] "
17697
- read -r demo_answer </dev/tty 2>/dev/null || demo_answer=""
17698
- if [[ ! "$demo_answer" =~ ^[Yy] ]]; then
17699
- echo ""
17700
- echo -e "Cancelled. Nothing was spent. The demo PRD is at:"
17701
- echo -e " ${CYAN}$demo_dir/prd.md${NC}"
17702
- return 0
17703
- fi
17606
+ echo -n "Build the Todo app now? [Y/n] "
17607
+ read -r demo_answer </dev/tty 2>/dev/null || demo_answer=""
17608
+ if [[ -n "$demo_answer" && ! "$demo_answer" =~ ^[Yy] ]]; then
17609
+ echo ""
17610
+ echo -e "Cancelled. Nothing was spent. The demo PRD is at:"
17611
+ echo -e " ${CYAN}$demo_dir/prd.md${NC}"
17612
+ return 0
17704
17613
  fi
17705
17614
  else
17706
- # Non-TTY without --yes: never hang; refuse with an honest message.
17707
17615
  echo "demo needs confirmation; re-run with --yes to proceed non-interactively" >&2
17708
17616
  return 2
17709
17617
  fi
17710
17618
  fi
17711
17619
 
17712
- echo -e "${DIM}Starting autonomous build...${NC}"
17620
+ echo -e "${DIM}Starting the build...${NC}"
17713
17621
  echo -e "${DIM}(Press Ctrl+C to stop at any time)${NC}"
17714
17622
  echo ""
17715
17623
 
17716
- # Build start args
17717
- start_args+=("prd.md" "--simple" "--yes")
17718
- if [ -n "$provider" ]; then
17719
- start_args+=("--provider" "$provider")
17720
- fi
17721
-
17722
- # Run loki start from the demo directory
17723
17624
  local start_exit=0
17724
- (cd "$demo_dir" && cmd_start "${start_args[@]}") || start_exit=$?
17625
+ (cd "$demo_dir" && LOKI_FIRST_RUN_FILES=prd.md "$SKILL_DIR/bin/loki" "${run_args[@]}") || start_exit=$?
17725
17626
 
17726
17627
  echo ""
17727
17628
  echo -e "${DIM}---------------------------------------${NC}"
@@ -4,21 +4,21 @@
4
4
  # `loki quickstart` is a thin orchestrator over three already-shipped pieces:
5
5
  # 1. the provider install offer (autonomy/provider-offer.sh, slice B)
6
6
  # 2. the honest cost estimator (show_prd_plan in autonomy/loki, slice A)
7
- # 3. cmd_start (autonomy/loki) for the actual build
7
+ # 3. `loki start <prd>` (bin/loki -> the default engine, engine10) for the build
8
8
  # plus one new, deterministic, offline keyword matcher over templates/.
9
9
  #
10
- # It NEVER reimplements the runner and NEVER fabricates a number: every figure
11
- # in step 4 comes from the same estimator cmd_start will run with, so the quote
12
- # equals the charge by construction (the slice-A honesty keystone).
10
+ # It NEVER reimplements the runner and NEVER fabricates a number: step 4 shows the
11
+ # PRD estimator's figures, and the run prints the engine's own estimate on its
12
+ # first line before any model session.
13
13
  #
14
14
  # Sourcing contract (load-bearing for tests): this file defines functions ONLY.
15
15
  # It runs no top-level command and never calls `main`. autonomy/loki sources it
16
16
  # near the top so cmd_quickstart and its helpers are in scope for the dispatch
17
17
  # case. Tests source it directly, override the _qs_non_interactive predicate, and
18
- # stub cmd_start / provider_offer_gate to prove the composition without spending
18
+ # stub provider_offer_gate to prove the composition without spending
19
19
  # or starting a build. Because it is sourced (not a subprocess), it relies on the
20
20
  # caller (autonomy/loki) for SKILL_DIR, the color vars, show_prd_plan,
21
- # provider_offer_gate, and cmd_start; the test harness provides stubs for those
21
+ # and provider_offer_gate; the test harness provides stubs for those
22
22
  # it does not exercise for real.
23
23
 
24
24
  # Guard against double-source.
@@ -449,9 +449,8 @@ _qs_selected_provider() {
449
449
  }
450
450
 
451
451
  # _qs_emit_plan <prd_path>: render the step-4 plan block from the REAL estimator.
452
- # Honesty invariant: NO LOKI_COMPLEXITY override is passed, so the complexity,
453
- # iterations, and cost are exactly what cmd_start will run with (cmd_start
454
- # auto-detects complexity from the same PRD). Returns 0 if a number was shown,
452
+ # NO LOKI_COMPLEXITY override is passed: the figures are the PRD estimator's
453
+ # auto-detected ones. Returns 0 if a number was shown,
455
454
  # non-zero if the estimator gave no result (caller falls back to a no-number
456
455
  # confirm, never fabricating a figure).
457
456
  _qs_emit_plan() {
@@ -1021,19 +1020,19 @@ _qs_help() {
1021
1020
  }
1022
1021
 
1023
1022
  # cmd_quickstart: the 4-step guided interview. Composes provider_offer_gate
1024
- # (slice B), show_prd_plan (slice A), the template matcher, and cmd_start.
1023
+ # (slice B), show_prd_plan (slice A), the template matcher, and `loki start`.
1025
1024
  #
1026
1025
  # Order is load-bearing:
1027
1026
  # argv validation -> non-TTY/CI gate (hint + exit 2) -> provider gate or skip ->
1028
1027
  # step 2 (idea / PRD path) -> step 3 (template) -> step 4 (plan + confirm) ->
1029
- # write PRD to CWD -> cmd_start --yes --no-plan (subshelled; it execs the runner).
1028
+ # write PRD to CWD -> `loki start <prd>` (engine10; subshelled).
1030
1029
  #
1031
1030
  # The non-TTY/CI gate admits two fully-specified shapes:
1032
1031
  # loki quickstart "<idea>|<prd-path>" --yes
1033
1032
  # loki quickstart "<idea>|<prd-path>" --dry-run
1034
1033
  # Execution requires argv consent; preview forbids it. Both paths skip prompts
1035
1034
  # and share template ranking plus the honest estimator. Only execution crosses
1036
- # the provider, confirm, write, and cmd_start boundaries.
1035
+ # the provider, confirm, write, and build boundaries.
1037
1036
  cmd_quickstart() {
1038
1037
  local positional=""
1039
1038
  local assume_yes=false
@@ -1564,13 +1563,8 @@ cmd_quickstart() {
1564
1563
  # over a file the user already has. Staging in a temp file keeps the
1565
1564
  # brownfield path write-free in the user's directory.
1566
1565
  if [ "$use_brief_as_spec" = true ]; then
1567
- # The .md suffix is load-bearing, not cosmetic. cmd_start classifies a
1568
- # positional via detect_arg_type (loki:1675): an extensionless path is
1569
- # only reached by the late `[ -e "$arg" ]` branch, and BOTH PRD
1570
- # existence guards (loki:2962, loki:2985) are `case` arms matching
1571
- # *.md|*.json|*.txt|*.yaml|*.yml, so an extensionless spec silently
1572
- # skips the fail-fast checks. Naming it .md puts classification on the
1573
- # explicit extension branch and under those guards.
1566
+ # The .md suffix keeps the spec on the router's PRD branch (autonomy/route.sh
1567
+ # _route_classify), so `loki start` reads it as a PRD file.
1574
1568
  # BSD mktemp (stock macOS) does NOT substitute the X-run when a suffix
1575
1569
  # follows it: `mktemp foo.XXXXXX.md` creates the LITERAL file
1576
1570
  # "foo.XXXXXX.md". That is a fixed name, so a second concurrent
@@ -1586,9 +1580,7 @@ cmd_quickstart() {
1586
1580
  else
1587
1581
  prd_source="$_qs_stage"
1588
1582
  fi
1589
- # Not trap-cleaned on purpose: cmd_start EXECS the runner and never
1590
- # returns here, and the runner must still be able to read this spec.
1591
- # It lives in TMPDIR under a mktemp name, so the OS reaps it.
1583
+ # Not trap-cleaned: it lives in TMPDIR under a mktemp name, so the OS reaps it.
1592
1584
  _qs_write_change_prd "$prd_source" "$brief" "$spec_mode"
1593
1585
  fi
1594
1586
 
@@ -1597,7 +1589,7 @@ cmd_quickstart() {
1597
1589
  # The plan is ALWAYS rendered, on both paths, from the same real estimator.
1598
1590
  # The non-interactive path shows it before execution rather than before a
1599
1591
  # prompt: the operator still gets the honest quote in the transcript, and it
1600
- # is still the figure cmd_start runs with, so the quote equals the charge.
1592
+ # the run prints the engine's own estimate on its first line.
1601
1593
  if [ -n "$preview_prd_digest" ]; then
1602
1594
  local pre_estimate_digest=""
1603
1595
  if [ ! -f "$prd_source" ] || [ ! -r "$prd_source" ] || [ -L "$prd_source" ]; then
@@ -1646,7 +1638,7 @@ cmd_quickstart() {
1646
1638
 
1647
1639
  # The preview terminal boundary is intentionally immediately after the
1648
1640
  # shared estimator. Reaching it proves the same template and plan were
1649
- # rendered, while returning here makes the confirm, PRD copy, and cmd_start
1641
+ # rendered, while returning here makes the confirm, PRD copy, and build
1650
1642
  # structurally unreachable.
1651
1643
  if [ "$dry_run" = true ]; then
1652
1644
  printf 'Preview complete. No provider was run, no file was written, and no build was started.\n'
@@ -1682,7 +1674,7 @@ cmd_quickstart() {
1682
1674
  # The change-request path deliberately lands NOTHING in the working tree.
1683
1675
  # The user asked for a change to code that already exists; dropping a
1684
1676
  # generated prd.md into their project is the unrequested write that made the
1685
- # original bug worse. The staged spec is handed to cmd_start directly.
1677
+ # original bug worse. The staged spec is handed to `loki start` directly.
1686
1678
  local target="./prd.md"
1687
1679
  if [ "$use_brief_as_spec" = true ]; then
1688
1680
  target="$prd_source"
@@ -1766,24 +1758,15 @@ cmd_quickstart() {
1766
1758
  printf " Tip: run 'loki dashboard start' in another terminal to watch in a browser.\n"
1767
1759
  printf '\n'
1768
1760
 
1769
- # ----- Compose with cmd_start -------------------------------------------
1770
- # Consent was collected in step 4, so --yes is correct. The plan was already
1771
- # shown in step 4, so --no-plan avoids double-printing it. No --simple: the
1772
- # estimate shown was the auto-detect estimate, and the runner's own
1773
- # complexity detection agrees with the estimator for the default PRD
1774
- # (verified: detect_complexity and show_prd_plan both classify the sample
1775
- # Todo app SIMPLE), so the quote matches the charge.
1776
- #
1777
- # cmd_start EXECS the runner (loki:1856, _loki_new_session_exec), so it never
1778
- # returns into this function. We wrap it in a subshell -- the exact pattern
1779
- # cmd_demo uses (loki:9337) -- so the exec replaces the SUBSHELL while the
1780
- # interactive controlling tty (and Ctrl+C) is preserved, the build runs in
1781
- # the foreground, and on failure this function's honest message stays
1782
- # reachable. We do NOT auto-open a dashboard: the default `loki start` does
1783
- # not start one (it is gated on --api, loki:1825), and starting one here
1784
- # would bind port 57374, which quickstart deliberately must not own.
1761
+ # ----- Build on the default engine ---------------------------------------
1762
+ # L009: consent was collected in step 4. `loki start <prd>` goes through bin/loki,
1763
+ # whose router sends a PRD to engine10; quickstart never reaches the legacy loop.
1764
+ # Subshelled so a failed start still reaches the honest message below.
1765
+ # In a folder that is not a repo, the engine's first-run init (loki-ts/src/util/first_run_repo.ts) treats
1766
+ # the PRD quickstart just wrote as part of an empty folder and commits it; any other file means the engine
1767
+ # refuses with its fix. A brief path writes nothing here, so LOKI_FIRST_RUN_FILES names nothing present.
1785
1768
  local start_exit=0
1786
- ( cmd_start "$target" --yes --no-plan ) || start_exit=$?
1769
+ ( LOKI_FIRST_RUN_FILES="${target##*/}" "$SKILL_DIR/bin/loki" start "$target" ) || start_exit=$?
1787
1770
 
1788
1771
  if [ "$start_exit" -ne 0 ]; then
1789
1772
  printf "%sThe build did not start cleanly. Run 'loki doctor' and try 'loki start ./prd.md'.%s\n" "$_QS_RED" "$_QS_NC" >&2
package/autonomy/route.sh CHANGED
@@ -33,6 +33,7 @@ _route_refusal_hint() {
33
33
  --worktree|-w) echo "engine10 runs each attempt in its own isolated worktree already; drop the flag, or pass --engine legacy for a git-worktree run" ;;
34
34
  --detach|-d) echo "run it in the background yourself ('nohup loki start ... &') or queue it with 'loki queue run', or pass --engine legacy for --detach" ;;
35
35
  --parallel) echo "use 'loki queue run --parallel K' or 'loki issues run --parallel K' for parallel runs, or pass --engine legacy for --parallel" ;;
36
+ --issue) echo "give the issue as the task instead: loki start owner/repo#N (or the issue URL)" ;;
36
37
  *) echo "drop it, or pass --engine legacy to run the legacy loop with it" ;;
37
38
  esac
38
39
  }
@@ -217,7 +218,10 @@ loki_route_resolve() {
217
218
  *) R_ERR="loki: unknown engine '$engine_req' (use --engine legacy or --engine engine10)"; R_DECIDED=1; return 0 ;;
218
219
  esac
219
220
 
220
- # Input.
221
+ # Input. A bare `loki start` takes LOKI_PRD_FILE as its PRD (documented in `loki start --help`).
222
+ if [ "${#positionals[@]}" -eq 0 ] && [ "$verb" = "start" ] && [ -n "${LOKI_PRD_FILE:-}" ]; then
223
+ positionals+=("$LOKI_PRD_FILE")
224
+ fi
221
225
  local npos=${#positionals[@]}
222
226
  if [ "$npos" -eq 0 ]; then
223
227
  R_INPUT_TYPE=none
@@ -226,10 +230,36 @@ loki_route_resolve() {
226
230
  if [ "${passthru[$k]}" = "--spec" ]; then sp=1; fi
227
231
  k=$((k + 1))
228
232
  done
229
- # No positional and no --spec: not ours (bare `loki start` auto-detects a PRD).
230
- if [ "$sp" = "0" ]; then R_INPUT_TYPE=""; return 0; fi
231
- R_INPUT_TYPE=spec
232
- R_INPUT="(from --spec)"
233
+ if [ "$sp" = "1" ]; then
234
+ R_INPUT_TYPE=spec
235
+ R_INPUT="(from --spec)"
236
+ elif [ "$verb" = "bare" ] || [ -n "$front_flag" ]; then
237
+ # Flag-first bare calls and the front end (--workspace, --deploy) keep their own handlers.
238
+ R_INPUT_TYPE=""; return 0
239
+ elif [ "$engine_req" = "legacy" ]; then
240
+ # `loki start --engine legacy` (the previous loop's resume command): decided, so bin/loki hands the legacy
241
+ # CLI the args without --engine, which it does not know.
242
+ R_DECIDED=1; R_ENGINE=legacy; R_REASON="explicit: --engine legacy or LOKI_ENGINE=legacy"; R_INPUT_TYPE=none; R_INPUT="(no task)"
243
+ return 0
244
+ elif [ "$verb" = "start" ] && [ -z "$provider_flag" ] && [ -z "${LOKI_PROVIDER:-}" ] && [ -z "$legacy_flag" ] \
245
+ && ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
246
+ # No repo, no task, no provider and no legacy-only flag: cmd_start shows the offline sample receipt
247
+ # (README, `loki tour`) and spends nothing. A legacy-only flag is refused below like anywhere else.
248
+ R_INPUT_TYPE=""; return 0
249
+ else
250
+ # L009: a bare `loki start` or `loki quick` runs engine10 with no task. It resumes an interrupted
251
+ # run when there is one, otherwise prints the loki "<goal>" usage and exits 64. Never the legacy loop.
252
+ R_INPUT_TYPE=none
253
+ R_INPUT="(no task)"
254
+ local top st prd
255
+ top="$(git rev-parse --show-toplevel 2>/dev/null || printf '%s' "$PWD")"
256
+ st="$top/.loki/autonomy-state.json"
257
+ if [ -f "$st" ] && grep -Eq '"status"[[:space:]]*:[[:space:]]*"(running|paused|interrupted)"' "$st" 2>/dev/null; then
258
+ prd="$(sed -n 's/.*"prdPath"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p' "$st" | head -1)"
259
+ if [ -n "$prd" ] && [ -f "$prd" ]; then prd=" \"$prd\""; else prd=""; fi
260
+ R_NOTICE="loki: .loki/autonomy-state.json holds an interrupted run of the previous loop; continue it with: loki start --engine legacy$prd"
261
+ fi
262
+ fi
233
263
  elif [ "$npos" -eq 1 ]; then
234
264
  R_INPUT_TYPE=$(_route_classify "${positionals[0]}")
235
265
  # Only `loki start` sends a PR URL to verify-pr (_route_pr_mode); on any other verb engine10 runs it as a brief.
@@ -286,14 +316,16 @@ loki_route_resolve() {
286
316
  local task
287
317
  if [ "$R_INPUT_TYPE" = "prd" ]; then
288
318
  task=$(cat "${positionals[0]}" 2>/dev/null || true)
289
- elif [ "$R_INPUT_TYPE" = "spec" ]; then
319
+ elif [ "$R_INPUT_TYPE" = "spec" ] || [ "$R_INPUT_TYPE" = "none" ]; then
290
320
  task=""
291
321
  else
292
322
  task="${positionals[*]}"
293
323
  fi
294
324
  if [ "$verb" = "quick" ]; then R_E10_ARGS+=(--no-pr); fi
295
325
  if [ -n "$task" ]; then R_E10_ARGS+=("$task"); fi
296
- R_E10_ARGS+=("${passthru[@]+"${passthru[@]}"}")
326
+ R_E10_ARGS+=(${passthru[@]+"${passthru[@]}"})
327
+ # No task: `--` sends engine10 to the run path (interrupted-run offer, then the goal usage), not its command table.
328
+ if [ "$R_INPUT_TYPE" = "none" ]; then R_E10_ARGS+=(--); fi
297
329
 
298
330
  # --prd and --brief name the input themselves; a second input would have glued its words into the task.
299
331
  if [ -n "$input_flag" ] && [ "$npos" -gt 1 ]; then
@@ -336,11 +368,12 @@ loki_route_resolve() {
336
368
  elif [ "$engine_req" = "engine10" ]; then
337
369
  R_ENGINE=engine10; R_E10=1; R_HARD=1; R_REASON="explicit: --engine engine10"
338
370
  else
371
+ # L009: a provider with no engine10 invoker is refused, never sent to the legacy loop.
339
372
  case "$R_PROVIDER" in
340
373
  claude|codex|cline|aider|opencode) ;;
341
- *) why="provider $R_PROVIDER has no engine10 invoker (use claude, codex, cline, aider or opencode)" ;;
374
+ *) R_ERR="loki: provider $R_PROVIDER is not supported; use one of: claude, codex, cline, aider, opencode"; return 0 ;;
342
375
  esac
343
- if [ -z "$why" ] && [ "$R_INPUT_TYPE" = "prd" ]; then
376
+ if [ "$R_INPUT_TYPE" = "prd" ]; then
344
377
  local sz
345
378
  sz=$(wc -c < "${positionals[0]}" 2>/dev/null | tr -d ' ' || echo 0)
346
379
  if [ "${sz:-0}" -gt 100000 ]; then why="PRD is larger than 100000 bytes (engine10 takes the task as one argument)"; fi
package/bin/loki CHANGED
@@ -462,6 +462,23 @@ _loki_bun() {
462
462
  done
463
463
  return 0
464
464
  }
465
+ # No working bun for an engine10 command: say why and how to fix it, exit 2. A Homebrew install of loki-mode
466
+ # (its own keg, not an npm install under Homebrew's node) is told the brew formula.
467
+ _loki_no_bun_exit() {
468
+ local os arch
469
+ case "$(uname -s 2>/dev/null)" in
470
+ Darwin) os=darwin ;; Linux) os=linux ;; MINGW*|MSYS*|CYGWIN*) os=win32 ;; *) os=$(uname -s 2>/dev/null | tr '[:upper:]' '[:lower:]') ;;
471
+ esac
472
+ case "$(uname -m 2>/dev/null)" in
473
+ arm64|aarch64) arch=aarch64 ;; x86_64|amd64) arch=x64 ;; *) arch=$(uname -m 2>/dev/null) ;;
474
+ esac
475
+ echo "loki: the Loki 10 engine cannot run on this machine: no working bun (none on PATH, and the bundled bun for ${os}-${arch} is $(_loki_bun_why))." >&2
476
+ case "$REPO_ROOT" in
477
+ */Cellar/loki-mode/*) echo "To fix: brew install oven-sh/bun/bun" >&2 ;;
478
+ *) echo "To fix: curl -fsSL https://bun.sh/install | bash (or reinstall: npm install -g loki-mode, without --omit=optional)" >&2 ;;
479
+ esac
480
+ exit 2
481
+ }
465
482
  # Reason text for the fallback notice: missing, or failed to start, exit N.
466
483
  _loki_bun_why() {
467
484
  local c rc
@@ -704,7 +721,8 @@ case "v10" in
704
721
  esac
705
722
  ;;
706
723
  # D58: `loki start <issue ref|issue URL|"multi-word task">` takes the same v10 path as
707
- # `loki <ref>`; any other start call (PRD file, flags first, one word) stays legacy.
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.
708
726
  start)
709
727
  # --workspace and --deploy (with its companions) are run by the bash front end around the engine; never glue them into an engine10 task.
710
728
  _e10_front=0
@@ -746,31 +764,27 @@ case "v10" in
746
764
  esac
747
765
  if [ "$_R_APPLIED" = "1" ]; then
748
766
  _e10="$R_E10"; _e10_hard="$R_HARD"
749
- if [ "$R_E10" = "1" ]; then _e10_args=("${R_E10_ARGS[@]}"); fi
767
+ if [ "$R_E10" = "1" ]; then _e10_args=(${R_E10_ARGS[@]+"${R_E10_ARGS[@]}"}); fi
750
768
  fi
751
- # Default (unset) mode never breaks a host: no bun, or a provider engine10 has no
752
- # invoker for, falls through to the legacy engine. Explicit v10 keeps its hard error.
753
- if [ "$_e10" = "1" ] && [ "$_e10_hard" = "0" ]; then
754
- case "${LOKI_PROVIDER:-claude}" in
755
- claude|codex|cline|aider|opencode) ;;
769
+ # L009: a run never falls back to the legacy loop. A provider engine10 cannot invoke, or a host with
770
+ # no working bun, is refused with the fix. Data commands start no model session, so the provider is not
771
+ # checked for them; with no bun only a bare `loki verify` still reads proofs with the bash verify.
772
+ # `plan --spec` drafts the spec with a model session, so it is checked like a run.
773
+ if [ "$_e10" = "1" ]; then
774
+ case "${1:-}" in
775
+ keys|export|status|verify|dashboard)
776
+ if [ -z "$(_loki_bun)" ]; then
777
+ if [ "$1" = "verify" ] && [ -z "${2:-}" ]; then _e10=0; else _loki_no_bun_exit; fi
778
+ fi
779
+ ;;
756
780
  *)
757
- _e10=0
758
- echo "loki: using the legacy engine (the Loki 10 engine does not support LOKI_PROVIDER=${LOKI_PROVIDER:-}; use claude, codex, cline, aider or opencode)." >&2
781
+ case "${LOKI_PROVIDER:-claude}" in
782
+ claude|codex|cline|aider|opencode) ;;
783
+ *) echo "loki: provider ${LOKI_PROVIDER:-} is not supported; use one of: claude, codex, cline, aider, opencode (LOKI_PROVIDER)." >&2; exit 2 ;;
784
+ esac
785
+ [ -n "$(_loki_bun)" ] || _loki_no_bun_exit
759
786
  ;;
760
787
  esac
761
- if [ "$_e10" = "1" ]; then
762
- _lb=$(_loki_bun)
763
- if [ -z "$_lb" ]; then
764
- _e10=0
765
- case "$(uname -s 2>/dev/null)" in
766
- Darwin) _os=darwin ;; Linux) _os=linux ;; MINGW*|MSYS*|CYGWIN*) _os=win32 ;; *) _os=$(uname -s 2>/dev/null | tr '[:upper:]' '[:lower:]') ;;
767
- esac
768
- case "$(uname -m 2>/dev/null)" in
769
- arm64|aarch64) _arch=aarch64 ;; x86_64|amd64) _arch=x64 ;; *) _arch=$(uname -m 2>/dev/null) ;;
770
- esac
771
- echo "loki: the Loki 10 engine cannot run on this machine: no working bun (none on PATH, and the bundled bun for ${_os}-${_arch} is $(_loki_bun_why)). Running the legacy engine instead. To fix: install bun from https://bun.sh, or reinstall loki-mode without --omit=optional." >&2
772
- fi
773
- fi
774
788
  fi
775
789
  if [ "$_e10" = "1" ]; then
776
790
  _lb=$(_loki_bun)
@@ -781,13 +795,13 @@ case "v10" in
781
795
  case "${1:-}" in
782
796
  keys|export|status|verify|dashboard|plan) ;;
783
797
  *)
784
- for _e10_v in "${_e10_args[@]}"; do
798
+ for _e10_v in ${_e10_args[@]+"${_e10_args[@]}"}; do
785
799
  if [ "$_e10_v" = "--verbose" ]; then _loki_f2p_banner; _loki_print_autonomy; break; fi
786
800
  done
787
801
  unset _e10_v
788
802
  ;;
789
803
  esac
790
- exec "$_lb" "${_LOKI_BUN_SAFE[@]}" "$BUN_CLI" engine10 "${_e10_args[@]}"
804
+ exec "$_lb" "${_LOKI_BUN_SAFE[@]}" "$BUN_CLI" engine10 ${_e10_args[@]+"${_e10_args[@]}"}
791
805
  fi
792
806
  unset _e10 _e10_args _e10_hard
793
807
  ;;
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.114.0"
10
+ __version__ = "11.115.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.114.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.115.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.114.0
5
+ **Version:** v11.115.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
 
@@ -225,6 +225,6 @@ There is no importer that copies a Claude Code or OpenCode transcript into a Lok
225
225
  ## Troubleshooting
226
226
 
227
227
  - `loki: command not found`: the global bin directory of your package manager is not on `PATH` (`npm prefix -g` shows where npm installs).
228
- - `the Loki 10 engine cannot run on this machine: no working bun`: install Bun, or reinstall without `--omit=optional`.
228
+ - `the Loki 10 engine cannot run on this machine: no working bun` (exit 2, nothing runs): install Bun (`curl -fsSL https://bun.sh/install | bash`), or reinstall without `--omit=optional`.
229
229
  - A provider is missing: `loki doctor` names it and prints the install command.
230
230
  - Anything else: `loki doctor --json`, then [KNOWN-ISSUES.md](KNOWN-ISSUES.md), then `loki crash` to file a report.
@@ -441,7 +441,7 @@ The JSON carries `engine`, `adapter`, `provider`, `model`, `input_type`, `input`
441
441
 
442
442
  - 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
443
  - 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`, for one call when a flag engine10 does not support is present (a notice is printed), for a provider with no engine10 invoker, or for a PRD larger than 100000 bytes.
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.
445
445
  - `--engine engine10` with an unsupported flag is refused (exit 2) instead of rerouted.
446
446
  - A missing PRD file path is a usage error (exit 2).
447
447
  - Adapter is `<engine>:<provider>`, with the legacy engine written `legacy-bash:<provider>`.