loki-mode 11.2.2 → 11.3.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 (68) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/lib/skill-link-heal.sh +78 -1
  4. package/dashboard/__init__.py +1 -1
  5. package/docs/CLI-REFERENCE.md +1 -1
  6. package/docs/INSTALLATION.md +1 -1
  7. package/docs/v10/FAILURE-CLASSES.md +11 -0
  8. package/loki-ts/dist/loki.js +590 -590
  9. package/mcp/__init__.py +1 -1
  10. package/package.json +1 -1
  11. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  12. package/web-app/dist/assets/{AdminPage-C-iMLNxe.js → AdminPage-D_e45uTw.js} +1 -1
  13. package/web-app/dist/assets/{Avatar-C7VUvwsO.js → Avatar-T3nIpoaf.js} +1 -1
  14. package/web-app/dist/assets/{Badge-tGvQEhnw.js → Badge-BKqb59pP.js} +1 -1
  15. package/web-app/dist/assets/{Button-_iHlH_yL.js → Button-DjVlkh8_.js} +1 -1
  16. package/web-app/dist/assets/{CockpitPage-J_nNjbcR.js → CockpitPage-DXJgLGmh.js} +1 -1
  17. package/web-app/dist/assets/{ComparePage-B05ui6Xt.js → ComparePage-BRP_eVc_.js} +1 -1
  18. package/web-app/dist/assets/{ErrorBoundary-Bxex6DLn.js → ErrorBoundary-CLjpGLjC.js} +1 -1
  19. package/web-app/dist/assets/{EvidenceReceiptPanel-BsgWfdD1.js → EvidenceReceiptPanel-DX-vb4Xy.js} +1 -1
  20. package/web-app/dist/assets/{GitHubIssuesPanel-DZBhZ8_X.js → GitHubIssuesPanel-214HVHtX.js} +1 -1
  21. package/web-app/dist/assets/{GitHubPRsPanel-BaxlAl6R.js → GitHubPRsPanel-BEiZKc4t.js} +1 -1
  22. package/web-app/dist/assets/{HomePage-mVJvzqbF.js → HomePage-VvMHS5ga.js} +2 -2
  23. package/web-app/dist/assets/{LoginPage-B0zd4A_G.js → LoginPage-5WD-v7n3.js} +1 -1
  24. package/web-app/dist/assets/{MagicPage-DXLQ-y_R.js → MagicPage-DUQT_Jye.js} +1 -1
  25. package/web-app/dist/assets/{MetricsPage-CLS34Xvr.js → MetricsPage-lga-z79v.js} +1 -1
  26. package/web-app/dist/assets/{NotFoundPage-BXG8PbNV.js → NotFoundPage-CGhBX3G1.js} +1 -1
  27. package/web-app/dist/assets/{ProjectPage-D3kFFC0F.js → ProjectPage-CdzF2GzZ.js} +3 -3
  28. package/web-app/dist/assets/{ProjectsPage-2bFn-gnC.js → ProjectsPage-DRG64N8s.js} +1 -1
  29. package/web-app/dist/assets/{SettingsPage-CBM0ziWE.js → SettingsPage-5fzW9Frb.js} +1 -1
  30. package/web-app/dist/assets/{ShowcasePage-BTaXhjI3.js → ShowcasePage-DrTdxO4y.js} +1 -1
  31. package/web-app/dist/assets/{SystemSettingsPage-BrC2hyAr.js → SystemSettingsPage-C9Mqs6Rd.js} +1 -1
  32. package/web-app/dist/assets/{TeamsPage-oqxdbVbY.js → TeamsPage-CUGPdSWo.js} +1 -1
  33. package/web-app/dist/assets/{TemplatesPage-CEbUIY21.js → TemplatesPage-CNraDY0F.js} +1 -1
  34. package/web-app/dist/assets/{TerminalOutput-aIoWLbJA.js → TerminalOutput-BIu_6Pea.js} +1 -1
  35. package/web-app/dist/assets/{activity-CPyi45gt.js → activity-Bk-kgqaf.js} +1 -1
  36. package/web-app/dist/assets/{bell-BhaNBaJp.js → bell-BXmUdmo8.js} +1 -1
  37. package/web-app/dist/assets/{bot-Da8REaEP.js → bot-CiuzXxUR.js} +1 -1
  38. package/web-app/dist/assets/{check-DPj99ArM.js → check-BEzjXppd.js} +1 -1
  39. package/web-app/dist/assets/{chevron-left-CkxonN0X.js → chevron-left-AYWCXHf8.js} +1 -1
  40. package/web-app/dist/assets/{circle-alert-C0JkB1y5.js → circle-alert-BNg2uSRq.js} +1 -1
  41. package/web-app/dist/assets/{clock-COzFIiWi.js → clock-DTj0kkGT.js} +1 -1
  42. package/web-app/dist/assets/{cloud-bjkac4kn.js → cloud-x4nTDBLT.js} +1 -1
  43. package/web-app/dist/assets/{code-xml-hlKlvXUJ.js → code-xml-BVh_MLrk.js} +1 -1
  44. package/web-app/dist/assets/{database-D555S5Km.js → database-DdfBaowG.js} +1 -1
  45. package/web-app/dist/assets/{dollar-sign-CVcApzcD.js → dollar-sign-XuYFmAOY.js} +1 -1
  46. package/web-app/dist/assets/{file-code-corner-UORaMIcO.js → file-code-corner-D4cRnmeL.js} +1 -1
  47. package/web-app/dist/assets/{file-plus-ALJtDoI2.js → file-plus-CyoVlHc_.js} +1 -1
  48. package/web-app/dist/assets/{globe-CPlrM_IC.js → globe-Y6IK2RPW.js} +1 -1
  49. package/web-app/dist/assets/{hammer-qaGZHpja.js → hammer-BKzr9VZI.js} +1 -1
  50. package/web-app/dist/assets/{index-BcXljIAO.js → index-B20cSx5G.js} +3 -3
  51. package/web-app/dist/assets/{layers-BV8R9VUK.js → layers-DebNOhGS.js} +1 -1
  52. package/web-app/dist/assets/{loader-circle-6TlDS9Tu.js → loader-circle-DyGbrEgd.js} +1 -1
  53. package/web-app/dist/assets/{lock-B9t6oWI0.js → lock-BKPpyt20.js} +1 -1
  54. package/web-app/dist/assets/{package-2gEUAtZJ.js → package-egF5Wi4y.js} +1 -1
  55. package/web-app/dist/assets/{plus-DXocxPjU.js → plus-OiEgKIc-.js} +1 -1
  56. package/web-app/dist/assets/{refresh-cw-D3dWHBd6.js → refresh-cw-CzKvrONq.js} +1 -1
  57. package/web-app/dist/assets/{rotate-ccw-CvuWqaSB.js → rotate-ccw-Bu2mII0p.js} +1 -1
  58. package/web-app/dist/assets/{scroll-text-ktmD_xJY.js → scroll-text-CSkiyax8.js} +1 -1
  59. package/web-app/dist/assets/{server-E7pZtj5A.js → server-DlPthJFw.js} +1 -1
  60. package/web-app/dist/assets/{shield-alert-968j9z0V.js → shield-alert-CbpHWQQX.js} +1 -1
  61. package/web-app/dist/assets/{thumbs-up-Tz_8rpU_.js → thumbs-up-DgGpZe-Q.js} +1 -1
  62. package/web-app/dist/assets/{trash-2-Drh9IIj8.js → trash-2-BV3GlCB-.js} +1 -1
  63. package/web-app/dist/assets/{trending-down-DCQXtVSL.js → trending-down-Y4TJtXhD.js} +1 -1
  64. package/web-app/dist/assets/{trending-up-BIiwQbWV.js → trending-up-DsDNoHZY.js} +1 -1
  65. package/web-app/dist/assets/{upload-sCbPkfmy.js → upload-gkThrc_I.js} +1 -1
  66. package/web-app/dist/assets/{usePolling-BMIg6ZVT.js → usePolling-jpNSeNAe.js} +1 -1
  67. package/web-app/dist/assets/{user-kGzXC3V2.js → user-3Zez1WOK.js} +1 -1
  68. package/web-app/dist/index.html +1 -1
package/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: An autonomous software factory that knows what it is supposed to deliver, and proves it did. Use when the user says Loki Mode or asks to build, fix or verify software autonomously.
4
4
  ---
5
5
 
6
- # Loki Mode v11.2.2
6
+ # Loki Mode v11.3.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 legacy engine, which still ships and is being removed (`loki start owner/repo#N` still routes to it; prefer `loki owner/repo#N`).
9
9
 
@@ -483,4 +483,4 @@ See `CHANGELOG.md` entries [7.5.7], [7.5.8], [7.5.13] for the per-fix list and r
483
483
 
484
484
  ---
485
485
 
486
- **v11.2.2 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
486
+ **v11.3.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.2.2
1
+ 11.3.0
@@ -13,6 +13,9 @@
13
13
  # - its target is missing, or resolves to a different install than the running one
14
14
  # - the running root is itself an install path with a SKILL.md, so a dev checkout
15
15
  # or worktree never hijacks the user's global link
16
+ # - the running install is durable (npm global root, bun global dir, Homebrew
17
+ # prefix); an npx cache, temp dir or arbitrary prefix is refused with one
18
+ # stderr line and the link is left untouched
16
19
 
17
20
  _loki_skill_is_install_path() {
18
21
  case "${1%/}" in
@@ -21,9 +24,75 @@ _loki_skill_is_install_path() {
21
24
  return 1
22
25
  }
23
26
 
27
+ # Durable-install rule (FC-30 amendment). A repoint writes a user-owned path, so
28
+ # the running install must outlive this process: a one-off `npx loki-mode` run or
29
+ # a scratch prefix would turn the link into a new dangling link. Durable means
30
+ # the running root sits under the npm global root (`npm root -g`), the bun global
31
+ # dir, or a Homebrew prefix. Prints a reason and returns 1 when it is not.
32
+ _loki_skill_dir_p() { (cd "$1" 2>/dev/null && pwd -P); }
33
+
34
+ # `npm root -g` bounded to 3s so a hung npm can never hang bin/loki. Output goes
35
+ # to a file (not a pipe) so an orphaned grandchild cannot hold the caller open.
36
+ # Returns 124 on timeout (callers fail closed), otherwise npm's own status.
37
+ _loki_skill_npm_root() {
38
+ local out pid i=0 rc
39
+ out="$(mktemp "${TMPDIR:-/tmp}/loki-npmroot.XXXXXX")" || return 1
40
+ npm root -g >"$out" 2>/dev/null </dev/null &
41
+ pid=$!
42
+ while kill -0 "$pid" 2>/dev/null; do
43
+ if [ "$i" -ge 30 ]; then
44
+ kill "$pid" 2>/dev/null
45
+ rm -f "$out"
46
+ return 124
47
+ fi
48
+ sleep 0.1
49
+ i=$((i + 1))
50
+ done
51
+ wait "$pid"; rc=$?
52
+ [ "$rc" -eq 0 ] && head -n 1 "$out"
53
+ rm -f "$out"
54
+ return "$rc"
55
+ }
56
+
57
+ _loki_skill_root_durable() {
58
+ local root_p="$1" cand cands="" npmroot prefix rc
59
+ case "$root_p" in
60
+ */_npx/*) printf 'running from an npx cache (%s)' "$root_p"; return 1 ;;
61
+ esac
62
+ npmroot="$(_loki_skill_npm_root)"; rc=$?
63
+ if [ "$rc" -eq 124 ]; then
64
+ printf 'npm root -g timed out (running install %s not verified durable)' "$root_p"
65
+ return 1
66
+ fi
67
+ [ "$rc" -eq 0 ] || npmroot=""
68
+ [ -n "$npmroot" ] && cands="$cands
69
+ $npmroot"
70
+ [ -n "${NPM_CONFIG_PREFIX:-}" ] && cands="$cands
71
+ ${NPM_CONFIG_PREFIX}/lib/node_modules"
72
+ cands="$cands
73
+ ${BUN_INSTALL:-${HOME:-}/.bun}/install/global/node_modules"
74
+ for prefix in "${HOMEBREW_PREFIX:-}" /opt/homebrew /usr/local /home/linuxbrew/.linuxbrew; do
75
+ [ -n "$prefix" ] || continue
76
+ cands="$cands
77
+ $prefix/Cellar/loki-mode
78
+ $prefix/opt/loki-mode
79
+ $prefix/lib/node_modules"
80
+ done
81
+ while IFS= read -r cand; do
82
+ [ -n "$cand" ] || continue
83
+ cand="$(_loki_skill_dir_p "$cand")" || continue
84
+ [ "$root_p" = "$cand" ] && return 0
85
+ case "$root_p" in "$cand"/*) return 0 ;; esac
86
+ done <<EOT
87
+ $cands
88
+ EOT
89
+ printf 'running install %s is not a durable global install (npm global, bun global or Homebrew)' "$root_p"
90
+ return 1
91
+ }
92
+
24
93
  loki_skill_link_heal() {
25
94
  [ "${LOKI_NO_SKILL_LINK_HEAL:-}" = "1" ] && return 0
26
- local root="${1:-}" home="${HOME:-}" root_p rel link tgt live_p tmp
95
+ local root="${1:-}" home="${HOME:-}" root_p rel link tgt live_p tmp durable="" why
27
96
  [ -n "$root" ] && [ -n "$home" ] || return 0
28
97
  [ -f "$root/SKILL.md" ] || return 0
29
98
  root_p="$(cd "$root" 2>/dev/null && pwd -P)" || return 0
@@ -39,6 +108,14 @@ loki_skill_link_heal() {
39
108
  live_p="$(cd "$link" 2>/dev/null && pwd -P)" || live_p=""
40
109
  [ "$live_p" = "$root_p" ] && continue
41
110
  fi
111
+ if [ -z "$durable" ]; then
112
+ if why="$(_loki_skill_root_durable "$root_p")"; then
113
+ durable=yes
114
+ else
115
+ printf 'loki: not repointing skill links: %s\n' "$why" >&2
116
+ return 0
117
+ fi
118
+ fi
42
119
  tmp="${link}.heal.$$"
43
120
  rm -f "$tmp" 2>/dev/null
44
121
  ln -s "$root_p" "$tmp" 2>/dev/null || continue
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "11.2.2"
10
+ __version__ = "11.3.0"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -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.2.2. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.3.0. Do not edit by hand.
4
4
  Hidden and legacy-only commands are omitted; see `docs/v10/CLI-MODERN.md` for the full inventory.
5
5
 
6
6
  | Command | Description |
@@ -2,7 +2,7 @@
2
2
 
3
3
  The flagship product of [Autonomi](https://www.autonomi.dev/). Loki Mode is a spec-driven autonomous builder with a built-in trust layer that takes any spec to a deployed product and verifies completion with evidence (quality gates plus a completion council), not just a "done" claim. Complete installation instructions for all platforms and use cases.
4
4
 
5
- **Version:** v11.2.2
5
+ **Version:** v11.3.0
6
6
 
7
7
  **Engine note:** `loki "<task>"`, `loki owner/repo#N` and `loki quick` run the Loki 10 engine. `loki start` still routes to the legacy engine, which is being removed (planned work resumes 2026-10-07); prefer `loki owner/repo#N`. See [docs/v10/GUIDE.md](v10/GUIDE.md).
8
8
 
@@ -344,6 +344,9 @@ L0 review rule (ENGINE-LAWS.md L0): a fix that adds an `if` or a regex about the
344
344
  - Siblings: swept every place Loki writes an install-time path. Provider skill links ~/.claude, ~/.codex, ~/.cline, ~/.aider skills/loki-mode (all four covered by the shared mechanism); `cmd_remote` ln -sf of the Claude skill link in autonomy/loki (only creates when SKILL.md is absent, covered by the same repair on the next run); shell completions via `completion --postinstall` and the shim (already self-healing, stamped by VERSION in ~/.loki/completions-version); no PATH shims or bin links are written by Loki (the package manager owns bin/loki). Real directories and foreign links are deliberately left to doctor.
345
345
  - Mechanism of the fix: autonomy/lib/skill-link-heal.sh `loki_skill_link_heal` repoints a symlink only when its target is a Loki install path (node_modules/loki-mode or a Homebrew loki-mode dir) that is missing or is a different install than the running one, and only when the running root is itself an install path. Atomic temp link plus rename, one stderr line, silent no-op when correct, LOKI_NO_SKILL_LINK_HEAL=1 opts out. Called from bin/loki-postinstall.js (install and upgrade) and the bin/loki shim (first run).
346
346
  - Fixture: tests/test-skill-link-heal.sh (dangling, other install, real dir, foreign link, correct link, opt-out, dev checkout), red before autonomy/lib/skill-link-heal.sh existed.
347
+ - Amendment (FC30-DURABLE): the repair repointed to WHATEVER install was running, so a one-off `npx loki-mode@x` or a scratch-prefix install would hijack the user's link to a path that later disappears and dangles again. Rule: repoint only when the running install is durable (under `npm root -g`, the bun global dir, or a Homebrew prefix). An npx cache (_npx), a temp dir or any other prefix is refused with one stderr line and the link is left untouched. The rule lives only in autonomy/lib/skill-link-heal.sh (`_loki_skill_root_durable`); there is no TS copy, and bin/loki-postinstall.js and the bin/loki shim both call it. The check runs only on the repair path, so the steady state stays subprocess-free.
348
+ - Amendment siblings swept: other Loki writers that derive a user-owned path from the running install location: `cmd_remote` ln -sf of the Claude skill link (creates only when SKILL.md is absent; shares the same later repair, no repoint from the running root); shell completions (stamped by VERSION, content not install-path dependent); no PATH shim or bin link is written by Loki. No other self-repair writes from the running root.
349
+ - Amendment fixture: tests/test-skill-link-heal.sh cases 8-12 (npx cache refused, temp or arbitrary prefix refused, brew prefix healed, bun global healed, foreign link untouched), red on the npx and temp cases before the fix (11 passed, 2 failed), with npm stubbed and HOME and HOMEBREW_PREFIX faked.
347
350
 
348
351
  ## FC-31 A slice gate skips the suites that guard its own files, and main goes red in Tier B
349
352
  - User saw: main 27447cf46 failed Tier B on tests/test-doctor-blocker-parity.sh (run 37697291383). The slice R1-20 (8ff988516) changed loki-ts/src/commands/doctor.ts and gated only on tsc and bun test. The local-ci fast tier had timed out (rc=124) on a loaded host, so no shell suite ran.
@@ -370,3 +373,11 @@ L0 review rule (ENGINE-LAWS.md L0): a fix that adds an `if` or a regex about the
370
373
  - Mechanism: `_loki_bun_delegate <cmd> "$@"` in autonomy/loki (bun resolved PATH then @oven/bun-*, dist then src, `version` preflight under 5s, then exec). Doctor is the first command moved onto it; bash keeps only a minimal "bun route unavailable" diagnostic. `cmd_control` is the precedent. Remaining twins move onto the same helper as their slices land.
371
374
  - Known gap: the delegate preflight only runs `<cli> version`. A throw inside doctor.ts AFTER the CLI loads (during the doctor run itself) is not covered by the preflight and surfaces as that crash, not the minimal fallback.
372
375
  - Fixture: tests/test-doctor-single-impl.sh.
376
+
377
+ ## FC-34 Test imports a temp copy of src in-process under bun --coverage
378
+ - User saw: Tier B on main 83109bc1a failed in "Bun tests on ubuntu-latest bun=1.3.13" (`cd loki-ts && bun test --coverage`): every test printed (pass), no (fail) line and no summary, the output stopped mid coverage table and the job ended "exit code 1". The table was full of /tmp/loki-rmx-*/src/... rows. Raw view: a green test list with a dead process.
379
+ - Law: L2 (a verdict must be produced by the runner, not lost with it), L0 (the harness must not depend on a reporter surviving deleted files).
380
+ - Cause (measured): loki-ts/tests/engine10/route_matrix_mutation.test.ts (e49c7d29f) copies src into a mkdtemp dir 31 times and route_matrix_lib.ts matrixViolations(root) dynamically imports those copies in the test process; afterAll removes the dirs before the coverage reporter reads them. macOS exits 0 but prints 2170 loki-rmx rows; Linux died after 4 dirs.
381
+ - Siblings swept: grep of loki-ts/tests and loki-ts/test for in-process dynamic imports from tmp/mkdtemp roots and for cpSync tests that import. Only route_matrix_lib.ts (lines 57-60, 178-179) imports from a variable root. graph.test.ts and providers.test.ts copy fixtures, not src; providers.test.ts imports real src inside a spawned script. route_matrix.test.ts passes the real src dir, which coverage tracks normally. No other hits.
382
+ - Mechanism: the mutation test evaluates each copy through `Bun.spawn([process.execPath, route_matrix_child.ts, root])` (no --coverage), reading violations as JSON. A non-zero exit or unparsable output throws, so a crashed child can never pass a red case or the control case vacuously.
383
+ - Fixture: the "FC-34 guard" describe block in loki-ts/tests/engine10/route_matrix_mutation.test.ts (red when the file imports route_matrix_lib in-process or does `await import(join(root` against a temp root; verified red by reverting the fix locally).