loki-mode 6.59.0 → 6.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/loki +150 -0
- package/autonomy/mirofish-adapter.py +1530 -0
- package/autonomy/run.sh +162 -4
- package/dashboard/__init__.py +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
- package/skills/00-index.md +8 -0
- package/skills/mirofish-integration.md +100 -0
package/autonomy/run.sh
CHANGED
|
@@ -8125,6 +8125,70 @@ except Exception:
|
|
|
8125
8125
|
" 2>/dev/null || true)
|
|
8126
8126
|
fi
|
|
8127
8127
|
|
|
8128
|
+
# MiroFish market validation context injection (if available)
|
|
8129
|
+
local mirofish_context=""
|
|
8130
|
+
if [[ -f ".loki/mirofish-context.json" ]]; then
|
|
8131
|
+
mirofish_context=$(python3 -c "
|
|
8132
|
+
import json
|
|
8133
|
+
try:
|
|
8134
|
+
with open('.loki/mirofish-context.json') as f:
|
|
8135
|
+
data = json.load(f)
|
|
8136
|
+
parts = ['MIROFISH MARKET VALIDATION:']
|
|
8137
|
+
adv = data.get('analysis', {})
|
|
8138
|
+
summary = adv.get('overall_sentiment', '')
|
|
8139
|
+
score = adv.get('sentiment_score', 0)
|
|
8140
|
+
conf = adv.get('confidence', '')
|
|
8141
|
+
rec = adv.get('recommendation', '')
|
|
8142
|
+
if summary:
|
|
8143
|
+
parts.append(f'Overall: {summary} (score={score}, confidence={conf}, recommendation={rec})')
|
|
8144
|
+
concerns = adv.get('key_concerns', [])
|
|
8145
|
+
if concerns:
|
|
8146
|
+
parts.append('Key Concerns: ' + '; '.join(c[:200] for c in concerns[:5]))
|
|
8147
|
+
rankings = adv.get('feature_rankings', [])
|
|
8148
|
+
if rankings:
|
|
8149
|
+
ranked = ', '.join(f'{r[\"feature\"]}={r[\"reception_score\"]}' for r in rankings[:5])
|
|
8150
|
+
parts.append(f'Feature Reception: {ranked}')
|
|
8151
|
+
quotes = adv.get('notable_quotes', [])
|
|
8152
|
+
if quotes:
|
|
8153
|
+
parts.append('Agent Quotes: ' + ' | '.join(q[:150] for q in quotes[:3]))
|
|
8154
|
+
parts.append('NOTE: MiroFish results are advisory only. They do NOT override Completion Council or quality gates.')
|
|
8155
|
+
print(' '.join(parts))
|
|
8156
|
+
except Exception:
|
|
8157
|
+
pass
|
|
8158
|
+
" 2>/dev/null || true)
|
|
8159
|
+
elif [[ -f ".loki/mirofish/pipeline-state.json" ]]; then
|
|
8160
|
+
mirofish_context=$(python3 -c "
|
|
8161
|
+
import json, os
|
|
8162
|
+
try:
|
|
8163
|
+
with open('.loki/mirofish/pipeline-state.json') as f:
|
|
8164
|
+
state = json.load(f)
|
|
8165
|
+
status = state.get('status', 'unknown')
|
|
8166
|
+
stage = state.get('current_stage', 0)
|
|
8167
|
+
pid = state.get('pid', 0)
|
|
8168
|
+
alive = False
|
|
8169
|
+
if pid:
|
|
8170
|
+
try:
|
|
8171
|
+
os.kill(pid, 0)
|
|
8172
|
+
alive = True
|
|
8173
|
+
except OSError:
|
|
8174
|
+
pass
|
|
8175
|
+
if status == 'running' and alive:
|
|
8176
|
+
s3 = state.get('stages', {}).get('3_simulation', {})
|
|
8177
|
+
progress = ''
|
|
8178
|
+
if s3.get('status') == 'running':
|
|
8179
|
+
cr = s3.get('current_round', 0)
|
|
8180
|
+
tr = s3.get('total_rounds', 0)
|
|
8181
|
+
if tr:
|
|
8182
|
+
progress = f' (simulation round {cr}/{tr})'
|
|
8183
|
+
print(f'MIROFISH_STATUS: Market validation running stage {stage}/4{progress}. Advisory will appear when complete.')
|
|
8184
|
+
elif status == 'failed':
|
|
8185
|
+
error = state.get('error', 'unknown')[:200]
|
|
8186
|
+
print(f'MIROFISH_STATUS: Market validation failed at stage {stage}: {error}. Proceeding without.')
|
|
8187
|
+
except Exception:
|
|
8188
|
+
pass
|
|
8189
|
+
" 2>/dev/null || true)
|
|
8190
|
+
fi
|
|
8191
|
+
|
|
8128
8192
|
# Degraded providers with small models need simplified prompts
|
|
8129
8193
|
# Full RARV/SDLC instructions overwhelm models < 30B parameters
|
|
8130
8194
|
if [ "${PROVIDER_DEGRADED:-false}" = "true" ]; then
|
|
@@ -8149,15 +8213,15 @@ except Exception:
|
|
|
8149
8213
|
else
|
|
8150
8214
|
if [ $retry -eq 0 ]; then
|
|
8151
8215
|
if [ -n "$prd" ]; then
|
|
8152
|
-
echo "Loki Mode with PRD at $prd. $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $checklist_status $app_runner_info $playwright_info $memory_context_section $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8216
|
+
echo "Loki Mode with PRD at $prd. $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $mirofish_context $checklist_status $app_runner_info $playwright_info $memory_context_section $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8153
8217
|
else
|
|
8154
|
-
echo "Loki Mode. $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $checklist_status $app_runner_info $playwright_info $memory_context_section $analysis_instruction $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8218
|
+
echo "Loki Mode. $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $mirofish_context $checklist_status $app_runner_info $playwright_info $memory_context_section $analysis_instruction $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8155
8219
|
fi
|
|
8156
8220
|
else
|
|
8157
8221
|
if [ -n "$prd" ]; then
|
|
8158
|
-
echo "Loki Mode - Resume iteration #$iteration (retry #$retry). PRD: $prd. $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $checklist_status $app_runner_info $playwright_info $memory_context_section $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8222
|
+
echo "Loki Mode - Resume iteration #$iteration (retry #$retry). PRD: $prd. $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $mirofish_context $checklist_status $app_runner_info $playwright_info $memory_context_section $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8159
8223
|
else
|
|
8160
|
-
echo "Loki Mode - Resume iteration #$iteration (retry #$retry). $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $checklist_status $app_runner_info $playwright_info $memory_context_section Use .loki/generated-prd.md if exists. $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8224
|
+
echo "Loki Mode - Resume iteration #$iteration (retry #$retry). $human_directive $gate_failure_context $queue_tasks $bmad_context $openspec_context $mirofish_context $checklist_status $app_runner_info $playwright_info $memory_context_section Use .loki/generated-prd.md if exists. $rarv_instruction $memory_instruction $compaction_reminder $completion_instruction $sdlc_instruction $autonomous_suffix"
|
|
8161
8225
|
fi
|
|
8162
8226
|
fi
|
|
8163
8227
|
fi
|
|
@@ -8439,6 +8503,97 @@ OPENSPEC_QUEUE_EOF
|
|
|
8439
8503
|
log_info "OpenSpec queue population complete"
|
|
8440
8504
|
}
|
|
8441
8505
|
|
|
8506
|
+
#===============================================================================
|
|
8507
|
+
# MiroFish Task Queue Population
|
|
8508
|
+
#===============================================================================
|
|
8509
|
+
|
|
8510
|
+
# Populate the task queue from MiroFish market validation advisory
|
|
8511
|
+
# Only runs once -- skips if queue was already populated from MiroFish
|
|
8512
|
+
populate_mirofish_queue() {
|
|
8513
|
+
# Skip if no MiroFish tasks file
|
|
8514
|
+
if [[ ! -f ".loki/mirofish-tasks.json" ]]; then
|
|
8515
|
+
return 0
|
|
8516
|
+
fi
|
|
8517
|
+
|
|
8518
|
+
# Skip if already populated (marker file)
|
|
8519
|
+
if [[ -f ".loki/queue/.mirofish-populated" ]]; then
|
|
8520
|
+
log_info "MiroFish queue already populated, skipping"
|
|
8521
|
+
return 0
|
|
8522
|
+
fi
|
|
8523
|
+
|
|
8524
|
+
log_step "Populating task queue from MiroFish market validation..."
|
|
8525
|
+
|
|
8526
|
+
# Ensure queue directory exists
|
|
8527
|
+
mkdir -p ".loki/queue"
|
|
8528
|
+
|
|
8529
|
+
# Read MiroFish tasks and create queue entries
|
|
8530
|
+
python3 << 'MIROFISH_QUEUE_EOF'
|
|
8531
|
+
import json
|
|
8532
|
+
import os
|
|
8533
|
+
import sys
|
|
8534
|
+
|
|
8535
|
+
mf_tasks_path = ".loki/mirofish-tasks.json"
|
|
8536
|
+
pending_path = ".loki/queue/pending.json"
|
|
8537
|
+
|
|
8538
|
+
try:
|
|
8539
|
+
with open(mf_tasks_path, "r") as f:
|
|
8540
|
+
mf_tasks = json.load(f)
|
|
8541
|
+
except (json.JSONDecodeError, FileNotFoundError) as e:
|
|
8542
|
+
print(f"Warning: Could not read MiroFish tasks: {e}", file=sys.stderr)
|
|
8543
|
+
sys.exit(0)
|
|
8544
|
+
|
|
8545
|
+
if not isinstance(mf_tasks, list) or not mf_tasks:
|
|
8546
|
+
print("No MiroFish tasks found to queue", file=sys.stderr)
|
|
8547
|
+
sys.exit(0)
|
|
8548
|
+
|
|
8549
|
+
# Load existing pending tasks (if any)
|
|
8550
|
+
existing = []
|
|
8551
|
+
if os.path.exists(pending_path):
|
|
8552
|
+
try:
|
|
8553
|
+
with open(pending_path, "r") as f:
|
|
8554
|
+
data = json.load(f)
|
|
8555
|
+
if isinstance(data, list):
|
|
8556
|
+
existing = data
|
|
8557
|
+
elif isinstance(data, dict) and "tasks" in data:
|
|
8558
|
+
existing = data["tasks"]
|
|
8559
|
+
except (json.JSONDecodeError, FileNotFoundError):
|
|
8560
|
+
existing = []
|
|
8561
|
+
|
|
8562
|
+
# Convert MiroFish tasks to queue format (with deduplication)
|
|
8563
|
+
existing_ids = {t.get("id") for t in existing if isinstance(t, dict)}
|
|
8564
|
+
added = 0
|
|
8565
|
+
for i, task in enumerate(mf_tasks):
|
|
8566
|
+
if not isinstance(task, dict):
|
|
8567
|
+
continue
|
|
8568
|
+
task_id = task.get("id", f"mirofish-{i+1:03d}")
|
|
8569
|
+
if task_id in existing_ids:
|
|
8570
|
+
continue
|
|
8571
|
+
entry = {
|
|
8572
|
+
"id": task_id,
|
|
8573
|
+
"title": task.get("title", f"MiroFish Advisory {i+1}"),
|
|
8574
|
+
"description": task.get("description", ""),
|
|
8575
|
+
"priority": task.get("priority", "medium"),
|
|
8576
|
+
"source": "mirofish",
|
|
8577
|
+
}
|
|
8578
|
+
if task.get("category"):
|
|
8579
|
+
entry["category"] = task["category"]
|
|
8580
|
+
existing.append(entry)
|
|
8581
|
+
added += 1
|
|
8582
|
+
|
|
8583
|
+
with open(pending_path, "w") as f:
|
|
8584
|
+
json.dump(existing, f, indent=2)
|
|
8585
|
+
print(f"Added {added} MiroFish advisory tasks to queue", file=sys.stderr)
|
|
8586
|
+
MIROFISH_QUEUE_EOF
|
|
8587
|
+
|
|
8588
|
+
if [[ $? -ne 0 ]]; then
|
|
8589
|
+
log_warn "Failed to populate MiroFish queue"
|
|
8590
|
+
return 0
|
|
8591
|
+
fi
|
|
8592
|
+
|
|
8593
|
+
touch ".loki/queue/.mirofish-populated"
|
|
8594
|
+
log_info "MiroFish queue population complete"
|
|
8595
|
+
}
|
|
8596
|
+
|
|
8442
8597
|
#===============================================================================
|
|
8443
8598
|
# Main Autonomous Loop
|
|
8444
8599
|
#===============================================================================
|
|
@@ -8548,6 +8703,9 @@ run_autonomous() {
|
|
|
8548
8703
|
# Populate task queue from OpenSpec artifacts (if present, runs once)
|
|
8549
8704
|
populate_openspec_queue
|
|
8550
8705
|
|
|
8706
|
+
# Populate task queue from MiroFish advisory (if present, runs once)
|
|
8707
|
+
populate_mirofish_queue
|
|
8708
|
+
|
|
8551
8709
|
# Check max iterations before starting
|
|
8552
8710
|
if check_max_iterations; then
|
|
8553
8711
|
log_error "Max iterations already reached. Reset with: rm .loki/autonomy-state.json"
|
package/dashboard/__init__.py
CHANGED
package/docs/INSTALLATION.md
CHANGED
package/mcp/__init__.py
CHANGED
package/package.json
CHANGED
package/skills/00-index.md
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
| GitHub issues, PRs, syncing | `github-integration.md` |
|
|
29
29
|
| Multi-provider (Codex, Gemini) | `providers.md` |
|
|
30
30
|
| OpenSpec delta context, brownfield modifications | `openspec-integration.md` |
|
|
31
|
+
| MiroFish market validation, `--mirofish` flag | `mirofish-integration.md` |
|
|
31
32
|
| Plan deepening, knowledge extraction | `compound-learning.md` |
|
|
32
33
|
|
|
33
34
|
## Module Descriptions
|
|
@@ -118,6 +119,13 @@
|
|
|
118
119
|
- Source mapping and verification tracking
|
|
119
120
|
- Complexity-based agent strategy
|
|
120
121
|
|
|
122
|
+
### mirofish-integration.md
|
|
123
|
+
**When:** Project has MiroFish market validation data, `--mirofish` flag used
|
|
124
|
+
- Market validation context interpretation
|
|
125
|
+
- Sentiment-aware feature prioritization
|
|
126
|
+
- Risk-driven task ordering
|
|
127
|
+
- Advisory-only (never gates RARV or Completion Council)
|
|
128
|
+
|
|
121
129
|
### compound-learning.md (v5.30.0)
|
|
122
130
|
**When:** After architecture phase (deepen plan), after verification (extract learnings)
|
|
123
131
|
- Deepen-plan: 4 parallel research agents enhance plans before implementation
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# MiroFish Market Validation Integration
|
|
2
|
+
|
|
3
|
+
> MiroFish provides swarm intelligence market validation via simulated user/market
|
|
4
|
+
> reception. Results are **advisory only** and never gate the RARV cycle or
|
|
5
|
+
> Completion Council decisions.
|
|
6
|
+
|
|
7
|
+
## When This Module Applies
|
|
8
|
+
|
|
9
|
+
Load this module when ANY of the following are true:
|
|
10
|
+
- Your prompt contains a `MIROFISH MARKET VALIDATION` section
|
|
11
|
+
- The project has `.loki/mirofish-context.json`
|
|
12
|
+
- The session was started with `--mirofish` flag
|
|
13
|
+
- Tasks in `.loki/queue/pending.json` have `source: "mirofish"`
|
|
14
|
+
|
|
15
|
+
**If none of the above are true, do not load this module.**
|
|
16
|
+
|
|
17
|
+
## Understanding MiroFish Advisory Data
|
|
18
|
+
|
|
19
|
+
When present, MiroFish context includes:
|
|
20
|
+
- **overall_sentiment**: positive, negative, or mixed
|
|
21
|
+
- **sentiment_score**: 0.0-1.0 (higher = more positive)
|
|
22
|
+
- **confidence**: low, medium, or high (based on simulation depth)
|
|
23
|
+
- **key_concerns**: Risk items identified by simulated personas
|
|
24
|
+
- **feature_rankings**: Features ranked by simulated reception score
|
|
25
|
+
- **recommendation**: proceed, review_concerns, or reconsider
|
|
26
|
+
|
|
27
|
+
## Risk-Driven Prioritization
|
|
28
|
+
|
|
29
|
+
When MiroFish identifies key concerns, address them proactively:
|
|
30
|
+
|
|
31
|
+
| Concern Category | Action |
|
|
32
|
+
|-----------------|--------|
|
|
33
|
+
| User adoption / UX | Prioritize UX polish and onboarding |
|
|
34
|
+
| Market fit / demand | Validate core value proposition first |
|
|
35
|
+
| Competition | Differentiate early, focus unique features |
|
|
36
|
+
| Privacy / trust | Add transparency features, opt-in controls |
|
|
37
|
+
| Technical feasibility | Prototype risky components first |
|
|
38
|
+
|
|
39
|
+
## Sentiment-Aware Feature Ordering
|
|
40
|
+
|
|
41
|
+
Use feature reception scores to influence implementation order:
|
|
42
|
+
- **Score >= 0.8**: High demand -- implement first (validated demand)
|
|
43
|
+
- **Score 0.6-0.79**: Moderate interest -- standard priority
|
|
44
|
+
- **Score 0.4-0.59**: Lukewarm -- consider redesign before building
|
|
45
|
+
- **Score < 0.4**: Low reception -- deprioritize or cut from MVP
|
|
46
|
+
|
|
47
|
+
## Confidence Score Interpretation
|
|
48
|
+
|
|
49
|
+
| Range | Meaning | Action |
|
|
50
|
+
|-------|---------|--------|
|
|
51
|
+
| 80-100 | Strong market signal | Proceed with confidence |
|
|
52
|
+
| 60-79 | Moderate signal | Consider pivots for weak areas |
|
|
53
|
+
| 40-59 | Weak signal | Recommend PRD revision before heavy implementation |
|
|
54
|
+
| Below 40 | Insufficient data | Treat as noise, proceed with caution |
|
|
55
|
+
|
|
56
|
+
## Pipeline Status
|
|
57
|
+
|
|
58
|
+
If your prompt contains `MIROFISH_STATUS` instead of full validation data, the
|
|
59
|
+
pipeline is still running. This is normal -- MiroFish simulations take 15-45 minutes.
|
|
60
|
+
|
|
61
|
+
- Continue with implementation using available context
|
|
62
|
+
- Results will appear in subsequent iterations when the pipeline completes
|
|
63
|
+
- Do not wait or block for MiroFish results
|
|
64
|
+
|
|
65
|
+
## What MiroFish Does NOT Do
|
|
66
|
+
|
|
67
|
+
- Does NOT override Completion Council decisions
|
|
68
|
+
- Does NOT block the RARV cycle
|
|
69
|
+
- Does NOT evaluate code quality (that is the quality gates system)
|
|
70
|
+
- Does NOT make architecture decisions (those are yours)
|
|
71
|
+
- Results are directional signals, not precise measurements
|
|
72
|
+
|
|
73
|
+
## Known Limitations
|
|
74
|
+
|
|
75
|
+
- **LLM convergence bias**: Simulated agents may converge on similar opinions
|
|
76
|
+
- **Garbage-in-garbage-out**: Poor PRD = poor simulation seed = unreliable results
|
|
77
|
+
- **No real user data**: Synthetic personas, not actual market research
|
|
78
|
+
- **Cultural bias**: Agent behavior reflects LLM training data distributions
|
|
79
|
+
- **Timing**: Results arrive 15-45 min after launch, may miss early iterations
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
MiroFish requires these environment variables for its Docker container:
|
|
84
|
+
- `LLM_API_KEY` (required) -- API key for MiroFish's LLM provider
|
|
85
|
+
- `ZEP_API_KEY` (required) -- Zep Cloud key for graph memory
|
|
86
|
+
|
|
87
|
+
CLI flags:
|
|
88
|
+
- `--mirofish [URL]` -- Enable with optional custom URL (default: localhost:5001)
|
|
89
|
+
- `--mirofish-docker IMAGE` -- Auto-start MiroFish Docker container
|
|
90
|
+
- `--mirofish-rounds N` -- Simulation rounds (default: 100)
|
|
91
|
+
- `--mirofish-timeout S` -- Max pipeline wait (default: 3600s)
|
|
92
|
+
- `--mirofish-bg` -- Run in background mode
|
|
93
|
+
- `--no-mirofish` -- Disable even if LOKI_MIROFISH_URL is set
|
|
94
|
+
|
|
95
|
+
## MiroFish Task Queue
|
|
96
|
+
|
|
97
|
+
When MiroFish completes, actionable items from the report are added to the task
|
|
98
|
+
queue with `source: "mirofish"`. These tasks represent risk mitigations and
|
|
99
|
+
recommendations. They are advisory -- prioritize alongside normal development tasks
|
|
100
|
+
based on the concern severity and your judgment.
|