loki-mode 11.157.0 → 11.159.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 (69) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/route.sh +1 -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/dev/architecture-reference.md +11 -0
  8. package/loki-ts/dist/loki.js +1999 -1972
  9. package/mcp/__init__.py +1 -1
  10. package/package.json +2 -2
  11. package/packages/control-plane/dist/server.js +2469 -2036
  12. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  13. package/web-app/dist/assets/{AdminPage-Dtr9qXAr.js → AdminPage-4t6REr4U.js} +1 -1
  14. package/web-app/dist/assets/{Avatar-Bbd5nIIQ.js → Avatar-D4wpxSfU.js} +1 -1
  15. package/web-app/dist/assets/{Badge-KlCR8eBL.js → Badge-P2SnNuxp.js} +1 -1
  16. package/web-app/dist/assets/{Button-CuvgSS4G.js → Button-BpLBSSH4.js} +1 -1
  17. package/web-app/dist/assets/{CockpitPage-DoEOdgP2.js → CockpitPage-DV41vgwC.js} +1 -1
  18. package/web-app/dist/assets/{ComparePage-kHjdfoWo.js → ComparePage-CoKK_Mc3.js} +1 -1
  19. package/web-app/dist/assets/{ErrorBoundary-Cdm7nC6_.js → ErrorBoundary-B1H2uq3y.js} +1 -1
  20. package/web-app/dist/assets/{EvidenceReceiptPanel-Cy4gJTfN.js → EvidenceReceiptPanel-DIGLEUvk.js} +1 -1
  21. package/web-app/dist/assets/{GitHubIssuesPanel-CoaeSXOe.js → GitHubIssuesPanel-Q-iSkPtP.js} +1 -1
  22. package/web-app/dist/assets/{GitHubPRsPanel-CQJCoIz_.js → GitHubPRsPanel-BrlojVYu.js} +1 -1
  23. package/web-app/dist/assets/{HomePage-3XZPfCSJ.js → HomePage-Xqyhcces.js} +2 -2
  24. package/web-app/dist/assets/{LoginPage-BNSbxeMm.js → LoginPage-D5QXPief.js} +1 -1
  25. package/web-app/dist/assets/{MagicPage-WWH7SwfZ.js → MagicPage--N9Ulhm3.js} +1 -1
  26. package/web-app/dist/assets/{MetricsPage-Cjvh-jSf.js → MetricsPage-BbkHyH9j.js} +1 -1
  27. package/web-app/dist/assets/{NotFoundPage-CgL4EF3d.js → NotFoundPage-CPq6tR8H.js} +1 -1
  28. package/web-app/dist/assets/{ProjectPage-B2y6gBfZ.js → ProjectPage-DHUCsQDt.js} +3 -3
  29. package/web-app/dist/assets/{ProjectsPage-BTagWO2i.js → ProjectsPage-B1LZbJG-.js} +1 -1
  30. package/web-app/dist/assets/{SettingsPage-WmRElM3E.js → SettingsPage-CN9fM0_r.js} +1 -1
  31. package/web-app/dist/assets/{ShowcasePage-wQ-VZyW1.js → ShowcasePage-BjZaGd88.js} +1 -1
  32. package/web-app/dist/assets/{SystemSettingsPage-CkoLiTvO.js → SystemSettingsPage-DTMAfwAZ.js} +1 -1
  33. package/web-app/dist/assets/{TeamsPage-D-LHZsn9.js → TeamsPage-CibVk-G-.js} +1 -1
  34. package/web-app/dist/assets/{TemplatesPage-DuRKmn-s.js → TemplatesPage-CQnxrlyH.js} +1 -1
  35. package/web-app/dist/assets/{TerminalOutput-2PXo3eS2.js → TerminalOutput-D_iUzQto.js} +1 -1
  36. package/web-app/dist/assets/{activity-D3TUBclR.js → activity-DoxxKwzi.js} +1 -1
  37. package/web-app/dist/assets/{bell-BDl1J6X-.js → bell-DpKux6kB.js} +1 -1
  38. package/web-app/dist/assets/{bot-CHoQ0cL1.js → bot-DDtWlaBR.js} +1 -1
  39. package/web-app/dist/assets/{check-BuGreETS.js → check-Bqe66E6e.js} +1 -1
  40. package/web-app/dist/assets/{chevron-left-Dkf6mFUB.js → chevron-left-DGE-739G.js} +1 -1
  41. package/web-app/dist/assets/{circle-alert-WFj2TQ9c.js → circle-alert-CB95wIch.js} +1 -1
  42. package/web-app/dist/assets/{clock-Bn6QW9zr.js → clock-DtW_sMIs.js} +1 -1
  43. package/web-app/dist/assets/{cloud-Yzjfx2Bv.js → cloud-DSrTBp5o.js} +1 -1
  44. package/web-app/dist/assets/{code-xml-CtpDC2I8.js → code-xml-tycXD2N7.js} +1 -1
  45. package/web-app/dist/assets/{database-Datydoc-.js → database-qY6k-0_t.js} +1 -1
  46. package/web-app/dist/assets/{dollar-sign-BCJkxKs6.js → dollar-sign-EB3BldhM.js} +1 -1
  47. package/web-app/dist/assets/{file-code-corner-gbgUZQ60.js → file-code-corner-BdibGlX5.js} +1 -1
  48. package/web-app/dist/assets/{file-plus-B-Ah_CpZ.js → file-plus-Cbg1Z0-Q.js} +1 -1
  49. package/web-app/dist/assets/{globe-Bst-IJOg.js → globe-Dl_ePXOr.js} +1 -1
  50. package/web-app/dist/assets/{hammer-CcKIK3jL.js → hammer-BoxzbeDo.js} +1 -1
  51. package/web-app/dist/assets/{index-DtmaWxTZ.js → index-Dq89IeXS.js} +3 -3
  52. package/web-app/dist/assets/{layers-BAdGUPGI.js → layers-CUXtROT-.js} +1 -1
  53. package/web-app/dist/assets/{loader-circle-CzTwEeEV.js → loader-circle-ffWSDFna.js} +1 -1
  54. package/web-app/dist/assets/{lock-B5s3sYxt.js → lock-ed4QSXzR.js} +1 -1
  55. package/web-app/dist/assets/{package-BwP9xtUT.js → package-x5BMt8tn.js} +1 -1
  56. package/web-app/dist/assets/{plus-BkTkRvnl.js → plus-B5yO9Pw6.js} +1 -1
  57. package/web-app/dist/assets/{refresh-cw-vZWSQT4C.js → refresh-cw-BUQpCMty.js} +1 -1
  58. package/web-app/dist/assets/{rotate-ccw-BfiOpKkJ.js → rotate-ccw-CRa-q1MZ.js} +1 -1
  59. package/web-app/dist/assets/{scroll-text-0F2pJrT7.js → scroll-text-u06AYazi.js} +1 -1
  60. package/web-app/dist/assets/{server-DKTp6Lsg.js → server-DMUq0K5k.js} +1 -1
  61. package/web-app/dist/assets/{shield-alert-DpL3knlY.js → shield-alert-BKrdJYSJ.js} +1 -1
  62. package/web-app/dist/assets/{thumbs-up-CRr5J1fb.js → thumbs-up-IYywEn-u.js} +1 -1
  63. package/web-app/dist/assets/{trash-2-MhZJBf3n.js → trash-2-rIFdA3XE.js} +1 -1
  64. package/web-app/dist/assets/{trending-down-DL8xT5IX.js → trending-down-D-df-or3.js} +1 -1
  65. package/web-app/dist/assets/{trending-up-Ciy20G6q.js → trending-up-DmlGQFRC.js} +1 -1
  66. package/web-app/dist/assets/{upload-BlJIPegj.js → upload-COeblp8V.js} +1 -1
  67. package/web-app/dist/assets/{usePolling-CxQ0uJJk.js → usePolling-DxzXSOK8.js} +1 -1
  68. package/web-app/dist/assets/{user-C0ktPCL2.js → user-CdBkKYlR.js} +1 -1
  69. 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.157.0
6
+ # Loki Mode v11.159.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.157.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
464
+ **v11.159.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.157.0
1
+ 11.159.0
package/autonomy/route.sh CHANGED
@@ -19,7 +19,7 @@ _ROUTE_OPTVAL_FLAGS=" --mirofish "
19
19
  # engine rather than configure it: the route still resolves (R_FRONT=1) but the dispatcher leaves the call to the front end.
20
20
  _ROUTE_FRONT_FLAGS=" --workspace --deploy --health-url --health-match --auto-rollback --destination --canary --domain "
21
21
  # Flags engine10 honors as-is.
22
- _ROUTE_E10_FLAGS=" --no-pr --deep --verified --json --verbose --quiet --resume --provider --max-cost --spec --attempts --seal-existing --detach -d "
22
+ _ROUTE_E10_FLAGS=" --no-pr --deep --verified --json --verbose --quiet --resume --provider --max-cost --spec --attempts --seal-existing --detach -d --base-current "
23
23
  # The largest PRD engine10 takes: it carries the task in env vars and CLI arguments (with a context pack added under
24
24
  # --session-model), and Linux caps one string at 128 KiB. A bigger PRD runs on the legacy engine, or is refused under
25
25
  # SDK mode with claude (the legacy engine has no SDK path).
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.157.0"
10
+ __version__ = "11.159.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.157.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.159.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.157.0
5
+ **Version:** v11.159.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
 
@@ -197,6 +197,7 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
197
197
  - `LOKI_E10_BASE_MEMO` -- on by default, `0` opts out (fl24; `loki-ts/src/engine10/stages/verify.ts` baseMemo in subtractBase). Base reruns are kept in `.loki/runs/<id>/base-runs.json`, bound to the base sha and to whether dependency dirs were linked, and reused by later verifies of the same run.
198
198
  - `LOKI_E10_ONE_BASE_RUN` -- on by default, `0` opts out (acc-171; `loki-ts/src/runner/repo_profile.ts` repoRelCmd, used by baselineSuites rootSpeaks, baseFor and suiteEmptyOnBase). A command whose first word is the repo dir's absolute path is compared with the repo prefix dropped, so the root baseline speaks for the root package suite and intake runs it once.
199
199
  - `LOKI_E10_EVIDENCE_PER_PACKAGE` -- on by default, `0` opts out (acc-147; `loki-ts/src/engine10/testmap.ts` buildTestMap marks, `loki-ts/src/util/test_file_text.ts` scopeRunnersByPackage). Package scoping grants a runner to every package that owns a file proving it (go.mod, Cargo.toml, a test file), not only to the package of the first such file listed. Without it a multi-module repo whose nested module sorts first (go-chi/chi `_examples/rest/go.mod`) left the root module with no runner and 0 tests once the Project Model loaded. The 5 tuning repos' test maps are unchanged.
200
+ - `LOKI_E10_PY_IMPORT_RESOLVE` -- on by default, `0` opts out (`loki-ts/src/engine10/testmap.ts` buildTestMap pyImports, impactedRefs). A changed .py file keeps a test matched through an import only when the test's imports (dotted modules from the repo root or the test's directory, `from pkg import mod`, dotted strings such as monkeypatch targets) resolve to that file, or when the import resolves to no repo module or is relative; a JavaScript or TypeScript test never maps to a .py file. The test_<stem>.py name floor is unchanged. hermes-agent issue 155462: hermes_cli/gateway.py matched 772 tests by the basename "gateway" and verify ran out of time.
200
201
  - `LOKI_E10_ENCLOSING_DECL` -- on by default, `0` opts out (acc-147; `loki-ts/src/util/check_result.ts` changedSymbols / enclosingDecl, read by `stages/seal.ts` and `stages/verify.ts`). When a hunk declares nothing and git's `@@` context names nothing (an edit inside an indented method: git's default funcname reads only unindented lines, and JS/TS has no built-in driver), the enclosing declaration is read from the head file. Hunks whose context already names a declaration are unchanged. Without it the lean gate and the fail-then-pass proof read "(no declared symbol)" and a run with a real fail-then-pass test stayed PARTIAL (commander.js).
201
202
  - `LOKI_E10_ASSERT_JS` -- on by default, `0` opts out (acc-148; `loki-ts/src/util/check_result.ts` assertionFailure / jsAssertionFailure, read by the fail-then-pass proof in `stages/seal.ts`). node:test, jest and mocha failures on the base count as red by assertion when the output carries an assertion (ERR_ASSERTION, AssertionError, `expect(received).<matcher>`) and no missing-API or load failure (not a function or constructor, ReferenceError, SyntaxError, a missing module or export, a suite that failed to run). Before it, only pytest, vitest and go were read, so a real fail-then-pass on these runners never counted (commander.js).
202
203
  - `LOKI_E10_SPAWN_NOT_RUN` -- on by default, `0` opts out (acc-148; `loki-ts/src/util/check_result.ts` spawnFailedTool, read by `stages/verify.ts` runOnce). A check whose tool could not start (uv's "Failed to spawn", a shell exit 127 "command not found", node's "spawn X ENOENT") is not_run with the tool named, never a failure, when that is essentially the whole output (at most 6 non-empty lines). Before it, `uv run -- ruff check` without ruff installed read as a lint failure that fix rounds chased (marshmallow, Python-Markdown).
@@ -259,6 +260,16 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
259
260
  - `LOKI_E10_DEFECT_PIN` -- existing assertions that pin the wrong value the issue reports are listed in the implement brief, and a pure value replacement of exactly such an assertion is not counted as a weakened test (it never counts as fail-then-pass proof, and the receipt always lists the rewrite). `=0` turns both off. Code: `findDefectPins` in `loki-ts/src/e10ext/context.ts`, `pinLift` in `loki-ts/src/engine10/stages/seal.ts`.
260
261
  - `LOKI_E10_ATTEMPTS` and `LOKI_E10_ATTEMPTS_EARLY` stay off by default (N=1) until the bench decides; the older form (2 extra attempts after a red verify) raised cost per run 17-47% on the v131 ledger with no accuracy evidence.
261
262
 
263
+ ## Pull request base and target (`loki-ts/src/util/base_guard.ts`, PR-BASE)
264
+
265
+ The label must describe exactly what the pull request merges. Three places hold that, all on one measurement (`prScope`: files from `merge-base(target, head)` to head, commits in `target..head`, against the run's `base_sha..head`).
266
+
267
+ - Start (`prBasePlan`, called by `engine10/supervisor.ts` before the header, pull request runs only). HEAD already in the target: nothing changes and nothing is fetched. Otherwise the target is fetched once and the run (a) starts from the target tip when the tracked tree is clean (intake creates `loki/<run>` from that commit; the user's branch is never moved), (b) with `--base-current` or `LOKI_BASE_CURRENT=1` builds on the current branch and targets it (`LOKI_PR_BASE` is set to the branch) when origin has the branch and HEAD is in it, or (c) exits 2 with the reason and two commands. A dirty tracked tree is refused by intake as before; a detached HEAD starts from its commit as before and the seal holds its label.
268
+ - Seal (`sealPrScope`, one open note in `engine10/stages/seal.ts`): a difference holds the label at PARTIAL and the receipt records `pr_base` (target, target_sha, merge_base, base_sha, pr_files, measured_files, pr_commits, measured_commits, mode, start_branch, line). The key is absent on a run that opens no pull request.
269
+ - Pull request stage (`prScopeGate` in `engine10/stages/pr.ts`, called first in `runPr`): the same measurement after fetching the target; a difference that appeared after the seal opens the pull request as a draft with the reason.
270
+ - `--base-current` / `LOKI_BASE_CURRENT=1` -- build on the current branch; the pull request targets that branch. Off by default.
271
+ - `LOKI_E10_START_FROM`, `LOKI_E10_PR_TARGET` -- set by the supervisor for its own worker (the commit to start from, the target ref); never inherited from the caller's environment.
272
+
262
273
  ## Worktree substrate (autonomy/lib/worktree_prep.py)
263
274
 
264
275
  `prepare_worktree(source_repo, dest, branch, setup=None, base=None)` creates an isolated git worktree and returns `{path, base_sha, deps, left_out_changes, deps_skipped}`. The start point is `origin/HEAD` after a fetch (when a remote exists), else HEAD. Uncommitted edits in the source checkout are never carried or stashed; their count is reported as `left_out_changes`. An fcntl lock at `~/.loki/repos/<slug>.lock` covers fetch and worktree add. Dependencies: a `setup` command run in the worktree, else a copy-on-write copy of ignored top-level `node_modules`, `.venv`, `venv`, `vendor` (a dir holding absolute symlinks or editable finders is never copied: it (or whose copy fails, with the partial copy removed) is left out, named in `deps_skipped`, `deps` is `skipped`, and the session installs it; a declared `setup` still fails hard), else `none`. CLI: `python3 autonomy/lib/worktree_prep.py SRC DEST BRANCH [--setup CMD] [--base REF]` prints the result as JSON. Callers: `autonomy/lib/backlog.py` (logs skipped deps), `autonomy/lib/workspace.py` (passes the entry `setup`) and `dashboard/api_start.py`.