lemming-cli 0.8.1__tar.gz → 0.9.0__tar.gz

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.
Files changed (196) hide show
  1. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/PKG-INFO +11 -7
  2. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/README.md +10 -6
  3. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/SKILL.md +28 -8
  4. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docs/HOOKS.md +3 -0
  5. lemming_cli-0.9.0/docs/screenshots/dashboard-desktop.png +0 -0
  6. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docs/screenshots/dashboard-mobile.png +0 -0
  7. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/package-lock.json +4 -4
  8. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/package.json +1 -1
  9. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/pyproject.toml +1 -1
  10. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/tasks.py +89 -2
  11. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/tasks_test.py +120 -2
  12. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/exec_cli.py +1 -1
  13. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/exec_cli_test.py +15 -3
  14. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/main.py +4 -1
  15. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/main_test.py +19 -0
  16. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/operations.py +3 -3
  17. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/operations_test.py +35 -0
  18. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/tasks.py +146 -34
  19. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/tasks_test.py +130 -1
  20. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/cli.py +1 -1
  21. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/models.py +24 -1
  22. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/models_test.py +25 -4
  23. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/orchestrator.py +542 -31
  24. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/orchestrator_test.py +1078 -6
  25. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts/hooks/90-roadmap.md +6 -4
  26. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts/taskrunner.md +13 -13
  27. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts.py +14 -2
  28. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts_test.py +68 -1
  29. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/runner.py +8 -4
  30. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/runner_test.py +84 -0
  31. lemming_cli-0.9.0/src/lemming/snapshots.py +498 -0
  32. lemming_cli-0.9.0/src/lemming/snapshots_test.py +495 -0
  33. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/lifecycle.py +118 -24
  34. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/lifecycle_test.py +182 -2
  35. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/operations.py +239 -2
  36. lemming_cli-0.9.0/src/lemming/tasks/operations_test.py +1076 -0
  37. lemming_cli-0.9.0/src/lemming/web/mancha.js +46 -0
  38. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/uv.lock +1 -1
  39. lemming_cli-0.8.1/docs/screenshots/dashboard-desktop.png +0 -0
  40. lemming_cli-0.8.1/src/lemming/tasks/operations_test.py +0 -443
  41. lemming_cli-0.8.1/src/lemming/web/mancha.js +0 -58
  42. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.dockerignore +0 -0
  43. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.github/workflows/ci.yml +0 -0
  44. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.github/workflows/publish.yml +0 -0
  45. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.github/workflows/screenshots.yml +0 -0
  46. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.gitignore +0 -0
  47. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.prettierignore +0 -0
  48. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/.prettierrc +0 -0
  49. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/Dockerfile +0 -0
  50. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/LICENSE +0 -0
  51. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/biome.json +0 -0
  52. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docker-compose.yml +0 -0
  53. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docs/EVALS.md +0 -0
  54. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docs/WORKSPACE.md +0 -0
  55. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docs/screenshots/task-log-desktop.png +0 -0
  56. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/docs/screenshots/task-log-mobile.png +0 -0
  57. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/playwright.config.js +0 -0
  58. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/__init__.py +0 -0
  59. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/__init__.py +0 -0
  60. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/auth.py +0 -0
  61. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/auth_test.py +0 -0
  62. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/config.py +0 -0
  63. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/config_test.py +0 -0
  64. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/conftest.py +0 -0
  65. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/context.py +0 -0
  66. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/context_test.py +0 -0
  67. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/directories.py +0 -0
  68. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/directories_test.py +0 -0
  69. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/files.py +0 -0
  70. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/files_test.py +0 -0
  71. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/hooks.py +0 -0
  72. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/hooks_test.py +0 -0
  73. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/logging.py +0 -0
  74. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/logging_test.py +0 -0
  75. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/loop.py +0 -0
  76. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/loop_test.py +0 -0
  77. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/main.py +0 -0
  78. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/api/main_test.py +0 -0
  79. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/artifact_test.py +0 -0
  80. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/brief_test.py +0 -0
  81. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/__init__.py +0 -0
  82. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/artifact.py +0 -0
  83. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/brief.py +0 -0
  84. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/config.py +0 -0
  85. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/config_test.py +0 -0
  86. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/goal.py +0 -0
  87. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/goal_test.py +0 -0
  88. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/hooks.py +0 -0
  89. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/hooks_test.py +0 -0
  90. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/machine_output_test.py +0 -0
  91. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/progress.py +0 -0
  92. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/progress_test.py +0 -0
  93. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/readability_cli.py +0 -0
  94. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/readability_cli_test.py +0 -0
  95. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/skill.py +0 -0
  96. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/skill_test.py +0 -0
  97. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/cli/stop_test.py +0 -0
  98. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/conftest.py +0 -0
  99. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/__init__.py +0 -0
  100. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/__main__.py +0 -0
  101. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/cli_test.py +0 -0
  102. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/container.py +0 -0
  103. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/container_test.py +0 -0
  104. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/fixtures.py +0 -0
  105. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/fixtures_test.py +0 -0
  106. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/harness.py +0 -0
  107. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/harness_test.py +0 -0
  108. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/metrics.py +0 -0
  109. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/metrics_test.py +0 -0
  110. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/base/README.md +0 -0
  111. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/base/calc/__init__.py +0 -0
  112. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/base/calc/legacy.py +0 -0
  113. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/base/calc/ops.py +0 -0
  114. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/base/calc/ops_test.py +0 -0
  115. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/clean/calc/ops.py +0 -0
  116. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/clean/calc/ops_test.py +0 -0
  117. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/dead-code/calc/ops.py +0 -0
  118. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/dead-code/calc/ops_test.py +0 -0
  119. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/duplicated-behavior/calc/ops.py +0 -0
  120. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/duplicated-behavior/calc/ops_test.py +0 -0
  121. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/false-reuse/calc/limits.py +0 -0
  122. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/false-reuse/calc/limits_test.py +0 -0
  123. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/lint-debt/calc/ops.py +0 -0
  124. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/readability/lint-debt/calc/ops_test.py +0 -0
  125. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/add-only/README.md +0 -0
  126. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/add-only/calc/__init__.py +0 -0
  127. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/add-only/calc/ops.py +0 -0
  128. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/add-only/calc/ops_test.py +0 -0
  129. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/buggy-subtract/README.md +0 -0
  130. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/buggy-subtract/calc/__init__.py +0 -0
  131. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/buggy-subtract/calc/ops.py +0 -0
  132. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/buggy-subtract/calc/ops_test.py +0 -0
  133. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/full-ops/README.md +0 -0
  134. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/full-ops/calc/__init__.py +0 -0
  135. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/full-ops/calc/ops.py +0 -0
  136. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/full-ops/calc/ops_test.py +0 -0
  137. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/unwired-cli/README.md +0 -0
  138. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/unwired-cli/calc/__init__.py +0 -0
  139. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/unwired-cli/calc/cli.py +0 -0
  140. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/unwired-cli/calc/cli_test.py +0 -0
  141. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/unwired-cli/calc/ops.py +0 -0
  142. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/roadmap/unwired-cli/calc/ops_test.py +0 -0
  143. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/task/hidden/stats/summary_hidden_test.py +0 -0
  144. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/task/summary/README.md +0 -0
  145. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/task/summary/stats/__init__.py +0 -0
  146. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/task/summary/stats/summary.py +0 -0
  147. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/projects/task/summary/stats/summary_test.py +0 -0
  148. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/readability.py +0 -0
  149. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/readability_test.py +0 -0
  150. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/report.py +0 -0
  151. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/report_test.py +0 -0
  152. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/roadmap.py +0 -0
  153. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/roadmap_test.py +0 -0
  154. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/scenarios.py +0 -0
  155. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/scenarios_test.py +0 -0
  156. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/suites.py +0 -0
  157. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/task.py +0 -0
  158. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/task_test.py +0 -0
  159. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/trial.py +0 -0
  160. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/evals/trial_test.py +0 -0
  161. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/hooks.py +0 -0
  162. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/hooks_test.py +0 -0
  163. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/integration_test.py +0 -0
  164. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/main.py +0 -0
  165. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/main_test.py +0 -0
  166. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/paths.py +0 -0
  167. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/paths_test.py +0 -0
  168. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/persistence.py +0 -0
  169. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/persistence_test.py +0 -0
  170. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts/hooks/50-readability.md +0 -0
  171. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts/hooks/60-testing.md +0 -0
  172. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/prompts/hooks/70-ux.md +0 -0
  173. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/providers.py +0 -0
  174. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/providers_test.py +0 -0
  175. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/scope.py +0 -0
  176. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/scope_test.py +0 -0
  177. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/shutdown.py +0 -0
  178. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/shutdown_integration_test.py +0 -0
  179. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/shutdown_test.py +0 -0
  180. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/__init__.py +0 -0
  181. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/limits.py +0 -0
  182. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/progress.py +0 -0
  183. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/progress_test.py +0 -0
  184. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/queries.py +0 -0
  185. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/tasks/queries_test.py +0 -0
  186. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/dashboard.spec.js +0 -0
  187. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/dashboard.test.js +0 -0
  188. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/favicon.js +0 -0
  189. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/favicon.spec.js +0 -0
  190. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/files.html +0 -0
  191. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/files.spec.js +0 -0
  192. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/index.html +0 -0
  193. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/index.js +0 -0
  194. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/logs.html +0 -0
  195. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/logs.test.js +0 -0
  196. {lemming_cli-0.8.1 → lemming_cli-0.9.0}/src/lemming/web/screenshots.spec.js +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: lemming-cli
3
- Version: 0.8.1
3
+ Version: 0.9.0
4
4
  Summary: An autonomous, iterative task runner for AI coding agents.
5
5
  Project-URL: Homepage, https://github.com/owahltinez/lemming
6
6
  Project-URL: Repository, https://github.com/owahltinez/lemming
@@ -91,7 +91,8 @@ Start the autonomous loop.
91
91
 
92
92
  ```bash
93
93
  # Run using the project's configured agent (defaults to the first
94
- # supported runner found on PATH: agy, opencode, claude, or codex)
94
+ # supported runner found on PATH or in ~/.local/bin: agy, opencode,
95
+ # claude, or codex)
95
96
  lemming run
96
97
 
97
98
  # Flags passed after -- are sent directly to the underlying runner
@@ -150,9 +151,10 @@ Reviews may edit the working directory. The built-in readability review
150
151
  intentionally applies fixes, and testing may repair production code or tests.
151
152
  UX is instructed to remain advisory, but its prompt and `--no-yolo` do not
152
153
  enforce filesystem isolation. A global review override may perform any actions
153
- its prompt requests. When isolation is required, follow the working-copy
154
- guidance below and pass a separate VCS-managed working copy with
155
- `lemming -C <working-copy> exec --review ...`.
154
+ its prompt requests. There is no read-only review mode: runners keep write
155
+ access, so a prompt-only flag could not be enforced. When isolation is required,
156
+ follow the working-copy guidance below and pass a separate VCS-managed working
157
+ copy with `lemming -C <working-copy> exec --review ...`.
156
158
 
157
159
  Each run is self-contained: nothing is read from the project's roadmap or its
158
160
  local hooks, it runs only the requested task and reviews, and its state
@@ -466,7 +468,7 @@ These come before the subcommand and apply to all of them.
466
468
  - `-f/--file`: Read the description from a file, or `-` for stdin. Unlike
467
469
  `add`, there is no length cap.
468
470
  - `--review <names>`: Reviews to run after the task, comma-separated or
469
- repeated; `all` selects every one. With no description, only the reviews
471
+ repeated; `'*'` selects every one. With no description, only the reviews
470
472
  run. Reviews may edit the working directory. Hooks that revise the roadmap
471
473
  cannot be selected.
472
474
  - `--scope <path|range>`: What the reviews look at. Paths pass through; a git
@@ -527,7 +529,9 @@ lemming -C ~/src/other-project status
527
529
  `-C` works whether or not the target keeps a `tasks.yml` in its repo, so you
528
530
  never have to know where its isolated state lives. Because it changes the
529
531
  working directory, everything else follows too: the target's `.env`, its
530
- `.lemming/hooks`, and the directory the runner executes in.
532
+ `.lemming/hooks`, and the directory the runner executes in. With a
533
+ `--tasks-file` anywhere other than the target's root, `.env` and the runner's
534
+ directory still follow `-C`, but hooks follow the tasks file.
531
535
 
532
536
  When an agent files a task this way from inside a `lemming run`, the new task
533
537
  records the task it came from via `parent` and `parent_tasks_file`. The
@@ -71,7 +71,8 @@ Start the autonomous loop.
71
71
 
72
72
  ```bash
73
73
  # Run using the project's configured agent (defaults to the first
74
- # supported runner found on PATH: agy, opencode, claude, or codex)
74
+ # supported runner found on PATH or in ~/.local/bin: agy, opencode,
75
+ # claude, or codex)
75
76
  lemming run
76
77
 
77
78
  # Flags passed after -- are sent directly to the underlying runner
@@ -130,9 +131,10 @@ Reviews may edit the working directory. The built-in readability review
130
131
  intentionally applies fixes, and testing may repair production code or tests.
131
132
  UX is instructed to remain advisory, but its prompt and `--no-yolo` do not
132
133
  enforce filesystem isolation. A global review override may perform any actions
133
- its prompt requests. When isolation is required, follow the working-copy
134
- guidance below and pass a separate VCS-managed working copy with
135
- `lemming -C <working-copy> exec --review ...`.
134
+ its prompt requests. There is no read-only review mode: runners keep write
135
+ access, so a prompt-only flag could not be enforced. When isolation is required,
136
+ follow the working-copy guidance below and pass a separate VCS-managed working
137
+ copy with `lemming -C <working-copy> exec --review ...`.
136
138
 
137
139
  Each run is self-contained: nothing is read from the project's roadmap or its
138
140
  local hooks, it runs only the requested task and reviews, and its state
@@ -446,7 +448,7 @@ These come before the subcommand and apply to all of them.
446
448
  - `-f/--file`: Read the description from a file, or `-` for stdin. Unlike
447
449
  `add`, there is no length cap.
448
450
  - `--review <names>`: Reviews to run after the task, comma-separated or
449
- repeated; `all` selects every one. With no description, only the reviews
451
+ repeated; `'*'` selects every one. With no description, only the reviews
450
452
  run. Reviews may edit the working directory. Hooks that revise the roadmap
451
453
  cannot be selected.
452
454
  - `--scope <path|range>`: What the reviews look at. Paths pass through; a git
@@ -507,7 +509,9 @@ lemming -C ~/src/other-project status
507
509
  `-C` works whether or not the target keeps a `tasks.yml` in its repo, so you
508
510
  never have to know where its isolated state lives. Because it changes the
509
511
  working directory, everything else follows too: the target's `.env`, its
510
- `.lemming/hooks`, and the directory the runner executes in.
512
+ `.lemming/hooks`, and the directory the runner executes in. With a
513
+ `--tasks-file` anywhere other than the target's root, `.env` and the runner's
514
+ directory still follow `-C`, but hooks follow the tasks file.
511
515
 
512
516
  When an agent files a task this way from inside a `lemming run`, the new task
513
517
  records the task it came from via `parent` and `parent_tasks_file`. The
@@ -139,9 +139,10 @@ a clean tree stops the run rather than reviewing everything.
139
139
  Reviews may edit the working directory. Readability intentionally applies fixes,
140
140
  and testing may repair production code or tests. UX is instructed to remain
141
141
  advisory, but its prompt and `--no-yolo` do not enforce filesystem isolation. A
142
- global review override may perform any actions its prompt requests. When
143
- isolation is required, use a separate VCS-managed working copy and pass it with
144
- the global `-C` option, as in the example above.
142
+ global review override may perform any actions its prompt requests. There is no
143
+ read-only review mode: runners keep write access, so a prompt-only flag could
144
+ not be enforced. When isolation is required, use a separate VCS-managed working
145
+ copy and pass it with the global `-C` option, as in the example above.
145
146
 
146
147
  ## Drive a roadmap
147
148
 
@@ -160,7 +161,10 @@ lemming run --until <task-id> # or stops once that task settles
160
161
 
161
162
  The loop shares one workspace across all its tasks, so isolate the **whole run**
162
163
  — one branch or worktree created before `lemming run`, driven with
163
- `lemming -C <worktree> run` — never one per task.
164
+ `lemming -C <worktree> run` — never one per task. In a greenfield directory
165
+ without a `.gitignore`, create one (or queue it as the first `--oneshot` task)
166
+ before tasks install dependencies or run builds so workspace snapshots skip
167
+ `node_modules/`, `.venv/`, and build outputs.
164
168
 
165
169
  **Mark mechanical tasks `--oneshot`.** After every other task, a roadmap hook
166
170
  may revise the queue and any enabled reviews run; each hook is a full agent
@@ -184,8 +188,13 @@ milestones instead:
184
188
  which. Add `--max-tasks N` as a budget cap when a runaway roadmap hook
185
189
  would be expensive.
186
190
  2. Between milestones, judge direction: `lemming status --brief`, then
187
- `lemming status <id>` for the tasks that matter. Re-plan with `add`, `edit`,
188
- `supersede`, or `delete`, then run the next milestone.
191
+ `lemming status <id>` for the tasks that matter. Inspect a task's changes
192
+ with `lemming diff [<id>] [--stat] [--hook <name>]`, or undo them with
193
+ `lemming rollback <id>` (rewinds from `<id>` onward),
194
+ `lemming rollback <id> --only` (reverts only `<id>`'s patch), or
195
+ `lemming rollback <id> --hook <name>` (reverts only one hook's edits).
196
+ Re-plan with `add`, `edit`, `supersede`, or `delete`, then run the next
197
+ milestone.
189
198
  3. Delegate each milestone to a subagent when one exists, so the polling and
190
199
  the log reading stay out of your context. The subagent reports back in the
191
200
  fixed shape below, nothing more.
@@ -200,12 +209,18 @@ sparingly and read the smallest thing that answers the question:
200
209
  ```sh
201
210
  lemming status --brief # one row per task, no descriptions
202
211
  lemming status <id> # Run Time against the time limit, progress entries
212
+ lemming diff [<id>] --stat # diffstat for a task (or the full patch without --stat)
203
213
  lemming logs <id> | tail -n 30 # never the whole log
204
214
  ```
205
215
 
206
216
  A task is stuck when its run time approaches the limit with no new progress
207
217
  entries and the log tail shows the same step repeating. Otherwise leave it.
208
218
 
219
+ If your harness backgrounds long commands and sleeps until they exit, a
220
+ backgrounded `run --until` hides a stuck task until it exhausts its retries.
221
+ Pair it with a wake-up near each task's time limit that runs the checks above;
222
+ if the task is stuck, `lemming cancel <id>` and `add` smaller tasks in its place.
223
+
209
224
  Adjust the queue while it runs — new tasks are picked up automatically:
210
225
 
211
226
  ```sh
@@ -241,8 +256,13 @@ work done adds tasks with `lemming add`; the running loop picks them up.
241
256
  - **`exec` makes one attempt by default.** `--retries N` opts into at most `N`
242
257
  total task attempts with progress carried forward. Explicit failure,
243
258
  cancellation, interruption, and failed reviews stop immediately.
244
- - **Interrupting leaves partial edits.** Nothing is restored, so there is no
245
- atomicity to rely on.
259
+ - **Failed attempts roll back automatically.** Each task snapshots the working
260
+ tree in a shadow Git repository before it starts; if an attempt fails, times
261
+ out, crashes, or is cancelled, its diff is saved under `<id>-artifacts/` and
262
+ the workspace (and host Git `HEAD`) is restored to the task's `pre_tree`.
263
+ Completed tasks (or individual hook edits) can be inspected with
264
+ `lemming diff [<id>] [--stat] [--hook <name>]` or rolled back when the loop
265
+ is idle via `lemming rollback <id> [--only] [--hook <name>]`.
246
266
  - **Concurrent runs in one checkout interleave their edits.** Give each writing
247
267
  run its own VCS-managed working copy and address it with `-C`; retain the copy
248
268
  until its result is recovered.
@@ -19,6 +19,9 @@ more **orchestrator hooks**. Each hook:
19
19
  execution log, and any commands it runs (e.g. `lemming add`, `lemming edit`)
20
20
  are executed against the roadmap.
21
21
 
22
+ Each hook run is killed after 15 minutes, or after the task's time limit if
23
+ that is shorter. A time limit of 0 disables both.
24
+
22
25
  ## Naming Convention
23
26
 
24
27
  Hooks are Markdown files discovered from the filesystem, and udev-style filename
@@ -12,7 +12,7 @@
12
12
  "@biomejs/biome": "^2.5.9",
13
13
  "@playwright/test": "^1.62.1",
14
14
  "jsdom": "^30.0.1",
15
- "mancha": "^0.25.1",
15
+ "mancha": "^0.28.0",
16
16
  "playwright": "^1.62.1",
17
17
  "prettier": "^3.9.6"
18
18
  }
@@ -1042,9 +1042,9 @@
1042
1042
  }
1043
1043
  },
1044
1044
  "node_modules/mancha": {
1045
- "version": "0.25.1",
1046
- "resolved": "https://registry.npmjs.org/mancha/-/mancha-0.25.1.tgz",
1047
- "integrity": "sha512-S53J9sCoyKM9vMH9da4j6VHyQKyUP2K/8E/n0xZF+38svzhj3u+Slfuop24JoMMZzINpS3L+cHgbUk3EFsNTkQ==",
1045
+ "version": "0.28.0",
1046
+ "resolved": "https://registry.npmjs.org/mancha/-/mancha-0.28.0.tgz",
1047
+ "integrity": "sha512-Yt3M0jSXCpi5ZARRWFicE56I8pCak29LuZCmKDKcAQk47wgsWaEpiHDIhD6dghaxzhVWWxI6O88m+8sWTlDOQQ==",
1048
1048
  "dev": true,
1049
1049
  "license": "MIT",
1050
1050
  "dependencies": {
@@ -16,7 +16,7 @@
16
16
  "@biomejs/biome": "^2.5.9",
17
17
  "@playwright/test": "^1.62.1",
18
18
  "jsdom": "^30.0.1",
19
- "mancha": "^0.25.1",
19
+ "mancha": "^0.28.0",
20
20
  "playwright": "^1.62.1",
21
21
  "prettier": "^3.9.6"
22
22
  }
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "lemming-cli"
7
- version = "0.8.1"
7
+ version = "0.9.0"
8
8
  description = "An autonomous, iterative task runner for AI coding agents."
9
9
  readme = "README.md"
10
10
  authors = [
@@ -3,7 +3,7 @@
3
3
  import fastapi
4
4
  import pydantic
5
5
 
6
- from .. import hooks, models, paths, persistence
6
+ from .. import hooks, models, paths, persistence, snapshots
7
7
  from ..tasks import lifecycle, operations, queries
8
8
  from . import context, loop
9
9
 
@@ -203,7 +203,9 @@ def cancel_task_endpoint(
203
203
  ):
204
204
  """Cancel a running or pending task."""
205
205
  if lifecycle.cancel_task(
206
- context.resolve_tasks_file(request.app.state, project), task_id
206
+ context.resolve_tasks_file(request.app.state, project),
207
+ task_id,
208
+ working_dir=context.resolve_project_dir(request.app.state, project),
207
209
  ):
208
210
  return {"status": "ok"}
209
211
  raise fastapi.HTTPException(404, "Task not found")
@@ -236,3 +238,88 @@ def get_task_log(
236
238
  except (ValueError, models.AmbiguousTaskIdError) as e:
237
239
  raise fastapi.HTTPException(400, str(e))
238
240
  return {"log": log_file.read_text(encoding="utf-8")}
241
+
242
+
243
+ @router.get("/api/tasks/{task_id}/diff")
244
+ def get_task_diff(
245
+ request: fastapi.Request,
246
+ task_id: str,
247
+ hook: str | None = None,
248
+ project: str | None = None,
249
+ ):
250
+ """Get the git diff and summary captured for a task."""
251
+ tasks_file = context.resolve_tasks_file(request.app.state, project)
252
+ working_dir = context.resolve_project_dir(request.app.state, project)
253
+ with persistence.read_lock_tasks(tasks_file):
254
+ data = persistence.load_tasks(tasks_file)
255
+ try:
256
+ target = queries.resolve_task(data.tasks, task_id)
257
+ except models.TaskNotFoundError as e:
258
+ raise fastapi.HTTPException(404, str(e))
259
+ except models.AmbiguousTaskIdError as e:
260
+ raise fastapi.HTTPException(400, str(e))
261
+
262
+ if hook:
263
+ pair = (target.hook_trees or {}).get(hook)
264
+ if not pair or len(pair) != 2 or not pair[0] or not pair[1]:
265
+ raise fastapi.HTTPException(
266
+ 404, f"Task {target.id} has no snapshot for hook '{hook}'"
267
+ )
268
+ h_pre, h_post = pair
269
+ return {
270
+ "diff": snapshots.diff_trees(tasks_file, h_pre, h_post),
271
+ "summary": snapshots.summarize_diff(tasks_file, h_pre, h_post),
272
+ }
273
+
274
+ if not target.pre_tree:
275
+ return {"diff": "", "summary": target.diff_summary}
276
+
277
+ end_tree = target.post_tree or target.runner_tree
278
+ if not end_tree and target.status == models.TaskStatus.IN_PROGRESS:
279
+ end_tree = snapshots.snapshot_tree(tasks_file, working_dir)
280
+ diff_text = (
281
+ snapshots.diff_trees(tasks_file, target.pre_tree, end_tree)
282
+ if end_tree
283
+ else ""
284
+ )
285
+ summary = target.diff_summary or (
286
+ snapshots.summarize_diff(tasks_file, target.pre_tree, end_tree)
287
+ if end_tree
288
+ else None
289
+ )
290
+ return {"diff": diff_text, "summary": summary}
291
+
292
+
293
+ class RollbackTaskRequest(pydantic.BaseModel):
294
+ """Request body for rolling back a task."""
295
+
296
+ only: bool = False
297
+ hook: str | None = None
298
+
299
+
300
+ @router.post("/api/tasks/{task_id}/rollback")
301
+ def rollback_task_endpoint(
302
+ request: fastapi.Request,
303
+ task_id: str,
304
+ body: RollbackTaskRequest = fastapi.Body(
305
+ default_factory=RollbackTaskRequest
306
+ ),
307
+ hook: str | None = None,
308
+ project: str | None = None,
309
+ ):
310
+ """Roll back workspace changes for a task and reset state to pending."""
311
+ tasks_file = context.resolve_tasks_file(request.app.state, project)
312
+ working_dir = context.resolve_project_dir(request.app.state, project)
313
+ try:
314
+ reset_tasks = operations.rollback_task(
315
+ tasks_file,
316
+ task_id,
317
+ only=body.only,
318
+ hook=hook if hook is not None else body.hook,
319
+ working_dir=working_dir,
320
+ )
321
+ except models.TaskNotFoundError as e:
322
+ raise fastapi.HTTPException(404, str(e))
323
+ except ValueError as e:
324
+ raise fastapi.HTTPException(400, str(e))
325
+ return {"status": "ok", "tasks": reset_tasks}
@@ -1,6 +1,6 @@
1
1
  from unittest.mock import patch
2
2
 
3
- from lemming import models, paths, persistence
3
+ from lemming import models, paths, persistence, snapshots
4
4
  from lemming.api import main
5
5
  from lemming.tasks import limits, operations, progress
6
6
 
@@ -525,10 +525,17 @@ def test_add_task_starts_loop_with_cwd(test_workspace, client):
525
525
 
526
526
 
527
527
  def test_cancel_task_endpoint(client, test_tasks):
528
- with patch("lemming.tasks.lifecycle.cancel_task", return_value=True):
528
+ with patch(
529
+ "lemming.tasks.lifecycle.cancel_task", return_value=True
530
+ ) as mock_cancel:
529
531
  response = client.post("/api/tasks/task3/cancel")
530
532
  assert response.status_code == 200
531
533
  assert response.json() == {"status": "ok"}
534
+ mock_cancel.assert_called_once_with(
535
+ test_tasks,
536
+ "task3",
537
+ working_dir=main.app.state.root,
538
+ )
532
539
 
533
540
  with patch("lemming.tasks.lifecycle.cancel_task", return_value=False):
534
541
  response = client.post("/api/tasks/nonexistent/cancel")
@@ -576,3 +583,114 @@ def test_add_task_rejects_outside_parent_tasks_file(client, test_tasks):
576
583
  def test_get_task_log_rejects_traversal(client, test_tasks):
577
584
  response = client.get("/api/tasks/..%2Fsecret/log")
578
585
  assert response.status_code in (400, 404)
586
+
587
+
588
+ def test_get_task_diff_and_rollback_endpoints(client, test_tasks, monkeypatch):
589
+ root = main.app.state.root
590
+ monkeypatch.setenv("LEMMING_HOME", str(root / "lemming_home"))
591
+ sample = root / "sample.py"
592
+ sample.write_text("before\n", encoding="utf-8")
593
+ pre_tree = snapshots.snapshot_tree(test_tasks, root)
594
+ assert pre_tree is not None
595
+
596
+ sample.write_text("after\n", encoding="utf-8")
597
+ runner_tree = snapshots.snapshot_tree(test_tasks, root)
598
+ assert runner_tree is not None
599
+
600
+ sample.write_text("after\n# formatted\n", encoding="utf-8")
601
+ post_tree = snapshots.snapshot_tree(test_tasks, root)
602
+ assert post_tree is not None
603
+ summary = snapshots.summarize_diff(test_tasks, pre_tree, post_tree)
604
+
605
+ with persistence.lock_tasks(test_tasks):
606
+ data = persistence.load_tasks(test_tasks)
607
+ task1 = next(t for t in data.tasks if t.id == "task1")
608
+ task1.pre_tree = pre_tree
609
+ task1.runner_tree = runner_tree
610
+ task1.post_tree = post_tree
611
+ task1.diff_summary = summary
612
+ task1.hook_trees = {"readability": [runner_tree, post_tree]}
613
+ persistence.save_tasks(test_tasks, data)
614
+
615
+ diff_resp = client.get("/api/tasks/task1/diff")
616
+ assert diff_resp.status_code == 200
617
+ payload = diff_resp.json()
618
+ assert "-before" in payload["diff"]
619
+ assert "+after" in payload["diff"]
620
+ assert payload["summary"] == summary
621
+
622
+ hook_diff_resp = client.get(
623
+ "/api/tasks/task1/diff", params={"hook": "readability"}
624
+ )
625
+ assert hook_diff_resp.status_code == 200
626
+ assert "+# formatted" in hook_diff_resp.json()["diff"]
627
+ assert (
628
+ client.get(
629
+ "/api/tasks/task1/diff", params={"hook": "missing"}
630
+ ).status_code
631
+ == 404
632
+ )
633
+
634
+ assert client.get("/api/tasks/nonexistent/diff").status_code == 404
635
+
636
+ with patch("lemming.tasks.lifecycle.is_loop_running", return_value=True):
637
+ busy = client.post("/api/tasks/task1/rollback", json={"only": True})
638
+ assert busy.status_code == 400
639
+
640
+ with patch("lemming.tasks.lifecycle.is_loop_running", return_value=False):
641
+ active_task_busy = client.post(
642
+ "/api/tasks/task1/rollback", json={"only": True}
643
+ )
644
+ assert active_task_busy.status_code == 400
645
+
646
+ with persistence.lock_tasks(test_tasks):
647
+ data = persistence.load_tasks(test_tasks)
648
+ task3 = next(t for t in data.tasks if t.id == "task3")
649
+ task3.status = models.TaskStatus.PENDING
650
+ task3.pid = None
651
+ task3.last_heartbeat = None
652
+ persistence.save_tasks(test_tasks, data)
653
+
654
+ combo = client.post(
655
+ "/api/tasks/task1/rollback",
656
+ json={"only": True, "hook": "readability"},
657
+ )
658
+ assert combo.status_code == 400
659
+
660
+ hook_rb = client.post(
661
+ "/api/tasks/task1/rollback", json={"hook": "readability"}
662
+ )
663
+ assert hook_rb.status_code == 200
664
+ assert sample.read_text(encoding="utf-8") == "after\n"
665
+ task1_mid = next(
666
+ t
667
+ for t in persistence.load_tasks(test_tasks).tasks
668
+ if t.id == "task1"
669
+ )
670
+ assert task1_mid.status == models.TaskStatus.COMPLETED
671
+ assert task1_mid.hook_trees is None
672
+
673
+ rb_resp = client.post("/api/tasks/task1/rollback", json={"only": True})
674
+ assert rb_resp.status_code == 200
675
+ assert sample.read_text(encoding="utf-8") == "before\n"
676
+ task1_after = next(
677
+ t
678
+ for t in persistence.load_tasks(test_tasks).tasks
679
+ if t.id == "task1"
680
+ )
681
+ assert task1_after.status == models.TaskStatus.PENDING
682
+ assert task1_after.pre_tree is None
683
+
684
+ sample.write_text("unrelated dirty edit\n", encoding="utf-8")
685
+ with persistence.lock_tasks(test_tasks):
686
+ data = persistence.load_tasks(test_tasks)
687
+ task1 = next(t for t in data.tasks if t.id == "task1")
688
+ task1.status = models.TaskStatus.CANCELLED
689
+ task1.pre_tree = pre_tree
690
+ task1.runner_tree = None
691
+ task1.post_tree = None
692
+ persistence.save_tasks(test_tasks, data)
693
+
694
+ cancelled_diff = client.get("/api/tasks/task1/diff")
695
+ assert cancelled_diff.status_code == 200
696
+ assert cancelled_diff.json() == {"diff": "", "summary": None}
@@ -283,7 +283,7 @@ def exec_command(
283
283
  working_dir = pathlib.Path.cwd().resolve()
284
284
 
285
285
  scope_text = None
286
- if reviews:
286
+ if reviews and (prompt is None or scope_values):
287
287
  try:
288
288
  entries = scope.resolve_scope(scope_values, working_dir)
289
289
  except scope.ScopeError as e:
@@ -3,6 +3,7 @@
3
3
  import json
4
4
  import os
5
5
  import subprocess
6
+ import sys
6
7
  import time
7
8
  from unittest import mock
8
9
 
@@ -312,9 +313,9 @@ def test_exec_retries_transient_runner_failures(workspace, first_result):
312
313
 
313
314
  def test_exec_retries_a_real_runner_process(workspace):
314
315
  """The CLI preserves task state across actual subprocess launches."""
315
- fake_runner = workspace / "flaky_runner.py"
316
+ fake_runner = workspace.parent / "flaky_runner.py"
316
317
  fake_runner.write_text(
317
- "#!/usr/bin/env python3\n"
318
+ f"#!{sys.executable}\n"
318
319
  "import json\n"
319
320
  "import os\n"
320
321
  "import pathlib\n"
@@ -461,6 +462,7 @@ def repo(workspace):
461
462
  _git(workspace, "init", "-q", "-b", "main")
462
463
  _git(workspace, "config", "user.email", "test@example.com")
463
464
  _git(workspace, "config", "user.name", "Test")
465
+ _git(workspace, "config", "commit.gpgsign", "false")
464
466
  (workspace / "committed.py").write_text("x = 1\n")
465
467
  _git(workspace, "add", "committed.py")
466
468
  _git(workspace, "commit", "-qm", "initial")
@@ -570,10 +572,17 @@ def test_review_rejects_an_unresolvable_scope(repo):
570
572
 
571
573
  def test_a_task_can_be_followed_by_reviews(repo):
572
574
  """Doing the work and gating it is one invocation, in order."""
575
+ (repo / "committed.py").write_text("preexisting_dirty = True\n")
573
576
  headers = []
577
+ review_prompts = []
574
578
 
575
579
  def record(cmd, tasks_file, task_id, *args, **kwargs):
576
- headers.append(kwargs.get("header"))
580
+ header = kwargs.get("header")
581
+ headers.append(header)
582
+ if header == "Task Runner":
583
+ (repo / "pagination.py").write_text("page = 1\n")
584
+ else:
585
+ review_prompts.append(cmd[-1])
577
586
  return _finish("Done.")(cmd, tasks_file, task_id, *args, **kwargs)
578
587
 
579
588
  with mock.patch("lemming.runner.run_with_heartbeat", record):
@@ -582,6 +591,9 @@ def test_a_task_can_be_followed_by_reviews(repo):
582
591
  )
583
592
 
584
593
  assert headers == ["Task Runner", "Hook: readability"]
594
+ assert len(review_prompts) == 1
595
+ assert "- pagination.py" in review_prompts[0]
596
+ assert "- committed.py" not in review_prompts[0]
585
597
 
586
598
 
587
599
  def test_a_failing_review_does_not_become_a_task_run(repo):
@@ -102,7 +102,10 @@ def cli(
102
102
  tasks_file = tasks_file.resolve()
103
103
 
104
104
  # Load .env files (global, then project-level); real env vars always win.
105
- paths.load_dotenv(project_dir=paths.get_working_dir(tasks_file))
105
+ paths.load_dotenv(
106
+ project_dir=project_dir or paths.get_working_dir(tasks_file)
107
+ )
106
108
 
109
+ ctx.obj["PROJECT_DIR"] = project_dir
107
110
  ctx.obj["TASKS_FILE"] = tasks_file
108
111
  ctx.obj["VERBOSE"] = verbose
@@ -124,6 +124,25 @@ class TestProjectDirOption(unittest.TestCase):
124
124
  self.assertEqual(result.exit_code, 0, result.output)
125
125
  self.assertEqual(seen, [self.other])
126
126
 
127
+ def test_loads_project_dir_env_with_external_tasks_file(self):
128
+ # A tasks file in a scratch dir must not move .env discovery off -C.
129
+ scratch = self.here / "scratch"
130
+ scratch.mkdir()
131
+ tasks_file = scratch / "tasks.yml"
132
+ persistence.save_tasks(tasks_file, models.Roadmap())
133
+ env_file = self.other / ".env"
134
+ env_file.write_text("LEMMING_TEST_PROJECT_ENV=repo\n")
135
+ env_file.chmod(0o600)
136
+ self.addCleanup(os.environ.pop, "LEMMING_TEST_PROJECT_ENV", None)
137
+
138
+ result = self.cli_runner.invoke(
139
+ main.cli,
140
+ ["-C", str(self.other), "--tasks-file", str(tasks_file), "status"],
141
+ )
142
+
143
+ self.assertEqual(result.exit_code, 0, result.output)
144
+ self.assertEqual(os.environ.get("LEMMING_TEST_PROJECT_ENV"), "repo")
145
+
127
146
  def test_restores_the_original_working_directory(self):
128
147
  self.cli_runner.invoke(main.cli, ["-C", str(self.other), "status"])
129
148
 
@@ -105,9 +105,6 @@ def run(
105
105
  click.echo(f"Error: {e}")
106
106
  ctx.exit(1)
107
107
 
108
- # Determine the project's working directory
109
- working_dir = paths.get_working_dir(tasks_file)
110
-
111
108
  # Parse environment overrides
112
109
  env_overrides = {}
113
110
  for e in env:
@@ -120,6 +117,9 @@ def run(
120
117
  if env_overrides:
121
118
  os.environ.update(env_overrides)
122
119
 
120
+ # After the overrides, which may move LEMMING_HOME; an explicit -C wins.
121
+ working_dir = ctx.obj["PROJECT_DIR"] or paths.get_working_dir(tasks_file)
122
+
123
123
  # Handle stop requests before claiming work, so a SIGTERM arriving mid-task
124
124
  # takes the runner down instead of orphaning it.
125
125
  shutdown.clear_drain()
@@ -1,4 +1,5 @@
1
1
  import logging.config
2
+ import os
2
3
  import pathlib
3
4
  import shutil
4
5
  import tempfile
@@ -98,6 +99,40 @@ class TestCLIOperations(unittest.TestCase):
98
99
  self.assertEqual(result.exit_code, 0)
99
100
  self.assertEqual(run_loop.call_args.kwargs["max_tasks"], 2)
100
101
 
102
+ def test_run_uses_project_dir_over_external_tasks_file(self):
103
+ with tempfile.TemporaryDirectory() as repo:
104
+ repo_dir = pathlib.Path(repo).resolve()
105
+ with mock.patch.object(
106
+ operations, "run_loop", return_value=True
107
+ ) as run_loop:
108
+ result = self.cli_runner.invoke(
109
+ cli.cli, ["-C", repo] + self.base_args + ["run"]
110
+ )
111
+
112
+ self.assertEqual(result.exit_code, 0, result.output)
113
+ self.assertEqual(run_loop.call_args.kwargs["working_dir"], repo_dir)
114
+
115
+ def test_run_applies_env_before_resolving_working_dir(self):
116
+ # With LEMMING_HOME pointing at the tasks file's dir, the file is
117
+ # isolated state and the runner must stay in the current directory.
118
+ with (
119
+ mock.patch.dict(os.environ),
120
+ mock.patch.object(
121
+ operations, "run_loop", return_value=True
122
+ ) as run_loop,
123
+ ):
124
+ result = self.cli_runner.invoke(
125
+ cli.cli,
126
+ self.base_args
127
+ + ["run", "--env", f"LEMMING_HOME={self.test_dir}"],
128
+ )
129
+
130
+ self.assertEqual(result.exit_code, 0, result.output)
131
+ self.assertEqual(
132
+ run_loop.call_args.kwargs["working_dir"],
133
+ pathlib.Path.cwd().resolve(),
134
+ )
135
+
101
136
  def test_run_resolves_until_prefix(self):
102
137
  persistence.save_tasks(
103
138
  self.test_tasks_file,