loki-mode 11.140.0 → 11.141.1

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 (70) hide show
  1. package/SKILL.md +2 -2
  2. package/VERSION +1 -1
  3. package/autonomy/route.sh +10 -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 +50 -1
  8. package/docs/dev/release-checklist.md +2 -0
  9. package/loki-ts/dist/loki.js +2087 -2039
  10. package/mcp/__init__.py +1 -1
  11. package/package.json +2 -2
  12. package/packages/control-plane/dist/server.js +11146 -9399
  13. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  14. package/web-app/dist/assets/{AdminPage-AnTJfYHn.js → AdminPage-CyrZ0lVQ.js} +1 -1
  15. package/web-app/dist/assets/{Avatar-D5vJgobT.js → Avatar-HVsqbJDy.js} +1 -1
  16. package/web-app/dist/assets/{Badge-3wfrvysN.js → Badge-Cl4d3UiW.js} +1 -1
  17. package/web-app/dist/assets/{Button-CGZjyCE6.js → Button-DK96_8fz.js} +1 -1
  18. package/web-app/dist/assets/{CockpitPage-C7mqBi9n.js → CockpitPage-trGqUQG8.js} +1 -1
  19. package/web-app/dist/assets/{ComparePage-D3-obrte.js → ComparePage-DAH2WKoS.js} +1 -1
  20. package/web-app/dist/assets/{ErrorBoundary-Bs43Su89.js → ErrorBoundary-YLMvxCBX.js} +1 -1
  21. package/web-app/dist/assets/{EvidenceReceiptPanel-xLwznkum.js → EvidenceReceiptPanel-ChbaWlfG.js} +1 -1
  22. package/web-app/dist/assets/{GitHubIssuesPanel-BpBghyAA.js → GitHubIssuesPanel-Cy-a21mI.js} +1 -1
  23. package/web-app/dist/assets/{GitHubPRsPanel-DnmivBIU.js → GitHubPRsPanel-DZxyuRJn.js} +1 -1
  24. package/web-app/dist/assets/{HomePage-NShCAanO.js → HomePage-CitCe7Hp.js} +2 -2
  25. package/web-app/dist/assets/{LoginPage-BVdS4b5G.js → LoginPage-D77qV6GG.js} +1 -1
  26. package/web-app/dist/assets/{MagicPage-olsKKr2s.js → MagicPage-ls3_mi0r.js} +1 -1
  27. package/web-app/dist/assets/{MetricsPage-5Tpzi-m_.js → MetricsPage-BRiWJxwM.js} +1 -1
  28. package/web-app/dist/assets/{NotFoundPage-DGc0rIRK.js → NotFoundPage-zg2L2XVX.js} +1 -1
  29. package/web-app/dist/assets/{ProjectPage-W1TfOMF0.js → ProjectPage-CZzWE-4p.js} +3 -3
  30. package/web-app/dist/assets/{ProjectsPage-Bgcxx5KG.js → ProjectsPage-VUcvC0NC.js} +1 -1
  31. package/web-app/dist/assets/{SettingsPage-BzDq7U69.js → SettingsPage-CHVQJ19x.js} +1 -1
  32. package/web-app/dist/assets/{ShowcasePage-CX1VViUt.js → ShowcasePage-Bg6grTXX.js} +1 -1
  33. package/web-app/dist/assets/{SystemSettingsPage-B6T8o5Sx.js → SystemSettingsPage-DsRZ0-xE.js} +1 -1
  34. package/web-app/dist/assets/{TeamsPage-CMEiG4uP.js → TeamsPage-CaTemCxx.js} +1 -1
  35. package/web-app/dist/assets/{TemplatesPage-BKR6J5Ll.js → TemplatesPage-BhaJA7pC.js} +1 -1
  36. package/web-app/dist/assets/{TerminalOutput-rbmcfF-w.js → TerminalOutput-BfOkrKSl.js} +1 -1
  37. package/web-app/dist/assets/{activity-ZjbYoVdt.js → activity-DbQIWo1H.js} +1 -1
  38. package/web-app/dist/assets/{bell-dnzVJHRx.js → bell-BIxiZZLC.js} +1 -1
  39. package/web-app/dist/assets/{bot-DZ93FeML.js → bot-B29JFAKe.js} +1 -1
  40. package/web-app/dist/assets/{check-BWG8-QRb.js → check-eFrYlRX2.js} +1 -1
  41. package/web-app/dist/assets/{chevron-left-BcIUnNVH.js → chevron-left-B8Y6dg5E.js} +1 -1
  42. package/web-app/dist/assets/{circle-alert-DSUMN2Ag.js → circle-alert-DBBzGsvI.js} +1 -1
  43. package/web-app/dist/assets/{clock-CTsf9GNv.js → clock-Dq4VdmRL.js} +1 -1
  44. package/web-app/dist/assets/{cloud-CD5QNCYt.js → cloud-By5Dz28l.js} +1 -1
  45. package/web-app/dist/assets/{code-xml-C3xkqqgT.js → code-xml-BuxW3PKD.js} +1 -1
  46. package/web-app/dist/assets/{database-MKFTZWrp.js → database-8yPYngba.js} +1 -1
  47. package/web-app/dist/assets/{dollar-sign-DgiA1wBy.js → dollar-sign-CnMURBiL.js} +1 -1
  48. package/web-app/dist/assets/{file-code-corner-I2g6rLZE.js → file-code-corner-DvauxYVA.js} +1 -1
  49. package/web-app/dist/assets/{file-plus-DbhvhoLG.js → file-plus-BRtK7xDy.js} +1 -1
  50. package/web-app/dist/assets/{globe-BfMA-pSa.js → globe-DSzvEwzA.js} +1 -1
  51. package/web-app/dist/assets/{hammer-Cud0M92b.js → hammer-C-0bgkhm.js} +1 -1
  52. package/web-app/dist/assets/{index-3cLafqmP.js → index-XQ-bFGQE.js} +3 -3
  53. package/web-app/dist/assets/{layers-BE2O5qhC.js → layers-CHtZrk_M.js} +1 -1
  54. package/web-app/dist/assets/{loader-circle-DJZ69MCM.js → loader-circle-DDIRImbs.js} +1 -1
  55. package/web-app/dist/assets/{lock-BNPYDDqH.js → lock-DMYEb6iD.js} +1 -1
  56. package/web-app/dist/assets/{package-Cz5ktewS.js → package-Vh6ODRFi.js} +1 -1
  57. package/web-app/dist/assets/{plus-C4TXh0S_.js → plus-DdbM86Sk.js} +1 -1
  58. package/web-app/dist/assets/{refresh-cw-DRI1ZECq.js → refresh-cw-DN7fyy51.js} +1 -1
  59. package/web-app/dist/assets/{rotate-ccw-WJ_wl2QR.js → rotate-ccw-_LiXn4f3.js} +1 -1
  60. package/web-app/dist/assets/{scroll-text-CfGN1Pna.js → scroll-text-iOYkzHRL.js} +1 -1
  61. package/web-app/dist/assets/{server-BEjlKkq8.js → server-C4fDFqum.js} +1 -1
  62. package/web-app/dist/assets/{shield-alert-hGEgtX7e.js → shield-alert-BrlFKF10.js} +1 -1
  63. package/web-app/dist/assets/{thumbs-up-CFpE08NC.js → thumbs-up-CELA6jYM.js} +1 -1
  64. package/web-app/dist/assets/{trash-2-u1mzVC4h.js → trash-2-BFh0_4hy.js} +1 -1
  65. package/web-app/dist/assets/{trending-down-DKwwom19.js → trending-down-BuhHSUh0.js} +1 -1
  66. package/web-app/dist/assets/{trending-up-TXMyIGFb.js → trending-up-DdM35X0R.js} +1 -1
  67. package/web-app/dist/assets/{upload-Dtje_MkI.js → upload-CylWmA1t.js} +1 -1
  68. package/web-app/dist/assets/{usePolling-CV8no3Jz.js → usePolling-BS-LpZFV.js} +1 -1
  69. package/web-app/dist/assets/{user-C83wfF0K.js → user-BqgsBztl.js} +1 -1
  70. 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.140.0
6
+ # Loki Mode v11.141.1
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.140.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
464
+ **v11.141.1 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 11.140.0
1
+ 11.141.1
package/autonomy/route.sh CHANGED
@@ -333,8 +333,17 @@ $(loki_removed_saved_provider_hint "$R_PROVIDER")"
333
333
  R_MODEL="$LOKI_OPENCODE_MODEL"
334
334
  elif [ "$R_PROVIDER" = "opencode" ]; then
335
335
  R_MODEL="opencode default (unreported)"
336
- elif [ "$R_PROVIDER" = "claude" ]; then
336
+ elif [ "$R_PROVIDER" = "claude" ] && [ -n "${LOKI_CLAUDE_MODEL_DEVELOPMENT:-}${LOKI_MODEL_DEVELOPMENT:-}${LOKI_CLAUDE_MODEL_PLANNING:-}${LOKI_MODEL_PLANNING:-}${LOKI_CLAUDE_MODEL_FAST:-}${LOKI_MODEL_FAST:-}" ]; then
337
337
  R_MODEL="${LOKI_CLAUDE_MODEL_DEVELOPMENT:-${LOKI_MODEL_DEVELOPMENT:-claude (provider default)}}"
338
+ elif [ "$R_PROVIDER" = "claude" ]; then
339
+ # acc-156: no model named, so engine10 pins its default (DEFAULT_SESSION_MODEL in loki-ts/src/util/claude_model.ts; tests/min/newcomer-path.sh checks the two agree)
340
+ local _dsm; _dsm="$(printf '%s' "${LOKI_DEFAULT_SESSION_MODEL:-}" | tr '[:upper:]' '[:lower:]' | tr -d '[:space:]')"
341
+ case "$(printf '%s' "${LOKI_ROUTER:-}" | tr '[:upper:]' '[:lower:]')" in 1|true|on|auto) _dsm=provider ;; esac # the router picks per unit (claude_model.ts chooseSessionModel)
342
+ case "$_dsm" in
343
+ provider) R_MODEL="claude (provider default)" ;;
344
+ "") R_MODEL="sonnet (Loki default)" ;;
345
+ *) R_MODEL="$_dsm (LOKI_DEFAULT_SESSION_MODEL)" ;;
346
+ esac
338
347
  else
339
348
  R_MODEL="$R_PROVIDER (model not recorded)"
340
349
  fi
@@ -7,6 +7,6 @@ Modules:
7
7
  control: Session control helpers (status, atomic writes, origin check)
8
8
  """
9
9
 
10
- __version__ = "11.140.0"
10
+ __version__ = "11.141.1"
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.140.0. Do not edit by hand.
3
+ Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.141.1. 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.140.0
5
+ **Version:** v11.141.1
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
 
@@ -131,6 +131,22 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
131
131
  - `LOKI_E10_SMALL_NO_RUNNER` -- default on: a missing test runner no longer disqualifies a task from "small". A small task skips the plan session (the implementer plans) and the skipped plan writes `plan-scope.json` from the files the task names. Set to `0` to make a missing runner force "normal".
132
132
  - `LOKI_E10_SMALL_MAX_CHARS` -- task text length above which a task is not small (positive number, default 600; an invalid value falls back to 600 with a stderr note).
133
133
  - `LOKI_E10_SCAFFOLD` -- release-note fragment writer (on by default; `=0` opts out). Right before the first verify, when the implement stage ended `done` and the repo keeps changesets (`.changeset/config.json`) or towncrier fragments, and the diff carries no fragment, Loki writes one with no model call: the package of each changed file (public workspace packages only, config `ignore` honored) or `<issue>.<type><ext>` named from the task number and the repo's own fragments, the body from the task title plus one sentence of the implement summary, quote style and trailing period from the newest real fragment. Nothing is written when the task says no changelog, the title is an internal change (chore, refactor, docs, ci, deps), only tests or docs changed, or the type or issue number is unclear; `changeset status` / `towncrier build --draft` remove a fragment they reject. Emits `scaffold.applied`. Whenever it writes a fragment, the receipt (not-proven list) and the PR body both say: "Loki added <path> as the release note for this change; delete it if this change needs no release note (LOKI_E10_SCAFFOLD=0 turns this off)." (`fragmentNoticeLine`). Code: `writeReleaseNoteFragment` in `loki-ts/src/project_model/conventions.ts`; tests in `tests/min/context-pack.sh`.
134
+ - `LOKI_E10_CHANGELOG_CONVENTION` -- on by default, `0` opts out (CL; `changelogFileConvention` in `loki-ts/src/project_model/conventions.ts`, reached through `releaseNoteConvention`, so it feeds the same per-run "Release-note convention" brief line after the cache-stable prefix). When the repo keeps no fragment convention (changesets, towncrier, changelog.d, newsfragments, changie win, unchanged), a single changelog file (`CHANGELOG`, `CHANGES`, `HISTORY`, `NEWS` or `RELEASE_NOTES` with an md/rst/txt extension, at the root or in `docs/`) is the convention when the contribution guide or PR template (root, `.github/`, `docs/`) asks for an entry (a checklist box, must, please, add, update, include, entry ...) and the file has an unreleased section (a markdown heading, an underlined rst title, or a bare or linked "Unreleased"/"upcoming" title line). The line names the file, the unreleased heading and the first entry under it as the format example. Nothing fires when any guide clause says not to update the changelog, the only mentions are optional, suggested, generated or left to maintainers, a PR-body "Release Notes" section is the only mention, the file has no unreleased section, or its head says it is no longer maintained or points to a releases page. The changelog file is never written automatically (`LOKI_E10_SCAFFOLD` skips this kind). The failure: on fresh repos whose CONTRIBUTING or PR checklist requires a changelog entry, the brief named no convention, FIXED_RULES says to write no documentation, and the judge failed the diff for the missing entry (3 of 5 judge fails on the dev set); on the 20 tuning trees it fires on none.
135
+ - `LOKI_E10_SCAFFOLD_TRACE` -- on by default, `0` opts out (TR; `scaffoldRecord` and `releaseNoteSkipBlock` in `loki-ts/src/project_model/conventions.ts`, kept by `scaffoldNow` in `engine10/machine.ts` as `implement.scaffold_skipped`). When the repo has a release-note convention but the `LOKI_E10_SCAFFOLD` writer wrote nothing, the receipt carries `release_note_skipped` with the writer's reason (for example "towncrier: the task names no issue number and the repo does not use orphan fragments"). Omitted when a fragment was written, the diff already carries the fragment or changelog entry, or the repo has no convention, so other receipts hash the same.
136
+ - `LOKI_E10_TOWNCRIER_ORPHAN` -- on by default, `0` opts out (TO; `towncrierOrphanPrefix` in `loki-ts/src/project_model/conventions.ts`). A task with no issue number gets an orphan fragment `<prefix><slug>.<type>[.<ext>]` when the repo uses orphans: its towncrier config sets `orphan_prefix` (that prefix is used), or any fragment in the directory already starts with "+". Before, only a newest example that was itself an orphan counted. A repo with no orphan in use still gets nothing, and TR records why.
137
+ - `LOKI_E10_TOWNCRIER_NEW_ORPHAN` -- on by default, `0` opts out (TN; `towncrierNoNumberPrefix`, `orphanBriefClause` in `loki-ts/src/project_model/conventions.ts`). A fix whose task gives no issue or PR number still ships the towncrier fragment the repo requires, in towncrier's orphan form `+<slug>.<type>[.<ext>]`, even when the repo has no orphan fragment yet: the fragment writer writes it (when the change type is clear), the towncrier brief line says "name it with the issue or PR number the task gives; when the task gives none, use towncrier's orphan form ... and never invent a number", and the self-check's missing-fragment flag names the same form for the review turn. Only a config that disables orphans (`orphan_prefix = ""`) keeps the old skip. The failure: CONTRIBUTING requires `<PR number>.<type>.rst`, the writer skipped (no number), the review turn justified skipping ("needs the PR number, which can't be invented"), and the judge failed the missing fragment.
138
+ - `LOKI_E10_ORPHAN_RENAME` -- on by default, `0` opts out (ON; `renameInventedFragment` in `loki-ts/src/project_model/conventions.ts`, run after the self-check's review turn by `stripInventedReleaseRefs`). A towncrier fragment the run created under a number no input gives (the task gives none) is renamed to the orphan form with the repo's own prefix, slug from the task title, when the repo already has orphan fragments or sets `orphan_prefix`; the receipt lists it under `changelog_refs_removed` ("renamed <old> -> <new>"). Otherwise nothing moves and the self-check's release-note item flags it ("numbered N, a number the task never gives; rename it to the orphan form ...") for the review turn. The failure: a run created a numbered fragment although no input carried that number.
139
+ - `LOKI_E10_CHANGELOG_FROZEN_STRICT` -- on by default, `0` opts out (FS; `logFrozen` in `loki-ts/src/project_model/conventions.ts`). The CL rule treats a changelog as frozen only when its first 15 lines say so in words ("no longer maintained/updated", "this file has been/is deprecated", "not maintained"), or when it has no unreleased section. The failure: the first rule also matched a bare "Deprecated" and "releases page", so a Keep a Changelog file with a "### Deprecated" subsection under Unreleased got no line. Off: that loose rule.
140
+ - `LOKI_E10_RUN_OUTPUT_DROP` -- on by default, `0` opts out (RO; `runOutputs` in `loki-ts/src/e10ext/commit_filter.ts`, part of `dropSet` beside GB, named on the receipt with the GB note). A deterministic filter before commit, never a model judgment: an ADDED file under a `.loki/` or `.loki-*` directory at any depth (the root one was always dropped), under `test-results/`, `playwright-report/`, `blob-report/`, `coverage/`, `htmlcov/`, `.nyc_output/`, `.pytest_cache/`, `.mypy_cache/`, `.ruff_cache/`, `.tox/` or `.hypothesis/` anywhere, or a JUnit report, `*.log`, `.coverage`, `lcov.info`, `coverage.xml` or `nohup.out` file, never reaches the delivered diff. Kept: the task names the file, or that directory holds a file tracked at base. The self-check's stray-files item records these as `auto`. The failure: on held-out repos the top review-fail class was stray committed run artifacts (test-results output and nested `.loki` logs).
141
+ - `LOKI_E10_CHANGELOG_REF` -- on by default, `0` opts out (CR; `changelogRefStyle`, `releaseNoteProblems` and the CL brief line in `loki-ts/src/project_model/conventions.ts`; checked by the self-check's release-note item). The reference form most existing changelog entries use (a markdown issue/PR link, `(#N)`, an rst `:pr:` role, `GH-N`, bare `#N`; at least 3 of the first 40 bullets and at least half) goes into the CL brief line with "use the number the task gives in that form, and never invent a number". The self-check flags an added entry that cites a number the task does not give, an entry with no reference to the task's number when existing entries carry one, a changeset naming a package no changed file belongs to, and a towncrier fragment numbered differently from the task's issue; a flag starts the self-check's review turn. After that turn a deterministic pass (`stripInventedRefsInFile`, `stripInventedReleaseRefs` in `features/self_review.ts`) removes from every release-note line the run added each `#N`, `(#N)`, `[#N](url)`, issue or pull URL, `:pr:` role and `GH-N` whose number the task input never gives, and tidies what is left, so the entry falls back to the repo's no-reference form; the receipt lists each removal (`changelog_refs_removed`). Base lines are never touched. The failure: on held-out repos the second review-fail class was changelog entries with no PR or issue reference, or with the wrong package or issue number.
142
+ - `LOKI_E10_SELF_REVIEW` -- on by default, `0` opts out, `always` runs the turn on every run (SR; `loki-ts/src/features/self_review.ts`, called at the end of the implement stage after the named-sites check and before the Wall restore; the receipt carries `self_review`). The pre-delivery review self-check. Five deterministic items are computed on the implemented tree against base, with no model call: (a) a release note the repo's rules require (the CL, changeset or towncrier convention) and the diff lacks; (b) stray files: a run-added file in a directory the repo has never tracked (build output is recorded as `auto`, the commit filter drops it); (c) a source change with no test file in the diff; (d) format: `auto` when a configured formatter normalizes the changed files at commit, otherwise the style configs are named; (e) scope: edits to existing files outside every scope signal (`outsideScope`). When any item is flagged (or with `always`), one bounded resume of the implement session (suffix `-rv`, turn cap `LOKI_E10_SELF_REVIEW_MAX_TURNS`, default 12, the cost cap; skipped when the stage has under 60 s left) gets the flagged items, the CONTRIBUTING and PR template text (6000 characters) and the style config names, may edit the diff, must change nothing that already follows the rules, and ends with one `REVIEW <a-e>: ok|fixed|justified: <reason>` line per item. Each item is then settled: the after-turn check no longer flagging it reads `fixed`; a persisting flag reads `justified` only with a stated reason, else `unresolved`. A clean minimal diff starts no turn, so it is never touched and costs nothing. Verify and the commit stage run on the reviewed tree as usual.
143
+ - `LOKI_E10_REVIEW_TURN_GUARD` -- OFF by default until measured, `1` turns it on (TG; `guardReviewTurn`, `restoreTurnPaths` in `loki-ts/src/features/self_review.ts`, `reviewTurnGuard` in `loki-ts/src/engine10/stages/implement.ts`). Before the SR review turn the tree is snapshotted against base. When the turn changes any path, the tests of those paths (`patchCheckRefs`: the impacted tests of the turn's paths plus its own test files, at most 6) are rerun quietly through verify's runner. A test that fails after the turn is rerun with only the turn's paths put back to the snapshot; if it passes there, the turn stays taken back (the implement diff is kept, the implement result is not replaced by the review reply, and the items settle against the restored tree with the review reply ignored, so a flag the turn tried to fix reads unresolved), `self_review.turn_guard` records the paths, the runs and the broken test, and the receipt `not_proven` names it. A test that also fails without the turn keeps the turn. A new test file the turn added is never counted as a test that passed before.
144
+ - `LOKI_E10_SR_COVERAGE` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (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.
145
+ - `LOKI_E10_DOC_ENUM` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (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.
146
+ - `LOKI_E10_DOC_UPDATE_RULE` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (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.
147
+ - `LOKI_E10_WALL_CASES` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (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.
148
+ - `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.
149
+ - `LOKI_E10_TOWNCRIER_EXAMPLE` -- on by default, `0` opts out (TX; `releaseNoteBrief` in `loki-ts/src/project_model/conventions.ts`). The towncrier "Release-note convention" line names a real fragment as its example (`towncrierExample`: `<issue>.<type>[.<ext>]` or `+<slug>.<type>[.<ext>]` with a declared type, the same picker the fragment writer uses), or no example when the directory holds none. The failure: a fresh checkout ties every mtime, so the old newest-file pick fell to the name tie-break and named the repo's towncrier template (`template.rst`, `towncrier_template.md.jinja`) as the "newest example". Off: the newest file of the directory, as before.
134
150
  - `LOKI_E10_ATTEMPTS` -- best-of-N implement attempts (EXP-0010, `loki-ts/src/features/attempts.ts`). N is the TOTAL count: unset, `0`, `1` and anything unparseable are off (one attempt); `on`/`true`/`yes` is 2; a whole number 2-6 sets N on any model. Before 11.140 the number was the EXTRA count after a red verify, so `LOKI_E10_ATTEMPTS=3` meant 3 extra attempts and now means 3 in all. When the first attempt (fix rounds included) is not clean (a red check, a spec conflict, or a NOT PROVEN line from verify or a fix round; `pre red:` lines do not count), N-1 more independent attempts run in parallel on the same model (`LOKI_E10_ATTEMPT_MODELS`, unset by default, is a comma list with one model per attempt in order: `haiku,sonnet` runs the first attempt's implement session on Haiku and the extra one on Sonnet; an attempt past the list reuses its last entry; the receipt's `attempts` lines then name each attempt's model and `implement.attempts` records `models` and `winner_model`), each in a detached worktree in its own temp directory with a different instruction (smallest change, test first, read the covering tests first). Each finished attempt is swapped into the primary and gets Loki's normal verify (the complete one, never a fix round's quick one); the first clean one stops the others. Otherwise `e10ext/select.ts` rankAttempts orders them on what a user can see: verify green, then no spec conflict, then fewer NOT PROVEN lines. A disqualified attempt (killed, errored, an empty diff without already-done evidence, a loosened existing or Wall test) never wins. A tie at the top goes to one tool-less review (reviewTie; `LOKI_E10_SELECT_REVIEW_MODEL`, default claude-sonnet-5-5, `opus` for a reviewer independent of a Sonnet judge; `LOKI_E10_ATTEMPTS_REVIEW_MODEL` is its older name and loses to the new one; aliases resolve through `providers/model_catalog.json`; `LOKI_E10_ATTEMPTS_REVIEW=0` keeps the lowest index). It compares the tied diffs, new files included, against the issue, the repo's CONTRIBUTING, PR template, style configs, top-level entries and the pre-fix text of every touched file, all read at the base commit. It is shown in forward and reversed order and counts only when both orders name the same attempt; anything else keeps the lowest index. No hidden test or benchmark file is read. Only the chosen tree is sealed, with its own verify and fix outputs; the receipt field `attempts` lists every attempt and the selection reason, and is omitted when no extra attempt ran. Shares the run's `--max-cost` and time caps and needs one 90 s window. Journal event `attempts.selected`, stage data `implement.attempts`.
135
151
  - `LOKI_E10_PATCH` -- the implement patch protocol (`loki-ts/src/features/patch_protocol.ts`, wired in `engine10/stages/implement.ts`). On by default; `0`/`off`/`false` turns it off. Lean path only (plan skipped, router off, no session to continue, claude provider, a named model). One tool-less call (`runner/sdk_invoker.ts` toolLessCall, thinking off; `claude -p --tools ""` under `LOKI_E10_INVOKER=cli`) gets a dossier: the context pack's code, the heads and test names of the tests covering it, and the check command. It answers with FILE/SEARCH/REPLACE edit blocks. Before anything is written the harness refuses edits to lockfiles the task does not ask to change, test-runner and compiler configs (`features/runner_config.ts` RUNNER_CONFIGS), Wall tests, `.git`, `.loki`, paths outside the repo or through any symlink (realpath check), and an edit that changes nothing; the rest applies all-or-nothing (an exact, unique SEARCH match). The harness runs the targeted tests with verify's runner. At most one repair call follows (a red check with a failure digest and the edited regions, a rejected or missed edit, a NEED read, or a green fix with no regression test, which gets a test-only turn that can never make the green tree worse). Green means a check ran and passed and at least one of the checks is a test that existed before the change (the model's own new test alone never counts); the agentic session is then skipped and verify and seal judge the tree as usual. Any other end, including an exception anywhere in the protocol, restores every file the protocol wrote and today's agentic session runs, so the outcome floor is unchanged. A failed patch's spend still lands in the receipt total. Cost lands in the child ledger under phase `implement-patch`; the stage data carries `implement.patch` (status, calls, applied, refused, restored, usd, check) and the run dir keeps `implement-patch-<n>.txt` (prompt and reply). The receipt carries `patch` (outcome green, fallback or error, the protocol status, calls, seconds and dollars), so a scored run can count the fallback rate.
136
152
  - `LOKI_E10_LEAN_CALLS` -- on by default, `0` opts out (`loki-ts/src/util/cost_profile.ts`): skips the coverage claim re-ask `-c2`, whose result changed no outcome on the 20-task Haiku bench (v11.137.1, patch off: 11 of 11 sessions edited nothing, 3 of 3 on v11.137.0; 4.6% of the arm's dollars). An explicit `LOKI_E10_CLAIM_CHECK=1` keeps the call. The same knob sets three more cheaper defaults, each with its own opt-out: the Opus consult and never-stop are off (`LOKI_E10_OPUS_CONSULT=1` turns them on), the exec-spec generator call is off (`LOKI_E10_EXEC_SPEC=1` turns it on) and the coverage requirement is folded into the implement brief instead of a separate turn (`LOKI_E10_COVERAGE_RESUME=1` restores the turn). `LOKI_E10_LEAN_CALLS=0` restores all four v11.138.0 defaults.
@@ -152,14 +168,47 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
152
168
  The bench's empty remedy checks, recorded as transport with 0 tokens, were the output cap. Measured at load average 30 to 40: 9 of 12 concurrent checks at the 50-token cap failed that way, 0 of 12 at 256, and none for a network or auth reason. The remedy check now runs at 256 (`REMEDY_MAX_TOKENS`); output is billed by the tokens written.
153
169
  - `LOKI_E10_NAMED_SITES` -- on by default, `0` opts out (R2; `loki-ts/src/util/conflict_resume.ts` namedSites / resumeForNamedSites / namedUnchangedOf, read by `stages/seal.ts`). An extension of the coverage map: every symbol the task names (a site atom of `features/exec_spec.ts` that resolves to a definition in the repo; a callee it was not named for is left out) is either changed by the diff (its file is) or written by the model as `SITE <path>:<line>: unchanged - <why>` with a reason about the code. A reason that only restates the task's hedge ("may need", "out of scope", "optional") does not count. The fold brief carries one more fixed line (NAMED_SITE_LINE, cache-stable prefix). After a clean done with a non-empty diff, an unaccounted named site gets one "-ns" resume that names it. Seal reads the final diff (a winning extra attempt's own SITE reasons replace the first attempt's): each named site left unchanged is listed in the receipt key `named_unchanged` with its reason, and one with no reason adds `named site unchanged without a reason: <symbol> (<path>:<line>)` and caps VERIFIED at PARTIAL. Off: the fold brief is byte-identical to the coverage map alone, no resume runs and the key is omitted. Stage data `implement.named_sites`.
154
170
  - `LOKI_E10_PLAN_SCOPE_ANCHOR` -- on by default, `0` opts out (R3; `loki-ts/src/e10ext/scope.ts` anchoredPlanScope, read by the commit stage's scope notes and by the attempts ranking). plan-scope.json's file list is the scope only when it holds a file the task names (its path, or its basename in the same case) or a file that defines a symbol the task names. When the task names a file or symbol and the list holds none, the list is discarded and the other scope signals decide (often "scope not determined", a disclosure that never caps). A task that names nothing keeps the list. The failure: a prose word matched a same-named file case-insensitively, that file became the whole scope, and the real fix file was flagged "outside stated scope".
155
- - `LOKI_E10_INTAKE_CAP_S` -- default 180, `0` opts out to the per-command caps alone (R3; `loki-ts/src/runner/repo_profile.ts` intakeCapS / baselineSuites `deadlineMs`, wired in `stages/intake.ts` and `project_model/install.ts` intakeDeps). One budget in seconds for all of intake's baseline test runs together: the root baseline, its rerun after an install, and the per-suite baselines. A run the budget cuts is recorded as cut off, and a suite with no budget left reads "baseline budget used up", as before. The dependency install keeps its own cap (INSTALL_CAP_MS) and is not counted. The failure: a suite past the 300 s per-command cap was measured twice under two names, so intake spent 600 s on two cut-off runs that excuse nothing. Of 65 recorded bench baselines, 6 took over 180 s in all; 1 of them (195.8 s root, 219.2 s suite) completed and would now be cut.
171
+ - `LOKI_E10_INTAKE_CAP_S` -- off by default since acc-148 (unset, `0` or a non-number keeps the per-command caps alone); a positive number of seconds turns the shared budget on. When on and it cuts a baseline, intake prints one line starting `loki: intake budget spent after N s` (`repo_profile.ts` intakeBudgetNote). Turned off because it had no measured accuracy benefit and cut 6 of 65 past baselines (a complete 196 s gitea suite among them), and a cut baseline is unattributable base red. (R3; `loki-ts/src/runner/repo_profile.ts` intakeCapS / baselineSuites `deadlineMs`, wired in `stages/intake.ts` and `project_model/install.ts` intakeDeps). One budget in seconds for all of intake's baseline test runs together: the root baseline, its rerun after an install, and the per-suite baselines. A run the budget cuts is recorded as cut off, and a suite with no budget left reads "baseline budget used up", as before. The dependency install keeps its own cap (INSTALL_CAP_MS) and is not counted. The failure: a suite past the 300 s per-command cap was measured twice under two names, so intake spent 600 s on two cut-off runs that excuse nothing. Of 65 recorded bench baselines, 6 took over 180 s in all; 1 of them (195.8 s root, 219.2 s suite) completed and would now be cut.
156
172
  - `LOKI_E10_MOCHA_TARGETED` -- on by default, `0` opts out (R5; `loki-ts/src/engine10/testmap.ts` mochaTargets, used by `stages/verify.ts`). When verify selects no test at all, a changed JS/TS file whose nearest package.json declares mocha (a dependency, a script, a `mocha` key, or a .mocharc file beside it) maps to its own test file: itself under the package's test/, tests/ or spec/ directory (fixtures excluded), else the file at the same path under one of them (with or without the source's first directory). At most 8, each run as `npx --no-install mocha <file>` (runner `mocha`, which runner detection never lists) through the normal test path, so base subtraction and the flaky rerun apply and a passing one covers its source. Mocha test files carry no .test or .spec suffix, so such a repo verified with no test at all.
157
173
  - `LOKI_E10_BASE_RED_SHAPE` -- on by default, `0` opts out (acc-147; `loki-ts/src/runner/repo_profile.ts` sameUnattributableRed inside attributeFullSuite, `loki-ts/src/util/check_result.ts` failureShape). The intake baseline records the output shape of a base suite that is red with no parseable failing ids (`failing_shape`). A head full suite of the same command is pre-existing only when it fails in the identical kind: the same exit code, no parseable ids, and the same shape (whole output, only durations, clock times, timestamps and hex addresses normalized). A newly broken test, a different message or count, or another exit code stays introduced. The excuse is disclosed on NOT PROVEN. Dev corpus 2026-11-13: 4 of 24 runs ended FAILED with fix rounds chasing such a suite ("the base run is not attributable").
158
174
  - `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.
159
175
  - `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).
176
+ - `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).
177
+ - `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).
178
+ - `LOKI_E10_PYTEST_FALLBACK` -- on by default, `0` opts out (acc-148; `loki-ts/src/engine10/testmap.ts` buildTestMap / pytestImportable). Python tests that only their `test_*.py` names marked as pytest (no pytest.ini, conftest.py, `[tool.pytest]`, `[tool:pytest]`, tox `[pytest]`, and no test file importing pytest) run under the stdlib unittest when the repo's own `.venv`/`venv` interpreter cannot import pytest. A system interpreter is never probed. Before it, a unittest repo without pytest installed ran every test as pytest and each check failed in under a second with no ids (Python-Markdown).
179
+ - `LOKI_E10_EMPTY_SUBSUITE_NA` -- on by default, `0` opts out (acc-148; `loki-ts/src/project_model/package_suite.ts` runPackageSuites, `loki-ts/src/util/check_result.ts` emptyDiscovery). A package suite below the repo root that executed exactly 0 tests on base and on head (exit 0, empty discovery, no skips on either side) is not applicable even when no Wall or task-named check passed. The root package keeps that requirement. go test -json's package-level "skip" event and its "[no test files]" line no longer read as a skipped test, so a Go module with no test files is empty discovery. Before it, go-chi/chi's two `_examples/*` modules capped the run with "not run: full suite".
180
+ - `LOKI_E10_REPORTED_KIND` -- on by default, `0` opts out (acc-148; `loki-ts/src/util/check_result.ts` reportedErrors / assertionFailure / goReportedPanic, read by the fail-then-pass proof). A base failure that is not an assertion counts only when it is the error the issue itself shows happening. That covers an exception type the issue names by its qualified name (`http.client.IncompleteRead`, not only names ending in Error or Exception, matched by type when the issue quotes no exact message), in a test that asserts a result or expects a wanted type, and a Go panic whose message contains the issue's `panic: <message>` (at least 8 characters, `runtime error:` and bracketed values ignored). Missing-API errors (ImportError, SyntaxError, AttributeError and kin) are never credited, nor is any unreported exception or panic. Before it, pyjwt's and samber/lo's real fail-then-pass tests read "test fails without the fix: yes" and stayed PARTIAL.
181
+ - `LOKI_E10_ASSERT_UNITTEST` -- on by default, `0` opts out (acc-150; `loki-ts/src/util/check_result.ts` unittestAssertionFailure, read by the fail-then-pass proof). A `python -m unittest` base failure counts as red by assertion when there is at least one FAIL: block, every FAIL: block ends in AssertionError, and there is no ERROR: block (a raised exception, or an import that failed). Before it, unittest output was never read, so Python-Markdown's real fail-then-pass did not count.
182
+ - `LOKI_E10_LINT_MISSING_DISCLOSE` -- on by default, `0` opts out (acc-150; `loki-ts/src/engine10/stages/verify.ts` lintFallbacks in runLintChecks, `stages/seal.ts` missingLintChecks). When ruff cannot be started, verify retries it the way the repo's own tooling would without a global install: `uvx ruff`, then the repo virtualenv's `python -m ruff`. A lint check (`lint:*`) whose tool still could not be started (skip_code `tool_not_on_path`) leaves the verdict inputs and is disclosed as "linter not installed, not run (disclosed, does not cap)". A linter that runs and reports violations still caps, and a missing test runner is never disclosed this way.
183
+ - `LOKI_E10_PROOF_COMPILED_BUDGET` -- on by default, `0` opts out (acc-152; `loki-ts/src/util/mutation_proof.ts` proofBudgetS / warmGoBuild). The fail-then-pass proof of a compiled stack (go, cargo, maven, gradle, javac, dotnet tests) gets the 40 s cap (MAX_TOTAL_S, inside seal's 60 s limit) by default instead of 30 s. An explicit LOKI_MUTATION_PROOF_TIMEOUT_S or caller budget still wins. For go, the base worktree's test packages are compiled once (`go test -run ^$ -count=1 ./<pkg>`, no test runs) inside the same deadline before the timed runs. It only grants time; what counts as proof is unchanged. Before it, go-chi/chi's cold go build took 32 s of the 30 s budget and a real fail-then-pass read "inconclusive (timeout)".
184
+ - `LOKI_E10_NAMED_EXACT` -- on by default, `0` opts out (acc-154; `loki-ts/src/engine10/sizing.ts` namedFiles, used by sizing and by verify's task-named tests). A basename every mention of which sits inside a spelled path names only the files those paths spell, even when the spelled file does not exist yet. A bare mention ("fix page.tsx") keeps naming every file with that basename. Before it, FireLater#24's task spelled `.../search/page.tsx` and named all 54 `page.tsx` files and 46 `page.test.tsx` files in the repo.
185
+ - `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).
186
+ - `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.
187
+ - `LOKI_E10_COLLATERAL_BASELINE` -- on by default, `0` opts out (acc-154, fix D; `loki-ts/src/runner/repo_profile.ts` collateralOnBaseline, `stages/verify.ts`). A collateral test (relevant, not the task's own) is pre-existing at once, with no COLLATERAL_RED cap and no fix round, only when the environment is as intake left it, the test file is unedited, no changed file is its path-paired source, and every comparable failing id with its error lines equals this base commit's intake profile. A changed paired source, a new failing id, or the same id with another error keeps the cap and the fix round. Before it, FireLater#24's collateral page tests cost a fix round each slice and capped VERIFIED although they matched base exactly.
188
+ - `LOKI_DEFAULT_SESSION_MODEL` -- the session model a Claude run uses when the user names none (acc-156; `loki-ts/src/util/claude_model.ts` DEFAULT_SESSION_MODEL and chooseSessionModel, applied in `engine10/supervisor.ts`, shown by `autonomy/route.sh`). Unset means DEFAULT_SESSION_MODEL (`sonnet`); any session pin value (`haiku`, `sonnet`, `opus`, `small`, `medium`, `high`, ...) sets another; `provider` restores the pre-acc-156 run with no `--model`, the Claude CLI's account default. The default is exported as LOKI_SESSION_MODEL, so a default run is exactly a `--session-model <default>` run. `--session-model`, LOKI_SESSION_MODEL, LOKI_MODEL_OVERRIDE, LOKI_MODEL_ROUTE, LOKI_{,CLAUDE_}MODEL_{DEVELOPMENT,PLANNING,FAST} and the model router (LOKI_ROUTER=on|auto, which `--haiku` and `--cost lean` set) always win. The start line prints `model <m> (<why>)` and the receipt records `model_source` (explicit, default, provider). Bench: an `L-Default` arm or BENCH_NO_SESSION_MODEL=1 runs `bench/bin/run_arm.sh` with no `--session-model`.
189
+ - `LOKI_E10_COMMIT_HOOK_BYPASS` -- on by default, `0` opts out (acc-160; `loki-ts/src/engine10/stages/seal.ts` commitStage, `engine10/machine.ts`, knob in `util/safe_git.ts`). Loki's internal commit runs the repo's own hooks first, with the user's signing kept and a 120 s limit. If that commit fails, the index and the run's own files go back to the tree verify judged, which undoes a hook that ran a formatter and restaged. The commit is then retried once with `core.hooksPath=/dev/null`, signing still kept. A pass on the retry proves a hook was the cause, and the receipt says so on NOT PROVEN (a disclosure, not a cap). A failure the retry does not fix, such as signing, stays `git commit failed`. In both cases seal now writes a FAILED receipt with the git error on NOT PROVEN, instead of ending with no receipt. Found on dev-msw-2829: the session's `pnpm run build` installed simple-git-hooks, whose commitlint `commit-msg` hook rejected the `loki:` subject.
190
+ - `LOKI_E10_CARGO_MERGED_DOCTEST` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162; `loki-ts/src/util/check_result.ts`). rustdoc's merged-doctests note (Rust 2024 edition), `all doctests ran in Xs; merged doctests compilation took Ys`, prints after a doctest segment's own `test result:` trailer. It is cargo's note, not test output, so it is dropped from segment bodies and from the stream's tail, and the segment and the run read as measured. A green `cargo test` with no test target at all (a fuzz or bin-only crate) ran 0 tests instead of reading as unparsed. Found on tera (dev2): every cargo suite read not_run.
191
+ - `LOKI_E10_AVA_TARGETED` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162; `engine10/testmap.ts` avaTargets, `util/check_result.ts`). When verify selects nothing, a changed JS/TS file whose nearest package declares ava (a dependency, an `ava` key, or an ava.config file) maps to its own ava test: itself under test/ or tests/ (helpers and fixtures excluded), else the same-stem file there. At most 8 refs, each run as `npx --no-install ava <file>`. The count comes from ava's own summary block after its last rule, past stderr noise. Found on ink (dev2): only lint:tsc ran.
192
+ - `LOKI_E10_NO_TEST_FALLBACK` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162; `engine10/stages/verify.ts`, `project_model/package_suite.ts` ownedSuites). A low-tier verify that executed no test at all runs the repo's own test command, through the full-suite path and its base attribution. That means the Project Model suites of the packages that own the changed files (for example `cargo test` in that crate), else the detected runner's full command. verify records `no_test_fallback: true`. When nothing executable runs, NOT PROVEN still says `no tests executed`.
193
+ - `LOKI_E10_BASE_CRASH_ENV` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162; `engine10/stages/verify.ts` crashSignature and subtractBase). A test check that failed with no parseable id because its process crashed or could not import (a fatal Python signal, a ModuleNotFoundError, a conftest or module ImportError) is run once on base, with the head's .venv or node_modules linked. When base crashes with the same signature, the check becomes not_run with the signature on NOT PROVEN, never a failure of the change and never fix-round input. A different signature, a base that passes, or a check with ids stays a failure. Found on pydantic (dev2): a stand-in env segfaulted on base and head alike, and the run ended FAILED.
194
+ - `LOKI_E10_UV_REQUIRED` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162; `project_model/install.ts`). When a repo pins uv's `required-version` and the host uv is older, uv refuses every `uv sync`. The install is then retried once, unchanged, as `uvx --from 'uv<spec>' uv ...`. A workspace member's retry runs at the `[tool.uv.workspace]` root, as the repo's CI does, because a member-only sync of the shared .venv would drop the root's test dependencies. The install record's lock_note says so. Found on pydantic (dev2): `Required uv version >=0.13.0` against host uv 0.9.26.
195
+ - `LOKI_E10_PYTEST_PRETTY` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162; `util/check_result.ts`). A repo that loads pytest-pretty prints `Results (Xs):` followed by one count per line instead of pytest's `N passed in Xs`. That block counts when it ends the output and every line in it is a count. Found on pydantic: every pytest check read as executed count unmeasured.
196
+ - `LOKI_E10_SOURCE_SITES` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162 do-no-harm a; `features/exec_spec.ts` resolveSites and siteRank). A named symbol resolves to a source file first. It goes to a test-area file (test/, tests/, benchmark/, examples/, docs/) only if no source declares it, and to build output or a type declaration (build/, out/, lib/x beside a src/x twin, *.d.ts, *.min.js) last. Fire marker: a named site records `instead_of`, the file the old first-match order would have picked. Found on dev2: ink resolved to build/ and benchmark/, axios to index.d.ts.
197
+ - `LOKI_E10_PLAN_HINTS` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162 do-no-harm a; `e10ext/context.ts`, `stages/implement.ts`). The implement brief introduces the plan as a hint, not the scope: the task decides what to change, and every case it states is covered even where the plan leaves it out. The same lead says any file the fix needs may be edited. The `Relevant files:` list keeps its wording, because the L021 Opus golden and the exemplar lookup read it. Fire marker: implement records `plan_hints: true` when a plan was given. Found on tera: the plan covered only a top-level `-1`.
198
+ - `LOKI_E10_UNCAUSED_NO_FIX` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162 do-no-harm b; `stages/verify.ts` uncausedRed). A red check the diff cannot have caused never feeds a fix round. That means no failing id or diagnostic names a changed file, and either the diff changes only inert files (docs, type declarations, test files, changelog fragments) or, for a lint, every diagnostic sits in an unchanged file and names no symbol the diff changed. Wall, targeted and base-green-now-red checks are never uncaused. The check still fails and the verdict is unchanged; only the round is not spent. Fire marker: verify records `uncaused_reds`. Found on axios: 2 rounds on port clashes and a docs tsc error.
199
+ - `LOKI_E10_HAIKU_INDEP_FIX` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (acc-162 do-no-harm b; `engine10/machine.ts`, `stages/verify.ts` independent_fail). A run whose implement model is Haiku gets no fix round unless an independent check failed: the Wall, a targeted test the diff touches (a changed test file, an impacted test, the task's own), or a full-suite failure absent from the base profile. Fire marker: verify records `fix_gate`, plus a skipped `loop.repeat` event. Found on dev2: rounds ran on 11 of 20 Loki-Haiku runs, at 25% of spend, and flipped none of the losses.
200
+ - `LOKI_E10_WALL_ON_LEAN` -- off by default, `1` opts in; implied by `LOKI_E10_CASCADE_V0=1` (`util/wall_knobs.ts`, `stages/wall.ts`, `stages/plan.ts`). A Wall that is on (`LOKI_E10_WALL=1`) also runs on the lean path, a small or normal task with a relevant visible test, without forcing plan. Off, the lean path skips the Wall as before.
201
+ - `LOKI_E10_CASCADE_V0` -- OFF by default, `1` turns it on (cascade v0; `util/wall_knobs.ts`, `engine10/machine.ts` extraAttempts, `features/attempts.ts`). The Wall is the oracle and the model cascade is `LOKI_E10_ATTEMPT_MODELS`, or `haiku,sonnet` when that is unset. The flag turns the Wall on for the run, unless `LOKI_E10_WALL=0`. Only a Wall check that fails on the first candidate starts one more attempt, before any fix round, on the next model in the list. The run's own model is the first candidate, so a Haiku run cascades to Sonnet. That attempt's brief is the saved implement brief plus the Wall's failing output. The existing best-of selection keeps the better tree, and fix rounds still follow when the winner is red. No other red cascades: not lint, not a collateral test, not a NOT PROVEN line. With the flag on, the after-fix-rounds attempts trigger is off. The flag implies `LOKI_E10_WALL_ON_LEAN`, so the Wall also runs on the lean path, without forcing plan. Under this flag, a failed pre-implement snapshot (too big or too slow) no longer drops the concurrent Wall: its base run uses a fresh checkout of the base commit, said on NOT PROVEN (`base_checkout: fresh`). The receipt records `wall_oracle` {cost_usd, duration_s} whenever the Wall ran, and, under the flag, `cascade` {fired, from, to}. Fire marker: `attempts.cascade` = {trigger: "wall", from, to} on implement and on the `attempts.selected` event.
202
+ - `LOKI_E10_ID_PKG_RELATIVE` -- on by default, `0` opts out (acc-154; `loki-ts/src/engine10/failures.ts` idNamesFile, also `repo_profile.ts` whyFullSuiteNotExcused). A package-relative vitest id (`src/x.test.ts > t`, printed by a run inside `frontend/`) names the repo file `frontend/src/x.test.ts`. Before it such an id never named its changed file, so a full-suite failure in an edited file could be excused (fail open). A full-suite id that TOUCHED-BASE-RED already showed red on base with the same error in the edited file's own run is the only one allowed to name that file.
203
+ - `LOKI_E10_PROOF_PROJECT_API` -- on by default, `0` opts out (acc-154; `loki-ts/src/engine10/stages/seal.ts` baseProofRunner and the Wall mutation proof). The fail-then-pass proof runs each test with the real repo's Project Model. RealBaseTestRunner otherwise read the model from the temporary base worktree, which has no `.loki/`, so in a multi-package repo a frontend vitest file ran from the repo root (no vitest there) and the proof read "inconclusive (the Wall command did not execute to a result)".
160
204
  - `LOKI_E10_PRECEDENCE_CHECK` -- on by default, `0` opts out (F3; `loki-ts/src/util/edit_shape.ts` precedenceSites / precedenceBrief, `util/conflict_resume.ts` resumeForPrecedence). The edit-shape precedence rule detects a widened check from the diff alone: a Go `x.(T)` replaced by `errors.As` or `errors.Is`, an `isinstance` or `instanceof` moved to another type, or an exact `==` / `===` comparison replaced by a membership test (`includes`, `in`, `strings.Contains`). For each such site it lists the other type or value checks in the same function, the inputs that took their own branch before. After a clean LOKI_DONE with a non-empty diff, a site that has such inputs gets one follow-up resume (`-pr`) naming each input and asking that it still take its branch, with a test case per input; only a clean LOKI_DONE replaces the first result. Nothing fires, and nothing is spent, without such a site. The implement stage records `precedence_check: {sites, resumed}`. The tuning case was a widened error check placed ahead of an existing assertion branch; the test fixtures are synthetic.
205
+ - `LOKI_E10_BUILD_ARTIFACT_DROP` -- on by default, `0` opts out (GB; `buildArtifacts` in `loki-ts/src/e10ext/commit_filter.ts`, part of `dropSet`, so the commit stage, the supervisor backstop and the WIP commit all apply it; seal names each one with "generated or build file left out of the commit: <path>"). A file the run ADDED is left out when the repo's ignore rules match it (`git check-ignore --no-index`, so a force-added file counts), when it is byte-compiled or incremental build state anywhere (`*.pyc`, `*.pyo`, `*.tsbuildinfo`, `__pycache__/`, `<name>.egg-info/`), or when it sits under `dist/`, `build/`, `coverage/`, `.nyc_output/` or `target/` at the repo root or beside a package manifest. Kept: the task names the file, or that output or cache directory (`dist/`, `__pycache__/`, `<name>.egg-info/` ...) already holds a file tracked at the run base (a repo that commits it). Modified tracked files are never touched. The ignore rules are the tree's at commit time, which equal the base's unless the run edited a `.gitignore`.
206
+ - `LOKI_E10_REGEN_DROP` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (RD; `noteRegenerated`, `regenDrops` in `loki-ts/src/e10ext/commit_filter.ts`; the machine snapshots the tree around every verify run in `engine10/machine.ts`, and the commit stage in `stages/seal.ts` applies it). A path a verify run changed joins `<runDir>/regenerated.json`; a path a model stage (wall, implement, fix) later writes leaves it. At commit, a staged path still in that set is left out unless the task names it or one of its changed lines carries a task keyword (a backticked span, or an identifier of 5 or more characters with a digit, underscore or camelCase, or 8 or more letters), so a doc a test run regenerated in step with the change stays. Each drop is named on the receipt: "rewritten only by Loki's own check run, not by the change, and left out of the commit: <path>". The failure: a test run regenerated an unrelated doc page with a machine-specific path, the commit shipped it, and review failed a VERIFIED run as an unrelated edit.
207
+ - `LOKI_E10_DIFF_NEED` -- off by default since 11.141.0 (no bench measurement yet, GOALS A3.2), `1` opts in (DN; `needDrops`, `formattingOnly`, `suppressionOnly` in `loki-ts/src/e10ext/commit_filter.ts`, applied by the commit stage in `stages/seal.ts` after RD). Deliver only what the fix needs, with no model call: a staged modified file the task does not name is left out when its change is formatting only (base and head equal once whitespace, quote style, semicolons and trailing commas are normalized; Python, YAML and other whitespace-significant files keep their indentation, so only trailing space, blank lines and quotes are normalized), unless the task asks for formatting; or when its change only adds or removes lint-suppression comments (noqa, type: ignore, eslint-disable, @ts-ignore, @ts-expect-error, nolint, pylint: disable, rubocop:disable, #[allow(..)], @SuppressWarnings) in a file outside the stated scope (or with no scope signal), unless the task is about lint or warnings. Each drop is named on the receipt ("formatting-only change left out of the delivered diff: <path>"). The failures: a 177 KB delivered diff of reformatted generated route trees and schema files where the raw run delivered 4.5 KB, and a drive-by suppression removal in an unrelated file.
208
+ - `LOKI_E10_TEST_REACH` -- on by default, `0` opts out (TK; `exercisesChange` in `loki-ts/src/e10ext/scope.ts`, applied inside J3 `crossPackageTestEdits`). J3 never drops a test that imports the changed code: a JS/TS import or require whose relative specifier resolves to a changed source file (extension and `/index` optional) or names the changed file's package (its package.json name or a subpath), or a Go import of a changed file's package path (go.mod module plus directory; import blocks and single imports). A test that imports nothing changed is still dropped as before. Measured on synthetic layouts: a JS tests workspace importing the changed package, a relative import from a sibling package, and a Go package importing the changed subpackage were all dropped before (the run's only regression test, so the diff carried none) and are kept now; Python src-layout and Rust `tests/` are never J3 candidates.
161
209
  - `LOKI_E10_SCOPE_TEST_DROP` -- on by default, `0` opts out (J3; `loki-ts/src/e10ext/scope.ts` crossPackageTestEdits, applied by the commit stage in `stages/seal.ts`). The one non-advisory scope rule: a test file the run added or modified in an owner package (a Go directory, or a JS/TS package with its own package.json) where the change has no non-test change, the package has source files, and the task names neither the file nor the package, is reset to base (index and tree) before commit, with a NOT PROVEN line naming it. Source files, Python layouts, Go tests-only directories and test-only changes are never touched. On the tuning bench it fires on the 3 cross-package test scope fails and on 0 of 160 lean runs.
162
210
  - `LOKI_E10_FORMAT_RESOLVE` -- on by default, `0` opts out (J1; `loki-ts/src/runner/repo_profile.ts` detectFormatters / runFormattersRecord, called by the commit stage through `e10ext/commit_filter.ts` formatChangedRecord). The repo's own formatter is resolved the way verify resolves its linter: ruff through `util/check_result.ts` resolveTool (the project `.venv` or `venv`, then `uv run`, then PATH); prettier and biome stay repo-local binaries only. Only files the run added or modified and kept are formatted, and a modified file whose BASE text is not formatter-clean (the formatter's stdin mode prints something else, or fails) is left alone, so the run never reformats lines it did not write. The commit stage records `format: [{tool, cmd, formatted, skipped, error}]`, so a missing binary is visible. On the tuning bench the bare `ruff` argv found no binary (the repo's ruff is `.venv/bin/ruff`), nothing was formatted, and 11 judge fails were formatting. `=0` restores the bare argv with no base check.
211
+ - `LOKI_E10_FORMAT_FALLBACK` -- on by default, `0` opts out (FF; `pickRunnable` in `loki-ts/src/runner/repo_profile.ts`, fallbacks from `toolFallbacks` in `loki-ts/src/util/check_result.ts`, which verify's `lintFallbacks` now also uses). The commit-stage ruff formatter resolves exactly like verify's linter: the J1 resolution first (project venv, `uv run` with a uv.lock, PATH), and when that command cannot start (a spawn error, or a non-zero exit on the base text, such as `uv run -- ruff` with no ruff in the task venv), `uvx ruff`, then the repo venv's `python -m ruff`, unpinned exactly as the linter runs them. The first variant whose stdin form runs on one file's base text is used for every file; the J1 base-clean rule is unchanged (a file whose base text the chosen formatter would change is never formatted), and the format record carries `fallback` naming both commands. The failure: lint passed through `uvx ruff` while the formatter had no fallback, skipped every file ("exited 2 on the base text", "not runnable (ENOENT)"), and the judge failed style.
163
212
  - `LOKI_E10_RANKED_REMEDY` -- on by default, `0` opts out (`loki-ts/src/features/spec_ambiguity.ts` rankedRemedy, `loki-ts/src/util/conflict_resume.ts` resumeForRemedy). Intake extracts the issue's first-ranked remedy deterministically: a numbered list of at least two items under a "Possible / Suggested / Proposed fix or solution" heading or intro, or after "in order of preference" / "preferred"; the item marked preferred (and not a fallback) wins over item 1. It is stored as `intake.ranked_remedy`, never in `assumptions`. The implement brief names it after the task block (per-task text, outside the cache-stable prefix; `COVERAGE_FOLD` is unchanged) as the first site of the coverage check. After a clean LOKI_DONE with a non-empty diff, one tool-less Haiku check (`LOKI_E10_RANKED_REMEDY_MODEL`, default claude-haiku-5-5; the diff capped at 12,000 chars, at most 50 output tokens, thinking off) answers IMPLEMENTED or MISSING; only a parsed MISSING starts one targeted resume (`-rr`), and only a clean LOKI_DONE reply replaces the first result. The implement stage records `ranked_remedy: {check, usd, resumed}`. It fires only when a ranked list exists: on the 20 tuning tasks that was one task, where the runs had implemented the second-ranked remedy instead of the first.
164
213
  - `LOKI_E10_PACK_DIET` -- the implement context keeps only the code the task names plus its direct callers and callees (no fill up to the budget). `=0` restores the full pack. Code: `packDietEnabled` in `loki-ts/src/util/context_pack.ts`.
165
214
  - `LOKI_E10_PRECEDENT` -- sibling-implementation precedent is added to open either/or choices in the task. `=0` (or `off`/`false`) removes it. Code: `resolveChoices` in `loki-ts/src/features/spec_ambiguity.ts`.
@@ -113,6 +113,8 @@ create tags.
113
113
 
114
114
  Run the engine end-to-end check alone with `cd loki-ts && bun run test:engine10` (it runs `tests/min/engine10-e2e-stub.sh` through `scripts/local-ci.sh`).
115
115
 
116
+ `release.sh --ship` refuses with exit 6 (SHIP_CI_NOT_GREEN) unless the latest completed GitHub CI run (`PR fast tier`, `required-ci`; LOKI_RELEASE_CI_WORKFLOWS) on HEAD, or on its parent when HEAD has none, succeeded. A gh error or a timeout (LOKI_RELEASE_CI_TIMEOUT_S, default 30) also refuses. Push the release candidate and wait for its CI first. `bash scripts/release.sh --check-ci` runs the same check alone. Main's PR fast tier was red from acc-154 through v11.141.0, a CI-only timeout that local gates never saw.
117
+
116
118
  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
119
 
118
120
  ### 5. Verify ALL Distribution Channels