loki-mode 5.57.0 → 5.57.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.57.0
6
+ # Loki Mode v5.57.1
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.57.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
266
+ **v5.57.1 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.57.0
1
+ 5.57.1
package/autonomy/loki CHANGED
@@ -4854,7 +4854,7 @@ cmd_migrate_help() {
4854
4854
  }
4855
4855
 
4856
4856
  cmd_migrate_list() {
4857
- python3 -c "
4857
+ PYTHONPATH="${SKILL_DIR:-.}" python3 -c "
4858
4858
  import sys
4859
4859
  sys.path.insert(0, '.')
4860
4860
  from dashboard.migration_engine import list_migrations
@@ -4900,7 +4900,7 @@ cmd_migrate_status() {
4900
4900
  return 1
4901
4901
  fi
4902
4902
 
4903
- python3 -c "
4903
+ PYTHONPATH="${SKILL_DIR:-.}" python3 -c "
4904
4904
  import json, sys
4905
4905
  sys.path.insert(0, '.')
4906
4906
  from dashboard.migration_engine import MigrationPipeline
@@ -4955,7 +4955,7 @@ print(data.get('id', ''))
4955
4955
  " "$plan_file" 2>/dev/null || echo "")
4956
4956
 
4957
4957
  if [ -n "$migration_id_for_plan" ]; then
4958
- python3 -c "
4958
+ PYTHONPATH="${SKILL_DIR:-.}" python3 -c "
4959
4959
  import sys
4960
4960
  sys.path.insert(0, '.')
4961
4961
  from dashboard.migration_engine import MigrationPipeline
@@ -5121,7 +5121,7 @@ if manifests:
5121
5121
 
5122
5122
  # Create migration via engine
5123
5123
  local create_result
5124
- create_result=$(python3 -c "
5124
+ create_result=$(PYTHONPATH="${SKILL_DIR:-.}" python3 -c "
5125
5125
  import json, sys
5126
5126
  sys.path.insert(0, '.')
5127
5127
  from dashboard.migration_engine import MigrationPipeline
@@ -5215,7 +5215,7 @@ print(json.dumps({'id': manifest.id, 'dir': str(pipeline.migration_dir)}))
5215
5215
  echo -e "${CYAN}[Phase: ${p}]${NC} Starting..."
5216
5216
 
5217
5217
  # Start phase via engine
5218
- python3 -c "
5218
+ PYTHONPATH="${SKILL_DIR:-.}" python3 -c "
5219
5219
  import sys
5220
5220
  sys.path.insert(0, '.')
5221
5221
  from dashboard.migration_engine import MigrationPipeline
@@ -5226,31 +5226,140 @@ pipeline.start_phase(sys.argv[2])
5226
5226
  return 1
5227
5227
  }
5228
5228
 
5229
- # Phase-specific logic
5229
+ # Phase-specific logic -- invoke Claude to do real work
5230
+ local phase_prompt=""
5230
5231
  case "$p" in
5231
5232
  understand)
5232
5233
  echo -e " ${DIM}Analyzing codebase structure...${NC}"
5233
- echo -e " ${DIM}Detecting languages, frameworks, dependencies...${NC}"
5234
- echo -e " ${DIM}Building dependency graph...${NC}"
5234
+ phase_prompt="You are performing the UNDERSTAND phase of a codebase migration.
5235
+ Target: ${target}
5236
+ Codebase: ${codebase_path}
5237
+
5238
+ Tasks:
5239
+ 1. Analyze the full codebase structure (languages, frameworks, dependencies, architecture)
5240
+ 2. Create the docs directory: mkdir -p ${migration_dir}/docs
5241
+ 3. Write analysis documentation to ${migration_dir}/docs/analysis.md
5242
+ 3. Identify migration seams (logical boundaries for incremental migration) and write them to ${migration_dir}/seams.json as a JSON array of objects with fields: id, name, description, files (array of file paths), dependencies (array of seam ids), priority (high/medium/low)
5243
+
5244
+ You MUST create both files. The migration cannot proceed without them.
5245
+ Write the analysis doc first, then the seams.json."
5235
5246
  ;;
5236
5247
  guardrail)
5237
- echo -e " ${DIM}Identifying existing tests...${NC}"
5238
- echo -e " ${DIM}Creating rollback checkpoints...${NC}"
5239
- echo -e " ${DIM}Setting up safety nets...${NC}"
5248
+ echo -e " ${DIM}Setting up safety nets and characterization tests...${NC}"
5249
+ phase_prompt="You are performing the GUARDRAIL phase of a codebase migration.
5250
+ Target: ${target}
5251
+ Codebase: ${codebase_path}
5252
+ Migration dir: ${migration_dir}
5253
+
5254
+ Read ${migration_dir}/docs/analysis.md and ${migration_dir}/seams.json for context.
5255
+
5256
+ Tasks:
5257
+ 1. Identify existing tests and create characterization tests that capture current behavior
5258
+ 2. Write ${migration_dir}/features.json as a JSON array of objects with fields: id, name, description, test_command (shell command to verify), passes (boolean, set to true for existing passing behavior)
5259
+ 3. Create a git checkpoint: cd ${codebase_path} && git stash || true
5260
+
5261
+ All features in features.json must have passes: true for the gate to pass."
5240
5262
  ;;
5241
5263
  migrate)
5242
- echo -e " ${DIM}Executing migration transforms (${parallel} parallel agents)...${NC}"
5243
- echo -e " ${DIM}Applying incremental changes...${NC}"
5264
+ echo -e " ${DIM}Executing migration transforms...${NC}"
5265
+ phase_prompt="You are performing the MIGRATE phase of a codebase migration.
5266
+ Target: ${target}
5267
+ Codebase: ${codebase_path}
5268
+ Migration dir: ${migration_dir}
5269
+
5270
+ Read ${migration_dir}/docs/analysis.md, ${migration_dir}/seams.json, and ${migration_dir}/features.json for context.
5271
+
5272
+ Tasks:
5273
+ 1. Create a migration plan and write it to ${migration_dir}/migration-plan.json with fields: target, source_path, steps (array of objects with: id, name, description, status set to 'completed' after you do the step)
5274
+ 2. Execute the actual code migration transforms in ${codebase_path} -- convert code from the current framework/language to ${target}
5275
+ 3. Update each step status to 'completed' as you finish it
5276
+ 4. Work incrementally seam by seam from ${migration_dir}/seams.json
5277
+
5278
+ All steps must have status: completed for the gate to pass."
5244
5279
  ;;
5245
5280
  verify)
5246
5281
  echo -e " ${DIM}Running verification suite...${NC}"
5247
- echo -e " ${DIM}Checking regression tests...${NC}"
5248
- echo -e " ${DIM}Validating build output...${NC}"
5282
+ phase_prompt="You are performing the VERIFY phase of a codebase migration.
5283
+ Target: ${target}
5284
+ Codebase: ${codebase_path}
5285
+ Migration dir: ${migration_dir}
5286
+
5287
+ Tasks:
5288
+ 1. Run syntax validation on all migrated files
5289
+ 2. Run any test commands from ${migration_dir}/features.json to verify behavior is preserved
5290
+ 3. Check for common migration issues (missing imports, broken references, etc.)
5291
+ 4. Write a verification report to ${migration_dir}/docs/verification-report.md
5292
+ 5. Summarize what was migrated, what works, and any remaining issues"
5249
5293
  ;;
5250
5294
  esac
5251
5295
 
5296
+ # Invoke Claude to execute the phase
5297
+ local phase_exit=0
5298
+ if [ -n "$phase_prompt" ]; then
5299
+ local provider_name="${LOKI_PROVIDER:-claude}"
5300
+ case "$provider_name" in
5301
+ claude)
5302
+ (cd "$codebase_path" && claude --dangerously-skip-permissions -p "$phase_prompt" --output-format stream-json --verbose 2>&1) | \
5303
+ while IFS= read -r line; do
5304
+ # Extract text from stream-json
5305
+ if echo "$line" | python3 -c "
5306
+ import sys, json
5307
+ try:
5308
+ d = json.loads(sys.stdin.read())
5309
+ if d.get('type') == 'assistant':
5310
+ for item in d.get('message', {}).get('content', []):
5311
+ if item.get('type') == 'text':
5312
+ print(item.get('text', ''), end='')
5313
+ except Exception: pass
5314
+ " 2>/dev/null; then
5315
+ true
5316
+ fi
5317
+ done
5318
+ phase_exit=${PIPESTATUS[0]}
5319
+ ;;
5320
+ codex)
5321
+ (cd "$codebase_path" && codex exec --full-auto "$phase_prompt" 2>&1) || phase_exit=$?
5322
+ ;;
5323
+ gemini)
5324
+ (cd "$codebase_path" && gemini --approval-mode=yolo "$phase_prompt" 2>&1) || phase_exit=$?
5325
+ ;;
5326
+ esac
5327
+ fi
5328
+
5329
+ # Verify phase gate artifacts exist before advancing
5330
+ local gate_ok=true
5331
+ case "$p" in
5332
+ understand)
5333
+ if [ ! -f "${migration_dir}/docs/analysis.md" ] || [ ! -f "${migration_dir}/seams.json" ]; then
5334
+ echo -e "${RED}Error: Phase 'understand' did not produce required artifacts${NC}"
5335
+ echo -e "${DIM} Expected: docs/analysis.md, seams.json${NC}"
5336
+ gate_ok=false
5337
+ fi
5338
+ ;;
5339
+ guardrail)
5340
+ if [ ! -f "${migration_dir}/features.json" ]; then
5341
+ echo -e "${RED}Error: Phase 'guardrail' did not produce required artifacts${NC}"
5342
+ echo -e "${DIM} Expected: features.json${NC}"
5343
+ gate_ok=false
5344
+ fi
5345
+ ;;
5346
+ migrate)
5347
+ if [ ! -f "${migration_dir}/migration-plan.json" ]; then
5348
+ echo -e "${RED}Error: Phase 'migrate' did not produce required artifacts${NC}"
5349
+ echo -e "${DIM} Expected: migration-plan.json${NC}"
5350
+ gate_ok=false
5351
+ fi
5352
+ ;;
5353
+ esac
5354
+
5355
+ if [ "$gate_ok" != "true" ]; then
5356
+ echo -e "${YELLOW}Phase '$p' artifacts missing. Migration halted.${NC}"
5357
+ echo -e "${DIM}Re-run with: loki migrate <path> --target ${target} --phase ${p} --resume${NC}"
5358
+ return 1
5359
+ fi
5360
+
5252
5361
  # Complete phase via engine
5253
- python3 -c "
5362
+ PYTHONPATH="${SKILL_DIR:-.}" python3 -c "
5254
5363
  import sys
5255
5364
  sys.path.insert(0, '.')
5256
5365
  from dashboard.migration_engine import MigrationPipeline
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "5.57.0"
10
+ __version__ = "5.57.1"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -307,12 +307,14 @@ class MigrationPipeline:
307
307
  return phase_data.get("status", "pending")
308
308
 
309
309
  def start_phase(self, phase: str) -> None:
310
- """Start a phase (transition from pending to in_progress)."""
310
+ """Start a phase (transition from pending to in_progress). Idempotent if already in_progress."""
311
311
  if phase not in PHASE_ORDER:
312
312
  raise ValueError(f"Unknown phase: {phase}")
313
313
  with self._lock:
314
314
  manifest = self._load_manifest_unlocked()
315
315
  current_status = manifest.phases[phase]["status"]
316
+ if current_status == "in_progress":
317
+ return # Already started, idempotent
316
318
  if current_status != "pending":
317
319
  raise RuntimeError(
318
320
  f"Cannot start phase '{phase}': status is '{current_status}', expected 'pending'"
@@ -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.57.0
5
+ **Version:** v5.57.1
6
6
 
7
7
  ---
8
8
 
package/mcp/__init__.py CHANGED
@@ -57,4 +57,4 @@ try:
57
57
  except ImportError:
58
58
  __all__ = ['mcp']
59
59
 
60
- __version__ = '5.57.0'
60
+ __version__ = '5.57.1'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "5.57.0",
3
+ "version": "5.57.1",
4
4
  "description": "Loki Mode by Autonomi - Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "agent",