loki-mode 11.147.0 → 11.149.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.
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/lib/secret-scan.sh +15 -0
- package/autonomy/loki +1 -1
- package/autonomy/route.sh +2 -1
- package/bin/loki +1 -1
- package/dashboard/__init__.py +1 -1
- package/docs/CLI-CORE-VERBS.md +1 -0
- package/docs/CLI-INVENTORY.md +4 -3
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/DOCKER.md +17 -0
- package/docs/INSTALLATION.md +1 -1
- package/docs/dev/architecture-reference.md +14 -0
- package/loki-ts/dist/loki.js +2040 -1983
- package/mcp/__init__.py +1 -1
- package/package.json +2 -2
- package/packages/control-plane/dist/server.js +4022 -3406
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/web-app/dist/assets/{AdminPage-BMvwexjQ.js → AdminPage-DGn-ZwrX.js} +1 -1
- package/web-app/dist/assets/{Avatar-CfkC79c3.js → Avatar-D6xYYRV6.js} +1 -1
- package/web-app/dist/assets/{Badge-CQqH4Hem.js → Badge-BAXI_3hM.js} +1 -1
- package/web-app/dist/assets/{Button-4UdYP24d.js → Button-CJCAjARE.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-C7LEbCrM.js → CockpitPage-BrhPC1ZD.js} +1 -1
- package/web-app/dist/assets/{ComparePage-Ve1BS_x2.js → ComparePage-DySlRlBr.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-Cl9od_1B.js → ErrorBoundary-CQPz8it0.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-5eTo3MR7.js → EvidenceReceiptPanel-Bv4J9aTb.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-ChxzVbJj.js → GitHubIssuesPanel-CM5wpClg.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-DMyctO75.js → GitHubPRsPanel-DbVwShaS.js} +1 -1
- package/web-app/dist/assets/{HomePage-XkiUsK0I.js → HomePage-BOXnWRFb.js} +2 -2
- package/web-app/dist/assets/{LoginPage-Do4AESUj.js → LoginPage-DNH9832e.js} +1 -1
- package/web-app/dist/assets/{MagicPage-tQT4NhvK.js → MagicPage-CdG-Lept.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-BRpQ5j9b.js → MetricsPage-TeVX52my.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-CClAf7lp.js → NotFoundPage-msfGRP1f.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-Bm_5mzNw.js → ProjectPage-BrFw1RQj.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-BEqNV5uq.js → ProjectsPage-CSahAMPc.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-B-3niEp-.js → SettingsPage-DrzttnD8.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-Bgmf8L36.js → ShowcasePage-CMY99xDU.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-B2r4ns1l.js → SystemSettingsPage-CTBKHcW8.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-CFnggeui.js → TeamsPage-B1SLwRYf.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-A_4uAZY6.js → TemplatesPage-DKoUrW-8.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-BoEdnm-M.js → TerminalOutput-Cq1l7EUa.js} +1 -1
- package/web-app/dist/assets/{activity-BOSpWO2W.js → activity-C_XDyA1m.js} +1 -1
- package/web-app/dist/assets/{bell-IyUIduRQ.js → bell-F5IScW9w.js} +1 -1
- package/web-app/dist/assets/{bot-BM1VS3XN.js → bot-CFP0ucCb.js} +1 -1
- package/web-app/dist/assets/{check-DaoAoVE6.js → check-fpdxnTQV.js} +1 -1
- package/web-app/dist/assets/{chevron-left-D5iMrc40.js → chevron-left-AIHJVWdS.js} +1 -1
- package/web-app/dist/assets/{circle-alert-DR3HNYeA.js → circle-alert-BeM4Oesa.js} +1 -1
- package/web-app/dist/assets/{clock-DOc4LATU.js → clock-SItnv_Bu.js} +1 -1
- package/web-app/dist/assets/{cloud-Dks7qs40.js → cloud-D2l1m2bT.js} +1 -1
- package/web-app/dist/assets/{code-xml-CMdkWBY9.js → code-xml-Cj1tLUuY.js} +1 -1
- package/web-app/dist/assets/{database-CFaZAV5h.js → database-CBKeE0ZS.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-3r252MtY.js → dollar-sign-Bif9gTbR.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-BdfoBM6Q.js → file-code-corner-Dpx2amq5.js} +1 -1
- package/web-app/dist/assets/{file-plus-DWgk1WFy.js → file-plus-C9TZYImS.js} +1 -1
- package/web-app/dist/assets/{globe-CQs1OPNS.js → globe-BV5OTJhG.js} +1 -1
- package/web-app/dist/assets/{hammer-BvKxwbdj.js → hammer-Z4kx2Pf7.js} +1 -1
- package/web-app/dist/assets/{index-DymFh2L1.js → index-BcMGFWcI.js} +3 -3
- package/web-app/dist/assets/{layers-lcbVWAxC.js → layers-g0hDOb94.js} +1 -1
- package/web-app/dist/assets/{loader-circle-VSOQj5_P.js → loader-circle-Du21mqpp.js} +1 -1
- package/web-app/dist/assets/{lock-c6R6zJnw.js → lock-DoR5zEqp.js} +1 -1
- package/web-app/dist/assets/{package-DELuK13T.js → package-WZ9scqUB.js} +1 -1
- package/web-app/dist/assets/{plus-d2vcE9IO.js → plus-DiB4xtbb.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-BzJ6JHvZ.js → refresh-cw-Dgg1nz5p.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-CYKipckB.js → rotate-ccw-CMjUfFks.js} +1 -1
- package/web-app/dist/assets/{scroll-text-DDzufCS2.js → scroll-text-BYiE9Oae.js} +1 -1
- package/web-app/dist/assets/{server-BPIwN9NB.js → server-D6gsw90g.js} +1 -1
- package/web-app/dist/assets/{shield-alert-PoaTr3PN.js → shield-alert-D5ipgKHn.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-Bb7o5Vke.js → thumbs-up-Cl9fNBRO.js} +1 -1
- package/web-app/dist/assets/{trash-2-BT9DxpYE.js → trash-2-x26lUw2K.js} +1 -1
- package/web-app/dist/assets/{trending-down-BG2q1nVM.js → trending-down-mLz-dEnd.js} +1 -1
- package/web-app/dist/assets/{trending-up-DI1UcsKN.js → trending-up-Cdozn2U3.js} +1 -1
- package/web-app/dist/assets/{upload-ZC7osdna.js → upload-BeFjw57F.js} +1 -1
- package/web-app/dist/assets/{usePolling-T5CvoNTb.js → usePolling-BQAx6WUY.js} +1 -1
- package/web-app/dist/assets/{user-BBesY7Dg.js → user-Dtfvii04.js} +1 -1
- 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.
|
|
6
|
+
# Loki Mode v11.149.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.
|
|
464
|
+
**v11.149.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.149.0
|
|
@@ -64,6 +64,14 @@ _commit_scan_secret_file() {
|
|
|
64
64
|
# placeholder or an environment-variable reference rather than a literal.
|
|
65
65
|
local deny='(\$\{|\$[A-Za-z_]|process\.env|os\.(environ|getenv)|%[A-Za-z_]+%|your[-_]|redacted|changeme|change[-_]me|placeholder|example|dummy|sample|fake|<[^>]*>|x{4,}|\*{4,})'
|
|
66
66
|
|
|
67
|
+
# TEST FILES: a test's made-up credential (adminPassword: 'correct-horse-battery') is test data, not a leak. Tier 1 above
|
|
68
|
+
# (real key formats) still applies to them; the generic tier below does not. A finished run was refused its push for
|
|
69
|
+
# exactly that line (FireLater#24, 2026-11-17).
|
|
70
|
+
case "$file" in
|
|
71
|
+
*/__tests__/*|*/tests/*|*/test/*|*/spec/*|*/e2e/*|*.test.*|*.spec.*|*_test.py|*_test.go|*/test_*.py)
|
|
72
|
+
return 1 ;;
|
|
73
|
+
esac
|
|
74
|
+
|
|
67
75
|
# TIER 2: generic assignments + bearer tokens + connection-string creds.
|
|
68
76
|
local tier2='(api[_-]?key|secret|token|password|passwd|access[_-]?key|client[_-]?secret|auth)[A-Za-z0-9_]*[[:space:]]*[:=][[:space:]]*["'"'"']?[A-Za-z0-9_/+.=-]{16,}'
|
|
69
77
|
local bearer='[Bb]earer[[:space:]]+[A-Za-z0-9_.\-]{20,}'
|
|
@@ -109,6 +117,13 @@ _commit_path_looks_secret() {
|
|
|
109
117
|
local lower base
|
|
110
118
|
lower="$(printf '%s' "$p" | tr '[:upper:]' '[:lower:]')"
|
|
111
119
|
base="${lower##*/}"
|
|
120
|
+
# SOURCE FILES: a file of program code is judged by its content (the content scan), not by a word in its name.
|
|
121
|
+
# backend/src/migrations/037_refresh_token_sessions.ts, auth_token_service.py and secret_rotation.go are code about
|
|
122
|
+
# tokens and secrets, not token or secret files; that migration's name alone stopped a finished run (FireLater#16).
|
|
123
|
+
case "$base" in
|
|
124
|
+
*.ts|*.tsx|*.js|*.jsx|*.mjs|*.cjs|*.py|*.go|*.rb|*.rs|*.java|*.kt|*.swift|*.cs|*.php|*.sql|*.vue|*.svelte|*.c|*.h|*.cpp|*.sh|*.md)
|
|
125
|
+
return 1 ;;
|
|
126
|
+
esac
|
|
112
127
|
local cand
|
|
113
128
|
for cand in "$lower" "$base"; do
|
|
114
129
|
case "$cand" in
|
package/autonomy/loki
CHANGED
|
@@ -1852,7 +1852,7 @@ show_help_all() {
|
|
|
1852
1852
|
echo "Integration and maintenance (hidden from the front page; they keep working):"
|
|
1853
1853
|
echo " stats memory backup restore kpis report crash contract slack engine10 review mcp acp github"
|
|
1854
1854
|
echo " ci modernize self-update secrets sandbox docker web syslog test bench compliance enterprise"
|
|
1855
|
-
echo " audit metrics magic workspace agents trigger merge heal outcomes"
|
|
1855
|
+
echo " audit metrics magic workspace agents trigger merge heal outcomes knowledge"
|
|
1856
1856
|
echo ""
|
|
1857
1857
|
echo "Renamed (the old name keeps working unchanged; some targets arrive in later releases,"
|
|
1858
1858
|
echo "and until each one lands the old name is the way to do it):"
|
package/autonomy/route.sh
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
# Bash 3.2 compatible (no associative arrays, no ${var,,}).
|
|
11
11
|
|
|
12
12
|
# Flags that take a separate value token.
|
|
13
|
-
_ROUTE_VALUE_FLAGS=" --provider --budget --budget-limit --max-cost --max-iterations --max-retries --session-model --completion-promise --base-wait --max-wait --prd --brief --attempts --spec --isolation --output --engine --mirofish-rounds --mirofish-timeout --max-duration --log-level --compliance --cost --remote --issue --bmad-project --openspec --mirofish-docker --destination --domain --env-file --health-url --health-match --workspace --config --vars --seal-existing "
|
|
13
|
+
_ROUTE_VALUE_FLAGS=" --provider --budget --budget-limit --max-cost --max-iterations --max-retries --session-model --completion-promise --base-wait --max-wait --prd --brief --attempts --spec --isolation --output --engine --mirofish-rounds --mirofish-timeout --max-duration --log-level --compliance --cost --remote --issue --bmad-project --openspec --mirofish-docker --destination --domain --env-file --health-url --health-match --workspace --config --vars --seal-existing --label "
|
|
14
14
|
# Flags whose value is optional (cmd_start reads one only when it is present): --mirofish takes a URL (a token that does not
|
|
15
15
|
# start with --, as _loki_start_optval_consumes). Declared here so a refused one still consumes its value. --parallel is NOT
|
|
16
16
|
# here: cmd_start treats it as a plain boolean (_loki_start_flag_kind), so "--parallel 3" leaves 3 as a positional.
|
|
@@ -206,6 +206,7 @@ loki_route_resolve() {
|
|
|
206
206
|
--attempts) passthru+=(--attempts "$val"); continue ;;
|
|
207
207
|
--spec) passthru+=(--spec "$val"); continue ;;
|
|
208
208
|
--seal-existing) passthru+=(--seal-existing "$val"); continue ;;
|
|
209
|
+
--label) passthru+=(--label "$val"); continue ;; # several issues at once: loki start owner/repo --label L (issues_run.ts startMany)
|
|
209
210
|
--max-duration)
|
|
210
211
|
max_duration="$(_route_duration_s "$val")"
|
|
211
212
|
if [ -z "$max_duration" ] && [ -z "$cap_err" ]; then
|
package/bin/loki
CHANGED
|
@@ -1036,7 +1036,7 @@ fi
|
|
|
1036
1036
|
# Two-token routes (provider show/list, memory list/index) match on the first
|
|
1037
1037
|
# token only; the Bun dispatcher handles subcommand routing internally.
|
|
1038
1038
|
case "${1:-}" in
|
|
1039
|
-
version|--version|-v|status|stats|doctor|provider|memory|rollback|internal|kpis|estimate|trust|proof|receipt|wiki|crash|control|contract|slack|queue|issues|answer|undo|runs|verify-pr|completion|__complete)
|
|
1039
|
+
version|--version|-v|status|stats|doctor|provider|memory|knowledge|rollback|internal|kpis|estimate|trust|proof|receipt|wiki|crash|control|contract|slack|queue|issues|answer|undo|runs|verify-pr|completion|__complete)
|
|
1040
1040
|
# v7.5.2: rollback added (wires loki-ts/src/commands/rollback.ts).
|
|
1041
1041
|
# v7.5.3: internal added for autonomy/run.sh phase1-hooks calls.
|
|
1042
1042
|
# v7.5.28: kpis added (Phase K MVP: read-only KPI snapshot).
|
package/dashboard/__init__.py
CHANGED
package/docs/CLI-CORE-VERBS.md
CHANGED
|
@@ -18,6 +18,7 @@ provider; other providers and model routes are additions selected with
|
|
|
18
18
|
| --- | --- |
|
|
19
19
|
| `loki "<goal>"` | Build it: a goal, a PRD file or an issue (`owner/repo#N`). Shorthand for `loki start` |
|
|
20
20
|
| `loki start [SPEC]` | The primary path. Build from a PRD file, an issue (`owner/repo#N`, issue URL, `PROJ-1`), a quoted task or a one-word brief. Alias: `run` |
|
|
21
|
+
| `loki start owner/repo#12 owner/repo#15` | Several issues of one repository at once: each is a whole-issue run in its own worktree and ends with its own pull request and its own label (`safe to merge` or `needs you`). One status line per issue while they run, one summary line each at the end. `loki start owner/repo --label L` takes every open issue carrying the label. `LOKI_START_PARALLEL` sets how many run at once (default 3, at most 4); a dollar cap is one total shared by all of them |
|
|
21
22
|
| `loki chat [--attach]` | Interactive alternative to `loki start`; `--attach` joins the running build |
|
|
22
23
|
| `loki status [--json]` | What is running and where it stands |
|
|
23
24
|
| `loki verify [base] [--fast] [--json] [--pubkey FILE]` | Deterministic verification with CI-gate exit codes |
|
package/docs/CLI-INVENTORY.md
CHANGED
|
@@ -7,11 +7,11 @@ Classes: KEEP (the 11 commands in `loki --help` and completions), HIDE (keeps wo
|
|
|
7
7
|
## Counts
|
|
8
8
|
|
|
9
9
|
- KEEP: 12
|
|
10
|
-
- HIDE:
|
|
10
|
+
- HIDE: 43
|
|
11
11
|
- FOLD: 61
|
|
12
12
|
- REMOVED: 29
|
|
13
|
-
- Total rows:
|
|
14
|
-
- Registry paths (commands and nested subcommands):
|
|
13
|
+
- Total rows: 145
|
|
14
|
+
- Registry paths (commands and nested subcommands): 218
|
|
15
15
|
|
|
16
16
|
## Commands
|
|
17
17
|
|
|
@@ -23,6 +23,7 @@ Classes: KEEP (the 11 commands in `loki --help` and completions), HIDE (keeps wo
|
|
|
23
23
|
| doctor | bun route, bash fallthrough | KEEP | Core onboarding gate | |
|
|
24
24
|
| provider | bun route, bash fallthrough | FOLD | Provider-agnostic core | loki config set provider NAME |
|
|
25
25
|
| memory | bun route, bash fallthrough | HIDE | Memory still carries legacy store paths | |
|
|
26
|
+
| knowledge | loki-ts/src/cli.ts | HIDE | Shown by doctor --repo; the visible command list stays at 11 | |
|
|
26
27
|
| rollback | bun route, bash fallthrough | FOLD | Checkpoint restore is engine-neutral | loki undo <run> |
|
|
27
28
|
| backup | autonomy/loki | HIDE | Enterprise retention and backup (D99 item 7) | |
|
|
28
29
|
| restore | autonomy/loki | HIDE | Enterprise retention and backup (D99 item 7) | |
|
package/docs/CLI-REFERENCE.md
CHANGED
|
@@ -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.
|
|
3
|
+
Generated from `loki-ts/src/cli/registry.ts` by `scripts/generate-stale-zero.sh` for v11.149.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 |
|
package/docs/DOCKER.md
CHANGED
|
@@ -468,3 +468,20 @@ Business Source License 1.1 (BUSL-1.1). Source-available, not open source. See [
|
|
|
468
468
|
|
|
469
469
|
- [GitHub Issues](https://github.com/asklokesh/loki-mode/issues)
|
|
470
470
|
- [Documentation Wiki](https://github.com/asklokesh/loki-mode/wiki)
|
|
471
|
+
|
|
472
|
+
## Always running: one container that works tagged issues
|
|
473
|
+
|
|
474
|
+
`loki issues watch owner/repo` is the always-on form of Loki. It keeps its own checkout of the repository current, and every interval it works each open issue that carries the label (default `loki`) and has no Loki pull request yet, one pull request per issue. The image's entrypoint is `loki`, so the container command is just the arguments:
|
|
475
|
+
|
|
476
|
+
```bash
|
|
477
|
+
docker run -d --name loki-watch \
|
|
478
|
+
-e GH_TOKEN -e ANTHROPIC_API_KEY -e LOKI_WATCH_SETUP_GIT=1 \
|
|
479
|
+
asklokesh/loki-mode:latest issues watch OWNER/REPO --label loki --interval 300 --parallel 2
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
- Credentials come from the environment only: `GH_TOKEN` (a token that can read issues and push branches and open pull requests on that repository) and `ANTHROPIC_API_KEY`. `LOKI_WATCH_SETUP_GIT=1` lets git push over https with that token.
|
|
483
|
+
- One container per repository. Two on the same repository would pick up the same issue.
|
|
484
|
+
- Nothing on its disk needs to survive a restart: the checkout is rebuilt from GitHub, and an issue that already has a Loki pull request is skipped.
|
|
485
|
+
- An issue whose runs end with no pull request is tried twice (`LOKI_WATCH_ATTEMPTS`), then held back; the log names it and the file to delete to try again. This keeps a failing issue from being rerun, and paid for, every interval.
|
|
486
|
+
- Stop it with SIGTERM (docker stop): the pass in flight is interrupted and the loop ends.
|
|
487
|
+
- Manifests: `deploy/kubernetes/loki-watch.yaml` (Deployment) and `deploy/ecs/loki-watch-task.json` (Fargate task). Options: `--label`, `--interval` (seconds, 30 or more), `--parallel`, `--limit`, `--draft`, `--once` (one pass, then exit), `--dir` (where checkouts live; `LOKI_WATCH_DIR`).
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -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.
|
|
5
|
+
**Version:** v11.149.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
|
|
|
@@ -263,6 +263,20 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
|
|
|
263
263
|
|
|
264
264
|
extract_learnings_from_session (autonomy/run.sh) mirrors learnings and decisions into .loki/memory/learnings/project-*.jsonl. get_relevant_learnings adds a bounded newest-first project_memory list (15 entries, LOKI_PROJECT_MEMORY_MAX_CHARS, default 2000) to .loki/state/relevant-learnings.json at run start. LOKI_PROJECT_MEMORY=0 disables both.
|
|
265
265
|
|
|
266
|
+
The engine10 implement brief reads `.loki/state/relevant-learnings.json` only with `LOKI_LEARNINGS_INJECT=1` (`learningsBlock` in `loki-ts/src/util/pr_lessons.ts`). These notes are model-written and marked unverified, and no run has shown a gain from them, so like the PR lessons (`LOKI_PR_LESSONS=1`) and the org graph (`LOKI_ORG_GRAPH=1`) they are opt-in. What a run is told about its repository by default is the repo card below.
|
|
267
|
+
|
|
268
|
+
## Repo card: what Loki knows about a repository (`loki-ts/src/e10ext/repomemory.ts`)
|
|
269
|
+
|
|
270
|
+
One mechanism, on by default, `LOKI_REPO_CARD=0` opts out (nothing read, nothing written, and the issue brief loses the one layout sentence below). No embeddings, no database, no model-written memory: every fact is something the harness ran.
|
|
271
|
+
|
|
272
|
+
- **Facts.** `setup`: the part of an issue run's proof script before its first `loki_http` / `loki_cmd` line (services through `loki_pg_start` / `loki_redis_start`, migrations, starting the product, the first record), kept only when Loki's own re-run of that script printed at least one check result, which happens only after the setup. `quirk`: each `# QUIRK:` comment line in that setup. `env`: the services the repository needs and the names the setup exports. `command`: the commands of verify checks that passed. Every fact records the base commit of the run (the facts were verified on that run's change, built on it, and every renderer says "a change based on <commit>"), a lockfile hash (sha256 over the tracked lockfiles in any directory, or the manifests when there are none) and the run.
|
|
273
|
+
- **What is refused.** A setup is not stored when the script calls no check, has fewer than 4 lines or more than 12000 characters before the first check, does not parse by itself (`bash -n`), still names a path of the machine after the repository path is replaced by `${LOKI_REPO_ROOT}`, or carries something shaped like a real provider credential. The generic secret redactor is deliberately not applied to a setup: it blanks the throwaway password and signing secret the script invents for its own empty database, and the recipe stops running.
|
|
274
|
+
- **Where.** The local copy is `~/.loki/repo-cards/<sha256 of the normalized origin URL, else the absolute path>/card.json` (directory 0700, file 0600), written by the seal stage after every issue run, so a fresh clone of the same origin reads it with no action from the user. `loki knowledge export` writes the same card to `.github/loki-repo-card.md` for a team to commit, so it travels with every clone, teammate, CI job and container. The path is under `.github/` because `.claude/` is ignored in real repositories (FireLater's own tracked `.gitignore` ignores it, so a card there would never reach a clone), and `.loki/` is ignored run state. Loki reads the file itself and puts it in the brief, so no provider has to load it; the command warns when git ignores the path. Loki never commits it. `.loki/memory/repo-card.md` (ignored run state) is a rendered mirror for the Knowledge tab. When both copies exist, per fact the one verified on the newer commit wins. A setup read from the committed file passes the same refusal test as a captured one (size, credential shape, machine path, `bash -n`) or is not read, and every fact from that file is labelled in the brief as "from the card committed in this repository, not run on this machine".
|
|
275
|
+
- **Use.** The implement stage of an issue run on claude appends the card to the brief's repository context (fixed order, no timestamps or run ids, so the bytes change only when the card or the lockfiles do), writes the setup to `$LOKI_SCRATCH/loki-setup.sh`, records `repo-card.json` in the run directory, `repo_card` in the implement data and a `repo.card` event. The brief tells the session to start its `loki-proof.sh` from the setup. The fixed sentence `SETUP_FIRST_LINE` (setup first, at the top level, `# QUIRK:` above a workaround) follows `PROOF_SCRIPT_LINE` in the issue brief.
|
|
276
|
+
- **Staleness.** A fact whose lockfile hash differs from the checkout's is shown as "last verified on <commit> with other dependency files: check before trusting". A stored setup is dropped at seal when the run's proof script carried it (7 in 10 of its lines), exited non-zero and reached no check. A stored command whose check could not start this run is dropped.
|
|
277
|
+
- **Show.** `loki knowledge` (`--json`), and `loki doctor --repo` prints the same lines after the repo profile.
|
|
278
|
+
- **What it replaced.** `verified_command.json` (E-126): the brief read it on every run and nothing ever wrote it.
|
|
279
|
+
|
|
266
280
|
## Verdicts, composite receipts and the autonomy ladder (v11.7.0)
|
|
267
281
|
- Two sets: receipt verdicts (`engine10/types.ts` Verdict: VERIFIED, PARTIAL, ALREADY_SATISFIED, SPEC_CONFLICT, FAILED) and run outcomes (`engine10/output.ts` Outcome adds BUDGET_STOP, BLOCKED, STALLED, CANCELLED; exit ladder EXIT). Only receipt verdicts are sealed.
|
|
268
282
|
- Composite: `features/speed/seal_group.ts` composeComposite/verifyComposite (schema `loki.v10.composite/1`), sealed by `loki verify --seal-composite <run_dir>`, signed with the existing `signReceipt`, capped by `capGroupVerdict`. Workspace runs seal it after integration.json.
|