loki-mode 11.141.6 → 11.142.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/agents/types.json +3 -3
- package/autonomy/lib/backlog.py +156 -20
- package/autonomy/loki +6 -3
- package/autonomy/telemetry.sh +1 -2
- package/dashboard/__init__.py +1 -1
- package/dashboard/server.py +4 -2
- package/dashboard/telemetry.py +1 -1
- package/docs/CLI-REFERENCE.md +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/docs/dev/architecture-reference.md +2 -0
- package/docs/v10/GUIDE.md +3 -1
- package/loki-ts/dist/loki.js +2 -2
- package/mcp/__init__.py +1 -1
- package/package.json +2 -2
- package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
- package/references/agent-types.md +3 -3
- package/references/business-ops.md +2 -2
- package/references/cursor-learnings.md +1 -1
- package/skills/agents.md +2 -2
- package/skills/github-integration.md +6 -0
- package/skills/model-selection.md +2 -2
- package/src/audit/compliance.js +11 -11
- package/web-app/dist/assets/{AdminPage-i9PHmMPD.js → AdminPage-DyMZec5q.js} +1 -1
- package/web-app/dist/assets/{Avatar-D_6q3v1s.js → Avatar-COqdNbsk.js} +1 -1
- package/web-app/dist/assets/{Badge-OB8s72yd.js → Badge-MAPrG4YW.js} +1 -1
- package/web-app/dist/assets/{Button-DrmV9ik6.js → Button-CCiLxPzL.js} +1 -1
- package/web-app/dist/assets/{CockpitPage-DJrzZLPZ.js → CockpitPage-CC65JqZo.js} +1 -1
- package/web-app/dist/assets/{ComparePage-CPClwQTQ.js → ComparePage-D8jLo09H.js} +1 -1
- package/web-app/dist/assets/{ErrorBoundary-EA1o3dOi.js → ErrorBoundary-DSe6Jio9.js} +1 -1
- package/web-app/dist/assets/{EvidenceReceiptPanel-CPUmEtva.js → EvidenceReceiptPanel-C2AkMLOP.js} +1 -1
- package/web-app/dist/assets/{GitHubIssuesPanel-ED2faRlk.js → GitHubIssuesPanel-xCJ1P7Zg.js} +1 -1
- package/web-app/dist/assets/{GitHubPRsPanel-Bclc5nd2.js → GitHubPRsPanel-2AY8_R8P.js} +1 -1
- package/web-app/dist/assets/{HomePage-Bv3f7LxZ.js → HomePage-DOf4taLJ.js} +2 -2
- package/web-app/dist/assets/{LoginPage-BTFpc_0h.js → LoginPage-C0wwSd39.js} +1 -1
- package/web-app/dist/assets/{MagicPage-D6qauYXz.js → MagicPage-BD3E-KJd.js} +1 -1
- package/web-app/dist/assets/{MetricsPage-DZfxKmxi.js → MetricsPage-qarlBbRU.js} +1 -1
- package/web-app/dist/assets/{NotFoundPage-C-ZQu1UW.js → NotFoundPage-BtrUhTdf.js} +1 -1
- package/web-app/dist/assets/{ProjectPage-CRFiZLSc.js → ProjectPage-D4WKVQ7S.js} +3 -3
- package/web-app/dist/assets/{ProjectsPage-BavFLKKb.js → ProjectsPage-jCrAWz4h.js} +1 -1
- package/web-app/dist/assets/{SettingsPage-zfZDQjF-.js → SettingsPage-B4pPpffz.js} +1 -1
- package/web-app/dist/assets/{ShowcasePage-DlHcRnXc.js → ShowcasePage-DOjR7Ex-.js} +1 -1
- package/web-app/dist/assets/{SystemSettingsPage-pFanwBec.js → SystemSettingsPage-95JqUbHx.js} +1 -1
- package/web-app/dist/assets/{TeamsPage-BLevzZIc.js → TeamsPage-yt8gvIKl.js} +1 -1
- package/web-app/dist/assets/{TemplatesPage-ylTIFbRI.js → TemplatesPage-DoUDJ9ub.js} +1 -1
- package/web-app/dist/assets/{TerminalOutput-CubbKVIZ.js → TerminalOutput-1rC0J4Bk.js} +1 -1
- package/web-app/dist/assets/{activity-CAWSp_6M.js → activity-Cl3Uec2Y.js} +1 -1
- package/web-app/dist/assets/{bell-jGlMrpVq.js → bell-DtNdQWzd.js} +1 -1
- package/web-app/dist/assets/{bot-2hTcA-8p.js → bot-DDpmlSz3.js} +1 -1
- package/web-app/dist/assets/{check-D80eIYDT.js → check-BMbCof2H.js} +1 -1
- package/web-app/dist/assets/{chevron-left-CnH2CR-8.js → chevron-left-ByTbAUwf.js} +1 -1
- package/web-app/dist/assets/{circle-alert-C7oUl8Ek.js → circle-alert-Bn9aE4IN.js} +1 -1
- package/web-app/dist/assets/{clock-DOzHiqGs.js → clock-SBTAfWqd.js} +1 -1
- package/web-app/dist/assets/{cloud-FSE-P1Jp.js → cloud-ChyNGWkw.js} +1 -1
- package/web-app/dist/assets/{code-xml-CJnb9wRC.js → code-xml-DI_krPD4.js} +1 -1
- package/web-app/dist/assets/{database-aawTQ1Q7.js → database-Wd5ifrBK.js} +1 -1
- package/web-app/dist/assets/{dollar-sign-FvH5JFJr.js → dollar-sign-C_lCtKRp.js} +1 -1
- package/web-app/dist/assets/{file-code-corner-f13oHQ3O.js → file-code-corner-qM8aq8IB.js} +1 -1
- package/web-app/dist/assets/{file-plus-iOo8cPnc.js → file-plus-C6LCrbiu.js} +1 -1
- package/web-app/dist/assets/{globe-DQ9k16nT.js → globe-CDZS309O.js} +1 -1
- package/web-app/dist/assets/{hammer-BS6OgHCv.js → hammer-Cyaf53eE.js} +1 -1
- package/web-app/dist/assets/{index-D9_qIW5t.js → index-D0a1MQnH.js} +3 -3
- package/web-app/dist/assets/{layers-DkgEg5Ww.js → layers-DG1AyE8w.js} +1 -1
- package/web-app/dist/assets/{loader-circle-DkjkYuPZ.js → loader-circle-D5yySgBF.js} +1 -1
- package/web-app/dist/assets/{lock-C6YNAGAd.js → lock-CJy7cTHd.js} +1 -1
- package/web-app/dist/assets/{package-EMz5m_kz.js → package-C7i6KmVK.js} +1 -1
- package/web-app/dist/assets/{plus-ALTNaQeY.js → plus-rqC7IjWg.js} +1 -1
- package/web-app/dist/assets/{refresh-cw-CHtVqI4m.js → refresh-cw-CtIjcJKv.js} +1 -1
- package/web-app/dist/assets/{rotate-ccw-C70B3mg2.js → rotate-ccw-CAmSTk-m.js} +1 -1
- package/web-app/dist/assets/{scroll-text-BKIkCUal.js → scroll-text-C300cwvb.js} +1 -1
- package/web-app/dist/assets/{server-DVlrE-zu.js → server-CgwnLQuj.js} +1 -1
- package/web-app/dist/assets/{shield-alert-DNcGRK6A.js → shield-alert-Cu4nt6vg.js} +1 -1
- package/web-app/dist/assets/{thumbs-up-DPAOjRCj.js → thumbs-up-8OQoTJWS.js} +1 -1
- package/web-app/dist/assets/{trash-2-CLgQfWQK.js → trash-2-CIgxRV_x.js} +1 -1
- package/web-app/dist/assets/{trending-down-C_C7_So6.js → trending-down-CelWNzAc.js} +1 -1
- package/web-app/dist/assets/{trending-up-D_L2MWc2.js → trending-up-B-mBwFXP.js} +1 -1
- package/web-app/dist/assets/{upload-_qHiSlwI.js → upload-BkfzF_e_.js} +1 -1
- package/web-app/dist/assets/{usePolling-z23loSZm.js → usePolling-CtnMxKVF.js} +1 -1
- package/web-app/dist/assets/{user-BeGvNcEy.js → user-BvZ0JmEO.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.142.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.142.0 | [Autonomi](https://www.autonomi.dev/) flagship product | core skill**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
11.
|
|
1
|
+
11.142.0
|
package/agents/types.json
CHANGED
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
"type": "ops-compliance",
|
|
124
124
|
"swarm": "operations",
|
|
125
125
|
"name": "Compliance Engineer",
|
|
126
|
-
"persona": "You are a senior compliance engineer specializing in
|
|
127
|
-
"focus": ["
|
|
128
|
-
"capabilities": "
|
|
126
|
+
"persona": "You are a senior compliance engineer specializing in audit preparation, policy documentation, and policy enforcement. You draft evidence and documents for the team's own review; you never state that a system is certified or compliant.",
|
|
127
|
+
"focus": ["audit preparation", "policy documentation", "policy enforcement", "evidence collection"],
|
|
128
|
+
"capabilities": "Audit preparation, policy documentation, policy enforcement, evidence collection (drafts for review, no compliance claim)"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"type": "biz-marketing",
|
package/autonomy/lib/backlog.py
CHANGED
|
@@ -40,6 +40,21 @@ each as `loki jira:PROJ-N` / `loki linear:TEAM-N` from the current checkout.
|
|
|
40
40
|
--issues takes item numbers (12 means PROJ-12). A large Jira or Linear item runs
|
|
41
41
|
as one run: the engine splits only GitHub issues today.
|
|
42
42
|
|
|
43
|
+
What the user sees: one line per state change (queued, running with the log
|
|
44
|
+
path, the result), a heartbeat line every LOKI_BACKLOG_HEARTBEAT_S seconds
|
|
45
|
+
(default 120, 0 off) naming what still runs, and at the end one row per item
|
|
46
|
+
(cost, time, result with its PR or PR count) plus one Total line (done, not
|
|
47
|
+
done, PRs, cost, time). Child output goes only to <checkout>-backlog/logs. A
|
|
48
|
+
SIGINT or SIGTERM stops the children and still prints the rows and the Total
|
|
49
|
+
(exit 130). A finished run's receipts are kept under
|
|
50
|
+
<checkout>-backlog/receipts/<item> before its worktree is removed.
|
|
51
|
+
|
|
52
|
+
LOKI_BACKLOG_LOCAL_ORIGIN=1 (off by default) accepts a checkout whose origin is
|
|
53
|
+
a local bare repository (an absolute path, the rule engine10-push.sh uses):
|
|
54
|
+
issues are still read from owner/repo, and each run publishes its branch to
|
|
55
|
+
that bare repository and prints PR: local://<path>#<branch>. For rehearsals and
|
|
56
|
+
tests: branches and PRs go to the local bare repository; the run still uses GitHub for the issue itself.
|
|
57
|
+
|
|
43
58
|
Test seam: LOKI_BACKLOG_LAUNCHER replaces the real launcher (called with the
|
|
44
59
|
issue ref, cwd = the issue worktree).
|
|
45
60
|
"""
|
|
@@ -91,6 +106,17 @@ def origin_slug(cwd):
|
|
|
91
106
|
return m.group(1) if m else ""
|
|
92
107
|
|
|
93
108
|
|
|
109
|
+
def local_bare_origin(cwd):
|
|
110
|
+
"""The origin path when it is a local bare repository (absolute, colon-free, its own git dir), else ""."""
|
|
111
|
+
url = git("config", "--get", "remote.origin.url", cwd=cwd).stdout.strip()
|
|
112
|
+
if not url.startswith("/") or ":" in url or not os.path.isdir(url):
|
|
113
|
+
return ""
|
|
114
|
+
real = os.path.realpath(url)
|
|
115
|
+
if git("rev-parse", "--is-bare-repository", cwd=real).stdout.strip() != "true":
|
|
116
|
+
return ""
|
|
117
|
+
return url if os.path.realpath(git("rev-parse", "--absolute-git-dir", cwd=real).stdout.strip()) == real else ""
|
|
118
|
+
|
|
119
|
+
|
|
94
120
|
def _issue(i, repo):
|
|
95
121
|
"""One work item. key: the job-table key; label: how it prints; ref: what the launcher runs; slug: branch suffix."""
|
|
96
122
|
labels = [l.get("name", "") if isinstance(l, dict) else str(l) for l in i.get("labels") or []]
|
|
@@ -230,9 +256,41 @@ def add_spend(usd):
|
|
|
230
256
|
json.dump(data, f)
|
|
231
257
|
|
|
232
258
|
|
|
259
|
+
def pr_urls(text):
|
|
260
|
+
"""-> (distinct PR urls a run printed, how many more it only counted). local://: published to a local bare origin (engine10-push.sh)."""
|
|
261
|
+
urls = list(dict.fromkeys(re.findall(r"^PR:\s+((?:https?|local)://\S+)", text, re.M)))
|
|
262
|
+
more = re.search(r"^PR:\s+\(\+(\d+) more", text, re.M) # issues_epic.ts prLines folds the rest into a count
|
|
263
|
+
return urls, int(more.group(1)) if more else 0
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
def pr_count(text):
|
|
267
|
+
urls, more = pr_urls(text)
|
|
268
|
+
return len(urls) + more
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
def pr_text(text):
|
|
272
|
+
""""PR <url>" for the one PR an issue should end in; a run that opened several says how many and why (its Combined line)."""
|
|
273
|
+
urls, more = pr_urls(text)
|
|
274
|
+
if not urls:
|
|
275
|
+
return ""
|
|
276
|
+
if len(urls) + more == 1:
|
|
277
|
+
return "PR " + urls[0]
|
|
278
|
+
why = re.search(r"^Combined:\s+(.+)$", text, re.M)
|
|
279
|
+
note = " (%s)" % clip(why.group(1).strip(), 140) if why else ""
|
|
280
|
+
return "%d PRs%s, first %s" % (len(urls) + more, note, urls[0])
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
def clip(s, n):
|
|
284
|
+
return s if len(s) <= n else s[:n - 3] + "..."
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
def mins(seconds):
|
|
288
|
+
return "%ds" % round(seconds) if seconds < 90 else "%dm" % round(seconds / 60.0)
|
|
289
|
+
|
|
290
|
+
|
|
233
291
|
def parse_result(rc, text):
|
|
234
292
|
"""-> (ok, status line text, cost_usd or None)."""
|
|
235
|
-
pr =
|
|
293
|
+
pr = pr_text(text)
|
|
236
294
|
why = re.search(r"^Reason:\s+(.+)$", text, re.M)
|
|
237
295
|
cost = re.search(r"^Cost:\s+(?:partial:\s+)?\$([0-9]+(?:\.[0-9]+)?)", text, re.M)
|
|
238
296
|
usd = float(cost.group(1)) if cost else None
|
|
@@ -241,13 +299,13 @@ def parse_result(rc, text):
|
|
|
241
299
|
usd = (usd or 0.0) + float(plan.group(1))
|
|
242
300
|
reason = why.group(1).strip() if why else ""
|
|
243
301
|
if rc == 0:
|
|
244
|
-
return True,
|
|
302
|
+
return True, pr or "VERIFIED", usd
|
|
245
303
|
if rc == 4:
|
|
246
304
|
return False, "BLOCKED: " + (reason or "see the run log"), usd
|
|
247
305
|
if rc == 3:
|
|
248
306
|
return False, "BUDGET_STOP: " + (reason or "run cost cap reached"), usd
|
|
249
307
|
if rc == 6: # PARTIAL: some proof missing; counts as done only with its (draft) PR
|
|
250
|
-
return bool(pr), ("PARTIAL,
|
|
308
|
+
return bool(pr), ("PARTIAL, " + pr) if pr else "PARTIAL: " + (reason or "not every check proven"), usd
|
|
251
309
|
return False, "FAILED: " + (reason or "exit %d" % rc), usd
|
|
252
310
|
|
|
253
311
|
|
|
@@ -392,7 +450,8 @@ def main(argv):
|
|
|
392
450
|
top = git("rev-parse", "--show-toplevel").stdout.strip()
|
|
393
451
|
if not top:
|
|
394
452
|
return die("run this from a checkout of %s" % a.repo)
|
|
395
|
-
|
|
453
|
+
local_origin = local_bare_origin(top) if os.environ.get("LOKI_BACKLOG_LOCAL_ORIGIN") == "1" and not tracker else ""
|
|
454
|
+
if not tracker and not local_origin and origin_slug(top).lower() != a.repo.lower():
|
|
396
455
|
return die("this checkout's origin is %r, not %s; cd into a checkout of %s"
|
|
397
456
|
% (origin_slug(top) or "unknown", a.repo, a.repo))
|
|
398
457
|
|
|
@@ -496,24 +555,70 @@ def main(argv):
|
|
|
496
555
|
"done": u["done"], "base": u["base"], "drop": sum(TRACKER_SECRETS.values(), ())} # a unit is a text task: no tracker token
|
|
497
556
|
if u["spec"]: # frozen group acceptance for unit_mode (wall.ts)
|
|
498
557
|
spec[k]["env"].update(LOKI_UNIT_SPEC=u["spec"], LOKI_SPEED="1")
|
|
499
|
-
state = {k: {"status": "queued", "ok": None, "cost": None, "ran": False} for k in spec}
|
|
558
|
+
state = {k: {"status": "queued", "ok": None, "cost": None, "ran": False, "prs": 0, "secs": None} for k in spec}
|
|
500
559
|
for k in state:
|
|
501
560
|
say("backlog: %s queued" % spec[k]["label"])
|
|
502
561
|
for n, (ok, status) in routed.items(): # in the summary, never in the job queue
|
|
503
|
-
state[n] = {"status": status, "ok": ok, "cost": None, "ran": False}
|
|
562
|
+
state[n] = {"status": status, "ok": ok, "cost": None, "ran": False, "prs": 0, "secs": None}
|
|
504
563
|
pending = list(spec)
|
|
505
564
|
running = {} # key -> (Popen, log path, worktree)
|
|
506
565
|
unmeasured = 0
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
566
|
+
t_start = time.time()
|
|
567
|
+
started = {} # key -> launch time
|
|
568
|
+
stop = [] # the signal that asked for a stop: the loop below ends, the children are stopped and the summary still prints
|
|
569
|
+
done_at_signal = set() # children that had already exited when the first signal came: they keep their real result
|
|
570
|
+
|
|
571
|
+
def term_children():
|
|
572
|
+
for k, (p, _l, _w) in list(running.items()):
|
|
573
|
+
if k in done_at_signal:
|
|
574
|
+
continue
|
|
510
575
|
try:
|
|
511
576
|
os.killpg(p.pid, signal.SIGTERM)
|
|
512
577
|
except OSError:
|
|
513
578
|
pass
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
579
|
+
|
|
580
|
+
def on_signal(signum, _f): # the children are told at once, even while a launch is still preparing a worktree
|
|
581
|
+
if not stop: # before any SIGTERM from us, an exited child finished on its own
|
|
582
|
+
done_at_signal.update(k for k, (p, _l, _w) in list(running.items()) if p.poll() is not None)
|
|
583
|
+
stop.append(signum)
|
|
584
|
+
term_children()
|
|
585
|
+
signal.signal(signal.SIGTERM, on_signal)
|
|
586
|
+
signal.signal(signal.SIGINT, on_signal)
|
|
587
|
+
|
|
588
|
+
def stop_children():
|
|
589
|
+
"""SIGTERM every child's process group, give the engine its cancel grace, then SIGKILL what is left."""
|
|
590
|
+
term_children()
|
|
591
|
+
try:
|
|
592
|
+
grace = float(os.environ.get("LOKI_BACKLOG_STOP_GRACE_S") or 30)
|
|
593
|
+
except ValueError:
|
|
594
|
+
grace = 30.0
|
|
595
|
+
deadline = time.time() + grace
|
|
596
|
+
for p, _l, _w in running.values():
|
|
597
|
+
try:
|
|
598
|
+
p.wait(timeout=max(0.1, deadline - time.time()))
|
|
599
|
+
except subprocess.TimeoutExpired:
|
|
600
|
+
try:
|
|
601
|
+
os.killpg(p.pid, signal.SIGKILL)
|
|
602
|
+
except OSError:
|
|
603
|
+
pass
|
|
604
|
+
p.wait()
|
|
605
|
+
|
|
606
|
+
def keep_receipts(k, wt):
|
|
607
|
+
"""Copy the run dirs (receipt, events, epic.json, slice receipts) out before the worktree goes."""
|
|
608
|
+
src = os.path.join(wt, ".loki", "runs")
|
|
609
|
+
if spec[k]["unit"] or os.path.islink(src) or not os.path.isdir(src):
|
|
610
|
+
return
|
|
611
|
+
dst = os.path.join(wt_root, "receipts", spec[k]["wt"])
|
|
612
|
+
try:
|
|
613
|
+
if os.path.lexists(dst): # an earlier run's receipts move aside under a dated name, never deleted
|
|
614
|
+
base = "%s.%s" % (dst, time.strftime("%Y%m%d-%H%M%S", time.localtime(os.lstat(dst).st_mtime)))
|
|
615
|
+
aside, i = base, 1
|
|
616
|
+
while os.path.lexists(aside):
|
|
617
|
+
aside, i = "%s-%d" % (base, i), i + 1
|
|
618
|
+
os.rename(dst, aside)
|
|
619
|
+
shutil.copytree(src, dst, symlinks=True, ignore=shutil.ignore_patterns("worktrees", "node_modules"))
|
|
620
|
+
except (OSError, shutil.Error):
|
|
621
|
+
pass
|
|
517
622
|
|
|
518
623
|
def harvest(k, wt):
|
|
519
624
|
"""Copy the newest unit receipt and events into the group dir before the worktree goes."""
|
|
@@ -550,9 +655,10 @@ def main(argv):
|
|
|
550
655
|
except OSError:
|
|
551
656
|
pass
|
|
552
657
|
|
|
553
|
-
def finish(k):
|
|
658
|
+
def finish(k, stopped=False):
|
|
554
659
|
nonlocal unmeasured
|
|
555
660
|
p, log, wt = running.pop(k)
|
|
661
|
+
state[k]["secs"] = time.time() - started[k]
|
|
556
662
|
try:
|
|
557
663
|
with open(log, errors="replace") as f:
|
|
558
664
|
text = redact(f.read(), token)
|
|
@@ -561,13 +667,16 @@ def main(argv):
|
|
|
561
667
|
except OSError:
|
|
562
668
|
text = ""
|
|
563
669
|
ok, status, usd = parse_result(p.returncode, text)
|
|
670
|
+
if stopped: # the child was killed mid-run: never read its exit code as the run's verdict
|
|
671
|
+
ok, status = False, "STOPPED: interrupted%s; worktree kept at %s" % (", " + pr_text(text) if pr_text(text) else "", wt)
|
|
564
672
|
if usd is None:
|
|
565
673
|
unmeasured += 1
|
|
566
674
|
else:
|
|
567
675
|
add_spend(usd)
|
|
568
|
-
state[k].update(status=status, ok=ok, cost=usd)
|
|
676
|
+
state[k].update(status=status, ok=ok, cost=usd, prs=pr_count(text))
|
|
569
677
|
say("backlog: %s %s" % (spec[k]["label"], status))
|
|
570
678
|
harvest(k, wt)
|
|
679
|
+
keep_receipts(k, wt)
|
|
571
680
|
if ok:
|
|
572
681
|
git("worktree", "remove", "--force", wt, cwd=top)
|
|
573
682
|
if not spec[k]["unit"]: # a passing unit branch is kept for the integrator
|
|
@@ -604,8 +713,9 @@ def main(argv):
|
|
|
604
713
|
p = subprocess.Popen(s["cmd"], cwd=wt, env=without(dict(child_env, **s["env"]), s.get("drop", ())), stdout=lf,
|
|
605
714
|
stderr=subprocess.STDOUT, stdin=subprocess.DEVNULL, start_new_session=True)
|
|
606
715
|
running[k] = (p, log, wt)
|
|
716
|
+
started[k] = time.time()
|
|
607
717
|
state[k].update(status="running", ran=True)
|
|
608
|
-
say("backlog: %s running" % s["label"])
|
|
718
|
+
say("backlog: %s running (log: %s)" % (s["label"], log))
|
|
609
719
|
|
|
610
720
|
def next_ready():
|
|
611
721
|
"""First pending job whose parents all passed; skip jobs whose parent did not."""
|
|
@@ -622,10 +732,20 @@ def main(argv):
|
|
|
622
732
|
return k
|
|
623
733
|
return None
|
|
624
734
|
|
|
625
|
-
|
|
735
|
+
try:
|
|
736
|
+
beat_s = float(os.environ.get("LOKI_BACKLOG_HEARTBEAT_S") or 120)
|
|
737
|
+
except ValueError:
|
|
738
|
+
beat_s = 120.0
|
|
739
|
+
last_beat = time.time()
|
|
740
|
+
while (pending or running) and not stop:
|
|
626
741
|
for k in [k for k, (p, _l, _w) in running.items() if p.poll() is not None]:
|
|
627
742
|
finish(k)
|
|
628
|
-
|
|
743
|
+
if beat_s > 0 and running and time.time() - last_beat >= beat_s:
|
|
744
|
+
last_beat = time.time()
|
|
745
|
+
say("backlog: %d running (%s), %d queued, %d finished, %s elapsed" % (
|
|
746
|
+
len(running), ", ".join("%s %s" % (spec[k]["label"], mins(last_beat - started[k])) for k in running),
|
|
747
|
+
len(pending), sum(1 for k in spec if state[k]["ok"] is not None), mins(last_beat - t_start)))
|
|
748
|
+
while pending and len(running) < conc and not stop:
|
|
629
749
|
group_spent = sum(st["cost"] or 0 for st in state.values())
|
|
630
750
|
if group_cap and group_spent >= group_cap:
|
|
631
751
|
for k in pending:
|
|
@@ -654,14 +774,30 @@ def main(argv):
|
|
|
654
774
|
if running:
|
|
655
775
|
time.sleep(0.2)
|
|
656
776
|
|
|
777
|
+
if stop:
|
|
778
|
+
say("backlog: interrupted (signal %d); stopping %d running, %d never started" % (stop[0], len(running), len(pending)))
|
|
779
|
+
stop_children()
|
|
780
|
+
for k in list(running):
|
|
781
|
+
finish(k, stopped=k not in done_at_signal)
|
|
782
|
+
for k in pending:
|
|
783
|
+
state[k].update(status="NOT STARTED: interrupted", ok=False)
|
|
784
|
+
pending = []
|
|
785
|
+
|
|
657
786
|
# ---- summary -----------------------------------------------------------
|
|
658
787
|
say("")
|
|
659
788
|
say("Summary: %s" % a.repo)
|
|
660
|
-
say("%-14s %-10s %s" % ("ITEM", "COST", "RESULT"))
|
|
789
|
+
say("%-14s %-10s %-6s %s" % ("ITEM", "COST", "TIME", "RESULT"))
|
|
661
790
|
for n, s in state.items():
|
|
662
|
-
say("%-14s %-10s %s" % (spec[n]["label"] if n in spec else labels[n], ("$%.2f" % s["cost"] if s["cost"] is not None else "unmeasured" if s["ran"] else "-"),
|
|
791
|
+
say("%-14s %-10s %-6s %s" % (spec[n]["label"] if n in spec else labels[n], ("$%.2f" % s["cost"] if s["cost"] is not None else "unmeasured" if s["ran"] else "-"),
|
|
792
|
+
mins(s["secs"]) if s["secs"] is not None else "-", s["status"]))
|
|
663
793
|
measured = sum(s["cost"] or 0 for s in state.values())
|
|
664
|
-
|
|
794
|
+
jobs = [s for n, s in state.items() if n in spec] # routed spec and human issues never run: they are counted apart
|
|
795
|
+
done = sum(1 for s in jobs if s["ok"])
|
|
796
|
+
say("Total: %d done, %d not done%s; %d PR(s); cost $%.2f%s; time %s" % (
|
|
797
|
+
done, len(jobs) - done, ", %d not run (spec or human)" % len(routed) if routed else "", sum(s["prs"] for s in jobs),
|
|
798
|
+
measured, " (%d run(s) unmeasured, not counted as $0)" % unmeasured if unmeasured else "", mins(time.time() - t_start)))
|
|
799
|
+
if stop:
|
|
800
|
+
return 130
|
|
665
801
|
bad = [s for s in state.values() if not s["ok"]]
|
|
666
802
|
if not bad:
|
|
667
803
|
return 0
|
package/autonomy/loki
CHANGED
|
@@ -14638,7 +14638,7 @@ cmd_backlog() {
|
|
|
14638
14638
|
echo " --all Every open issue"
|
|
14639
14639
|
echo " --label X Open issues with label X"
|
|
14640
14640
|
echo " --issues 1,2,3 Exactly these issue numbers"
|
|
14641
|
-
echo " --concurrency N Max
|
|
14641
|
+
echo " --concurrency N Max issues in flight (default: loki.yaml concurrency, else 2)"
|
|
14642
14642
|
echo " --dry-run Print each issue's triage class (implement, spec, human) and reason; launch nothing"
|
|
14643
14643
|
echo ""
|
|
14644
14644
|
echo "Run from a checkout of owner/repo (for Jira or Linear, the checkout the work lands in)."
|
|
@@ -14648,6 +14648,8 @@ cmd_backlog() {
|
|
|
14648
14648
|
echo "human issues are listed with the reason. Label loki:implement|loki:spec|loki:human forces a class;"
|
|
14649
14649
|
echo "LOKI_TRIAGE=0 runs every issue untriaged."
|
|
14650
14650
|
echo "Config: loki.yaml (repo root, then ~/.loki/loki.yaml); see docs/loki.yaml.example."
|
|
14651
|
+
echo "Output: one line per state change, each run's own output in <checkout>-backlog/logs, then one row per issue"
|
|
14652
|
+
echo "(cost, time, result, PR) and one Total line (done, not done, PRs, cost, time). Ctrl-C still prints them (exit 130)."
|
|
14651
14653
|
echo "Exit: 0 every run ended VERIFIED or with a PR (spec and human issues do not fail it); 3 only budget stops; 1 otherwise; 2 usage."
|
|
14652
14654
|
return 0
|
|
14653
14655
|
;;
|
|
@@ -25209,7 +25211,7 @@ if (res.valid) {
|
|
|
25209
25211
|
return $?
|
|
25210
25212
|
}
|
|
25211
25213
|
|
|
25212
|
-
# loki compliance - periodic
|
|
25214
|
+
# loki compliance - periodic audit evidence snapshot (three audit-event control mappings).
|
|
25213
25215
|
# The scheduler is default-disabled (LOKI_COMPLIANCE_SNAPSHOT_INTERVAL_HOURS
|
|
25214
25216
|
# unset or 0). `loki compliance snapshot` runs the self-rate-limiting check;
|
|
25215
25217
|
# `--force` generates a snapshot now regardless of interval/elapsed gate.
|
|
@@ -25307,7 +25309,8 @@ process.exit(0);
|
|
|
25307
25309
|
echo " help Show this help"
|
|
25308
25310
|
echo ""
|
|
25309
25311
|
echo "The compliance scheduler is default-disabled. A snapshot bundles the"
|
|
25310
|
-
echo "
|
|
25312
|
+
echo "audit evidence reports (three audit-event control mappings, no compliance"
|
|
25313
|
+
echo "claim) plus the audit chain-integrity verdict"
|
|
25311
25314
|
echo "into .loki/audit/compliance-snapshots/. Enable periodic generation by setting"
|
|
25312
25315
|
echo "LOKI_COMPLIANCE_SNAPSHOT_INTERVAL_HOURS, or run with --force on demand."
|
|
25313
25316
|
;;
|
package/autonomy/telemetry.sh
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Anonymous usage telemetry for Loki Mode
|
|
3
3
|
# Collection is ON BY DEFAULT for individual interactive installs, but AUTO-OFF
|
|
4
4
|
# in enterprise / CI / air-gapped contexts (see _loki_telemetry_auto_off), so
|
|
5
|
-
# enterprise + air-gapped deployments stay silent out of the box (
|
|
6
|
-
# safe). Only anonymous diagnostics are ever sent (os, arch, version, error type,
|
|
5
|
+
# enterprise + air-gapped deployments stay silent out of the box. Only anonymous diagnostics are ever sent (os, arch, version, error type,
|
|
7
6
|
# sanitized stack signatures); never code, prompts, paths, keys, or repo names.
|
|
8
7
|
# Opt-out (always wins): LOKI_TELEMETRY=off / LOKI_TELEMETRY_DISABLED=true /
|
|
9
8
|
# DO_NOT_TRACK=1 / ~/.loki/config: TELEMETRY_DISABLED=true
|
package/dashboard/__init__.py
CHANGED
package/dashboard/server.py
CHANGED
|
@@ -5609,7 +5609,7 @@ async def get_audit_summary(days: int = 7):
|
|
|
5609
5609
|
# it always reflects live state -- never a stale cached snapshot.
|
|
5610
5610
|
#
|
|
5611
5611
|
# The report is produced by the authoritative Node compliance engine
|
|
5612
|
-
# (src/audit/index.js, the single source of truth for
|
|
5612
|
+
# (src/audit/index.js, the single source of truth for the audit control
|
|
5613
5613
|
# mappings) via its `report` CLI shim, so the Python surface never
|
|
5614
5614
|
# reimplements (and never drifts from) the mapping logic. The chain it reads
|
|
5615
5615
|
# is the JS AGENT chain at <project>/.loki/audit/audit.jsonl -- a different
|
|
@@ -5631,7 +5631,9 @@ def get_compliance_status(request: Request, report_type: str = Query("soc2", ali
|
|
|
5631
5631
|
.loki-backed read endpoints; there is no DB tenant_id on a JSONL file
|
|
5632
5632
|
to enforce against.
|
|
5633
5633
|
|
|
5634
|
-
Query: ?type
|
|
5634
|
+
Query: ?type=<control set id> (one of _COMPLIANCE_TYPES; default the first).
|
|
5635
|
+
The ids are internal names for three audit-event control mappings; the report
|
|
5636
|
+
is an audit evidence report and makes no compliance claim.
|
|
5635
5637
|
|
|
5636
5638
|
Returns the compliance report JSON regenerated from CURRENT audit
|
|
5637
5639
|
state on every call. If no audit data has been recorded the report is
|
package/dashboard/telemetry.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Collection is ON BY DEFAULT for an ordinary individual install, and AUTO-OFF in
|
|
4
4
|
enterprise / CI / air-gapped / non-interactive contexts (see _auto_off), so those
|
|
5
|
-
deployments stay silent out of the box
|
|
5
|
+
deployments stay silent out of the box. Only anonymous
|
|
6
6
|
diagnostics are ever sent; never code, prompts, paths, keys, or repo names. The
|
|
7
7
|
gate mirrors autonomy/telemetry.sh + autonomy/crash.sh exactly.
|
|
8
8
|
|
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.142.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/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.142.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
|
|
|
@@ -231,6 +231,8 @@ These knobs together implement the RARV-C (closure) loop: findings -> override c
|
|
|
231
231
|
|
|
232
232
|
`prepare_worktree(source_repo, dest, branch, setup=None, base=None)` creates an isolated git worktree and returns `{path, base_sha, deps, left_out_changes, deps_skipped}`. The start point is `origin/HEAD` after a fetch (when a remote exists), else HEAD. Uncommitted edits in the source checkout are never carried or stashed; their count is reported as `left_out_changes`. An fcntl lock at `~/.loki/repos/<slug>.lock` covers fetch and worktree add. Dependencies: a `setup` command run in the worktree, else a copy-on-write copy of ignored top-level `node_modules`, `.venv`, `venv`, `vendor` (a dir holding absolute symlinks or editable finders is never copied: it (or whose copy fails, with the partial copy removed) is left out, named in `deps_skipped`, `deps` is `skipped`, and the session installs it; a declared `setup` still fails hard), else `none`. CLI: `python3 autonomy/lib/worktree_prep.py SRC DEST BRANCH [--setup CMD] [--base REF]` prints the result as JSON. Callers: `autonomy/lib/backlog.py` (logs skipped deps), `autonomy/lib/workspace.py` (passes the entry `setup`) and `dashboard/api_start.py`.
|
|
233
233
|
|
|
234
|
+
`loki backlog` uses it for every issue worktree (`<checkout>-backlog/issue-N`, logs in `<checkout>-backlog/logs`, kept receipts in `<checkout>-backlog/receipts`). Testing aid: `LOKI_BACKLOG_LOCAL_ORIGIN=1` (off by default) lets `loki backlog` run from a checkout whose origin is an absolute path to a local bare repository, so a rehearsal's branches and PRs go to that bare repository while the run still uses GitHub for the issue itself; any URL or non-bare path keeps the refusal.
|
|
235
|
+
|
|
234
236
|
## Project memory across runs
|
|
235
237
|
|
|
236
238
|
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.
|
package/docs/v10/GUIDE.md
CHANGED
|
@@ -409,9 +409,11 @@ on:
|
|
|
409
409
|
|
|
410
410
|
`loki backlog` also takes `--all`, `--issues 1,2,3` and `--dry-run`, and `jira:PROJ` or `linear:TEAM` in place of `owner/repo` to work a Jira project or Linear team the same way (see [Jira and Linear intake](../trackers.md)). The nightly job runs the agent and a write token together, so label only issues you trust.
|
|
411
411
|
|
|
412
|
+
While it runs, `loki backlog` prints one line per state change (queued, running with the path of that issue's log, the result) and a short line every two minutes naming what is still running (`LOKI_BACKLOG_HEARTBEAT_S` changes the interval, `0` turns it off). Each run's own output goes to its log under `<checkout>-backlog/logs`, never to the terminal. At the end it prints one row per issue (cost, time, result and its pull request) and one `Total:` line: issues done, not done, pull requests, cost and time. An issue that ended in more than one pull request says how many and why. Ctrl-C or a job time limit (SIGTERM) stops the runs and still prints the rows and the total (exit 130). Receipts of a finished run are kept under `<checkout>-backlog/receipts`.
|
|
413
|
+
|
|
412
414
|
Before anything runs, `loki backlog` triages every issue into one of three classes, each printed with a one-line reason (`--dry-run` prints only this and launches nothing):
|
|
413
415
|
|
|
414
|
-
- `implement`: a concrete target (a file, function, value or expected result), or a large issue. Only these run. Large has one definition, the same one `loki start owner/repo#N` uses: an epic label (`epic`, `umbrella`, `tracking` or `meta`), or at least two of 4 or more solution parts, 4 or more acceptance criteria, and both a backend and a frontend named. A large issue is split into slices that each run on their own (the reason says `runs split into slices`). Slices that do not depend on each other run at the same time (up to 4; `LOKI_EPIC_PARALLEL=1` runs them one at a time), and a slice that fails or reports a spec conflict skips only the slices built on it.
|
|
416
|
+
- `implement`: a concrete target (a file, function, value or expected result), or a large issue. Only these run. Large has one definition, the same one `loki start owner/repo#N` uses: an epic label (`epic`, `umbrella`, `tracking` or `meta`), or at least two of 4 or more solution parts, 4 or more acceptance criteria, and both a backend and a frontend named. A large issue is split into slices that each run on their own (the reason says `runs split into slices`). Slices that do not depend on each other run at the same time (up to 4; `LOKI_EPIC_PARALLEL=1` runs them one at a time), and a slice that fails or reports a spec conflict skips only the slices built on it. The issue normally ends in one pull request, with one commit per slice. A slice that conflicts and cannot be resolved, with the slices built on it, opens its own pull request; a refused push or a combined diff over `LOKI_SPLIT_ONE_PR_MAX_FILES` files (default 150) opens one pull request per slice instead, and the summary row says how many and why (`LOKI_SPLIT_ONE_PR=0` always opens one per slice).
|
|
415
417
|
- `spec`: vague or ambiguous (no concrete target named, or an ambiguity score at the threshold). Loki drafts `.loki/specs/<slug>.md` with `loki plan --spec`, runs nothing, and prints `loki start --spec .loki/specs/<slug>.md` to run after you edit or approve it.
|
|
416
418
|
- `human`: the issue touches secrets, production or a destructive operation. Never run headless; listed with the reason. Repos without tests, UI work and infra work still run: Loki writes its own tests and verifies once at the end.
|
|
417
419
|
|
package/loki-ts/dist/loki.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var zH8=Object.create;var{getPrototypeOf:VH8,defineProperty:EM,getOwnPropertyNames:OV0,getOwnPropertyDescriptor:KH8}=Object,PV0=Object.prototype.hasOwnProperty;function CV0($){return this[$]}var GH8,HH8,qH8=($,Z,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var X=Z?GH8??=new WeakMap:HH8??=new WeakMap,Y=X.get($);if(Y)return Y}J=$!=null?zH8(VH8($)):{};let W=Z||!$||!$.__esModule?EM(J,"default",{value:$,enumerable:!0}):J;for(let z of OV0($))if(!PV0.call(W,z))EM(W,z,{get:CV0.bind($,z),enumerable:!0});if(Q)X.set($,W);return W},Zc=($)=>{var Z=(jV0??=new WeakMap).get($),J;if(Z)return Z;if(Z=EM({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var Q of OV0($))if(!PV0.call(Z,Q))EM(Z,Q,{get:CV0.bind($,Q),enumerable:!(J=KH8($,Q))||J.enumerable})}return jV0.set($,Z),Z},jV0,oR=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var UH8=($)=>$;function BH8($,Z){this[$]=UH8.bind(null,Z)}var _0=($,Z)=>{for(var J in Z)EM($,J,{get:Z[J],enumerable:!0,configurable:!0,set:BH8.bind(Z,J)})};var y=($,Z)=>()=>($&&(Z=$($=0)),Z);var L9=import.meta.require;var Qc={};_0(Qc,{lokiDirFor:()=>cK,lokiDir:()=>F8,homeLokiDir:()=>AZ,findRepoRootForVersion:()=>DM,REPO_ROOT:()=>S0});import{resolve as kQ,dirname as Jc}from"path";import{fileURLToPath as MH8}from"url";import{existsSync as nR}from"fs";import{homedir as NH8}from"os";function FH8(){let $=AV0;for(let Z=0;Z<6;Z++){if(nR(kQ($,"VERSION"))&&nR(kQ($,"autonomy/run.sh")))return $;let J=Jc($);if(J===$)break;$=J}return kQ(AV0,"..","..","..")}function DM($){let Z=$;for(let J=0;J<6;J++){if(nR(kQ(Z,"VERSION"))&&nR(kQ(Z,"autonomy/run.sh")))return Z;let Q=Jc(Z);if(Q===Z)break;Z=Q}return kQ($,"..","..","..")}function cK($){return process.env.LOKI_DIR??kQ($,".loki")}function F8(){return cK(process.cwd())}function AZ(){return kQ(NH8(),".loki")}var AV0,S0;var O8=y(()=>{AV0=Jc(MH8(import.meta.url));S0=FH8()});import{readFileSync as LH8}from"fs";import{resolve as jH8,dirname as OH8}from"path";import{fileURLToPath as PH8}from"url";function H6(){if(HW!==null)return HW;let $="11.
|
|
2
|
+
var zH8=Object.create;var{getPrototypeOf:VH8,defineProperty:EM,getOwnPropertyNames:OV0,getOwnPropertyDescriptor:KH8}=Object,PV0=Object.prototype.hasOwnProperty;function CV0($){return this[$]}var GH8,HH8,qH8=($,Z,J)=>{var Q=$!=null&&typeof $==="object";if(Q){var X=Z?GH8??=new WeakMap:HH8??=new WeakMap,Y=X.get($);if(Y)return Y}J=$!=null?zH8(VH8($)):{};let W=Z||!$||!$.__esModule?EM(J,"default",{value:$,enumerable:!0}):J;for(let z of OV0($))if(!PV0.call(W,z))EM(W,z,{get:CV0.bind($,z),enumerable:!0});if(Q)X.set($,W);return W},Zc=($)=>{var Z=(jV0??=new WeakMap).get($),J;if(Z)return Z;if(Z=EM({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var Q of OV0($))if(!PV0.call(Z,Q))EM(Z,Q,{get:CV0.bind($,Q),enumerable:!(J=KH8($,Q))||J.enumerable})}return jV0.set($,Z),Z},jV0,oR=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var UH8=($)=>$;function BH8($,Z){this[$]=UH8.bind(null,Z)}var _0=($,Z)=>{for(var J in Z)EM($,J,{get:Z[J],enumerable:!0,configurable:!0,set:BH8.bind(Z,J)})};var y=($,Z)=>()=>($&&(Z=$($=0)),Z);var L9=import.meta.require;var Qc={};_0(Qc,{lokiDirFor:()=>cK,lokiDir:()=>F8,homeLokiDir:()=>AZ,findRepoRootForVersion:()=>DM,REPO_ROOT:()=>S0});import{resolve as kQ,dirname as Jc}from"path";import{fileURLToPath as MH8}from"url";import{existsSync as nR}from"fs";import{homedir as NH8}from"os";function FH8(){let $=AV0;for(let Z=0;Z<6;Z++){if(nR(kQ($,"VERSION"))&&nR(kQ($,"autonomy/run.sh")))return $;let J=Jc($);if(J===$)break;$=J}return kQ(AV0,"..","..","..")}function DM($){let Z=$;for(let J=0;J<6;J++){if(nR(kQ(Z,"VERSION"))&&nR(kQ(Z,"autonomy/run.sh")))return Z;let Q=Jc(Z);if(Q===Z)break;Z=Q}return kQ($,"..","..","..")}function cK($){return process.env.LOKI_DIR??kQ($,".loki")}function F8(){return cK(process.cwd())}function AZ(){return kQ(NH8(),".loki")}var AV0,S0;var O8=y(()=>{AV0=Jc(MH8(import.meta.url));S0=FH8()});import{readFileSync as LH8}from"fs";import{resolve as jH8,dirname as OH8}from"path";import{fileURLToPath as PH8}from"url";function H6(){if(HW!==null)return HW;let $="11.142.0";if(typeof $==="string"&&$.length>0)return HW=$,HW;try{let Z=OH8(PH8(import.meta.url)),J=DM(Z);HW=LH8(jH8(J,"VERSION"),"utf-8").trim()}catch{HW="unknown"}return HW}var HW=null;var IZ=y(()=>{O8()});import{mkdirSync as Yc,readFileSync as sR,realpathSync as CH8,statSync as AH8,writeFileSync as Wc}from"fs";import{dirname as lK,join as Xc,resolve as IV0}from"path";function EH8(){return IV0(AZ(),"cache","update-check.json")}function SQ($){let Z=/^(\d+)\.(\d+)\.(\d+)$/.exec($.trim());if(!Z)return null;return[Number(Z[1]),Number(Z[2]),Number(Z[3])]}function _M($,Z){let J=SQ($),Q=SQ(Z);if(!J||!Q)return!1;let[X,Y,W]=J,[z,V,K]=Q;if(X!==z)return X>z;if(Y!==V)return Y>V;return W>K}function TV0(){let $=(process.env.LOKI_NO_UPDATE_CHECK??"").trim().toLowerCase();if($==="1"||$==="true"||$==="yes")return!0;if(process.env.LOKI_AIRGAP==="true")return!0;if(process.env.CI)return!0;if(!process.stdout.isTTY)return!0;return!1}function RV0($){try{let Z=sR($,"utf-8"),J=JSON.parse(Z);if(typeof J.checkedAt==="number"&&typeof J.latest==="string"&&SQ(J.latest)!==null)return{checkedAt:J.checkedAt,latest:J.latest}}catch{}return null}function DH8($){try{let Z=JSON.parse(sR($,"utf-8")).failedAt;if(typeof Z==="number")return Z}catch{}return null}function _H8($,Z){let J=RV0($);try{Yc(lK($),{recursive:!0}),Wc($,JSON.stringify({...J??{},failedAt:Z}),"utf-8")}catch{}}function xH8($,Z){try{Yc(lK($),{recursive:!0}),Wc($,JSON.stringify(Z),"utf-8")}catch{}}async function yH8(){try{let $=await fetch(IH8,{signal:AbortSignal.timeout(RH8),headers:{accept:"application/json"}});if(!$.ok)return null;let Z=await $.json();if(typeof Z.version==="string"&&SQ(Z.version)!==null)return Z.version}catch{}return null}async function kH8($=Date.now(),Z=yH8,J=EH8()){let Q=RV0(J);if(Q&&$-Q.checkedAt<TH8)return Q.latest;let X=DH8(J);if(X!==null&&$-X>=0&&$-X<wH8)return null;let Y=await Z();if(Y===null)return _H8(J,$),null;return xH8(J,{checkedAt:$,latest:Y}),Y}function SH8($,Z=process.env){if(SQ($)===null)return null;let Q=Z.PATH;if(!Q)return null;let X=new Set;for(let Y of Q.split(":")){if(!Y)continue;let W=Xc(Y,"loki"),z;try{AH8(W),z=CH8(W)}catch{continue}if(X.has(z))continue;X.add(z);try{let V=Xc(lK(lK(z)),"package.json"),K=JSON.parse(sR(V,"utf8")).version;if(typeof K!=="string")continue;if(_M(K,$))return{path:W,version:K}}catch{continue}}return null}function bH8(){return IV0(AZ(),"cache","last-seen-version.json")}function vH8($,Z={}){try{if(TV0())return!1;if(SQ($)===null)return!1;let J=Z.seenFile??bH8(),Q=null;try{let Y=JSON.parse(sR(J,"utf-8")).version;if(typeof Y==="string"&&SQ(Y)!==null)Q=Y}catch{}if(Q!==null&&!_M($,Q))return!1;try{Yc(lK(J),{recursive:!0}),Wc(J,JSON.stringify({version:$}),"utf-8")}catch{return!1}if(Q===null)return!1;return(Z.write??((Y)=>process.stderr.write(Y)))(`Loki Mode upgraded ${Q} -> ${$}. What is new: https://github.com/asklokesh/loki-mode/releases/tag/v${$}
|
|
3
3
|
`),!0}catch{return!1}}function hH8($){let Z=$.replace(/\\/g,"/");if(Z.includes("/Cellar/"))return"brew upgrade loki-mode";if(/\/pnpm\//.test(Z)||Z.includes("/.pnpm/"))return"pnpm add -g loki-mode (or npm i -g loki-mode)";if(Z.includes("/yarn/global/")||Z.includes("/.yarn/"))return"yarn global add loki-mode (or npm i -g loki-mode)";if(Z.includes("/.bun/"))return"bun install -g loki-mode (or npm i -g loki-mode)";if(Z.includes("/lib/node_modules/"))return"npm i -g loki-mode (or bun install -g loki-mode)";if(Z.includes("/homebrew/"))return"brew upgrade loki-mode";return"bun install -g loki-mode (or npm i -g loki-mode)"}async function wV0($,Z={}){try{if(TV0())return;if(SQ($)===null)return;let J=Z.write??((Y)=>process.stderr.write(Y));vH8($,{write:J,...Z.cacheFile?{seenFile:Xc(lK(Z.cacheFile),"last-seen-version.json")}:{}});let Q=SH8($,Z.env??process.env);if(Q!==null){J(`Loki Mode ${Q.version} is installed but not the one running (you are running ${$}).
|
|
4
4
|
Another loki earlier on PATH is winning. Newer copy: ${Q.path}
|
|
5
5
|
Run \`which -a loki\` to see the order, then remove or re-point the earlier entry.
|
|
@@ -4354,4 +4354,4 @@ Unknown commands exit 2 with a suggestion; run 'loki help' for the full list.
|
|
|
4354
4354
|
`);{let{suggestCommand:Q}=await Promise.resolve().then(() => (R$(),xc)),X=Z===void 0?void 0:Q(Z);if(X)process.stderr.write(`Did you mean 'loki ${X}'?
|
|
4355
4355
|
`)}return process.stderr.write(YH8),2}}oJ8();var WH8=()=>globalThis[Symbol.for("loki.ownsStopSignals")]===!0;process.on("SIGINT",()=>{if(!WH8())process.exit(130)});process.on("SIGTERM",()=>{if(!WH8())process.exit(143)});var RU9=await TU9(Bun.argv.slice(2));process.exit(RU9);
|
|
4356
4356
|
|
|
4357
|
-
//# debugId=
|
|
4357
|
+
//# debugId=FEA3C30E76B09122BAD0E4A20E4E1B53
|
package/mcp/__init__.py
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "loki-mode",
|
|
3
3
|
"mcpName": "io.github.asklokesh/loki-mode",
|
|
4
|
-
"version": "11.
|
|
4
|
+
"version": "11.142.0",
|
|
5
5
|
"description": "An autonomous software factory that knows what it is supposed to deliver, and proves it did.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"agent",
|
|
@@ -161,5 +161,5 @@
|
|
|
161
161
|
"dependencies": {
|
|
162
162
|
"@resvg/resvg-wasm": "^2.6.2"
|
|
163
163
|
},
|
|
164
|
-
"gitHead": "
|
|
164
|
+
"gitHead": "53b097984ab7857108329e26c8e30a16d217c16f"
|
|
165
165
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
|
|
3
3
|
"name": "loki-mode",
|
|
4
4
|
"displayName": "Loki Mode",
|
|
5
|
-
"version": "11.
|
|
5
|
+
"version": "11.142.0",
|
|
6
6
|
"description": "Autonomous spec-to-product build system with a built-in trust layer (RARV-C closure loop, 8 quality gates, completion council). Ships Loki's spec-hardening, drift-detection, and deterministic PR verification commands plus the Loki MCP server.",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Autonomi",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Agent Types Reference
|
|
2
2
|
|
|
3
|
-
Complete definitions and capabilities for
|
|
3
|
+
Complete definitions and capabilities for every specialized agent type.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
Loki Mode has
|
|
9
|
+
Loki Mode has specialized agent roles across 8 domains (domain agents plus orchestration agents) - prompt-defined specifications the orchestrator adopts per phase, not separate processes. Parallelism on Claude Code comes from the blind review council, the adversarial reviewer, and optional git-worktree streams; on other providers everything runs sequentially. The orchestrator activates only the roles needed for your project -- typically 5-10 for simple projects, more for complex ones.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -762,7 +762,7 @@ Each role lists its capabilities (the domain tables above are the summary), then
|
|
|
762
762
|
**Task Types:**
|
|
763
763
|
- `tos`: Generate Terms of Service
|
|
764
764
|
- `privacy-policy`: Create privacy policy
|
|
765
|
-
- `
|
|
765
|
+
- `data-protection`: Draft data-protection notices and data-handling docs for legal review
|
|
766
766
|
- `contract`: Create contract template
|
|
767
767
|
- `compliance`: Verify legal compliance
|
|
768
768
|
|
|
@@ -257,7 +257,7 @@ Critical: < 6 months
|
|
|
257
257
|
12. Contact Information
|
|
258
258
|
```
|
|
259
259
|
|
|
260
|
-
### Privacy Policy Requirements (
|
|
260
|
+
### Privacy Policy Requirements (EU data-protection law)
|
|
261
261
|
```
|
|
262
262
|
Required Disclosures:
|
|
263
263
|
- [ ] Data controller identity
|
|
@@ -273,7 +273,7 @@ Required Disclosures:
|
|
|
273
273
|
- [ ] DPO contact (if applicable)
|
|
274
274
|
```
|
|
275
275
|
|
|
276
|
-
###
|
|
276
|
+
### Data-Protection Checklist (EU law; have counsel review)
|
|
277
277
|
```
|
|
278
278
|
Data Collection:
|
|
279
279
|
- [ ] Consent mechanism implemented
|
|
@@ -181,7 +181,7 @@ drift_prevention:
|
|
|
181
181
|
|
|
182
182
|
1. **3-reviewer bottleneck** - May not scale past 50+ agents
|
|
183
183
|
2. **Signal file coordination** - Similar to Cursor's failed file locking
|
|
184
|
-
3. **Over-specification** -
|
|
184
|
+
3. **Over-specification** - this many agent types may be overkill
|
|
185
185
|
|
|
186
186
|
---
|
|
187
187
|
|
package/skills/agents.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- [Project AGENTS.md](#project-agentsmd)
|
|
12
12
|
- [A2A-Inspired Communication (Google Protocol)](#a2a-inspired-communication-google-protocol)
|
|
13
13
|
- [Agentic Patterns Reference (awesome-agentic-patterns)](#agentic-patterns-reference-awesome-agentic-patterns)
|
|
14
|
-
- [The
|
|
14
|
+
- [The Agent Roles (Domain + Orchestration)](#the-agent-roles-domain--orchestration)
|
|
15
15
|
<!-- TOC:END -->
|
|
16
16
|
|
|
17
17
|
> **Full agent type definitions:** See `references/agent-types.md` for complete agent role specifications across 8 domains (Engineering, Operations, Business, Data, Product, Growth, Review, Orchestration). These are prompt-defined specifications the orchestrator adopts per phase; parallelism on Claude Code comes from the blind review council, the adversarial reviewer, and optional git-worktree streams, sequential on other providers.
|
|
@@ -260,7 +260,7 @@ Priority order for context:
|
|
|
260
260
|
|
|
261
261
|
---
|
|
262
262
|
|
|
263
|
-
## The
|
|
263
|
+
## The Agent Roles (Domain + Orchestration)
|
|
264
264
|
|
|
265
265
|
See `references/agent-types.md` for complete specifications. Summary:
|
|
266
266
|
|
|
@@ -214,6 +214,12 @@ LOKI_GITHUB_IMPORT=true loki start # drains .loki/queue sequentially
|
|
|
214
214
|
|
|
215
215
|
### Concurrent (one isolated run PER issue)
|
|
216
216
|
|
|
217
|
+
The one-command way: `loki backlog owner/repo --issues 101,102,103 --concurrency 2`
|
|
218
|
+
gives each issue its own worktree and branch, keeps each run's output in its own
|
|
219
|
+
log, and ends with one row per issue (cost, time, result, pull request) and one
|
|
220
|
+
`Total:` line (done, not done, pull requests, cost, time). `--dry-run` shows what
|
|
221
|
+
would run. The manual loop below does the same by hand.
|
|
222
|
+
|
|
217
223
|
To run N issues at the SAME time, each run needs its OWN git worktree AND its
|
|
218
224
|
OWN state dir. `--pr`/`--worktree` isolates the git branch, but two runs in the
|
|
219
225
|
same checkout still share one `.loki/` unless you also set a distinct `LOKI_DIR`.
|