loki-mode 11.87.0 → 11.89.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 (77) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/lib/claude-flags.sh +13 -0
  4. package/autonomy/lib/telemetry-schema.json +20 -0
  5. package/autonomy/route.sh +56 -2
  6. package/autonomy/run.sh +20 -7
  7. package/autonomy/telemetry.sh +33 -0
  8. package/bin/loki +3 -1
  9. package/dashboard/__init__.py +1 -1
  10. package/docs/CLI-REFERENCE.md +1 -1
  11. package/docs/INSTALLATION.md +1 -1
  12. package/docs/PRIVACY.md +2 -0
  13. package/docs/dev/release-checklist.md +15 -0
  14. package/loki-ts/dist/loki.js +1475 -1445
  15. package/loki-ts/package.json +2 -1
  16. package/mcp/__init__.py +1 -1
  17. package/package.json +2 -2
  18. package/packages/control-plane/dist/server.js +344 -147
  19. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  20. package/providers/claude.sh +3 -2
  21. package/web-app/dist/assets/{AdminPage-BZSZH480.js → AdminPage-BQLmlBoU.js} +1 -1
  22. package/web-app/dist/assets/{Avatar-Cyg5y96f.js → Avatar-sPMrfkwo.js} +1 -1
  23. package/web-app/dist/assets/{Badge-CWOFDg-f.js → Badge-D6bf5ZNR.js} +1 -1
  24. package/web-app/dist/assets/{Button-BpXB4zdp.js → Button-BKMmzs4p.js} +1 -1
  25. package/web-app/dist/assets/{CockpitPage-ofnfFbFu.js → CockpitPage-Cobt_89E.js} +1 -1
  26. package/web-app/dist/assets/{ComparePage-CbChKWXQ.js → ComparePage-D3_PQ05B.js} +1 -1
  27. package/web-app/dist/assets/{ErrorBoundary-BqJ-8-Qn.js → ErrorBoundary-YMrMfXT1.js} +1 -1
  28. package/web-app/dist/assets/{EvidenceReceiptPanel-Bigp3AwY.js → EvidenceReceiptPanel-wFjp7S3Y.js} +1 -1
  29. package/web-app/dist/assets/{GitHubIssuesPanel-Dnr57aE8.js → GitHubIssuesPanel-DpkjZRyt.js} +1 -1
  30. package/web-app/dist/assets/{GitHubPRsPanel-CASv_g39.js → GitHubPRsPanel-AVnL3HWL.js} +1 -1
  31. package/web-app/dist/assets/{HomePage-BIFq2V8N.js → HomePage-B0MtpdPg.js} +2 -2
  32. package/web-app/dist/assets/{LoginPage-DfTMhcjt.js → LoginPage-CC80bz-e.js} +1 -1
  33. package/web-app/dist/assets/{MagicPage-iMux51iv.js → MagicPage-DVV83HJy.js} +1 -1
  34. package/web-app/dist/assets/{MetricsPage-Cy4HOgOL.js → MetricsPage-C5BkFI0J.js} +1 -1
  35. package/web-app/dist/assets/{NotFoundPage-CJfVBBqH.js → NotFoundPage-s1rzn42S.js} +1 -1
  36. package/web-app/dist/assets/{ProjectPage-BCPurCC3.js → ProjectPage-B0agoWbD.js} +3 -3
  37. package/web-app/dist/assets/{ProjectsPage-BM3e1Fs8.js → ProjectsPage-BOm_XFI3.js} +1 -1
  38. package/web-app/dist/assets/{SettingsPage-DWNxV-1s.js → SettingsPage-DQz1M_vu.js} +1 -1
  39. package/web-app/dist/assets/{ShowcasePage-D3Mo3u_7.js → ShowcasePage-B2TVXqEE.js} +1 -1
  40. package/web-app/dist/assets/{SystemSettingsPage-DLezOP9j.js → SystemSettingsPage-CrfoTgPb.js} +1 -1
  41. package/web-app/dist/assets/{TeamsPage-ZKttKSUe.js → TeamsPage-BLGlLcfL.js} +1 -1
  42. package/web-app/dist/assets/{TemplatesPage-ieAW8_gO.js → TemplatesPage-iipnnIUw.js} +1 -1
  43. package/web-app/dist/assets/{TerminalOutput-D7iu52ze.js → TerminalOutput-B5pOWLP1.js} +1 -1
  44. package/web-app/dist/assets/{activity-DBV3YevX.js → activity-DNQZDHv_.js} +1 -1
  45. package/web-app/dist/assets/{bell-DgYWo05P.js → bell-BcOHxEZp.js} +1 -1
  46. package/web-app/dist/assets/{bot-B4dV6E76.js → bot-DJHk8DIS.js} +1 -1
  47. package/web-app/dist/assets/{check-16fhGkgk.js → check-DLcpqjjW.js} +1 -1
  48. package/web-app/dist/assets/{chevron-left-CKO7l0Eq.js → chevron-left-BBmSCXx7.js} +1 -1
  49. package/web-app/dist/assets/{circle-alert-D8VR7J0Q.js → circle-alert-B2CgD1z3.js} +1 -1
  50. package/web-app/dist/assets/{clock-DDPXWWrU.js → clock-CLTNw-dw.js} +1 -1
  51. package/web-app/dist/assets/{cloud-CZWk2ewo.js → cloud-BMJEQNqp.js} +1 -1
  52. package/web-app/dist/assets/{code-xml-DwMfntBZ.js → code-xml-BmFkHUyF.js} +1 -1
  53. package/web-app/dist/assets/{database-BnCpkPvi.js → database-Bq9o-0ff.js} +1 -1
  54. package/web-app/dist/assets/{dollar-sign-D-2P_Mnf.js → dollar-sign-CPvl4BSY.js} +1 -1
  55. package/web-app/dist/assets/{file-code-corner-D1rEZSlN.js → file-code-corner-Ok780J5c.js} +1 -1
  56. package/web-app/dist/assets/{file-plus-DoI4ReAv.js → file-plus-C-mvuzqz.js} +1 -1
  57. package/web-app/dist/assets/{globe-CYZzu63y.js → globe-7nchOhax.js} +1 -1
  58. package/web-app/dist/assets/{hammer-BSbG-hyh.js → hammer--C-eV19O.js} +1 -1
  59. package/web-app/dist/assets/{index-CT5FeqwQ.js → index-BY0d2rJT.js} +3 -3
  60. package/web-app/dist/assets/{layers-BV8xM9Qx.js → layers-B3T1id14.js} +1 -1
  61. package/web-app/dist/assets/{loader-circle-fp4YjxgQ.js → loader-circle-CtsL9AIK.js} +1 -1
  62. package/web-app/dist/assets/{lock-CV7GrGTs.js → lock-C5gtyC-I.js} +1 -1
  63. package/web-app/dist/assets/{package-DNCuUc4t.js → package-BWa9VJ_J.js} +1 -1
  64. package/web-app/dist/assets/{plus-C8QWqZV6.js → plus-CbrYo3zc.js} +1 -1
  65. package/web-app/dist/assets/{refresh-cw-BEezcsJd.js → refresh-cw-DpSr1VHS.js} +1 -1
  66. package/web-app/dist/assets/{rotate-ccw-CKjQEvAp.js → rotate-ccw-CGfdW9Iq.js} +1 -1
  67. package/web-app/dist/assets/{scroll-text-CdthLmiS.js → scroll-text-DJQaMueH.js} +1 -1
  68. package/web-app/dist/assets/{server-CyS-SXDQ.js → server-gW2YYTQK.js} +1 -1
  69. package/web-app/dist/assets/{shield-alert-DC8MKtLh.js → shield-alert-Q8pgbz-s.js} +1 -1
  70. package/web-app/dist/assets/{thumbs-up-ByWHn4xc.js → thumbs-up-Du9_EC4t.js} +1 -1
  71. package/web-app/dist/assets/{trash-2-DNLIig_Q.js → trash-2-D_P45JH4.js} +1 -1
  72. package/web-app/dist/assets/{trending-down-95KgPrlE.js → trending-down-B4tyujmD.js} +1 -1
  73. package/web-app/dist/assets/{trending-up-BKyrvrmW.js → trending-up-CkSU2NRR.js} +1 -1
  74. package/web-app/dist/assets/{upload-D7Adz-97.js → upload-Mh6nzuC2.js} +1 -1
  75. package/web-app/dist/assets/{usePolling-u5NswsG0.js → usePolling-BWRlQ0Ir.js} +1 -1
  76. package/web-app/dist/assets/{user-TGfzfMIB.js → user-BF6I3BoG.js} +1 -1
  77. 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.87.0
6
+ # Loki Mode v11.89.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
 
@@ -475,4 +475,4 @@ Implemented, planned and deprecated items, with the version each landed in: `ski
475
475
 
476
476
  ---
477
477
 
478
- **v11.87.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
478
+ **v11.89.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.87.0
1
+ 11.89.0
@@ -1174,3 +1174,16 @@ _loki_claude_permission_argv() {
1174
1174
  _LOKI_PERM_ARGV=()
1175
1175
  while IFS= read -r _a; do _LOKI_PERM_ARGV+=("$_a"); done <<< "$_out"
1176
1176
  }
1177
+
1178
+ # SHELL value for a claude child. Claude Code's Bash tool replays the aliases of
1179
+ # the shell named in SHELL, so a user's `alias ls=eza` hangs agent Bash commands.
1180
+ # Pin /bin/bash when executable (same rule as the engine10 route,
1181
+ # loki-ts/src/runner/worker_proc.ts pinBashShellEnv); LOKI_E10_KEEP_USER_SHELL=1
1182
+ # keeps the user's shell. Only SHELL changes; claude spawn sites only.
1183
+ _loki_claude_shell_value() {
1184
+ if [ "${LOKI_E10_KEEP_USER_SHELL:-}" != "1" ] && [ -x /bin/bash ]; then
1185
+ printf '%s' "/bin/bash"
1186
+ else
1187
+ printf '%s' "${SHELL-}"
1188
+ fi
1189
+ }
@@ -51,6 +51,26 @@
51
51
  "gates_passed": {"type": "int", "min": 0, "max": 1000},
52
52
  "gates_total": {"type": "int", "min": 0, "max": 1000},
53
53
  "gate_pass_rate": {"type": "number", "min": 0, "max": 1}
54
+ },
55
+ "run_started": {
56
+ "engine": {"type": "enum", "values": ["engine10"]}
57
+ },
58
+ "run_finished": {
59
+ "engine": {"type": "enum", "values": ["engine10"]},
60
+ "verdict": {"type": "enum", "values": ["VERIFIED", "PARTIAL", "ALREADY_SATISFIED", "SPEC_CONFLICT", "FAILED", "INTERRUPTED", "BLOCKED"]},
61
+ "duration_s": {"type": "int", "min": 0, "max": 31536000},
62
+ "fix_rounds": {"type": "int", "min": 0, "max": 1000},
63
+ "exit_code": {"type": "int", "min": 0, "max": 255},
64
+ "stage_s_intake": {"type": "int", "min": 0, "max": 31536000},
65
+ "stage_s_plan": {"type": "int", "min": 0, "max": 31536000},
66
+ "stage_s_wall": {"type": "int", "min": 0, "max": 31536000},
67
+ "stage_s_implement": {"type": "int", "min": 0, "max": 31536000},
68
+ "stage_s_verify": {"type": "int", "min": 0, "max": 31536000},
69
+ "stage_s_fix": {"type": "int", "min": 0, "max": 31536000},
70
+ "stage_s_commit": {"type": "int", "min": 0, "max": 31536000},
71
+ "stage_s_seal": {"type": "int", "min": 0, "max": 31536000},
72
+ "stage_s_pr": {"type": "int", "min": 0, "max": 31536000},
73
+ "stage_s_deep": {"type": "int", "min": 0, "max": 31536000}
54
74
  }
55
75
  }
56
76
  }
package/autonomy/route.sh CHANGED
@@ -60,9 +60,60 @@ _route_json_str() {
60
60
  printf '%s' "$1" | tr '\n\t\r' ' ' | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g'
61
61
  }
62
62
 
63
+ # Echoes the canonical https://github.com/owner/repo/pull/N for a github.com pull request URL
64
+ # (host case-insensitive, optional www., http or https, optional /files style suffix); echoes nothing otherwise.
65
+ # The owner/repo shape mirrors parsePrRef in loki-ts/src/commands/verify_pr.ts.
66
+ _route_pr_url() {
67
+ local re='^[Hh][Tt][Tt][Pp][Ss]?://([Ww][Ww][Ww]\.)?[Gg][Ii][Tt][Hh][Uu][Bb]\.[Cc][Oo][Mm]/([A-Za-z0-9][A-Za-z0-9_.-]*/[A-Za-z0-9][A-Za-z0-9_.-]*)/pull/([0-9]+)([/?#].*)?$'
68
+ if [[ "$1" =~ $re ]]; then printf 'https://github.com/%s/pull/%s' "${BASH_REMATCH[2]}" "${BASH_REMATCH[3]}"; fi
69
+ }
70
+
71
+ # `loki start <PR URL> [--json] [--out DIR] [--no-pr]` is the verify-pr command, whatever the flag order.
72
+ # Returns 1 when no argument is a PR URL (the caller carries on). Otherwise sets R_* (R_PR_ARGS = the verify-pr argv)
73
+ # and returns 0; an unsupported flag or a second input sets R_ERR.
74
+ # shellcheck disable=SC2034
75
+ _route_pr_mode() {
76
+ local a pr="" bad="" badref="" extra="" i=0 n=$# u
77
+ local -a argv=("$@") eargs=()
78
+ for u in "$@"; do
79
+ case "$u" in --help|-h) return 1 ;; esac
80
+ done
81
+ while [ "$i" -lt "$n" ]; do
82
+ a="${argv[$i]}"; i=$((i + 1))
83
+ case "$a" in
84
+ --explain-route) R_EXPLAIN=1 ;;
85
+ --json) eargs+=(--json); R_JSON=1 ;;
86
+ --no-pr) ;;
87
+ --out) eargs+=(--out "${argv[$i]:-}"); i=$((i + 1)) ;;
88
+ --out=*) eargs+=(--out "${a#--out=}") ;;
89
+ -*) [ -n "$bad" ] || bad="${a%%=*}" ;;
90
+ *)
91
+ u="$(_route_pr_url "$a")"
92
+ # PR-shaped but invalid (a ".." in owner/repo): refused, like parsePrRef in verify_pr.ts.
93
+ if [ -n "$u" ]; then case "${u#https://github.com/}" in *..*) [ -n "$badref" ] || badref="$a" ;; esac; fi
94
+ if [ -n "$u" ] && [ -z "$pr" ]; then pr="$u"; else extra="${extra:+$extra }$a"; fi ;;
95
+ esac
96
+ done
97
+ [ -n "$pr" ] || return 1
98
+ R_DECIDED=1; R_INPUT_TYPE="pr"; R_INPUT="$pr"; R_ENGINE="verify-pr"; R_ADAPTER="verify-pr"
99
+ R_PROVIDER="n/a"; R_MODEL="n/a (no model call)"
100
+ R_REASON="pull request URL: verify-pr seals it; no plan or implement stage, nothing is pushed"
101
+ if [ -n "$badref" ]; then
102
+ R_ERR="loki: start <PR url>: not a valid pull request URL: $badref"
103
+ elif [ -n "$bad" ]; then
104
+ R_ERR="loki: start <PR url>: flag $bad is not supported (verify-pr takes --out DIR, --json and --no-pr)"
105
+ elif [ -n "$extra" ]; then
106
+ R_ERR="loki: start <PR url> takes one input; also got: $extra"
107
+ else
108
+ R_PR_ARGS=("$pr" ${eargs[@]+"${eargs[@]}"})
109
+ fi
110
+ return 0
111
+ }
112
+
63
113
  _route_classify() {
64
- # $1 = single positional. Echoes: issue | prd | task | brief | missing-prd
114
+ # $1 = single positional. Echoes: pr | issue | prd | task | brief | missing-prd
65
115
  local p="$1"
116
+ if [ -n "$(_route_pr_url "$p")" ]; then echo pr; return 0; fi
66
117
  case "$p" in
67
118
  */*\#[0-9]*|http*://*/issues/*|http*://*/browse/*|jira:*|linear:*|https://linear.app/*/issue/*) echo issue; return 0 ;;
68
119
  esac
@@ -83,7 +134,8 @@ loki_route_resolve() {
83
134
  local verb="$1"; shift
84
135
  R_DECIDED=0; R_E10=0; R_HARD=0; R_ENGINE=""; R_REASON=""; R_INPUT_TYPE=""; R_INPUT=""
85
136
  R_PROVIDER=""; R_MODEL=""; R_NOTICE=""; R_ERR=""; R_EXPLAIN=0; R_JSON=0; R_SESSION_MODEL=""; R_VERB=""
86
- R_E10_ARGS=(); R_CLEAN=(); R_ADAPTER=""; R_CAPDIFF=(); R_E10_CAP_S=""; R_DRY=0; R_MAXCOST=""
137
+ R_E10_ARGS=(); R_CLEAN=(); R_ADAPTER=""; R_CAPDIFF=(); R_E10_CAP_S=""; R_DRY=0; R_MAXCOST=""; R_PR_ARGS=()
138
+ if [ "$verb" = "start" ] && _route_pr_mode "$@"; then return 0; fi
87
139
 
88
140
  local a engine_req="" dry=0 help=0 legacy_flag="" session_model="" provider_flag="" max_duration="" cap_err="" input_flag=""
89
141
  local -a positionals=() passthru=()
@@ -171,6 +223,8 @@ loki_route_resolve() {
171
223
  R_INPUT="(from --spec)"
172
224
  elif [ "$npos" -eq 1 ]; then
173
225
  R_INPUT_TYPE=$(_route_classify "${positionals[0]}")
226
+ # Only `loki start` sends a PR URL to verify-pr (_route_pr_mode); on any other verb engine10 runs it as a brief.
227
+ if [ "$R_INPUT_TYPE" = "pr" ]; then R_INPUT_TYPE=brief; fi
174
228
  R_INPUT="${positionals[0]}"
175
229
  else
176
230
  R_INPUT_TYPE=task
package/autonomy/run.sh CHANGED
@@ -6874,12 +6874,12 @@ spawn_worktree_session() {
6874
6874
  _LOKI_PERM_ARGV=(--dangerously-skip-permissions)
6875
6875
  ! type _loki_claude_permission_argv >/dev/null 2>&1 || _loki_claude_permission_argv
6876
6876
  if [ -n "$_loki_wt_cm" ]; then
6877
- CAVEMAN_DEFAULT_MODE="$_loki_wt_cm" claude "${_LOKI_PERM_ARGV[@]}" \
6877
+ SHELL="$(_loki_claude_shell_value)" CAVEMAN_DEFAULT_MODE="$_loki_wt_cm" claude "${_LOKI_PERM_ARGV[@]}" \
6878
6878
  "${_LOKI_WT_AUTO_FLAGS[@]+"${_LOKI_WT_AUTO_FLAGS[@]}"}" \
6879
6879
  -p "Loki Mode: $task_prompt. Read .loki/CONTINUITY.md for context." \
6880
6880
  >> "$log_file" 2>&1 || _wt_exit=$?
6881
6881
  else
6882
- claude "${_LOKI_PERM_ARGV[@]}" \
6882
+ SHELL="$(_loki_claude_shell_value)" claude "${_LOKI_PERM_ARGV[@]}" \
6883
6883
  "${_LOKI_WT_AUTO_FLAGS[@]+"${_LOKI_WT_AUTO_FLAGS[@]}"}" \
6884
6884
  -p "Loki Mode: $task_prompt. Read .loki/CONTINUITY.md for context." \
6885
6885
  >> "$log_file" 2>&1 || _wt_exit=$?
@@ -7124,7 +7124,7 @@ Output ONLY the resolved file content with no conflict markers. No explanations.
7124
7124
  # the EXACT resolved file content (the shell writes it verbatim).
7125
7125
  # Compressing prose into the merged source would corrupt the file,
7126
7126
  # so disable caveman unconditionally here. No-op when absent.
7127
- resolution=$(CAVEMAN_DEFAULT_MODE=off claude "${_cr_argv[@]}" -p "$conflict_prompt" --output-format text < /dev/null 2>/dev/null)
7127
+ resolution=$(SHELL="$(_loki_claude_shell_value)" CAVEMAN_DEFAULT_MODE=off claude "${_cr_argv[@]}" -p "$conflict_prompt" --output-format text < /dev/null 2>/dev/null)
7128
7128
  ;;
7129
7129
  codex)
7130
7130
  resolution=$(codex exec --sandbox workspace-write --skip-git-repo-check "$conflict_prompt" 2>/dev/null)
@@ -16821,7 +16821,7 @@ _dispatch_reviewer() {
16821
16821
  }
16822
16822
  fi
16823
16823
  _loki_with_deadline_stdin_text "$_cr_req_cap" "$prompt_text" \
16824
- "${_cr_provider_env[@]}" CAVEMAN_DEFAULT_MODE=off \
16824
+ "${_cr_provider_env[@]}" "SHELL=$(_loki_claude_shell_value)" CAVEMAN_DEFAULT_MODE=off \
16825
16825
  claude "${_rv_argv[@]}" -p \
16826
16826
  --output-format text > "$_cr_req_raw" \
16827
16827
  || _cr_req_rc=$?
@@ -16872,7 +16872,7 @@ _dispatch_reviewer() {
16872
16872
  _cr_cap=$(_loki_review_deadline_remaining "$_review_deadline_ms") || return 124
16873
16873
  fi
16874
16874
  _cr_json="$(_loki_with_deadline_stdin_text "$_cr_cap" "$prompt_text" \
16875
- "${_cr_provider_env[@]}" CAVEMAN_DEFAULT_MODE=off \
16875
+ "${_cr_provider_env[@]}" "SHELL=$(_loki_claude_shell_value)" CAVEMAN_DEFAULT_MODE=off \
16876
16876
  claude "${_rv_argv[@]}" -p \
16877
16877
  --json-schema "$_cr_schema_content" \
16878
16878
  --output-format json)" || _cr_rc=$?
@@ -16902,7 +16902,7 @@ _dispatch_reviewer() {
16902
16902
  _cr_text_cap=$(_loki_review_deadline_remaining "$_review_deadline_ms") || return 124
16903
16903
  fi
16904
16904
  _loki_with_deadline_stdin_text "$_cr_text_cap" "$prompt_text" \
16905
- "${_cr_provider_env[@]}" CAVEMAN_DEFAULT_MODE=off claude "${_rv_argv[@]}" -p \
16905
+ "${_cr_provider_env[@]}" "SHELL=$(_loki_claude_shell_value)" CAVEMAN_DEFAULT_MODE=off claude "${_rv_argv[@]}" -p \
16906
16906
  --output-format text > "$review_output"
16907
16907
  ;;
16908
16908
  codex)
@@ -21774,9 +21774,20 @@ ${_commits}"
21774
21774
  # would fail that check or produce caveman-style USAGE text, so disable
21775
21775
  # caveman unconditionally. Inlined on `claude` only (does not cross the pipe
21776
21776
  # to head). No-op when caveman is absent.
21777
+ # A non-claude provider with LOKI_ALLOW_CLAUDE_SIDECALLS=1 never loads
21778
+ # claude.sh, so compute the pinned shell in a subshell: the helper's
21779
+ # top-level exports (caveman vars) must not leak into this process.
21780
+ local _ic_shell
21781
+ _ic_shell="$(
21782
+ # shellcheck source=/dev/null
21783
+ type _loki_claude_shell_value >/dev/null 2>&1 \
21784
+ || . "$PROJECT_DIR/autonomy/lib/claude-flags.sh" >/dev/null 2>&1 || exit 1
21785
+ _loki_claude_shell_value
21786
+ )" || _ic_shell=""
21787
+ [ -n "$_ic_shell" ] || _ic_shell="${SHELL-}"
21777
21788
  local _ic_out
21778
21789
  _ic_out=$(printf '%s' "$_ic_prompt" \
21779
- | timeout 60 env CAVEMAN_DEFAULT_MODE=off claude "${_ic_argv[@]}" -p - 2>/dev/null \
21790
+ | timeout 60 env "SHELL=$_ic_shell" CAVEMAN_DEFAULT_MODE=off claude "${_ic_argv[@]}" -p - 2>/dev/null \
21780
21791
  | head -200)
21781
21792
  # Sanity check: response must look like Markdown (starts with # or ##).
21782
21793
  if [ -z "$_ic_out" ] || ! printf '%s' "$_ic_out" | head -1 | grep -qE '^#'; then
@@ -26174,11 +26185,13 @@ except Exception as exc:
26174
26185
  CAVEMAN_DEFAULT_MODE="$_loki_cm_level" \
26175
26186
  LOKI_DEADLINE_IDLE_TIMEOUT="${LOKI_PROVIDER_IDLE_TIMEOUT:-0}" \
26176
26187
  _loki_with_deadline "${LOKI_PROVIDER_CALL_TIMEOUT:-0}" \
26188
+ env "SHELL=$(_loki_claude_shell_value)" \
26177
26189
  claude "${_loki_claude_argv[@]}" -p "$prompt" \
26178
26190
  --output-format stream-json --verbose < /dev/null 2>&1
26179
26191
  else
26180
26192
  LOKI_DEADLINE_IDLE_TIMEOUT="${LOKI_PROVIDER_IDLE_TIMEOUT:-0}" \
26181
26193
  _loki_with_deadline "${LOKI_PROVIDER_CALL_TIMEOUT:-0}" \
26194
+ env "SHELL=$(_loki_claude_shell_value)" \
26182
26195
  claude "${_loki_claude_argv[@]}" -p "$prompt" \
26183
26196
  --output-format stream-json --verbose < /dev/null 2>&1
26184
26197
  fi | \
@@ -432,3 +432,36 @@ loki_emit_build_verified_enum() {
432
432
  loki_telemetry "build_verified" "headline=VERIFIED" "route=engine10"
433
433
  return 0
434
434
  }
435
+
436
+ # loki_emit_run_started: one run_started event for a default-route (engine10)
437
+ # run. Fixed engine value, no caller input. Same strict analytics gate as the
438
+ # other run-outcome events, so every existing opt-out wins.
439
+ loki_emit_run_started() {
440
+ _loki_analytics_enabled || return 0
441
+ loki_telemetry "run_started" "engine=engine10"
442
+ return 0
443
+ }
444
+
445
+ # loki_emit_run_finished <verdict> [key=value...]: one run_finished event.
446
+ # Enum and integer args only: a verdict outside the fixed list sends nothing,
447
+ # and a pair is forwarded only when its key is duration_s, fix_rounds, exit_code
448
+ # or stage_s_<engine stage> AND its value is a plain non-negative integer. Never
449
+ # a path, repo, branch, prompt or error text; the schema re-filters at send.
450
+ loki_emit_run_finished() {
451
+ _loki_analytics_enabled || return 0
452
+ local _verdict="${1:-}"; shift
453
+ case "$_verdict" in VERIFIED|PARTIAL|ALREADY_SATISFIED|SPEC_CONFLICT|FAILED|INTERRUPTED|BLOCKED) ;; *) return 0 ;; esac
454
+ local _args=("engine=engine10" "verdict=${_verdict}") _kv _k _v
455
+ for _kv in "$@"; do
456
+ _k="${_kv%%=*}"; _v="${_kv#*=}"
457
+ case "$_k" in
458
+ duration_s|fix_rounds|exit_code|stage_s_intake|stage_s_plan|stage_s_wall|stage_s_implement|stage_s_verify|stage_s_fix|stage_s_commit|stage_s_seal|stage_s_pr|stage_s_deep) ;;
459
+ *) continue ;;
460
+ esac
461
+ case "$_v" in ''|*[!0-9]*) continue ;; esac
462
+ [ "${#_v}" -le 9 ] || continue
463
+ _args+=("${_k}=${_v}")
464
+ done
465
+ loki_telemetry "run_finished" "${_args[@]}"
466
+ return 0
467
+ }
package/bin/loki CHANGED
@@ -643,7 +643,9 @@ if [ -f "$REPO_ROOT/autonomy/route.sh" ] && { [ "$_LOKI_START_ATTEMPTS" != "1" ]
643
643
  export LOKI_SESSION_MODEL="$R_SESSION_MODEL"
644
644
  fi
645
645
  if [ "$R_E10" = "1" ] && [ -n "${R_E10_CAP_S:-}" ]; then export LOKI_E10_CAP_S="$R_E10_CAP_S"; fi
646
- if [ "$R_E10" != "1" ]; then
646
+ if [ "$R_ENGINE" = "verify-pr" ]; then
647
+ set -- verify-pr "${R_PR_ARGS[@]}"
648
+ elif [ "$R_E10" != "1" ]; then
647
649
  set -- "$([ "$R_VERB" = "bare" ] && echo start || echo "$R_VERB")" ${R_CLEAN[@]+"${R_CLEAN[@]}"}
648
650
  fi
649
651
  fi
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.87.0"
10
+ __version__ = "11.89.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.87.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.89.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.87.0
5
+ **Version:** v11.89.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/PRIVACY.md CHANGED
@@ -102,6 +102,8 @@ paths, keys, or repo names -- only anonymous diagnostics.
102
102
  | `first_start_attempted` | first `loki start`, strict opt-in (section 4) | `entry` (a known loki subcommand, else `other`) |
103
103
  | `first_run_blocked` | first run stopped, strict opt-in (section 5) | `blocker` (fixed enum, section 5) |
104
104
  | `seal_hook_decision` | the loki-seal Stop hook decides, strict opt-in (section 4) | `decision` (allow, block), `reason` (none, tests_failed, tests_weakened, no_tests, contract_unverified, released, error) |
105
+ | `run_started` | a default-route run ends, strict opt-in (section 4) | `engine` (engine10) |
106
+ | `run_finished` | a default-route run ends, strict opt-in (section 4) | `engine`, `verdict` (VERIFIED, PARTIAL, ALREADY_SATISFIED, SPEC_CONFLICT, FAILED, INTERRUPTED, BLOCKED), `duration_s`, `stage_s_<stage>` (seconds per engine stage), `fix_rounds` (count), `exit_code` (0 to 255) |
105
107
  | `build_verified` | a build finishes, strict opt-in (section 4) | see section 4 |
106
108
 
107
109
  The `install` event of older versions is now `installed`. The npm postinstall
@@ -12,6 +12,19 @@ refs/heads/main` matches `git rev-parse HEAD`. `scripts/local-ci.sh` remains
12
12
  available for diagnosis on a quiet cycle -- it is no longer a push
13
13
  precondition, fast tier or full.
14
14
 
15
+ Slice gate (run before reporting a slice built; a reviewer reruns the same command):
16
+ `bash scripts/select-tests.sh --gate [--suite tests/test-foo.sh]... [--no-loki-ts]`.
17
+ It checks that HEAD contains the current origin/main (and names how far behind
18
+ it is, never rebasing for you), runs exactly the `--guards-only` row set (the
19
+ `scripts/global-guards.tsv` rows plus the marker-only walkers, from one shared emitter) one
20
+ at a time and names any red row, runs each `--suite`, then runs full engine10
21
+ (`bun run test:engine10` in loki-ts, through the slot queue when the tree has that script) unless `--no-loki-ts` says the slice
22
+ touched no loki-ts source. Every row, suite and the engine10 run is bounded by
23
+ `timeout -k 15` (`LOKI_GATE_ROW_TIMEOUT`, `LOKI_GATE_SUITE_TIMEOUT`, `LOKI_GATE_ENGINE10_TIMEOUT`);
24
+ a timeout, an empty guard list, a failed fetch (unless `--no-fetch`) or a missing
25
+ `bun` fails the gate. It prints a pass/fail summary per step and exits
26
+ non-zero on any failure.
27
+
15
28
  After a release ships, run post-release distribution validation:
16
29
  - npm: `npm pack loki-mode@<VERSION>`, untar, run `bash package/bin/loki version`
17
30
  - Docker: `docker pull asklokesh/loki-mode:<VERSION>`, `docker run --rm <img> version`,
@@ -113,6 +126,8 @@ For a manual push (`git push origin main`), run `bash scripts/local-ci.sh` first
113
126
  npm, then creates the tag and GitHub Release, builds/pushes Docker (including `:latest`), and updates the Homebrew tap. Do not manually
114
127
  create tags.
115
128
 
129
+ Run the full Bun suite (including `tests/engine10`) only through `cd loki-ts && bun run test` or `bun run test:engine10`: both go through `scripts/test-slot.sh`, which allows at most 2 full runs per machine (`LOKI_ENGINE10_SLOTS` overrides; slots live in `~/.cache/loki-test-slots`, override `LOKI_TEST_SLOT_DIR`). A third run prints "waiting for a test slot" and starts when one frees; it is never killed, and a slot whose holder PID is dead is reclaimed. Filtered runs (`bun run test <file>`) take no slot. Never start the suite with a bare `bun test` for a full run. Test: `tests/test-test-slot.sh`.
130
+
116
131
  Before pushing the release commit, run `bash scripts/release.sh --check-clean`: it exits 1 naming any tracked file (for example a stamped `loki-ts/dist/loki.js.map`) the commit left modified; `--bump-only` prints the "stage these files:" list.
117
132
 
118
133
  ### 5. Verify ALL Distribution Channels