loki-mode 11.154.0 → 11.156.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/dashboard/__init__.py +1 -1
  4. package/docs/CLI-REFERENCE.md +1 -1
  5. package/docs/INSTALLATION.md +1 -1
  6. package/docs/dev/architecture-reference.md +3 -1
  7. package/loki-ts/dist/loki.js +1946 -1937
  8. package/mcp/__init__.py +1 -1
  9. package/package.json +2 -2
  10. package/packages/control-plane/dist/server.js +3752 -2720
  11. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  12. package/web-app/dist/assets/{AdminPage-DiYv9QX3.js → AdminPage-CnEl1LJ0.js} +1 -1
  13. package/web-app/dist/assets/{Avatar-D8xgDhXi.js → Avatar-nR_QigXF.js} +1 -1
  14. package/web-app/dist/assets/{Badge-B9uBTN7K.js → Badge-B-Dei4TU.js} +1 -1
  15. package/web-app/dist/assets/{Button-BJkNLiWh.js → Button-CxjxI-uw.js} +1 -1
  16. package/web-app/dist/assets/{CockpitPage-DG23RV4T.js → CockpitPage-D8tmzOFq.js} +1 -1
  17. package/web-app/dist/assets/{ComparePage-CY9mcXyY.js → ComparePage-D8CXHyX0.js} +1 -1
  18. package/web-app/dist/assets/{ErrorBoundary-COHsdbJf.js → ErrorBoundary-Bj-_6IRg.js} +1 -1
  19. package/web-app/dist/assets/{EvidenceReceiptPanel-B4PseFey.js → EvidenceReceiptPanel-BNMf9o_x.js} +1 -1
  20. package/web-app/dist/assets/{GitHubIssuesPanel-D0KfNlW2.js → GitHubIssuesPanel-7m921nqb.js} +1 -1
  21. package/web-app/dist/assets/{GitHubPRsPanel-CDPAE9fn.js → GitHubPRsPanel-BOa-Qw0J.js} +1 -1
  22. package/web-app/dist/assets/{HomePage-aKEHtjps.js → HomePage-DUR58xru.js} +2 -2
  23. package/web-app/dist/assets/{LoginPage-Dz3tkjNe.js → LoginPage-DMeC_PZP.js} +1 -1
  24. package/web-app/dist/assets/{MagicPage-CwX7Qveh.js → MagicPage-BH_PUkIC.js} +1 -1
  25. package/web-app/dist/assets/{MetricsPage-BPn1kGrY.js → MetricsPage-DrX-1vg9.js} +1 -1
  26. package/web-app/dist/assets/{NotFoundPage-yN4E_E9L.js → NotFoundPage-CJvcnXIn.js} +1 -1
  27. package/web-app/dist/assets/{ProjectPage-DGozzUjl.js → ProjectPage-CcJGiv7r.js} +3 -3
  28. package/web-app/dist/assets/{ProjectsPage-CKfZ9HqL.js → ProjectsPage-D-dpezwE.js} +1 -1
  29. package/web-app/dist/assets/{SettingsPage-CZwkXq9s.js → SettingsPage-DP7btA4h.js} +1 -1
  30. package/web-app/dist/assets/{ShowcasePage-DMT87b7c.js → ShowcasePage-u7Rfj0wj.js} +1 -1
  31. package/web-app/dist/assets/{SystemSettingsPage-DXQECr0D.js → SystemSettingsPage-DEeW2RLu.js} +1 -1
  32. package/web-app/dist/assets/{TeamsPage-BToX86gg.js → TeamsPage-CIUHZTj2.js} +1 -1
  33. package/web-app/dist/assets/{TemplatesPage-BOsPainh.js → TemplatesPage-CYc3d0tK.js} +1 -1
  34. package/web-app/dist/assets/{TerminalOutput-BpUH2T2I.js → TerminalOutput-DPxVMWCr.js} +1 -1
  35. package/web-app/dist/assets/{activity-3fblzNUj.js → activity-Bsy01YfY.js} +1 -1
  36. package/web-app/dist/assets/{bell-mA0pgtzl.js → bell-D8DFcv4d.js} +1 -1
  37. package/web-app/dist/assets/{bot-vQONIYoS.js → bot-CacWSWwY.js} +1 -1
  38. package/web-app/dist/assets/{check-BrEJZqtS.js → check-DmLCcg4h.js} +1 -1
  39. package/web-app/dist/assets/{chevron-left-50IJvv4C.js → chevron-left-DSg7_Nm8.js} +1 -1
  40. package/web-app/dist/assets/{circle-alert-D9syjc3B.js → circle-alert-KccjUQRt.js} +1 -1
  41. package/web-app/dist/assets/{clock-BboMPS77.js → clock-Bnz3wpmw.js} +1 -1
  42. package/web-app/dist/assets/{cloud-DDEp4yUM.js → cloud-Bv1pXMGJ.js} +1 -1
  43. package/web-app/dist/assets/{code-xml-CAtMXik8.js → code-xml-Hub3vAtf.js} +1 -1
  44. package/web-app/dist/assets/{database-CAOqYM1E.js → database-BDbyQiYL.js} +1 -1
  45. package/web-app/dist/assets/{dollar-sign-DOdmdqOB.js → dollar-sign-AN4S0rjL.js} +1 -1
  46. package/web-app/dist/assets/{file-code-corner-BPAksle-.js → file-code-corner-C9I5wdgG.js} +1 -1
  47. package/web-app/dist/assets/{file-plus-CBmhCe_9.js → file-plus-BuoFKaIH.js} +1 -1
  48. package/web-app/dist/assets/{globe-ZsWZvCkr.js → globe-Cr8TvGwy.js} +1 -1
  49. package/web-app/dist/assets/{hammer-SbKfTPb3.js → hammer-Dyl7781L.js} +1 -1
  50. package/web-app/dist/assets/{index-C74Su7jP.js → index-Bvn4cBwL.js} +3 -3
  51. package/web-app/dist/assets/{layers-Cv_FErq-.js → layers-C9TmHkcI.js} +1 -1
  52. package/web-app/dist/assets/{loader-circle-dIPyEfsE.js → loader-circle-Djb2m9Hu.js} +1 -1
  53. package/web-app/dist/assets/{lock-CGAxTxO5.js → lock-Boqvd0Nw.js} +1 -1
  54. package/web-app/dist/assets/{package-CgvIF1Ku.js → package-CP7-aoul.js} +1 -1
  55. package/web-app/dist/assets/{plus-_3FKv0NS.js → plus-B5u1_pj4.js} +1 -1
  56. package/web-app/dist/assets/{refresh-cw-Bnb0_V6n.js → refresh-cw-SRzZ5IqE.js} +1 -1
  57. package/web-app/dist/assets/{rotate-ccw-ZLvlePsk.js → rotate-ccw-BatXNjHV.js} +1 -1
  58. package/web-app/dist/assets/{scroll-text-BPFgZCbN.js → scroll-text-B57TlwdW.js} +1 -1
  59. package/web-app/dist/assets/{server-H0O63Cgk.js → server-BsD10iWD.js} +1 -1
  60. package/web-app/dist/assets/{shield-alert-DZ91-CiS.js → shield-alert-Cu62bdJA.js} +1 -1
  61. package/web-app/dist/assets/{thumbs-up-DPoDpxQt.js → thumbs-up-DsprGKjp.js} +1 -1
  62. package/web-app/dist/assets/{trash-2-Da4bSFuC.js → trash-2-BTduWSwY.js} +1 -1
  63. package/web-app/dist/assets/{trending-down-CcnmOjB2.js → trending-down-CdhKHs5h.js} +1 -1
  64. package/web-app/dist/assets/{trending-up-NzCUunlQ.js → trending-up-DePgEFVD.js} +1 -1
  65. package/web-app/dist/assets/{upload-Cy_koNIe.js → upload-eZURGOKq.js} +1 -1
  66. package/web-app/dist/assets/{usePolling-CgA0f7-y.js → usePolling-CKmytDcn.js} +1 -1
  67. package/web-app/dist/assets/{user-DkwhGZ5j.js → user-CvDfX-rr.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: 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.154.0
6
+ # Loki Mode v11.156.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.154.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
464
+ **v11.156.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.154.0
1
+ 11.156.0
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.154.0"
10
+ __version__ = "11.156.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.154.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.156.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.154.0
5
+ **Version:** v11.156.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
 
@@ -155,6 +155,8 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
155
155
  - `LOKI_E10_REPO_CONVENTIONS` -- OFF by default until measured, `1` turns it on (RC; `repoConventionFlags`, `precommitFlags`, `guideBans`, `banFlags` in `loki-ts/src/features/self_review.ts`, self-check item (i) "conventions"). Runs the repository's own convention checks on the change, with no install and no model. (1) The local hooks of `.pre-commit-config.yaml` that need no environment: `language: fail` (a changed file matching `files` and not `exclude` is rejected with the hook's entry text) and `pygrep` (the entry regex found in an added line, `--ignore-case` honored). Python regexes are translated: `(?x)` verbose mode and `(?P<name>` groups. Hooks with an install, unknown `types` or other args are skipped. (2) The contribution guide's explicit bans, "never use `X`" / "do not use `X`" / "don't use `X`" for an identifier-shaped X, as a whole-word grep of added code lines with comments and string literals removed. Import and export lines are skipped, the guide's own "only exception is `X Y`" is exempt, and so is a use whose surrounding text the file already has on base (the repository's established usage, such as recharts' `DataKey<any>`). A hit flags the item, so the one review turn gets the hook's message or the rule. Replay on dev4 and dev2: verdicts/repo-conventions.md.
156
156
  - `LOKI_E10_SR_COVERAGE` -- on by default since 11.141.3 (measured on dev2, 2 seeds, GOALS A3.2), `0` opts out (SC; `statedCases`, `caseCovered`, `siblingDefinitions` in `loki-ts/src/features/self_review.ts`). Two more self-check items, computed only when the diff changes source: (f) stated cases, kept to fenced code blocks that show an error or a result (an error or exception token, a `// =>` result comment, or an expected/actual/output/returns/raises line right after the block) and four sentence forms ("similar error when ...", "... has the same effect", "both `x` and `y`" with a code token, "gets neither treatment"); a block case is covered when an added test line carries one of the block's called names, a sentence case when an added test line carries one of its backticked tokens, and a sentence with no code token is always flagged; at most 8 cases. (g) sibling definitions: other definitions, by name, of the function or method enclosing each changed hunk (Python, JS/TS, Go, Rust), in untouched non-test files of the same language, outside vendored or built dirs; a name with more than 5 such definitions, and common names (`__init__`, `constructor`, `main` ...), are dropped. Either flag starts the existing single `-rv` review turn, whose brief adds items (f) and (g) and accepts `REVIEW f|g` lines; a clean minimal diff still starts no turn. The failure: on a held-out style dev set Loki fixed the headline case and missed a stated one (a "similar error when wrapping it in ..." edge, a "... has the same effect" sentence, the issue's own error reproduction) or a sibling override in a subclass, while a stronger raw model covered them; expected reach 3-4 of those 6 losses, unmeasured.
157
157
  - `LOKI_E10_DOC_ENUM` -- on by default since 11.141.3 (measured on dev2, 2 seeds, GOALS A3.2), `0` opts out (DE; `docEnumerations` in `loki-ts/src/features/self_review.ts`, self-check item (h) "docs"). A Markdown file in a changed source file's directory, or a `docs/` page named after its directory or file, that the diff leaves untouched and that already names at least 2 of the option keys or quoted names the source file holds on base, is flagged when the change adds a new key or name the doc does not carry. The flag starts the existing single review turn (brief item (h), reply `REVIEW h`). The failure: a change added a secondary option to two rules and left each rule's README, which lists every other option, without it.
158
+ - `LOKI_E10_REPO_GUIDES` -- on by default, `0` opts out (`loki-ts/src/project_model/guides.ts`, the one reader; used by `discoverCommands` in `runner/repo_profile.ts`, `commandFor` and `fullSuiteCmd` in `util/check_result.ts`, `packageSuiteSpecs` in `project_model/package_suite.ts`). Intake reads AGENTS.md, CLAUDE.md, CONTRIBUTING.md, README.md, the justfile and `scripts/` of the repository root and of each directory that holds a guide (no model call) and keeps the reading for the run (`snapshotGuides`, in process and in `.loki/state/repo-guides.json`), so a session that edits a guide changes nothing. A command is read only from a code span or fenced block beside a test or setup word, and must be a script file inside the checkout, a Makefile target, a justfile recipe or a package.json script; Loki runs the normalized form, never the guide's arguments. A documented script tied to a runner (its text names pytest, vitest and so on) replaces the discovered per-file and suite command for that runner (never for Go); a documented make, just or package-script command replaces it only when the guide forbids the discovered form. The documented command leads the repo profile (so it is the base comparison), a forbidden discovered command is dropped when a documented one stands in, and the guide files are part of the profile's manifest hash. Unsafe commands (delete, push, publish, sudo, global install, download piped into a shell, a path outside the checkout, any shell operator) are ignored and listed under the receipt's "not applicable" notes beside "test command from <file>:<line>". A test file of a package below the root with no documented command of its own runs through the root guide's command (from the root, repo-relative path) only when the root guide forbids the discovered form. A guide that forbids a form but names no command Loki can run leaves the discovered command running, with a receipt note. The documented command is an argv with the test file as its own word (a checkout script starts through `env`), so a caller's appended flag reaches the script. Setup commands are told to the model only ("if the tests cannot start, set up with ..."), and a brief that names the documented command carries no "Detected test interpreter" line. The brief line is `REPO_GUIDE_LEAD` plus `guideSentence` in `e10ext/context.ts` briefRecord: per-repository text, so it sits in the per-task context after the cache-stable rules prefix.
159
+ - `LOKI_E10_TEST_HOME_ISOLATION` -- unset means `xdg`; `0` opts out; `home` also moves HOME (`testHomeEnv` in `loki-ts/src/util/check_result.ts`, applied inside `plainTestEnv`, the one env of every harness-run test command; the model session never takes it). `xdg`: the four XDG base directories point at one directory owned by the worker process (under `$LOKI_SCRATCH` when set, else a temp directory removed at exit), and toolchains that keep a cache or install under an XDG directory keep the real one through their own variable when the user has not set it (`UV_CACHE_DIR`, `UV_PYTHON_INSTALL_DIR`, `UV_TOOL_DIR`, `COREPACK_HOME`, `PRE_COMMIT_HOME`, `MISE_*`; on Linux also `GOCACHE`, `GOENV`, `PIP_CACHE_DIR`, `POETRY_CACHE_DIR`, `YARN_CACHE_FOLDER`, `PLAYWRIGHT_BROWSERS_PATH`, `CYPRESS_CACHE_FOLDER`, `DENO_DIR`, `HATCH_*`); the user's XDG git config stays readable through a link. `home` (opt-in): HOME points at that directory too, with `CARGO_HOME`, `RUSTUP_HOME`, `BUN_INSTALL`, `npm_config_cache`, `GOPATH`, `GOMODCACHE`, `GOCACHE`, `GOENV`, `PIP_CACHE_DIR`, pyenv, nvm, asdf, volta, gradle, dotnet, docker and the global git config pinned to the real locations, and on macOS a link to `~/Library/Python`. Not the default: tools that keep state under HOME with no variable of their own (for example `~/.m2`, `~/.ssh`, `~/.cache` users on macOS) are not covered.
158
160
  - `LOKI_E10_DOC_UPDATE_RULE` -- on by default since 11.141.3 (measured on dev2, 2 seeds, GOALS A3.2), `0` opts out (UD; `DOC_RULE_UPDATE` and `fixedRules` in `loki-ts/src/e10ext/context.ts`). The implement and fix rules no longer say "write no documentation": they say to write no new documentation pages unless asked, but to update existing docs that list what changed (an option, flag, method, rule or name a README or doc page already lists gets its entry, written like the entries around it). The never-announce-missing-behavior rule is unchanged. `=0` restores the v11.139.0 line byte for byte (`FIXED_RULES_DOC_V139`); either text is a constant, so the rules prefix stays cache-stable, and the legacy block (`LOKI_E10_PINNED_TEST_UPDATE=0`) keeps the old line. The failure: both Loki arms left a rule's README, which lists every option, without the added option, while every raw arm updated it.
159
161
  - `LOKI_E10_WALL_CASES` -- on by default since 11.141.3 (measured on dev2, 2 seeds, GOALS A3.2), `0` opts out (WC; `wallRequiredCases`, `wallCasesHanded` in `loki-ts/src/features/self_review.ts`, called from `stages/wall.ts`). The SC stated cases go to the Wall test writer as REQUIRED acceptance lines ("REQUIRED CASE n (stated in the issue; write a test that fails before the fix and passes after it): ..."), and the handoff is recorded in `<runDir>/wall-required-cases.json` (the fire marker). When the Wall then wrote tests, the self-check's stated-cases item reads `auto` (the Wall's sealed tests check the cases) instead of token-matching the model's own tests, which pass when they encode the model's wrong reading. With no Wall run the token match stays as the fallback. The sibling grep is unchanged.
160
162
  - `LOKI_E10_CHANGELOG_SCOPE` -- on by default, `0` opts out (CS; `briefChangelog` in `loki-ts/src/e10ext/scope.ts`, applied in `flagOutsideScope`). When the CL changelog-file convention applies, that changelog file is in scope for the advisory "outside stated scope" notes, so the entry the brief asked for is never called out of scope (`pr_lessons.ts` reads those notes). Every other unplanned file is still flagged. The failure: a run that added the required entry got "outside stated scope: CHANGELOG.md" on its receipt.
@@ -215,7 +217,7 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
215
217
  - `LOKI_E10_PROVE_REPAIR` -- on by default, `0` opts out (Q1 prove repair; `engine10/stages/prove.ts`). After the head pass, asks that are not proved (not those skipped by the endpoint check, nor "not run here") go back to the implement session through `util/conflict_resume.ts` resumeForProve (resumeWith, suffix `-pv<round>`, the last implement iteration and the saved implement brief, gated on RESUME_MIN_LEFT_S of implement time and 90 s of stage time) with `repairBrief` (each ask, its command and its reason); the sealed Wall files are restored after each resume and the same scripts rerun. At most two rounds; each is a `rounds` entry with its iteration id and a prove.ask per ask. The base pass runs after the last round.
216
218
  - F3 reviewer UNMET cap (no knob; Q1 F3; `loki-ts/src/engine10/stages/xreview.ts` isUnmetNote and parseReview, `stages/seal.ts` openNotes). A cross-review reason that says an asked-for line is unmet (`UNMET: ...`, the form util/intent_card.ts asks for) becomes an open note at seal, which caps VERIFIED at PARTIAL. parseReview sorts UNMET reasons ahead of the others before its 5-reason cap, so one written sixth is kept. The review levels, when the review runs and its prompt are unchanged; a run with no review is unchanged.
217
219
  - `LOKI_RERUN_GUARD` -- on by default, `0` opts out (Q1 F4; `loki-ts/src/commands/issues_run.ts` openLokiPrGuard, called by `engine10/supervisor.ts` right after the issue fetch, before startIssueEpic and any session). It lists the open pull requests with the same `gh pr list` and coveredIssues rule `loki issues run` dedupes by, and stops (exit 2) when one whose head is a `loki/` branch owned by the origin's owner covers the issue. A list that cannot be read stops the run (fail closed). It is skipped with `--no-pr`, when gh is not ready (publish already falls back to no PR) and when the origin is not a GitHub remote: a local mirror publishes `local://` branches, so no GitHub pull request can be duplicated and the hermetic tests and local-mirror runs are unaffected. It never writes to the pull request.
218
- - `LOKI_E10_CONTINUE_MAX` (default 4, `0` turns the resume off, at most 10) and `LOKI_E10_CONTINUE_MAX_USD` (default 1.00) -- Q1 S1b, claude provider only (CLI and SDK routes; opencode is unchanged). `loki-ts/src/engine10/session.ts` finishLineOf sets `markers.finishLine` from the last non-empty line of a session's final text (a literal `LOKI_DONE`, `LOKI_ALREADY_DONE:` or `LOKI_SPEC_CONFLICT:` line; a finish line quoted earlier or any other `LOKI_` token is not one); `markers.done` and its readers are unchanged. An implement session without a finish line is resumed in the same session through resumeWith (`util/conflict_resume.ts` resumeToFinish, suffix `-k<n>`), before the follow-up gates and the `-rv` turn, while each resume changes the tree (anti_loop.ts treeFingerprint), RESUME_MIN_LEFT_S holds, the count is under LOKI_E10_CONTINUE_MAX and the run's measured spend is under LOKI_E10_CONTINUE_MAX_USD (unmeasured spend, as on the CLI invoker, leaves only the count). The brief says the summary request is over, quotes the reply's last lines, names plan-scope files not in the tree and ends with FINISH_LINE. Each resume emits `s1b.resumed` {resume, iteration_id, compactions, finish_line}. A session still unfinished gets implement exit `incomplete`: no follow-up gate runs on it, the diff and the PR are kept, and seal adds `implement ended without a finish line (<why> after <n> resumes): <outstanding>` to the open notes, which caps VERIFIED at PARTIAL. The implement record carries `finish` {continues, ended, outstanding, spent_usd, compactions} only when S1b fired; compactions come from the SDK stream's system/compact_boundary (sdk_stream_parser.ts) and are null on the CLI route. Each resume is a new query, so the Haiku session caps (effort_policy.ts: implement 45 turns, 160K new tokens) start from zero per resume.
220
+ - `LOKI_E10_CONTINUE_MAX` (default 4, `0` turns the resume off, at most 10) and `LOKI_E10_CONTINUE_MAX_USD` (default 5.00) -- Q1 S1b, claude provider only (CLI and SDK routes; opencode is unchanged). `loki-ts/src/engine10/session.ts` finishLineOf sets `markers.finishLine` from the last non-empty line of a session's final text (a literal `LOKI_DONE`, `LOKI_ALREADY_DONE:` or `LOKI_SPEC_CONFLICT:` line; a finish line quoted earlier or any other `LOKI_` token is not one); `markers.done` and its readers are unchanged. An implement session without a finish line is resumed in the same session through resumeWith (`util/conflict_resume.ts` resumeToFinish, suffix `-k<n>`), before the follow-up gates and the `-rv` turn, while each resume changes the tree (anti_loop.ts treeFingerprint; one resume that changes nothing is allowed, the second in a row ends the loop), RESUME_MIN_LEFT_S holds, the count is under LOKI_E10_CONTINUE_MAX and the run's measured spend is under LOKI_E10_CONTINUE_MAX_USD (unmeasured spend, as on the CLI invoker, leaves only the count). The brief says the summary request is over, quotes the reply's last lines, names plan-scope files not in the tree and ends with FINISH_LINE. Each resume emits `s1b.resumed` {resume, iteration_id, compactions, finish_line}. A session still unfinished gets implement exit `incomplete`: no follow-up gate runs on it, the diff and the PR are kept, and seal adds `implement ended without a finish line (<why> after <n> resumes): <outstanding>` to the open notes, which caps VERIFIED at PARTIAL. The implement record carries `finish` {continues, ended, outstanding, spent_usd, compactions} only when S1b fired; compactions come from the SDK stream's system/compact_boundary (sdk_stream_parser.ts) and are null on the CLI route. Each resume is a new query, so the Haiku session caps (effort_policy.ts: implement 45 turns, 160K new tokens) start from zero per resume.
219
221
  - `LOKI_ISSUE_WHOLE_FIRST` -- unset: on for Sonnet and stronger models, off for a run that implements on Haiku (`loki-ts/src/util/claude_model.ts` haikuRun; LOKI_ROUTER=1, whose plan may route implement to Haiku later, is not covered); `1` forces it on any model, `0` opts out (Q1 S1; `loki-ts/src/features/decompose.ts` issueWholeFirst, read by `engine10/supervisor.ts` before startIssueEpic and by `features/triage.ts`). An issue run from `loki start owner/repo#N` (so also every `loki backlog` and `loki issues run` child) never asks for the up-front MASS-2 split: the issue runs as one whole-issue run on the same path `LOKI_UNIT_ID=whole` took (sized as before, plan kept for a large issue, Wall off by default). `0` restores the split. The per-model rule lives in issueWholeFirst.
220
222
  - `LOKI_E10_OWN_BY_PATH` -- on by default, `0` restores collateralTests' stem rule (acc-154; `loki-ts/src/engine10/stages/verify.ts` ownTests). Of the relevant tests (always selected, A-114), the task's own (never excused as red on base, and the ones that decide a quick verify, `keep`, `targets0`, `targetNames`) are only a test file the task names, or a test path-paired with a named non-test file the diff changed: the same covered stem, in that file's directory or its `__tests__`, `tests` or `test` subdirectory. A named file the diff did not edit is a reference, so its tests are collateral (base comparison, COLLATERAL_RED cap). Before it, a named `X/page.tsx`, or a reference "is not modified" or "following the pattern in", made every same-stem test in the repo the task's own (FireLater#24).
221
223
  - `LOKI_E10_TOUCHED_BASE_RED` -- on by default, `0` opts out (acc-154; `loki-ts/src/runner/repo_profile.ts` touchedRedOnBase, `stages/verify.ts` editedTestTitles). A test file the diff edited is excused (pre_red, never decisive, disclosed on the receipt's baseline line, never a cap) only when the environment is as intake left it (envChangedSince), every comparable failing id is red in the intake profile of this exact base commit with the same error lines, and no failing id is a case the diff added or whose body it edited (a changed line counts as editing the case above it only when it sits deeper than that case's title, so a top-level import edits none). A previously green id that now fails, a new error under an old id, or a failing added or edited case keeps it blocking. Before it, FireLater#24's one added assertion in a Sidebar.test.tsx with 19 base-red tests made the whole file the slice's failure.