loki-mode 5.49.1 → 5.49.3
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/README.md +57 -83
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/CONSTITUTION.md +2 -2
- package/dashboard/__init__.py +1 -1
- package/dashboard/server.py +140 -26
- package/dashboard/static/index.html +1 -1
- package/docs/COMPARISON.md +5 -5
- package/docs/COMPETITIVE-ANALYSIS.md +2 -2
- package/docs/INSTALLATION.md +23 -140
- package/docs/alternative-installations.md +145 -0
- package/docs/cursor-comparison.md +4 -4
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/references/core-workflow.md +1 -1
- package/references/quality-control.md +10 -0
- package/skills/00-index.md +1 -1
- package/skills/artifacts.md +1 -1
- package/skills/quality-gates.md +21 -1
- package/skills/testing.md +15 -0
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
[]()
|
|
12
12
|
[](benchmarks/)
|
|
13
13
|
|
|
14
|
-
**Current Version: v5.49.
|
|
14
|
+
**Current Version: v5.49.3**
|
|
15
15
|
|
|
16
16
|
**[Autonomi](https://www.autonomi.dev/)** | **[Documentation](https://www.autonomi.dev/docs)** | **[GitHub](https://github.com/asklokesh/loki-mode)**
|
|
17
17
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
[](https://asciinema.org/a/AjjnjzOeKLYItp6s)
|
|
27
27
|
|
|
28
|
-
*Click to watch Loki Mode v5.42 -- CLI commands, dashboard, 8 parallel agents,
|
|
28
|
+
*Click to watch Loki Mode v5.42 -- CLI commands, dashboard, 8 parallel agents, 9-gate quality, Completion Council, memory system*
|
|
29
29
|
|
|
30
30
|
---
|
|
31
31
|
|
|
@@ -39,98 +39,38 @@
|
|
|
39
39
|
|
|
40
40
|
---
|
|
41
41
|
|
|
42
|
-
##
|
|
43
|
-
|
|
44
|
-
### Option 1: npm (Recommended)
|
|
42
|
+
## Installation
|
|
45
43
|
|
|
46
44
|
```bash
|
|
47
|
-
|
|
48
|
-
loki start ./my-prd.md
|
|
45
|
+
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
49
46
|
```
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
That's it. Claude Code auto-discovers skills in `~/.claude/skills/`.
|
|
49
|
+
|
|
50
|
+
### Use It
|
|
52
51
|
|
|
53
52
|
```bash
|
|
54
|
-
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
55
53
|
claude --dangerously-skip-permissions
|
|
56
|
-
# Then say: Loki Mode with PRD at ./my-prd.md
|
|
54
|
+
# Then say: "Loki Mode with PRD at ./my-prd.md"
|
|
57
55
|
```
|
|
58
56
|
|
|
59
|
-
###
|
|
57
|
+
### Update
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```yaml
|
|
64
|
-
# .github/workflows/loki-review.yml
|
|
65
|
-
name: Loki Code Review
|
|
66
|
-
|
|
67
|
-
on:
|
|
68
|
-
pull_request:
|
|
69
|
-
types: [opened, synchronize]
|
|
70
|
-
|
|
71
|
-
permissions:
|
|
72
|
-
contents: read
|
|
73
|
-
pull-requests: write
|
|
74
|
-
|
|
75
|
-
jobs:
|
|
76
|
-
review:
|
|
77
|
-
runs-on: ubuntu-latest
|
|
78
|
-
steps:
|
|
79
|
-
- uses: actions/checkout@v4
|
|
80
|
-
- uses: asklokesh/loki-mode@v5
|
|
81
|
-
with:
|
|
82
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
83
|
-
mode: review # review, fix, or test
|
|
84
|
-
provider: claude # claude, codex, or gemini
|
|
85
|
-
max_iterations: 3 # sets LOKI_MAX_ITERATIONS env var
|
|
86
|
-
budget_limit: '5.00' # max cost in USD (maps to --budget flag)
|
|
87
|
-
env:
|
|
88
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
**Prerequisites:**
|
|
92
|
-
- An API key for your chosen provider (set as a repository secret):
|
|
93
|
-
- Claude: `ANTHROPIC_API_KEY`
|
|
94
|
-
- Codex: `OPENAI_API_KEY`
|
|
95
|
-
- Gemini: `GOOGLE_API_KEY`
|
|
96
|
-
- The action automatically installs `loki-mode` and `@anthropic-ai/claude-code` (for the Claude provider)
|
|
97
|
-
|
|
98
|
-
**Action Inputs:**
|
|
99
|
-
|
|
100
|
-
| Input | Default | Description |
|
|
101
|
-
|-------|---------|-------------|
|
|
102
|
-
| `mode` | `review` | `review`, `fix`, or `test` |
|
|
103
|
-
| `provider` | `claude` | `claude`, `codex`, or `gemini` |
|
|
104
|
-
| `budget_limit` | `5.00` | Max cost in USD (maps to `--budget` CLI flag) |
|
|
105
|
-
| `budget` | | Alias for `budget_limit` |
|
|
106
|
-
| `max_iterations` | `3` | Sets `LOKI_MAX_ITERATIONS` env var |
|
|
107
|
-
| `github_token` | (required) | GitHub token for PR comments |
|
|
108
|
-
| `prd_file` | | Path to PRD file relative to repo root |
|
|
109
|
-
| `auto_confirm` | `true` | Skip confirmation prompts (always true in CI) |
|
|
110
|
-
| `install_claude` | `true` | Auto-install Claude Code CLI if not present |
|
|
111
|
-
| `node_version` | `20` | Node.js version |
|
|
112
|
-
|
|
113
|
-
**Using with a PRD file (fix/test modes):**
|
|
114
|
-
|
|
115
|
-
```yaml
|
|
116
|
-
- uses: asklokesh/loki-mode@v5
|
|
117
|
-
with:
|
|
118
|
-
mode: fix
|
|
119
|
-
prd_file: 'docs/my-prd.md'
|
|
120
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
121
|
-
env:
|
|
122
|
-
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
59
|
+
```bash
|
|
60
|
+
cd ~/.claude/skills/loki-mode && git pull
|
|
123
61
|
```
|
|
124
62
|
|
|
125
|
-
|
|
63
|
+
### Troubleshooting
|
|
126
64
|
|
|
127
|
-
|
|
|
128
|
-
|
|
129
|
-
| `
|
|
130
|
-
|
|
|
131
|
-
|
|
|
65
|
+
| Problem | Fix |
|
|
66
|
+
|---------|-----|
|
|
67
|
+
| `SKILL.md` not found | Verify: `ls ~/.claude/skills/loki-mode/SKILL.md` |
|
|
68
|
+
| Claude doesn't recognize "Loki Mode" | Restart Claude Code after cloning |
|
|
69
|
+
| Permission denied on clone | Check SSH keys or use HTTPS URL above |
|
|
132
70
|
|
|
133
|
-
|
|
71
|
+
### Other Installation Methods
|
|
72
|
+
|
|
73
|
+
Also available via **npm**, **Homebrew**, **Docker**, **GitHub Action**, and **VS Code Extension**. See [docs/alternative-installations.md](docs/alternative-installations.md) for details and limitations of each method.
|
|
134
74
|
|
|
135
75
|
### Multi-Provider Support (v5.0.0)
|
|
136
76
|
|
|
@@ -188,6 +128,40 @@ PRD → Research → Architecture → Development → Testing → Deployment →
|
|
|
188
128
|
|
|
189
129
|
---
|
|
190
130
|
|
|
131
|
+
## Current Limitations
|
|
132
|
+
|
|
133
|
+
Loki Mode is powerful but not magic. Be aware of these honest limitations:
|
|
134
|
+
|
|
135
|
+
| Area | What Works | What Doesn't (Yet) |
|
|
136
|
+
|------|-----------|---------------------|
|
|
137
|
+
| **Code Generation** | Generates full-stack applications from PRDs | Complex domain logic may need human review and correction |
|
|
138
|
+
| **Deployment** | Generates deployment configs and scripts | Does not have cloud credentials -- human must provide and authorize |
|
|
139
|
+
| **Testing** | 9 automated quality gates, blind review | Test quality depends on AI-generated assertions; mutation testing is heuristic |
|
|
140
|
+
| **Business Ops** | Generates marketing copy, legal templates | Does not actually send emails, file legal documents, or process payments |
|
|
141
|
+
| **Multi-Provider** | Claude (full), Codex (degraded), Gemini (degraded) | Codex and Gemini lack parallel agents and Task tool -- sequential only |
|
|
142
|
+
| **Memory System** | Episodic, semantic, procedural memory tiers | Vector search requires optional `sentence-transformers` dependency |
|
|
143
|
+
| **Enterprise Security** | TLS, OIDC, RBAC, audit trail, SIEM configs | Self-signed certs only; production deployments need real certificates |
|
|
144
|
+
| **Dashboard** | Real-time status, task queue, agent monitoring | Single-machine only; no multi-node dashboard clustering |
|
|
145
|
+
| **Benchmarks** | HumanEval 98.78%, SWE-bench 299/300 patches | Self-reported; SWE-bench counts patch generation, not verified resolution |
|
|
146
|
+
|
|
147
|
+
**What "autonomous" means in practice:**
|
|
148
|
+
- Loki Mode runs without prompting between RARV cycles
|
|
149
|
+
- It does NOT have access to your cloud accounts, payment systems, or external services unless you provide credentials
|
|
150
|
+
- Human oversight is expected for: deployment credentials, domain setup, API keys, and critical business decisions
|
|
151
|
+
- The system is as good as the underlying AI model -- it can make mistakes, especially on novel or complex problems
|
|
152
|
+
|
|
153
|
+
## What To Expect
|
|
154
|
+
|
|
155
|
+
| Project Type | Examples | Autonomy Level | Typical Experience |
|
|
156
|
+
|---|---|---|---|
|
|
157
|
+
| Simple | Landing page, todo app, static site, single API | High | Completes with minimal retries. Human reviews output. |
|
|
158
|
+
| Standard | CRUD app with auth, REST API + React frontend | Medium | Completes most features. Complex components may need guidance. |
|
|
159
|
+
| Complex | Microservices, real-time systems, ML pipelines | Guided | Use as accelerator. Human reviews between phases. |
|
|
160
|
+
|
|
161
|
+
"Autonomous" means the system runs RARV cycles without prompting. It does NOT mean zero oversight.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
191
165
|
## Why Loki Mode?
|
|
192
166
|
|
|
193
167
|
### **How It Works**
|
|
@@ -196,7 +170,7 @@ PRD → Research → Architecture → Development → Testing → Deployment →
|
|
|
196
170
|
|----------------|---------------------|
|
|
197
171
|
| **Single agent** writes code linearly | **Multiple agents** work in parallel across engineering, ops, business, data, product, and growth |
|
|
198
172
|
| **Manual deployment** required | **Autonomous deployment** to AWS, GCP, Azure, Vercel, Railway with blue-green and canary strategies |
|
|
199
|
-
| **No testing** or basic unit tests | **
|
|
173
|
+
| **No testing** or basic unit tests | **9 automated quality gates**: input/output guardrails, static analysis, blind review, anti-sycophancy, severity blocking, test coverage, mock detection, mutation detection |
|
|
200
174
|
| **Code only** - you handle the rest | **Full business operations**: marketing, sales, legal, HR, finance, investor relations |
|
|
201
175
|
| **Stops on errors** | **Self-healing**: circuit breakers, dead letter queues, exponential backoff, automatic recovery |
|
|
202
176
|
| **No visibility** into progress | **Real-time dashboard** with agent monitoring, task queues, and live status updates |
|
|
@@ -234,7 +208,7 @@ PRD → Research → Architecture → Development → Testing → Deployment →
|
|
|
234
208
|
| **OpenClaw Bridge (v5.38.0)** | Multi-agent coordination protocol | [OpenClaw Integration](docs/openclaw-integration.md) |
|
|
235
209
|
| **41 Agent Types** | Engineering, Ops, Business, Data, Product, Growth, Orchestration | [Agent Definitions](references/agent-types.md) |
|
|
236
210
|
| **RARV Cycle** | Reason-Act-Reflect-Verify workflow | [Core Workflow](references/core-workflow.md) |
|
|
237
|
-
| **Quality Gates** |
|
|
211
|
+
| **Quality Gates** | 9-gate system: guardrails, static analysis, blind review, anti-sycophancy, severity blocking, test coverage, mock detection, mutation detection | [Quality Control](references/quality-control.md) |
|
|
238
212
|
| **Memory System (v5.15.0)** | Complete 3-tier memory with progressive disclosure | [Memory Architecture](references/memory-system.md) |
|
|
239
213
|
| **Parallel Workflows** | Git worktree-based parallelism | [Parallel Workflows](skills/parallel-workflows.md) |
|
|
240
214
|
| **GitHub Integration** | Issue import, PR creation, status sync | [GitHub Integration](skills/github-integration.md) |
|
|
@@ -661,7 +635,7 @@ references/ # Deep documentation (23KB+ files)
|
|
|
661
635
|
| **2. Architecture** | Tech stack selection with self-reflection |
|
|
662
636
|
| **3. Infrastructure** | Provision cloud, CI/CD, monitoring |
|
|
663
637
|
| **4. Development** | Implement with TDD, parallel code review |
|
|
664
|
-
| **5. QA** |
|
|
638
|
+
| **5. QA** | 9 quality gates, security audit, load testing |
|
|
665
639
|
| **6. Deployment** | Blue-green deploy, auto-rollback on errors |
|
|
666
640
|
| **7. Business** | Marketing, sales, legal, support setup |
|
|
667
641
|
| **8. Growth** | Continuous optimization, A/B testing, feedback loops |
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: loki-mode
|
|
|
3
3
|
description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with minimal human intervention. Requires --dangerously-skip-permissions flag.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Loki Mode v5.49.
|
|
6
|
+
# Loki Mode v5.49.3
|
|
7
7
|
|
|
8
8
|
**You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
|
|
9
9
|
|
|
@@ -263,4 +263,4 @@ The following features are documented in skill modules but not yet fully automat
|
|
|
263
263
|
| Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
|
|
264
264
|
| Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
|
|
265
265
|
|
|
266
|
-
**v5.49.
|
|
266
|
+
**v5.49.3 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.49.
|
|
1
|
+
5.49.3
|
package/autonomy/CONSTITUTION.md
CHANGED
|
@@ -155,7 +155,7 @@ SKILL.md (~190 lines) # Always loaded: RARV cycle, autonomy rules
|
|
|
155
155
|
skills/
|
|
156
156
|
00-index.md # Module routing table
|
|
157
157
|
model-selection.md # Task tool, parallelization
|
|
158
|
-
quality-gates.md #
|
|
158
|
+
quality-gates.md # 9-gate system, anti-sycophancy
|
|
159
159
|
testing.md # Playwright, E2E, property-based
|
|
160
160
|
production.md # CI/CD, batch processing
|
|
161
161
|
agents.md # 41 agent types, A2A patterns
|
|
@@ -196,7 +196,7 @@ Main Worktree (orchestrator)
|
|
|
196
196
|
|
|
197
197
|
---
|
|
198
198
|
|
|
199
|
-
## Quality Gates (
|
|
199
|
+
## Quality Gates (9-Gate System)
|
|
200
200
|
|
|
201
201
|
### Gate 1: Static Analysis
|
|
202
202
|
```yaml
|
package/dashboard/__init__.py
CHANGED
package/dashboard/server.py
CHANGED
|
@@ -3151,23 +3151,112 @@ async def get_github_sync_log(
|
|
|
3151
3151
|
# =============================================================================
|
|
3152
3152
|
|
|
3153
3153
|
|
|
3154
|
+
def _resolve_process_state(pid: Optional[int], last_status: str = "",
|
|
3155
|
+
started: str = "", heartbeat: str = "",
|
|
3156
|
+
stale_threshold: int = 30) -> dict[str, Any]:
|
|
3157
|
+
"""Resolve process state with honest labels.
|
|
3158
|
+
|
|
3159
|
+
States:
|
|
3160
|
+
RUNNING - PID alive AND heartbeat < stale_threshold seconds
|
|
3161
|
+
STALE - PID alive BUT no heartbeat update in > stale_threshold seconds
|
|
3162
|
+
COMPLETED - last_status marked done/completed and PID exited
|
|
3163
|
+
FAILED - last_status marked failed OR PID exited non-zero
|
|
3164
|
+
CRASHED - PID dead BUT last_status was 'running'
|
|
3165
|
+
UNKNOWN - No PID, no status, or conflicting data
|
|
3166
|
+
|
|
3167
|
+
Returns dict with: state, pid_alive, started, last_heartbeat, duration_seconds
|
|
3168
|
+
"""
|
|
3169
|
+
now = datetime.now(timezone.utc)
|
|
3170
|
+
pid_alive = False
|
|
3171
|
+
if pid is not None:
|
|
3172
|
+
try:
|
|
3173
|
+
os.kill(pid, 0)
|
|
3174
|
+
pid_alive = True
|
|
3175
|
+
except (OSError, ValueError, TypeError):
|
|
3176
|
+
pass
|
|
3177
|
+
|
|
3178
|
+
# Parse timestamps
|
|
3179
|
+
started_dt = None
|
|
3180
|
+
heartbeat_dt = None
|
|
3181
|
+
if started:
|
|
3182
|
+
try:
|
|
3183
|
+
started_dt = datetime.fromisoformat(started.replace("Z", "+00:00"))
|
|
3184
|
+
if started_dt.tzinfo is None:
|
|
3185
|
+
started_dt = started_dt.replace(tzinfo=timezone.utc)
|
|
3186
|
+
except (ValueError, AttributeError):
|
|
3187
|
+
pass
|
|
3188
|
+
if heartbeat:
|
|
3189
|
+
try:
|
|
3190
|
+
heartbeat_dt = datetime.fromisoformat(heartbeat.replace("Z", "+00:00"))
|
|
3191
|
+
if heartbeat_dt.tzinfo is None:
|
|
3192
|
+
heartbeat_dt = heartbeat_dt.replace(tzinfo=timezone.utc)
|
|
3193
|
+
except (ValueError, AttributeError):
|
|
3194
|
+
pass
|
|
3195
|
+
|
|
3196
|
+
# Calculate duration
|
|
3197
|
+
duration_seconds = None
|
|
3198
|
+
if started_dt:
|
|
3199
|
+
duration_seconds = round((now - started_dt).total_seconds())
|
|
3200
|
+
|
|
3201
|
+
# Calculate heartbeat age
|
|
3202
|
+
heartbeat_age = None
|
|
3203
|
+
if heartbeat_dt:
|
|
3204
|
+
heartbeat_age = round((now - heartbeat_dt).total_seconds())
|
|
3205
|
+
|
|
3206
|
+
# Resolve state
|
|
3207
|
+
normalized = last_status.lower().strip() if last_status else ""
|
|
3208
|
+
if pid_alive:
|
|
3209
|
+
if heartbeat_age is not None and heartbeat_age > stale_threshold:
|
|
3210
|
+
state = "STALE"
|
|
3211
|
+
else:
|
|
3212
|
+
state = "RUNNING"
|
|
3213
|
+
else:
|
|
3214
|
+
if normalized in ("done", "completed", "complete", "success"):
|
|
3215
|
+
state = "COMPLETED"
|
|
3216
|
+
elif normalized in ("failed", "error", "errored"):
|
|
3217
|
+
state = "FAILED"
|
|
3218
|
+
elif normalized in ("running", "active", "in_progress", "starting"):
|
|
3219
|
+
state = "CRASHED"
|
|
3220
|
+
elif pid is None:
|
|
3221
|
+
state = "UNKNOWN"
|
|
3222
|
+
else:
|
|
3223
|
+
# PID dead, unknown last status
|
|
3224
|
+
state = "CRASHED" if normalized == "" else "UNKNOWN"
|
|
3225
|
+
|
|
3226
|
+
result: dict[str, Any] = {
|
|
3227
|
+
"state": state,
|
|
3228
|
+
"pid_alive": pid_alive,
|
|
3229
|
+
}
|
|
3230
|
+
if started:
|
|
3231
|
+
result["started"] = started
|
|
3232
|
+
if heartbeat:
|
|
3233
|
+
result["last_heartbeat"] = heartbeat
|
|
3234
|
+
if heartbeat_age is not None:
|
|
3235
|
+
result["heartbeat_age_seconds"] = heartbeat_age
|
|
3236
|
+
if duration_seconds is not None:
|
|
3237
|
+
result["duration_seconds"] = duration_seconds
|
|
3238
|
+
return result
|
|
3239
|
+
|
|
3240
|
+
|
|
3154
3241
|
@app.get("/api/health/processes")
|
|
3155
3242
|
async def get_process_health(token: Optional[dict] = Depends(auth.get_current_token)):
|
|
3156
|
-
"""Get health status of all loki processes (dashboard, session, agents).
|
|
3243
|
+
"""Get health status of all loki processes (dashboard, session, agents).
|
|
3244
|
+
|
|
3245
|
+
Returns honest state labels: RUNNING, STALE, COMPLETED, FAILED, CRASHED, UNKNOWN.
|
|
3246
|
+
Every entry includes timestamps (started, last_heartbeat, duration_seconds).
|
|
3247
|
+
"""
|
|
3157
3248
|
result: dict[str, Any] = {"dashboard": None, "session": None, "agents": []}
|
|
3158
3249
|
|
|
3159
3250
|
loki_dir = _get_loki_dir()
|
|
3251
|
+
now_iso = datetime.now(timezone.utc).isoformat()
|
|
3160
3252
|
|
|
3161
3253
|
# Dashboard PID
|
|
3162
3254
|
dpid_file = loki_dir / "dashboard" / "dashboard.pid"
|
|
3163
3255
|
if dpid_file.exists():
|
|
3164
3256
|
try:
|
|
3165
3257
|
dpid = int(dpid_file.read_text().strip())
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
result["dashboard"] = {"pid": dpid, "status": "alive"}
|
|
3169
|
-
except OSError:
|
|
3170
|
-
result["dashboard"] = {"pid": dpid, "status": "dead"}
|
|
3258
|
+
state_info = _resolve_process_state(dpid, last_status="running")
|
|
3259
|
+
result["dashboard"] = {"pid": dpid, **state_info}
|
|
3171
3260
|
except (ValueError, OSError):
|
|
3172
3261
|
pass
|
|
3173
3262
|
|
|
@@ -3176,14 +3265,23 @@ async def get_process_health(token: Optional[dict] = Depends(auth.get_current_to
|
|
|
3176
3265
|
if spid_file.exists():
|
|
3177
3266
|
try:
|
|
3178
3267
|
spid = int(spid_file.read_text().strip())
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
result["session"] = {"pid": spid, "status": "alive"}
|
|
3182
|
-
except OSError:
|
|
3183
|
-
result["session"] = {"pid": spid, "status": "dead"}
|
|
3268
|
+
state_info = _resolve_process_state(spid, last_status="running")
|
|
3269
|
+
result["session"] = {"pid": spid, **state_info}
|
|
3184
3270
|
except (ValueError, OSError):
|
|
3185
3271
|
pass
|
|
3186
3272
|
|
|
3273
|
+
# Read dashboard-state.json for heartbeat timestamp
|
|
3274
|
+
state_file = loki_dir / "dashboard-state.json"
|
|
3275
|
+
state_heartbeat = ""
|
|
3276
|
+
if state_file.exists():
|
|
3277
|
+
try:
|
|
3278
|
+
st = os.stat(state_file)
|
|
3279
|
+
state_heartbeat = datetime.fromtimestamp(
|
|
3280
|
+
st.st_mtime, tz=timezone.utc
|
|
3281
|
+
).isoformat()
|
|
3282
|
+
except OSError:
|
|
3283
|
+
pass
|
|
3284
|
+
|
|
3187
3285
|
# Agent PIDs
|
|
3188
3286
|
agents_file = loki_dir / "state" / "agents.json"
|
|
3189
3287
|
if agents_file.exists():
|
|
@@ -3191,18 +3289,21 @@ async def get_process_health(token: Optional[dict] = Depends(auth.get_current_to
|
|
|
3191
3289
|
agents = json.loads(agents_file.read_text())
|
|
3192
3290
|
for agent in agents:
|
|
3193
3291
|
pid = agent.get("pid")
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3292
|
+
pid_int = int(pid) if pid else None
|
|
3293
|
+
agent_status = agent.get("status", "")
|
|
3294
|
+
agent_started = agent.get("started", "")
|
|
3295
|
+
agent_heartbeat = agent.get("heartbeat", state_heartbeat)
|
|
3296
|
+
state_info = _resolve_process_state(
|
|
3297
|
+
pid_int,
|
|
3298
|
+
last_status=agent_status,
|
|
3299
|
+
started=agent_started,
|
|
3300
|
+
heartbeat=agent_heartbeat,
|
|
3301
|
+
)
|
|
3201
3302
|
result["agents"].append({
|
|
3202
3303
|
"id": agent.get("id", ""),
|
|
3203
3304
|
"name": agent.get("name", ""),
|
|
3204
3305
|
"pid": pid,
|
|
3205
|
-
|
|
3306
|
+
**state_info,
|
|
3206
3307
|
})
|
|
3207
3308
|
except Exception:
|
|
3208
3309
|
pass
|
|
@@ -3216,17 +3317,29 @@ async def get_process_health(token: Optional[dict] = Depends(auth.get_current_to
|
|
|
3216
3317
|
pid_str = entry_file.stem
|
|
3217
3318
|
pid = int(pid_str)
|
|
3218
3319
|
entry = json.loads(entry_file.read_text())
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3320
|
+
entry_started = entry.get("started", "")
|
|
3321
|
+
entry_heartbeat = entry.get("heartbeat", "")
|
|
3322
|
+
# Use file mtime as heartbeat fallback
|
|
3323
|
+
if not entry_heartbeat:
|
|
3324
|
+
try:
|
|
3325
|
+
st = os.stat(entry_file)
|
|
3326
|
+
entry_heartbeat = datetime.fromtimestamp(
|
|
3327
|
+
st.st_mtime, tz=timezone.utc
|
|
3328
|
+
).isoformat()
|
|
3329
|
+
except OSError:
|
|
3330
|
+
pass
|
|
3331
|
+
entry_status = entry.get("status", "running")
|
|
3332
|
+
state_info = _resolve_process_state(
|
|
3333
|
+
pid,
|
|
3334
|
+
last_status=entry_status,
|
|
3335
|
+
started=entry_started,
|
|
3336
|
+
heartbeat=entry_heartbeat,
|
|
3337
|
+
)
|
|
3224
3338
|
registered.append({
|
|
3225
3339
|
"pid": pid,
|
|
3226
3340
|
"label": entry.get("label", "unknown"),
|
|
3227
|
-
"started": entry.get("started", ""),
|
|
3228
3341
|
"ppid": entry.get("ppid"),
|
|
3229
|
-
|
|
3342
|
+
**state_info,
|
|
3230
3343
|
})
|
|
3231
3344
|
except (ValueError, json.JSONDecodeError, OSError):
|
|
3232
3345
|
continue
|
|
@@ -3234,6 +3347,7 @@ async def get_process_health(token: Optional[dict] = Depends(auth.get_current_to
|
|
|
3234
3347
|
|
|
3235
3348
|
watchdog_enabled = os.environ.get("LOKI_WATCHDOG", "false").lower() == "true"
|
|
3236
3349
|
result["watchdog_enabled"] = watchdog_enabled
|
|
3350
|
+
result["checked_at"] = now_iso
|
|
3237
3351
|
|
|
3238
3352
|
return result
|
|
3239
3353
|
|
|
@@ -4774,7 +4774,7 @@ var LokiDashboard=(()=>{var X=Object.defineProperty;var gt=Object.getOwnProperty
|
|
|
4774
4774
|
<p>Checklist not initialized</p>
|
|
4775
4775
|
<p class="hint">The PRD checklist will be created during the first iteration when a PRD is provided.</p>
|
|
4776
4776
|
</div>
|
|
4777
|
-
`}_attachEventListeners(){let t=this.shadowRoot;t&&(t.querySelectorAll(".category-header[data-category]").forEach(e=>{e.addEventListener("click",()=>this._toggleCategory(e.dataset.category))}),t.querySelectorAll("button[data-waive-id]").forEach(e=>{e.addEventListener("click",a=>{a.stopPropagation(),this._waiveItem(e.dataset.waiveId)})}),t.querySelectorAll("button[data-unwaive-id]").forEach(e=>{e.addEventListener("click",a=>{a.stopPropagation(),this._unwaiveItem(e.dataset.unwaiveId)})}))}_escapeHtml(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}};customElements.define("loki-checklist-viewer",G);var ht={not_initialized:{color:"var(--loki-text-muted, #71717a)",label:"Not Started",pulse:!1},starting:{color:"var(--loki-yellow, #ca8a04)",label:"Starting...",pulse:!0},running:{color:"var(--loki-green, #16a34a)",label:"Running",pulse:!0},crashed:{color:"var(--loki-red, #dc2626)",label:"Crashed",pulse:!1},stopped:{color:"var(--loki-text-muted, #a1a1aa)",label:"Stopped",pulse:!1}},J=class extends c{static get observedAttributes(){return["api-url","theme"]}constructor(){super(),this._loading=!1,this._error=null,this._api=null,this._pollInterval=null,this._status=null,this._logs=[],this._lastDataHash=null,this._lastLogsHash=null}connectedCallback(){super.connectedCallback(),this._setupApi(),this._loadData(),this._startPolling()}disconnectedCallback(){super.disconnectedCallback(),this._stopPolling()}attributeChangedCallback(t,e,a){e!==a&&(t==="api-url"&&this._api&&(this._api.baseUrl=a,this._loadData()),t==="theme"&&this._applyTheme())}_setupApi(){let t=this.getAttribute("api-url")||window.location.origin;this._api=u({baseUrl:t})}_startPolling(){this._pollInterval=setInterval(()=>this._loadData(),3e3),this._visibilityHandler=()=>{document.hidden?this._pollInterval&&(clearInterval(this._pollInterval),this._pollInterval=null):this._pollInterval||(this._loadData(),this._pollInterval=setInterval(()=>this._loadData(),3e3))},document.addEventListener("visibilitychange",this._visibilityHandler)}_stopPolling(){this._pollInterval&&(clearInterval(this._pollInterval),this._pollInterval=null),this._visibilityHandler&&(document.removeEventListener("visibilitychange",this._visibilityHandler),this._visibilityHandler=null)}async _loadData(){try{let[t,e]=await Promise.all([this._api.getAppRunnerStatus(),this._api.getAppRunnerLogs()]),a=JSON.stringify({status:t?.status,port:t?.port,restarts:t?.restart_count,url:t?.url}),i=JSON.stringify(e?.lines?.slice(-5)||[]),s=i!==this._lastLogsHash;if(a===this._lastDataHash&&!s)return;this._lastDataHash=a,this._lastLogsHash=i,this._status=t,this._logs=e?.lines||[],this._error=null,this.render(),this._scrollLogsToBottom()}catch(t){this._error||(this._error=`Failed to load app status: ${t.message}`,this.render())}}_scrollLogsToBottom(){let t=this.shadowRoot;if(!t)return;let e=t.querySelector(".log-area");e&&(e.scrollTop=e.scrollHeight)}async _handleRestart(){try{await this._api.restartApp(),this._loadData()}catch(t){this._error=`Restart failed: ${t.message}`,this.render()}}async _handleStop(){try{await this._api.stopApp(),this._loadData()}catch(t){this._error=`Stop failed: ${t.message}`,this.render()}}_formatUptime(t){if(!t)return"--";let e=new Date(t),i=Math.floor((new Date-e)/1e3);if(i<60)return`${i}s`;if(i<3600)return`${Math.floor(i/60)}m ${i%60}s`;let s=Math.floor(i/3600),r=Math.floor(i%3600/60);return`${s}h ${r}m`}_isValidUrl(t){if(!t)return!1;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}_getStyles(){return`
|
|
4777
|
+
`}_attachEventListeners(){let t=this.shadowRoot;t&&(t.querySelectorAll(".category-header[data-category]").forEach(e=>{e.addEventListener("click",()=>this._toggleCategory(e.dataset.category))}),t.querySelectorAll("button[data-waive-id]").forEach(e=>{e.addEventListener("click",a=>{a.stopPropagation(),this._waiveItem(e.dataset.waiveId)})}),t.querySelectorAll("button[data-unwaive-id]").forEach(e=>{e.addEventListener("click",a=>{a.stopPropagation(),this._unwaiveItem(e.dataset.unwaiveId)})}))}_escapeHtml(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}};customElements.define("loki-checklist-viewer",G);var ht={not_initialized:{color:"var(--loki-text-muted, #71717a)",label:"Not Started",pulse:!1},starting:{color:"var(--loki-yellow, #ca8a04)",label:"Starting...",pulse:!0},running:{color:"var(--loki-green, #16a34a)",label:"Running",pulse:!0},stale:{color:"var(--loki-yellow, #ca8a04)",label:"Stale",pulse:!1},completed:{color:"var(--loki-text-muted, #a1a1aa)",label:"Completed",pulse:!1},failed:{color:"var(--loki-red, #dc2626)",label:"Failed",pulse:!1},crashed:{color:"var(--loki-red, #dc2626)",label:"Crashed",pulse:!1},stopped:{color:"var(--loki-text-muted, #a1a1aa)",label:"Stopped",pulse:!1},unknown:{color:"var(--loki-text-muted, #71717a)",label:"Unknown",pulse:!1}},J=class extends c{static get observedAttributes(){return["api-url","theme"]}constructor(){super(),this._loading=!1,this._error=null,this._api=null,this._pollInterval=null,this._status=null,this._logs=[],this._lastDataHash=null,this._lastLogsHash=null}connectedCallback(){super.connectedCallback(),this._setupApi(),this._loadData(),this._startPolling()}disconnectedCallback(){super.disconnectedCallback(),this._stopPolling()}attributeChangedCallback(t,e,a){e!==a&&(t==="api-url"&&this._api&&(this._api.baseUrl=a,this._loadData()),t==="theme"&&this._applyTheme())}_setupApi(){let t=this.getAttribute("api-url")||window.location.origin;this._api=u({baseUrl:t})}_startPolling(){this._pollInterval=setInterval(()=>this._loadData(),3e3),this._visibilityHandler=()=>{document.hidden?this._pollInterval&&(clearInterval(this._pollInterval),this._pollInterval=null):this._pollInterval||(this._loadData(),this._pollInterval=setInterval(()=>this._loadData(),3e3))},document.addEventListener("visibilitychange",this._visibilityHandler)}_stopPolling(){this._pollInterval&&(clearInterval(this._pollInterval),this._pollInterval=null),this._visibilityHandler&&(document.removeEventListener("visibilitychange",this._visibilityHandler),this._visibilityHandler=null)}async _loadData(){try{let[t,e]=await Promise.all([this._api.getAppRunnerStatus(),this._api.getAppRunnerLogs()]),a=JSON.stringify({status:t?.status,port:t?.port,restarts:t?.restart_count,url:t?.url}),i=JSON.stringify(e?.lines?.slice(-5)||[]),s=i!==this._lastLogsHash;if(a===this._lastDataHash&&!s)return;this._lastDataHash=a,this._lastLogsHash=i,this._status=t,this._logs=e?.lines||[],this._error=null,this.render(),this._scrollLogsToBottom()}catch(t){this._error||(this._error=`Failed to load app status: ${t.message}`,this.render())}}_scrollLogsToBottom(){let t=this.shadowRoot;if(!t)return;let e=t.querySelector(".log-area");e&&(e.scrollTop=e.scrollHeight)}async _handleRestart(){try{await this._api.restartApp(),this._loadData()}catch(t){this._error=`Restart failed: ${t.message}`,this.render()}}async _handleStop(){try{await this._api.stopApp(),this._loadData()}catch(t){this._error=`Stop failed: ${t.message}`,this.render()}}_formatUptime(t){if(!t)return"--";let e=new Date(t),i=Math.floor((new Date-e)/1e3);if(i<60)return`${i}s`;if(i<3600)return`${Math.floor(i/60)}m ${i%60}s`;let s=Math.floor(i/3600),r=Math.floor(i%3600/60);return`${s}h ${r}m`}_isValidUrl(t){if(!t)return!1;try{let e=new URL(t);return e.protocol==="http:"||e.protocol==="https:"}catch{return!1}}_getStyles(){return`
|
|
4778
4778
|
.app-status {
|
|
4779
4779
|
padding: 16px;
|
|
4780
4780
|
font-family: var(--loki-font-family, system-ui, -apple-system, sans-serif);
|
package/docs/COMPARISON.md
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
|---------|--------------|-----------|-----------|------------|----------|-----------------|--------------|--------------|
|
|
38
38
|
| **Code Review** | 3 blind reviewers + devil's advocate | Basic | Basic | BugBot PR | Property-based | Artifacts | Doc/Review | Basic |
|
|
39
39
|
| **Anti-Sycophancy** | Yes (CONSENSAGENT) | No | No | No | No | No | No | No |
|
|
40
|
-
| **Quality Gates** |
|
|
40
|
+
| **Quality Gates** | 9 gates + PBT | Basic | Sandbox | Tests | Spec validation | Artifact checks | Tests | Permissions |
|
|
41
41
|
| **Constitutional AI** | Yes (principles) | No | Refusal training | No | No | No | No | No |
|
|
42
42
|
|
|
43
43
|
---
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
|
|
147
147
|
| Feature | **Zencoder** | **Loki Mode** | **Assessment** |
|
|
148
148
|
|---------|-------------|---------------|----------------|
|
|
149
|
-
| **Four Pillars** | Structured Workflows, SDD, Multi-Agent Verification, Parallel Execution | SDLC + RARV +
|
|
149
|
+
| **Four Pillars** | Structured Workflows, SDD, Multi-Agent Verification, Parallel Execution | SDLC + RARV + 9 Gates + Worktrees | TIE |
|
|
150
150
|
| **Spec-Driven Dev** | Specs as first-class objects | OpenAPI-first | TIE |
|
|
151
151
|
| **Multi-Agent Verification** | Model diversity (Claude vs OpenAI, 54% improvement) | 3 blind reviewers + devil's advocate | Different approach (N/A for Claude Code - only Claude models) |
|
|
152
152
|
| **Quality Gates** | Built-in verification loops | 7 explicit gates + anti-sycophancy | **Loki Mode** |
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
| **Skills** | Progressive disclosure | 6 slash commands | N/A | 129 skills | N/A | 35 skills | Memory focus |
|
|
208
208
|
| **Multi-Provider** | Yes (Claude/Codex/Gemini) | 3 CLIs (separate) | No | No | No | No | No |
|
|
209
209
|
| **Memory System** | 3-tier (episodic/semantic/procedural) | None | N/A | N/A | Hybrid | N/A | SQLite+FTS5 |
|
|
210
|
-
| **Quality Gates** |
|
|
210
|
+
| **Quality Gates** | 9 gates + Completion Council | User verify only | Two-Stage Review | N/A | Consensus | Tiered | N/A |
|
|
211
211
|
| **Context Mgmt** | Standard | Fresh per task (core innovation) | Fresh per task | N/A | N/A | N/A | Progressive |
|
|
212
212
|
| **Autonomy** | High (minimal human) | Semi (checkpoints) | Human-guided | Human-guided | Orchestrated | Human-guided | N/A |
|
|
213
213
|
|
|
@@ -232,7 +232,7 @@ These are patterns from competing projects that are **practically and scientific
|
|
|
232
232
|
|----------|---------|-------------------------|
|
|
233
233
|
| **Multi-Provider Support** | Only skill supporting Claude, Codex, and Gemini with graceful degradation | All 8 competitors are Claude-only |
|
|
234
234
|
| **RARV Cycle** | Reason-Act-Reflect-Verify is more rigorous than Plan-Execute | Most use simple Plan-Execute |
|
|
235
|
-
| **
|
|
235
|
+
| **9-Gate Quality System** | Static analysis + 3 reviewers + devil's advocate + anti-sycophancy + severity blocking + coverage + debate | Superpowers has 2-stage, others have less |
|
|
236
236
|
| **Constitutional AI Integration** | Principles-based self-critique from Anthropic research | None have this |
|
|
237
237
|
| **Anti-Sycophancy (CONSENSAGENT)** | Blind review + devil's advocate prevents groupthink | None have this |
|
|
238
238
|
| **Provider Abstraction Layer** | Clean degradation from full-featured to sequential-only | Claude-only projects can't degrade |
|
|
@@ -359,7 +359,7 @@ Tiered agent architecture with explicit escalation:
|
|
|
359
359
|
|-----------|-------------------|
|
|
360
360
|
| **Autonomy** | Designed for high autonomy with minimal human intervention |
|
|
361
361
|
| **Multi-Agent** | 41 specialized agents in 8 swarms vs 1-8 in competitors |
|
|
362
|
-
| **Quality** |
|
|
362
|
+
| **Quality** | 9 gates + blind review + devil's advocate + property-based testing |
|
|
363
363
|
| **Research** | 10+ academic papers integrated vs proprietary/undisclosed |
|
|
364
364
|
| **Anti-Sycophancy** | Only agent with CONSENSAGENT-based blind review |
|
|
365
365
|
| **Memory** | 3-tier memory (episodic/semantic/procedural) + review learning + cross-project |
|
|
@@ -20,7 +20,7 @@ GSD is the closest competitor -- a context engineering system that spawns fresh
|
|
|
20
20
|
| Adoption | 594 stars, 6K/wk npm | 11,903 stars, 21K/wk npm | GSD (20x) |
|
|
21
21
|
| Simplicity | Complex (5.4K-line run.sh, 12 Python modules) | Simple (markdown agents + slash commands) | GSD |
|
|
22
22
|
| Full autonomy | Walk away, come back to deployed product | Human checkpoints at discuss/verify/milestone | Loki |
|
|
23
|
-
| Quality gates |
|
|
23
|
+
| Quality gates | 9-gate + Completion Council + anti-sycophancy | User verification only | Loki |
|
|
24
24
|
| Memory system | Episodic/semantic/procedural + vector search | None | Loki |
|
|
25
25
|
| Context management | Standard | Fresh subagent contexts per task (core innovation) | GSD |
|
|
26
26
|
| Time to value | Learn architecture, understand CLI flags | `npx get-shit-done-cc` and go | GSD |
|
|
@@ -85,7 +85,7 @@ GSD is the closest competitor -- a context engineering system that spawns fresh
|
|
|
85
85
|
|
|
86
86
|
**Strengths:**
|
|
87
87
|
- 85.9-87.7% Pass@1 on HumanEval
|
|
88
|
-
-
|
|
88
|
+
- High task completion rate in evaluations (100% reported by MetaGPT authors; not independently verified)
|
|
89
89
|
- Standard Operating Procedures (SOPs) reduce hallucinations
|
|
90
90
|
- Assembly line paradigm with role specialization
|
|
91
91
|
- Low cost: ~$1.09 per project completion
|
package/docs/INSTALLATION.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installation instructions for all platforms and use cases.
|
|
4
4
|
|
|
5
|
-
**Version:** v5.49.
|
|
5
|
+
**Version:** v5.49.3
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -36,9 +36,7 @@ The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installa
|
|
|
36
36
|
|
|
37
37
|
- [Quick Install (Recommended)](#quick-install-recommended)
|
|
38
38
|
- [VS Code Extension](#vs-code-extension)
|
|
39
|
-
- [
|
|
40
|
-
- [Homebrew (macOS/Linux)](#homebrew-macoslinux)
|
|
41
|
-
- [Docker](#docker)
|
|
39
|
+
- [Alternative Methods](#alternative-methods)
|
|
42
40
|
- [Sandbox Mode](#sandbox-mode)
|
|
43
41
|
- [Multi-Provider Support](#multi-provider-support)
|
|
44
42
|
- [Claude Code (CLI)](#claude-code-cli)
|
|
@@ -53,23 +51,19 @@ The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installa
|
|
|
53
51
|
|
|
54
52
|
## Quick Install (Recommended)
|
|
55
53
|
|
|
56
|
-
Choose your preferred method:
|
|
57
|
-
|
|
58
54
|
```bash
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
56
|
+
```
|
|
61
57
|
|
|
62
|
-
|
|
63
|
-
brew tap asklokesh/tap && brew install loki-mode
|
|
58
|
+
That's it. Claude Code auto-discovers skills in `~/.claude/skills/`.
|
|
64
59
|
|
|
65
|
-
|
|
66
|
-
docker pull asklokesh/loki-mode:latest
|
|
60
|
+
**Update:** `cd ~/.claude/skills/loki-mode && git pull`
|
|
67
61
|
|
|
68
|
-
#
|
|
69
|
-
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
70
|
-
```
|
|
62
|
+
Skip to [Verify Installation](#verify-installation) to confirm it's working.
|
|
71
63
|
|
|
72
|
-
|
|
64
|
+
### Alternative Installation Methods
|
|
65
|
+
|
|
66
|
+
Also available via npm, Homebrew, Docker, VS Code Extension, and GitHub Action. Each has trade-offs -- see [docs/alternative-installations.md](alternative-installations.md) for details, limitations, and current status of each method.
|
|
73
67
|
|
|
74
68
|
---
|
|
75
69
|
|
|
@@ -145,153 +139,42 @@ The extension will automatically connect when it detects the server is running a
|
|
|
145
139
|
|
|
146
140
|
---
|
|
147
141
|
|
|
148
|
-
##
|
|
142
|
+
## Alternative Methods
|
|
149
143
|
|
|
150
|
-
|
|
144
|
+
The following installation methods are available but each has limitations. Git clone (above) is the recommended primary method.
|
|
151
145
|
|
|
152
|
-
|
|
146
|
+
For full details, troubleshooting, and current status of each method, see [alternative-installations.md](alternative-installations.md).
|
|
153
147
|
|
|
154
|
-
|
|
148
|
+
### npm
|
|
155
149
|
|
|
156
|
-
|
|
150
|
+
**Status:** Published to npm registry. Verify current version: `npm view loki-mode version`
|
|
157
151
|
|
|
158
152
|
```bash
|
|
159
|
-
# Global installation
|
|
160
153
|
npm install -g loki-mode
|
|
161
|
-
|
|
162
|
-
# The skill is automatically installed to ~/.claude/skills/loki-mode
|
|
163
|
-
|
|
164
|
-
# Opt out of anonymous install telemetry:
|
|
165
|
-
# LOKI_TELEMETRY_DISABLED=true npm install -g loki-mode
|
|
166
|
-
# Or set DO_NOT_TRACK=1
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Usage
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
# Use the CLI
|
|
173
|
-
loki start ./my-prd.md
|
|
174
|
-
loki status
|
|
175
|
-
loki dashboard
|
|
176
|
-
|
|
177
|
-
# Or invoke in Claude Code
|
|
178
|
-
claude --dangerously-skip-permissions
|
|
179
|
-
> Loki Mode with PRD at ./my-prd.md
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Updating
|
|
183
|
-
|
|
184
|
-
```bash
|
|
185
|
-
npm update -g loki-mode
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Uninstalling
|
|
189
|
-
|
|
190
|
-
```bash
|
|
191
|
-
npm uninstall -g loki-mode
|
|
192
|
-
rm -rf ~/.claude/skills/loki-mode
|
|
193
154
|
```
|
|
194
155
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
## Homebrew (macOS/Linux)
|
|
156
|
+
Requires Node.js 16+. Provides the `loki` CLI and auto-installs the skill to `~/.claude/skills/loki-mode`.
|
|
198
157
|
|
|
199
|
-
|
|
158
|
+
### Homebrew
|
|
200
159
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
- Homebrew (https://brew.sh)
|
|
204
|
-
|
|
205
|
-
### Installation
|
|
160
|
+
**Status:** Available via tap. Verify formula: `brew info asklokesh/tap/loki-mode`
|
|
206
161
|
|
|
207
162
|
```bash
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
# Install Loki Mode
|
|
212
|
-
brew install loki-mode
|
|
213
|
-
|
|
214
|
-
# Set up Claude Code skill integration (manual symlink required)
|
|
163
|
+
brew tap asklokesh/tap && brew install loki-mode
|
|
164
|
+
# Manual symlink required for Claude Code:
|
|
215
165
|
ln -sf "$(brew --prefix)/opt/loki-mode/libexec" ~/.claude/skills/loki-mode
|
|
216
166
|
```
|
|
217
167
|
|
|
218
|
-
###
|
|
219
|
-
|
|
220
|
-
Homebrew automatically installs:
|
|
221
|
-
- bash 4.0+ (for associative arrays)
|
|
222
|
-
- jq (JSON processing)
|
|
223
|
-
- gh (GitHub CLI for integration)
|
|
224
|
-
|
|
225
|
-
### Usage
|
|
226
|
-
|
|
227
|
-
```bash
|
|
228
|
-
# Use the CLI
|
|
229
|
-
loki start ./my-prd.md
|
|
230
|
-
loki status
|
|
231
|
-
loki --help
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
### Updating
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
brew upgrade loki-mode
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### Uninstalling
|
|
168
|
+
### Docker
|
|
241
169
|
|
|
242
|
-
|
|
243
|
-
brew uninstall loki-mode
|
|
244
|
-
rm -rf ~/.claude/skills/loki-mode
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Docker
|
|
250
|
-
|
|
251
|
-
Run Loki Mode in a container for isolated execution.
|
|
252
|
-
|
|
253
|
-
### Prerequisites
|
|
254
|
-
|
|
255
|
-
- Docker installed and running
|
|
256
|
-
|
|
257
|
-
### Installation
|
|
170
|
+
**Status:** Published to Docker Hub.
|
|
258
171
|
|
|
259
172
|
```bash
|
|
260
|
-
# Pull the image
|
|
261
173
|
docker pull asklokesh/loki-mode:latest
|
|
262
|
-
|
|
263
|
-
# Or use docker-compose
|
|
264
|
-
curl -o docker-compose.yml https://raw.githubusercontent.com/asklokesh/loki-mode/main/docker-compose.yml
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### Usage
|
|
268
|
-
|
|
269
|
-
```bash
|
|
270
|
-
# Run with a PRD file
|
|
271
174
|
docker run -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:latest start ./my-prd.md
|
|
272
|
-
|
|
273
|
-
# Interactive mode
|
|
274
|
-
docker run -it -v $(pwd):/workspace -w /workspace asklokesh/loki-mode:latest
|
|
275
|
-
|
|
276
|
-
# Using docker-compose
|
|
277
|
-
docker-compose run loki start ./my-prd.md
|
|
278
175
|
```
|
|
279
176
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
Pass your configuration via environment variables:
|
|
283
|
-
|
|
284
|
-
```bash
|
|
285
|
-
docker run -e LOKI_MAX_RETRIES=100 -e LOKI_BASE_WAIT=120 \
|
|
286
|
-
-v $(pwd):/workspace -w /workspace \
|
|
287
|
-
asklokesh/loki-mode:latest start ./my-prd.md
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### Updating
|
|
291
|
-
|
|
292
|
-
```bash
|
|
293
|
-
docker pull asklokesh/loki-mode:latest
|
|
294
|
-
```
|
|
177
|
+
**Limitation:** Docker cannot run Claude Code interactively (Claude Code is a terminal-based CLI requiring TTY access). Docker is suitable for CI/CD pipelines, API-only modes, and sandbox execution -- not for the primary interactive workflow.
|
|
295
178
|
|
|
296
179
|
---
|
|
297
180
|
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Alternative Installation Methods
|
|
2
|
+
|
|
3
|
+
The primary installation method is git clone (see [README](../README.md#installation)). These alternatives serve specific use cases.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## npm (Secondary)
|
|
8
|
+
|
|
9
|
+
**Status**: Working. Version tracks releases automatically.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g loki-mode
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Limitation**: Installs to `node_modules`, not `~/.claude/skills/`. To use as a Claude Code skill, you must symlink:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g loki-mode
|
|
19
|
+
ln -sf "$(npm root -g)/loki-mode" ~/.claude/skills/loki-mode
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Best for**: CI/CD pipelines, programmatic access via `loki` CLI.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Homebrew (Secondary)
|
|
27
|
+
|
|
28
|
+
**Status**: Working. Tap and formula exist, version current.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
brew tap asklokesh/tap
|
|
32
|
+
brew install loki-mode
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**Limitation**: Installs the `loki` CLI binary only. Does NOT install the Claude Code skill. To use with Claude Code, also run:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/asklokesh/loki-mode.git ~/.claude/skills/loki-mode
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Best for**: Users who want the `loki` CLI wrapper for autonomous mode (`loki start`, `loki stop`, `loki cleanup`).
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Docker (Secondary)
|
|
46
|
+
|
|
47
|
+
**Status**: Image exists on Docker Hub. Tags: `latest`, version-specific (e.g., `5.49.1`).
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
docker pull asklokesh/loki-mode:latest
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Limitation**: Claude Code is an interactive CLI that requires API keys and terminal access. Running it inside a Docker container is not the standard workflow. Docker is useful for:
|
|
54
|
+
|
|
55
|
+
- CI/CD sandbox execution (running `loki` in isolated environments)
|
|
56
|
+
- Testing Loki Mode without modifying your local system
|
|
57
|
+
- Air-gapped environments with pre-built images
|
|
58
|
+
|
|
59
|
+
**Not recommended for**: Interactive Claude Code sessions. Use the git clone method instead.
|
|
60
|
+
|
|
61
|
+
See [DOCKER_README.md](../DOCKER_README.md) for Docker-specific usage instructions.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## GitHub Action (Secondary)
|
|
66
|
+
|
|
67
|
+
**Status**: Working. Adds automated AI code review to pull requests.
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
# .github/workflows/loki-review.yml
|
|
71
|
+
name: Loki Code Review
|
|
72
|
+
on:
|
|
73
|
+
pull_request:
|
|
74
|
+
types: [opened, synchronize]
|
|
75
|
+
permissions:
|
|
76
|
+
contents: read
|
|
77
|
+
pull-requests: write
|
|
78
|
+
jobs:
|
|
79
|
+
review:
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v4
|
|
83
|
+
- uses: asklokesh/loki-mode@v5
|
|
84
|
+
with:
|
|
85
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
mode: review
|
|
87
|
+
provider: claude
|
|
88
|
+
max_iterations: 3
|
|
89
|
+
budget_limit: '5.00'
|
|
90
|
+
env:
|
|
91
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
**Prerequisites:**
|
|
95
|
+
- API key for your provider (set as repository secret): `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `GOOGLE_API_KEY`
|
|
96
|
+
- The action auto-installs `loki-mode` and `@anthropic-ai/claude-code`
|
|
97
|
+
|
|
98
|
+
**Action Inputs:**
|
|
99
|
+
|
|
100
|
+
| Input | Default | Description |
|
|
101
|
+
|-------|---------|-------------|
|
|
102
|
+
| `mode` | `review` | `review`, `fix`, or `test` |
|
|
103
|
+
| `provider` | `claude` | `claude`, `codex`, or `gemini` |
|
|
104
|
+
| `budget_limit` | `5.00` | Max cost in USD |
|
|
105
|
+
| `max_iterations` | `3` | Max RARV cycles |
|
|
106
|
+
| `github_token` | (required) | GitHub token for PR comments |
|
|
107
|
+
| `prd_file` | | Path to PRD file (for fix/test modes) |
|
|
108
|
+
|
|
109
|
+
**Modes:**
|
|
110
|
+
|
|
111
|
+
| Mode | Description |
|
|
112
|
+
|------|-------------|
|
|
113
|
+
| `review` | Analyze PR diff, post structured review as PR comment |
|
|
114
|
+
| `fix` | Automatically fix issues found in the codebase |
|
|
115
|
+
| `test` | Run autonomous test generation and validation |
|
|
116
|
+
|
|
117
|
+
**Best for**: Automated PR review and CI/CD integration.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## GitHub Release Download (Secondary)
|
|
122
|
+
|
|
123
|
+
**Status**: Working. Release assets available for each version.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Download and extract to skills directory
|
|
127
|
+
curl -sL https://github.com/asklokesh/loki-mode/archive/refs/tags/v5.49.1.tar.gz | tar xz
|
|
128
|
+
mv loki-mode-5.49.1 ~/.claude/skills/loki-mode
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
**Best for**: Offline or air-gapped environments, pinned version deployments.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## VS Code Extension (Secondary)
|
|
136
|
+
|
|
137
|
+
**Status**: Available on VS Code Marketplace.
|
|
138
|
+
|
|
139
|
+
Search for "Loki Mode" in VS Code Extensions, or:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
code --install-extension asklokesh.loki-mode
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Best for**: VS Code users who want dashboard integration within their editor.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|-----------|--------|-----------|--------|
|
|
12
12
|
| **Proven Scale** | 1M+ LoC, large agent count | Benchmarks only | Cursor |
|
|
13
13
|
| **Research Foundation** | Empirical iteration | 25+ academic citations | Loki Mode |
|
|
14
|
-
| **Quality Assurance** | Workers self-manage |
|
|
14
|
+
| **Quality Assurance** | Workers self-manage | 9-gate system + anti-sycophancy | Loki Mode |
|
|
15
15
|
| **Anti-Sycophancy** | Not mentioned | CONSENSAGENT blind review | Loki Mode |
|
|
16
16
|
| **Velocity-Quality Balance** | Not mentioned | arXiv-backed metrics | Loki Mode |
|
|
17
17
|
| **Full SDLC Coverage** | Code generation focus | PRD to production + growth | Loki Mode |
|
|
@@ -66,7 +66,7 @@ velocity_quality_balance:
|
|
|
66
66
|
|
|
67
67
|
---
|
|
68
68
|
|
|
69
|
-
### 3.
|
|
69
|
+
### 3. 9-Gate Quality System
|
|
70
70
|
|
|
71
71
|
**Loki Mode's Gates:**
|
|
72
72
|
1. Input Guardrails - Validate scope, detect injection (OpenAI SDK pattern)
|
|
@@ -174,7 +174,7 @@ Cursor learned through failure:
|
|
|
174
174
|
### 3. Simplicity Principle
|
|
175
175
|
> "A surprising amount of the system's behavior comes down to how we prompt the agents. The harness and models matter, but the prompts matter more."
|
|
176
176
|
|
|
177
|
-
**Loki Mode:** More complex infrastructure (
|
|
177
|
+
**Loki Mode:** More complex infrastructure (9 gates, 41 agent types, memory systems). May be over-engineered for some use cases.
|
|
178
178
|
|
|
179
179
|
---
|
|
180
180
|
|
|
@@ -192,7 +192,7 @@ We incorporated Cursor's proven patterns:
|
|
|
192
192
|
## Conclusion
|
|
193
193
|
|
|
194
194
|
**Loki Mode is scientifically better in:**
|
|
195
|
-
- Quality assurance (research-backed
|
|
195
|
+
- Quality assurance (research-backed 9-gate system)
|
|
196
196
|
- Anti-sycophancy (CONSENSAGENT blind review)
|
|
197
197
|
- Velocity-quality balance (arXiv metrics)
|
|
198
198
|
- Full SDLC coverage (PRD to growth)
|
package/mcp/__init__.py
CHANGED
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ Full RARV cycle, CONTINUITY.md template, and autonomy rules.
|
|
|
6
6
|
|
|
7
7
|
## Autonomy Rules
|
|
8
8
|
|
|
9
|
-
**This system runs with
|
|
9
|
+
**This system runs with minimal human intervention.** Human oversight is expected for deployment credentials, domain setup, API keys, and critical business decisions.
|
|
10
10
|
|
|
11
11
|
### Core Rules
|
|
12
12
|
1. **NEVER ask questions** - Do not say "Would you like me to...", "Should I...", or "What would you prefer?"
|
|
@@ -165,6 +165,16 @@ IMPLEMENT -> BLIND REVIEW (parallel) -> DEBATE (if disagreement) -> AGGREGATE ->
|
|
|
165
165
|
- NEVER dispatch reviewers sequentially (always parallel - 3x faster)
|
|
166
166
|
- NEVER aggregate before all 3 reviewers complete
|
|
167
167
|
|
|
168
|
+
### Test Quality Review (Apply to Every Review)
|
|
169
|
+
|
|
170
|
+
Before approving, verify:
|
|
171
|
+
- Are tests using real implementations or excessive mocks of internal code?
|
|
172
|
+
- Were any assertion expected values changed in the same commit as implementation? (This is the top sign an agent cheated.)
|
|
173
|
+
- Do tests verify meaningful behavior or just "runs without throwing"?
|
|
174
|
+
- Could all tests pass while the feature is completely broken?
|
|
175
|
+
|
|
176
|
+
Assertion manipulation in the same commit as implementation = CRITICAL finding = automatic REJECT.
|
|
177
|
+
|
|
168
178
|
### Anti-Sycophancy Protocol (CONSENSAGENT Research)
|
|
169
179
|
|
|
170
180
|
**Problem:** Reviewers may reinforce each other's findings instead of critically engaging.
|
package/skills/00-index.md
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
### quality-gates.md
|
|
43
43
|
**When:** Code review, pre-commit checks, quality assurance
|
|
44
|
-
-
|
|
44
|
+
- 9-gate quality system
|
|
45
45
|
- Blind review + anti-sycophancy
|
|
46
46
|
- Velocity-quality feedback loop (arXiv research)
|
|
47
47
|
- Mandatory quality checks per task
|
package/skills/artifacts.md
CHANGED
package/skills/quality-gates.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Never ship code without passing all quality gates.**
|
|
4
4
|
|
|
5
|
-
## The
|
|
5
|
+
## The 9 Quality Gates
|
|
6
6
|
|
|
7
7
|
1. **Input Guardrails** - Validate scope, detect injection, check constraints (OpenAI SDK)
|
|
8
8
|
2. **Static Analysis** - CodeQL, ESLint/Pylint, type checking
|
|
@@ -11,6 +11,26 @@
|
|
|
11
11
|
5. **Output Guardrails** - Validate code quality, spec compliance, no secrets (tripwire on fail)
|
|
12
12
|
6. **Severity-Based Blocking** - Critical/High/Medium = BLOCK; Low/Cosmetic = TODO comment
|
|
13
13
|
7. **Test Coverage Gates** - Unit: 100% pass, >80% coverage; Integration: 100% pass
|
|
14
|
+
8. **Mock Detector** - Classifies internal vs external mocks; flags tests that never import source code, tautological assertions, and high internal mock ratios
|
|
15
|
+
9. **Test Mutation Detector** - Detects assertion value changes alongside implementation changes (test fitting), low assertion density, and missing pass/fail tracking
|
|
16
|
+
|
|
17
|
+
## Gate 8 and 9: Automated Test Integrity
|
|
18
|
+
|
|
19
|
+
Gates 8 (Mock Detector) and 9 (Test Mutation Detector) run during the VERIFY phase and are enabled by default.
|
|
20
|
+
|
|
21
|
+
**How they run:**
|
|
22
|
+
- Gate 8 runs `tests/detect-mock-problems.sh` against all test files in the project
|
|
23
|
+
- Gate 9 runs `tests/detect-test-mutations.sh` against recent commits (default: last 5, or use `--commit HASH` for targeted checks)
|
|
24
|
+
- Both produce findings at HIGH/MEDIUM/LOW severity levels
|
|
25
|
+
- HIGH findings = automatic FAIL (same as other blocking gates)
|
|
26
|
+
|
|
27
|
+
**Disabling (not recommended):**
|
|
28
|
+
```bash
|
|
29
|
+
LOKI_GATE_MOCK_DETECTOR=false # Disable gate 8
|
|
30
|
+
LOKI_GATE_MUTATION_DETECTOR=false # Disable gate 9
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
---
|
|
14
34
|
|
|
15
35
|
## Guardrails Execution Modes
|
|
16
36
|
|
package/skills/testing.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Testing
|
|
2
2
|
|
|
3
|
+
## Mandatory Testing Rules
|
|
4
|
+
|
|
5
|
+
1. Write tests FIRST. Commit the test before writing implementation.
|
|
6
|
+
2. Tests must call REAL functions with REAL inputs and assert REAL outputs.
|
|
7
|
+
3. Mock ONLY external dependencies: HTTP APIs, databases, file system, third-party services.
|
|
8
|
+
4. NEVER mock internal modules, utility functions, or any code that is part of this project.
|
|
9
|
+
5. NEVER change a test's expected value to make it pass. If a test fails, the implementation is wrong. Fix the code, not the test.
|
|
10
|
+
6. If you believe a test expectation is incorrect, document WHY and flag for council review. Do not silently change it.
|
|
11
|
+
7. Every test file must have at least one assertion per tested function.
|
|
12
|
+
|
|
13
|
+
Gate 8 (mock detector) and Gate 9 (mutation detector) enforce rules 3-5 automatically.
|
|
14
|
+
Violations result in automatic FAIL during VERIFY phase.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
3
18
|
## E2E Testing with Playwright MCP
|
|
4
19
|
|
|
5
20
|
**Use Playwright MCP for browser-based testing.**
|