lastlight 0.15.0 → 0.16.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.
Files changed (382) hide show
  1. package/README.md +71 -692
  2. package/dist/cli-config.js.map +1 -0
  3. package/dist/cli-format.js.map +1 -0
  4. package/dist/{cli/cli-server.d.ts → cli-server.d.ts} +26 -1
  5. package/dist/{cli/cli-server.js → cli-server.js} +40 -5
  6. package/dist/cli-server.js.map +1 -0
  7. package/dist/cli-timeline.js.map +1 -0
  8. package/dist/{cli/cli.js → cli.js} +4 -3
  9. package/dist/cli.js.map +1 -0
  10. package/dist/{cli/fork-cli.d.ts → fork-cli.d.ts} +3 -3
  11. package/dist/{cli/fork-cli.js → fork-cli.js} +28 -27
  12. package/dist/fork-cli.js.map +1 -0
  13. package/dist/{cli/oauth-cli.js → oauth-cli.js} +1 -1
  14. package/dist/oauth-cli.js.map +1 -0
  15. package/dist/{cli/setup.js → setup.js} +10 -4
  16. package/dist/setup.js.map +1 -0
  17. package/dist/{cli/skills-install.d.ts → skills-install.d.ts} +6 -0
  18. package/dist/{cli/skills-install.js → skills-install.js} +6 -2
  19. package/dist/skills-install.js.map +1 -0
  20. package/package.json +20 -65
  21. package/plugins/lastlight/.claude-plugin/plugin.json +1 -1
  22. package/agent-context/rules.md +0 -80
  23. package/agent-context/security.md +0 -69
  24. package/agent-context/soul.md +0 -21
  25. package/config/default.yaml +0 -119
  26. package/deploy/.env.production.example +0 -100
  27. package/deploy/entrypoint.sh +0 -82
  28. package/deploy/native/README.md +0 -160
  29. package/deploy/native/install.sh +0 -110
  30. package/deploy/native/lastlight.env.example +0 -95
  31. package/deploy/native/lastlight.service +0 -50
  32. package/deploy/sandbox-entrypoint.sh +0 -93
  33. package/dist/admin/auth.d.ts +0 -51
  34. package/dist/admin/auth.js +0 -121
  35. package/dist/admin/auth.js.map +0 -1
  36. package/dist/admin/chat-session-reader.d.ts +0 -39
  37. package/dist/admin/chat-session-reader.js +0 -84
  38. package/dist/admin/chat-session-reader.js.map +0 -1
  39. package/dist/admin/docker.d.ts +0 -61
  40. package/dist/admin/docker.js +0 -187
  41. package/dist/admin/docker.js.map +0 -1
  42. package/dist/admin/index.d.ts +0 -9
  43. package/dist/admin/index.js +0 -59
  44. package/dist/admin/index.js.map +0 -1
  45. package/dist/admin/routes.d.ts +0 -81
  46. package/dist/admin/routes.js +0 -1381
  47. package/dist/admin/routes.js.map +0 -1
  48. package/dist/admin/sessions.d.ts +0 -89
  49. package/dist/admin/sessions.js +0 -204
  50. package/dist/admin/sessions.js.map +0 -1
  51. package/dist/admin/tail.d.ts +0 -12
  52. package/dist/admin/tail.js +0 -145
  53. package/dist/admin/tail.js.map +0 -1
  54. package/dist/admin/version.d.ts +0 -22
  55. package/dist/admin/version.js +0 -92
  56. package/dist/admin/version.js.map +0 -1
  57. package/dist/cli/cli-config.js.map +0 -1
  58. package/dist/cli/cli-format.js.map +0 -1
  59. package/dist/cli/cli-server.js.map +0 -1
  60. package/dist/cli/cli-timeline.js.map +0 -1
  61. package/dist/cli/cli.js.map +0 -1
  62. package/dist/cli/fork-cli.js.map +0 -1
  63. package/dist/cli/oauth-cli.js.map +0 -1
  64. package/dist/cli/setup.js.map +0 -1
  65. package/dist/cli/skills-install.js.map +0 -1
  66. package/dist/config/config-resolve.d.ts +0 -28
  67. package/dist/config/config-resolve.js +0 -47
  68. package/dist/config/config-resolve.js.map +0 -1
  69. package/dist/config/config.d.ts +0 -157
  70. package/dist/config/config.js +0 -581
  71. package/dist/config/config.js.map +0 -1
  72. package/dist/config/core-pin.d.ts +0 -16
  73. package/dist/config/core-pin.js +0 -85
  74. package/dist/config/core-pin.js.map +0 -1
  75. package/dist/config/overlay-assets.d.ts +0 -20
  76. package/dist/config/overlay-assets.js +0 -114
  77. package/dist/config/overlay-assets.js.map +0 -1
  78. package/dist/config/overlay-bootstrap.d.ts +0 -44
  79. package/dist/config/overlay-bootstrap.js +0 -304
  80. package/dist/config/overlay-bootstrap.js.map +0 -1
  81. package/dist/connectors/github-webhook.d.ts +0 -45
  82. package/dist/connectors/github-webhook.js +0 -321
  83. package/dist/connectors/github-webhook.js.map +0 -1
  84. package/dist/connectors/index.d.ts +0 -18
  85. package/dist/connectors/index.js +0 -41
  86. package/dist/connectors/index.js.map +0 -1
  87. package/dist/connectors/messaging/base.d.ts +0 -42
  88. package/dist/connectors/messaging/base.js +0 -139
  89. package/dist/connectors/messaging/base.js.map +0 -1
  90. package/dist/connectors/messaging/delivery.d.ts +0 -14
  91. package/dist/connectors/messaging/delivery.js +0 -38
  92. package/dist/connectors/messaging/delivery.js.map +0 -1
  93. package/dist/connectors/messaging/index.d.ts +0 -4
  94. package/dist/connectors/messaging/index.js +0 -4
  95. package/dist/connectors/messaging/index.js.map +0 -1
  96. package/dist/connectors/messaging/session-manager.d.ts +0 -53
  97. package/dist/connectors/messaging/session-manager.js +0 -255
  98. package/dist/connectors/messaging/session-manager.js.map +0 -1
  99. package/dist/connectors/messaging/types.d.ts +0 -58
  100. package/dist/connectors/messaging/types.js +0 -7
  101. package/dist/connectors/messaging/types.js.map +0 -1
  102. package/dist/connectors/slack/connector.d.ts +0 -100
  103. package/dist/connectors/slack/connector.js +0 -341
  104. package/dist/connectors/slack/connector.js.map +0 -1
  105. package/dist/connectors/slack/index.d.ts +0 -2
  106. package/dist/connectors/slack/index.js +0 -3
  107. package/dist/connectors/slack/index.js.map +0 -1
  108. package/dist/connectors/slack/mrkdwn.d.ts +0 -8
  109. package/dist/connectors/slack/mrkdwn.js +0 -123
  110. package/dist/connectors/slack/mrkdwn.js.map +0 -1
  111. package/dist/connectors/types.d.ts +0 -61
  112. package/dist/connectors/types.js +0 -2
  113. package/dist/connectors/types.js.map +0 -1
  114. package/dist/cron/fanout.d.ts +0 -33
  115. package/dist/cron/fanout.js +0 -55
  116. package/dist/cron/fanout.js.map +0 -1
  117. package/dist/cron/jobs.d.ts +0 -18
  118. package/dist/cron/jobs.js +0 -37
  119. package/dist/cron/jobs.js.map +0 -1
  120. package/dist/cron/scheduler.d.ts +0 -45
  121. package/dist/cron/scheduler.js +0 -105
  122. package/dist/cron/scheduler.js.map +0 -1
  123. package/dist/engine/agent-executor.d.ts +0 -34
  124. package/dist/engine/agent-executor.js +0 -246
  125. package/dist/engine/agent-executor.js.map +0 -1
  126. package/dist/engine/chat/chat-runner.d.ts +0 -132
  127. package/dist/engine/chat/chat-runner.js +0 -424
  128. package/dist/engine/chat/chat-runner.js.map +0 -1
  129. package/dist/engine/chat/chat-skills.d.ts +0 -45
  130. package/dist/engine/chat/chat-skills.js +0 -184
  131. package/dist/engine/chat/chat-skills.js.map +0 -1
  132. package/dist/engine/chat/chat.d.ts +0 -54
  133. package/dist/engine/chat/chat.js +0 -316
  134. package/dist/engine/chat/chat.js.map +0 -1
  135. package/dist/engine/chat/message-batcher.d.ts +0 -32
  136. package/dist/engine/chat/message-batcher.js +0 -109
  137. package/dist/engine/chat/message-batcher.js.map +0 -1
  138. package/dist/engine/dispatcher.d.ts +0 -73
  139. package/dist/engine/dispatcher.js +0 -663
  140. package/dist/engine/dispatcher.js.map +0 -1
  141. package/dist/engine/event-shim.d.ts +0 -117
  142. package/dist/engine/event-shim.js +0 -435
  143. package/dist/engine/event-shim.js.map +0 -1
  144. package/dist/engine/executors/orchestrator.d.ts +0 -81
  145. package/dist/engine/executors/orchestrator.js +0 -365
  146. package/dist/engine/executors/orchestrator.js.map +0 -1
  147. package/dist/engine/executors/shared.d.ts +0 -189
  148. package/dist/engine/executors/shared.js +0 -616
  149. package/dist/engine/executors/shared.js.map +0 -1
  150. package/dist/engine/github/git-auth.d.ts +0 -62
  151. package/dist/engine/github/git-auth.js +0 -161
  152. package/dist/engine/github/git-auth.js.map +0 -1
  153. package/dist/engine/github/github-app-client.d.ts +0 -23
  154. package/dist/engine/github/github-app-client.js +0 -33
  155. package/dist/engine/github/github-app-client.js.map +0 -1
  156. package/dist/engine/github/github-tools.d.ts +0 -18
  157. package/dist/engine/github/github-tools.js +0 -263
  158. package/dist/engine/github/github-tools.js.map +0 -1
  159. package/dist/engine/github/github.d.ts +0 -1193
  160. package/dist/engine/github/github.js +0 -357
  161. package/dist/engine/github/github.js.map +0 -1
  162. package/dist/engine/github/profiles.d.ts +0 -279
  163. package/dist/engine/github/profiles.js +0 -42
  164. package/dist/engine/github/profiles.js.map +0 -1
  165. package/dist/engine/github/review-poster.d.ts +0 -98
  166. package/dist/engine/github/review-poster.js +0 -177
  167. package/dist/engine/github/review-poster.js.map +0 -1
  168. package/dist/engine/llm.d.ts +0 -79
  169. package/dist/engine/llm.js +0 -269
  170. package/dist/engine/llm.js.map +0 -1
  171. package/dist/engine/oauth.d.ts +0 -43
  172. package/dist/engine/oauth.js +0 -103
  173. package/dist/engine/oauth.js.map +0 -1
  174. package/dist/engine/router.d.ts +0 -29
  175. package/dist/engine/router.js +0 -680
  176. package/dist/engine/router.js.map +0 -1
  177. package/dist/engine/screen/classifier.d.ts +0 -93
  178. package/dist/engine/screen/classifier.js +0 -215
  179. package/dist/engine/screen/classifier.js.map +0 -1
  180. package/dist/engine/screen/screen.d.ts +0 -41
  181. package/dist/engine/screen/screen.js +0 -93
  182. package/dist/engine/screen/screen.js.map +0 -1
  183. package/dist/evals-api.d.ts +0 -24
  184. package/dist/evals-api.js +0 -22
  185. package/dist/evals-api.js.map +0 -1
  186. package/dist/index.d.ts +0 -1
  187. package/dist/index.js +0 -923
  188. package/dist/index.js.map +0 -1
  189. package/dist/managed-repos.d.ts +0 -30
  190. package/dist/managed-repos.js +0 -72
  191. package/dist/managed-repos.js.map +0 -1
  192. package/dist/notify/index.d.ts +0 -15
  193. package/dist/notify/index.js +0 -6
  194. package/dist/notify/index.js.map +0 -1
  195. package/dist/notify/model.d.ts +0 -57
  196. package/dist/notify/model.js +0 -89
  197. package/dist/notify/model.js.map +0 -1
  198. package/dist/notify/notifier.d.ts +0 -17
  199. package/dist/notify/notifier.js +0 -87
  200. package/dist/notify/notifier.js.map +0 -1
  201. package/dist/notify/render.d.ts +0 -21
  202. package/dist/notify/render.js +0 -59
  203. package/dist/notify/render.js.map +0 -1
  204. package/dist/notify/transports/github.d.ts +0 -26
  205. package/dist/notify/transports/github.js +0 -26
  206. package/dist/notify/transports/github.js.map +0 -1
  207. package/dist/notify/transports/slack.d.ts +0 -26
  208. package/dist/notify/transports/slack.js +0 -28
  209. package/dist/notify/transports/slack.js.map +0 -1
  210. package/dist/notify/types.d.ts +0 -95
  211. package/dist/notify/types.js +0 -16
  212. package/dist/notify/types.js.map +0 -1
  213. package/dist/providers.d.ts +0 -125
  214. package/dist/providers.js +0 -279
  215. package/dist/providers.js.map +0 -1
  216. package/dist/sandbox/docker.d.ts +0 -180
  217. package/dist/sandbox/docker.js +0 -517
  218. package/dist/sandbox/docker.js.map +0 -1
  219. package/dist/sandbox/egress-allowlist.d.ts +0 -74
  220. package/dist/sandbox/egress-allowlist.js +0 -164
  221. package/dist/sandbox/egress-allowlist.js.map +0 -1
  222. package/dist/sandbox/egress-firewall-config.d.ts +0 -127
  223. package/dist/sandbox/egress-firewall-config.js +0 -434
  224. package/dist/sandbox/egress-firewall-config.js.map +0 -1
  225. package/dist/sandbox/images.d.ts +0 -23
  226. package/dist/sandbox/images.js +0 -55
  227. package/dist/sandbox/images.js.map +0 -1
  228. package/dist/sandbox/index.d.ts +0 -112
  229. package/dist/sandbox/index.js +0 -332
  230. package/dist/sandbox/index.js.map +0 -1
  231. package/dist/sandbox/sandbox.d.ts +0 -214
  232. package/dist/sandbox/sandbox.js +0 -453
  233. package/dist/sandbox/sandbox.js.map +0 -1
  234. package/dist/sandbox/smol.d.ts +0 -162
  235. package/dist/sandbox/smol.js +0 -485
  236. package/dist/sandbox/smol.js.map +0 -1
  237. package/dist/session-log.d.ts +0 -63
  238. package/dist/session-log.js +0 -290
  239. package/dist/session-log.js.map +0 -1
  240. package/dist/state/approval-store.d.ts +0 -88
  241. package/dist/state/approval-store.js +0 -149
  242. package/dist/state/approval-store.js.map +0 -1
  243. package/dist/state/build-assets.d.ts +0 -50
  244. package/dist/state/build-assets.js +0 -154
  245. package/dist/state/build-assets.js.map +0 -1
  246. package/dist/state/db.d.ts +0 -81
  247. package/dist/state/db.js +0 -155
  248. package/dist/state/db.js.map +0 -1
  249. package/dist/state/execution-store.d.ts +0 -257
  250. package/dist/state/execution-store.js +0 -527
  251. package/dist/state/execution-store.js.map +0 -1
  252. package/dist/state/migrate.d.ts +0 -15
  253. package/dist/state/migrate.js +0 -175
  254. package/dist/state/migrate.js.map +0 -1
  255. package/dist/state/workflow-run-store.d.ts +0 -216
  256. package/dist/state/workflow-run-store.js +0 -403
  257. package/dist/state/workflow-run-store.js.map +0 -1
  258. package/dist/telemetry/index.d.ts +0 -38
  259. package/dist/telemetry/index.js +0 -253
  260. package/dist/telemetry/index.js.map +0 -1
  261. package/dist/telemetry/pi-events.d.ts +0 -12
  262. package/dist/telemetry/pi-events.js +0 -134
  263. package/dist/telemetry/pi-events.js.map +0 -1
  264. package/dist/workflows/dag.d.ts +0 -37
  265. package/dist/workflows/dag.js +0 -118
  266. package/dist/workflows/dag.js.map +0 -1
  267. package/dist/workflows/loader.d.ts +0 -53
  268. package/dist/workflows/loader.js +0 -421
  269. package/dist/workflows/loader.js.map +0 -1
  270. package/dist/workflows/loop-eval.d.ts +0 -28
  271. package/dist/workflows/loop-eval.js +0 -74
  272. package/dist/workflows/loop-eval.js.map +0 -1
  273. package/dist/workflows/phase-executor.d.ts +0 -215
  274. package/dist/workflows/phase-executor.js +0 -1144
  275. package/dist/workflows/phase-executor.js.map +0 -1
  276. package/dist/workflows/phase-ref.d.ts +0 -50
  277. package/dist/workflows/phase-ref.js +0 -91
  278. package/dist/workflows/phase-ref.js.map +0 -1
  279. package/dist/workflows/resume.d.ts +0 -58
  280. package/dist/workflows/resume.js +0 -313
  281. package/dist/workflows/resume.js.map +0 -1
  282. package/dist/workflows/runner.d.ts +0 -63
  283. package/dist/workflows/runner.js +0 -364
  284. package/dist/workflows/runner.js.map +0 -1
  285. package/dist/workflows/schema.d.ts +0 -344
  286. package/dist/workflows/schema.js +0 -460
  287. package/dist/workflows/schema.js.map +0 -1
  288. package/dist/workflows/simple.d.ts +0 -90
  289. package/dist/workflows/simple.js +0 -393
  290. package/dist/workflows/simple.js.map +0 -1
  291. package/dist/workflows/target-policy.d.ts +0 -74
  292. package/dist/workflows/target-policy.js +0 -80
  293. package/dist/workflows/target-policy.js.map +0 -1
  294. package/dist/workflows/templates.d.ts +0 -88
  295. package/dist/workflows/templates.js +0 -127
  296. package/dist/workflows/templates.js.map +0 -1
  297. package/dist/workflows/triggers.d.ts +0 -21
  298. package/dist/workflows/triggers.js +0 -45
  299. package/dist/workflows/triggers.js.map +0 -1
  300. package/dist/workflows/verdict.d.ts +0 -19
  301. package/dist/workflows/verdict.js +0 -30
  302. package/dist/workflows/verdict.js.map +0 -1
  303. package/dist/worktree/manager.d.ts +0 -43
  304. package/dist/worktree/manager.js +0 -127
  305. package/dist/worktree/manager.js.map +0 -1
  306. package/docker-compose.yml +0 -274
  307. package/sandbox.Dockerfile +0 -68
  308. package/skills/README.md +0 -42
  309. package/skills/browser-qa/SKILL.md +0 -208
  310. package/skills/browser-qa/scripts/agent-browser.mjs +0 -531
  311. package/skills/building/SKILL.md +0 -95
  312. package/skills/chat/SKILL.md +0 -36
  313. package/skills/code-review/SKILL.md +0 -82
  314. package/skills/debug-production/SKILL.md +0 -108
  315. package/skills/demo/SKILL.md +0 -228
  316. package/skills/demo/scripts/compose-demo.sh +0 -243
  317. package/skills/issue-answer/SKILL.md +0 -91
  318. package/skills/issue-comment/SKILL.md +0 -49
  319. package/skills/issue-triage/SKILL.md +0 -149
  320. package/skills/issue-triage/references/AGENT-BRIEF.md +0 -65
  321. package/skills/pr-comment/SKILL.md +0 -64
  322. package/skills/pr-review/SKILL.md +0 -148
  323. package/skills/pr-review/references/findings-schema.md +0 -89
  324. package/skills/qa-test/SKILL.md +0 -97
  325. package/skills/repo-health/SKILL.md +0 -67
  326. package/skills/security-feedback/SKILL.md +0 -173
  327. package/skills/security-feedback/references/templates.md +0 -77
  328. package/skills/security-review/SKILL.md +0 -215
  329. package/skills/security-review/references/issue-format.md +0 -302
  330. package/skills/verify/SKILL.md +0 -118
  331. package/workflows/answer.yaml +0 -44
  332. package/workflows/build.yaml +0 -129
  333. package/workflows/cron-health.yaml +0 -6
  334. package/workflows/cron-review.yaml +0 -8
  335. package/workflows/cron-security.yaml +0 -6
  336. package/workflows/cron-triage.yaml +0 -8
  337. package/workflows/demo.yaml +0 -62
  338. package/workflows/examples/bash-smoke.yaml +0 -41
  339. package/workflows/examples/parallel-review.yaml +0 -36
  340. package/workflows/examples/tdd-loop.yaml +0 -17
  341. package/workflows/explore.yaml +0 -80
  342. package/workflows/issue-comment.yaml +0 -15
  343. package/workflows/issue-triage.yaml +0 -22
  344. package/workflows/pr-comment.yaml +0 -16
  345. package/workflows/pr-fix.yaml +0 -17
  346. package/workflows/pr-review.yaml +0 -50
  347. package/workflows/prompts/answer.md +0 -68
  348. package/workflows/prompts/architect.md +0 -44
  349. package/workflows/prompts/classifier.md +0 -60
  350. package/workflows/prompts/classify-adds-info.md +0 -17
  351. package/workflows/prompts/demo.md +0 -125
  352. package/workflows/prompts/executor.md +0 -42
  353. package/workflows/prompts/explore-ask.md +0 -99
  354. package/workflows/prompts/explore-publish.md +0 -31
  355. package/workflows/prompts/explore-read.md +0 -120
  356. package/workflows/prompts/explore-synthesize.md +0 -88
  357. package/workflows/prompts/fix.md +0 -18
  358. package/workflows/prompts/guardrails.md +0 -96
  359. package/workflows/prompts/pr-fix.md +0 -26
  360. package/workflows/prompts/pr.md +0 -39
  361. package/workflows/prompts/qa-browser.md +0 -95
  362. package/workflows/prompts/qa-synth.md +0 -44
  363. package/workflows/prompts/qa-test.md +0 -60
  364. package/workflows/prompts/re-reviewer.md +0 -33
  365. package/workflows/prompts/reviewer.md +0 -60
  366. package/workflows/prompts/verify-browser.md +0 -93
  367. package/workflows/prompts/verify-synth.md +0 -44
  368. package/workflows/prompts/verify.md +0 -63
  369. package/workflows/qa-test.yaml +0 -94
  370. package/workflows/repo-health.yaml +0 -15
  371. package/workflows/security-feedback.yaml +0 -25
  372. package/workflows/security-review.yaml +0 -37
  373. package/workflows/verify.yaml +0 -93
  374. /package/dist/{cli/cli-config.d.ts → cli-config.d.ts} +0 -0
  375. /package/dist/{cli/cli-config.js → cli-config.js} +0 -0
  376. /package/dist/{cli/cli-format.d.ts → cli-format.d.ts} +0 -0
  377. /package/dist/{cli/cli-format.js → cli-format.js} +0 -0
  378. /package/dist/{cli/cli-timeline.d.ts → cli-timeline.d.ts} +0 -0
  379. /package/dist/{cli/cli-timeline.js → cli-timeline.js} +0 -0
  380. /package/dist/{cli/cli.d.ts → cli.d.ts} +0 -0
  381. /package/dist/{cli/oauth-cli.d.ts → oauth-cli.d.ts} +0 -0
  382. /package/dist/{cli/setup.d.ts → setup.d.ts} +0 -0
@@ -1,393 +0,0 @@
1
- import { randomUUID } from "crypto";
2
- import { getBotName } from "../config/config.js";
3
- import { getWorkflow } from "./loader.js";
4
- import { runWorkflow, } from "./runner.js";
5
- import { PhaseRef } from "./phase-ref.js";
6
- import { slugify } from "./templates.js";
7
- import { wrapUntrusted } from "../engine/screen/screen.js";
8
- import { buildProgressModel, runDashboardUrl } from "../notify/model.js";
9
- import { buildAssetIssueKey } from "../state/build-assets.js";
10
- import { PER_TARGET_REUSE_WORKFLOWS, PER_TARGET_RECREATE_WORKFLOWS, PREPOPULATE_SYNTH_WORKFLOWS, PR_HEADREF_PREPOPULATE_WORKFLOWS, } from "./target-policy.js";
11
- // Per-target workspace provisioning policy lives in `./target-policy.js` (a
12
- // leaf module the runner can share without an import cycle). Imported at the
13
- // top for local use; re-exported here for existing callers (e.g. src/index.ts
14
- // imports PR_HEADREF_PREPOPULATE_WORKFLOWS).
15
- export { PER_TARGET_REUSE_WORKFLOWS, PER_TARGET_RECREATE_WORKFLOWS, PREPOPULATE_SYNTH_WORKFLOWS, PR_HEADREF_PREPOPULATE_WORKFLOWS, };
16
- export function workflowScopedTaskId(repo, number, workflowName, workflowId) {
17
- // Reusable / recreatable per-target workspaces are keyed by (repo, issue)
18
- // only — no run suffix — so a re-run lands on the same dir (reused for
19
- // pr-review/pr-fix, recreated-from-base for build; see the two sets above).
20
- if (number !== undefined &&
21
- (PER_TARGET_REUSE_WORKFLOWS.has(workflowName) ||
22
- PER_TARGET_RECREATE_WORKFLOWS.has(workflowName))) {
23
- return `${repo}-${number}-${workflowName}`;
24
- }
25
- const suffix = workflowId.slice(0, 8);
26
- return number !== undefined
27
- ? `${repo}-${number}-${workflowName}-${suffix}`
28
- : `${repo}-${workflowName}-${suffix}`;
29
- }
30
- /**
31
- * Resolve the `{{branch}}` template var (and the matching sandbox
32
- * `prePopulateBranch`) for a dispatch.
33
- *
34
- * The branch a build-style run creates and pushes is `lastlight/N-<title-slug>`,
35
- * derived from the issue title at **first** dispatch. Every later re-entry of the
36
- * same run — an approval-gate resume, a retry — comes through `runSimpleWorkflow`
37
- * again, but the resume event carries an **empty** issue title, so a naive
38
- * recompute collapses to the `lastlight/N-issue-N` fallback. That drifted name
39
- * is harmless for phases that `git push origin HEAD` (the persisted workspace is
40
- * still on the real branch) but fatal for the PR phase, whose prompt feeds
41
- * `{{branch}}` straight into `github_create_pull_request`'s `head` — GitHub 422s
42
- * because the fallback ref was never pushed.
43
- *
44
- * So when reusing an existing run we pin to the branch stored on the run row at
45
- * creation, mirroring `resume.ts`'s `stored.branch ?? …` precedence. `stored`
46
- * is `undefined` for a fresh run (no row yet).
47
- */
48
- export function resolveRunBranch(args) {
49
- const { stored, requestPrePopulateBranch, issueNumber, issueTitle, workflowName } = args;
50
- const storedBranch = typeof stored?.branch === "string" && stored.branch ? stored.branch : undefined;
51
- const storedPrePopulate = typeof stored?.prePopulateBranch === "string" && stored.prePopulateBranch
52
- ? stored.prePopulateBranch
53
- : undefined;
54
- const branch = storedBranch
55
- ?? requestPrePopulateBranch
56
- ?? (issueNumber !== undefined
57
- ? `lastlight/${issueNumber}-${slugify(issueTitle || `issue-${issueNumber}`)}`
58
- : `lastlight/${workflowName}`);
59
- // Pre-populate (clone into the sandbox, cwd = repo root) for the workflows in
60
- // PREPOPULATE_SYNTH_WORKFLOWS even though they synthesize a not-yet-pushed
61
- // branch — see that const's doc comment for why (the verify/qa-test harvest
62
- // fix in particular).
63
- const prePopulateBranch = storedPrePopulate
64
- ?? requestPrePopulateBranch
65
- ?? (PREPOPULATE_SYNTH_WORKFLOWS.has(workflowName) ? branch : undefined);
66
- return { branch, prePopulateBranch };
67
- }
68
- /**
69
- * Run a named agent workflow against a target.
70
- *
71
- * If a workflow_run row already exists for this trigger, we reuse it and let
72
- * the runner's definition-driven resume pick up after the last completed
73
- * phase — including the paused/approved/rejected paths. Otherwise we create a
74
- * fresh row so the dashboard sees it immediately.
75
- */
76
- export async function runSimpleWorkflow(workflowName, request, config, callbacks, db, models, approvalConfig, bootstrapLabel = "lastlight:bootstrap", variants) {
77
- // Kill switch — if an admin has disabled this workflow in the dashboard,
78
- // skip every trigger source (cron, webhooks, mentions, Slack) without
79
- // creating a workflow_runs row. Returning success=true keeps callers
80
- // (router, cron tick, etc.) from treating this as an error.
81
- if (!db.isWorkflowEnabled(workflowName)) {
82
- console.log(`[workflow] skipped "${workflowName}" — disabled in admin dashboard`);
83
- return { success: true, phases: [] };
84
- }
85
- const definition = getWorkflow(workflowName);
86
- const { owner, repo, issueNumber, prNumber } = request;
87
- const notify = callbacks.postComment || (async () => { });
88
- // Identify the trigger uniquely. Issue/PR-scoped workflows include the
89
- // number; repo-scoped workflows (e.g. health) just identify by repo+name;
90
- // Slack-initiated runs pass an explicit `slack:*` id for thread scoping.
91
- const number = issueNumber ?? prNumber;
92
- const triggerId = request.triggerId
93
- ?? (number !== undefined
94
- ? `${owner}/${repo}#${number}`
95
- : `${owner}/${repo}::${workflowName}`);
96
- // When the dispatcher passes `prePopulateBranch` (set for pr-review /
97
- // pr-fix from the actual PR head ref), use that as the `branch` template
98
- // var too — the agent's workspace is going to be checked out at that
99
- // ref, so the prompt should reflect reality rather than a lastlight/N-slug
100
- // name that doesn't exist. Build-style workflows still get the synthesized
101
- // lastlight/N-slug branch they create themselves.
102
- // `let`, not `const`: when we reuse an existing run below the resolution is
103
- // redone with the run's stored context so the branch can't drift off the
104
- // already-pushed name on resume — see `resolveRunBranch`.
105
- let { branch, prePopulateBranch: effectivePrePopulateBranch } = resolveRunBranch({
106
- requestPrePopulateBranch: request.prePopulateBranch,
107
- issueNumber: number,
108
- issueTitle: request.issueTitle,
109
- workflowName,
110
- });
111
- // ── Resume handling ────────────────────────────────────────────────────────
112
- //
113
- // If a workflow_run already exists for this trigger, reuse its id. The
114
- // runner re-runs from the top and the executions ledger (`shouldRunPhase`)
115
- // skips already-completed phases — no per-workflow branching needed.
116
- // Only reuse a workflow_run row when the existing run is still live
117
- // (running/paused). `getWorkflowRunByTrigger` already filters out
118
- // completed rows — a fresh re-trigger for a succeeded run falls through
119
- // to the `else` branch, creating a new workflow_run_id and a new set of
120
- // dedup-scoped executions.
121
- let workflowId;
122
- let taskId;
123
- let issueDir;
124
- const existingRun = db.runs.getByTrigger(triggerId);
125
- if (existingRun && existingRun.workflowName === workflowName) {
126
- workflowId = existingRun.id;
127
- const stored = (existingRun.context || {});
128
- taskId = stored.taskId ||
129
- workflowScopedTaskId(repo, number, workflowName, workflowId);
130
- // Recover issueDir from stored context so resumed runs use the same
131
- // workspace path as the original.
132
- issueDir = stored.issueDir
133
- || `.lastlight/${buildAssetIssueKey(workflowName, number, workflowId)}`;
134
- // Re-resolve the branch with the run's stored context. A resume event (e.g.
135
- // an approval response) carries an empty issue title, so the fresh
136
- // computation above drifts to the `lastlight/N-issue-N` fallback — but the
137
- // executor already pushed under the original title-slug name. Pinning to the
138
- // stored branch keeps every re-entered phase's `{{branch}}` correct, most
139
- // critically the PR phase's `head:` ref (otherwise GitHub 422s on create).
140
- ({ branch, prePopulateBranch: effectivePrePopulateBranch } = resolveRunBranch({
141
- stored,
142
- requestPrePopulateBranch: request.prePopulateBranch,
143
- issueNumber: number,
144
- issueTitle: request.issueTitle,
145
- workflowName,
146
- }));
147
- const handled = await handleExistingRun(existingRun, definition, notify, db);
148
- if (handled)
149
- return handled;
150
- }
151
- else {
152
- workflowId = randomUUID();
153
- taskId = workflowScopedTaskId(repo, number, workflowName, workflowId);
154
- // Issue-scoped workflows share a dir by issue number; non-issue
155
- // workflows (explore, health, etc.) get a run-scoped dir so
156
- // concurrent sessions never overlap.
157
- issueDir = `.lastlight/${buildAssetIssueKey(workflowName, number, workflowId)}`;
158
- db.runs.createRun({
159
- id: workflowId,
160
- workflowName,
161
- triggerId,
162
- repo,
163
- issueNumber: issueNumber ?? prNumber,
164
- currentPhase: definition.phases[0]?.name || "phase_0",
165
- status: "running",
166
- context: {
167
- kind: definition.kind,
168
- owner,
169
- branch,
170
- taskId,
171
- issueDir,
172
- prePopulateBranch: effectivePrePopulateBranch,
173
- models: models,
174
- variants: variants,
175
- ...request.extra,
176
- },
177
- startedAt: new Date().toISOString(),
178
- });
179
- console.log(`[simple] Created workflow run ${workflowId} (${workflowName})`);
180
- }
181
- // Surface the run id to the dispatch layer as soon as it's known (either
182
- // fresh or reused). Fire-and-forget so a slow/broken downstream hook can't
183
- // stall the workflow.
184
- if (callbacks.onRunStart) {
185
- callbacks.onRunStart(workflowId).catch((err) => {
186
- const msg = err instanceof Error ? err.message : String(err);
187
- console.warn(`[simple] onRunStart callback threw: ${msg}`);
188
- });
189
- }
190
- // ── Seed the in-place progress checklist ───────────────────────────────────
191
- //
192
- // For workflows that opt into `status_checklist`, build the task-list model
193
- // from the definition's phases and publish the initial surface (one GitHub
194
- // comment / one Slack message that subsequent phases edit in place). On a
195
- // resumed run we re-seed the SAME surface (the transport re-attaches to the
196
- // stored comment id / message ts) and mark already-completed phases done.
197
- if (callbacks.reporter && definition.status_checklist) {
198
- const completed = new Set((existingRun?.phaseHistory ?? []).map((h) => h.phase));
199
- const model = buildProgressModel(definition, {
200
- workflowName,
201
- number,
202
- issueTitle: request.issueTitle,
203
- owner,
204
- repo,
205
- branch,
206
- completed,
207
- runUrl: runDashboardUrl(callbacks.publicUrl, workflowId, workflowName),
208
- });
209
- await callbacks.reporter.start(model).catch((err) => {
210
- const msg = err instanceof Error ? err.message : String(err);
211
- console.warn(`[simple] reporter.start threw: ${msg}`);
212
- });
213
- }
214
- // ── Build template context ─────────────────────────────────────────────────
215
- //
216
- // The context snapshot is the agent's primary view of the task. All
217
- // user-provided text is wrapped in <<<USER_CONTENT_UNTRUSTED>>> markers so
218
- // the agent — anchored by agent-context/security.md — treats them as data
219
- // rather than instructions. The trigger metadata (sender, branch, issue
220
- // ref) sits outside the wrappers so identity is established out-of-band.
221
- //
222
- // For build/pr-fix/explore workflows the dispatch path (src/index.ts)
223
- // pre-fetches the real issue body + full comment thread and stitches them
224
- // into request.extra.combinedContext (one screening call). For everything
225
- // else we fall back to whatever the envelope carried.
226
- const combinedContext = request.extra?.combinedContext || "";
227
- const issueRef = `${owner}/${repo}${issueNumber ? `#${issueNumber}` : ""}`;
228
- const hasAnyUserContent = !!(combinedContext || request.issueBody || request.commentBody);
229
- const contextSnapshot = hasAnyUserContent
230
- ? [
231
- `Repo: ${issueRef}`,
232
- `Issue title: ${request.issueTitle || "(none)"}`,
233
- request.commentBody
234
- ? `Triggering comment:\n${wrapUntrusted(request.commentBody, { source: "github-comment", author: request.sender })}`
235
- : "",
236
- `Requested by: ${request.sender}`,
237
- `Branch: ${branch}`,
238
- combinedContext
239
- ? `Issue body and full thread:\n${wrapUntrusted(combinedContext, { source: "github-issue-thread" })}`
240
- : request.issueBody
241
- ? `Issue body:\n${wrapUntrusted(request.issueBody, { source: "github-issue-body" })}`
242
- : "",
243
- ]
244
- .filter(Boolean)
245
- .join("\n\n")
246
- : "";
247
- const ctx = {
248
- owner,
249
- repo,
250
- // A PR is its own GitHub number, so for PR-scoped workflows (pr-review /
251
- // pr-fix, triggered by a `pr.*` webhook that carries only `prNumber`)
252
- // fall back to it — otherwise `issueNumber` is 0 and the `post-review`
253
- // action can't find the PR to post against. Mirrors the DB run row and
254
- // taskId, both of which already key off `issueNumber ?? prNumber`.
255
- issueNumber: issueNumber ?? prNumber ?? 0,
256
- // Surface the PR number explicitly too; `post-review` prefers it over
257
- // `issueNumber`, and PR-scoped prompts can reference `{{prNumber}}`.
258
- prNumber,
259
- issueTitle: request.issueTitle || "",
260
- issueBody: request.issueBody || "",
261
- issueLabels: request.issueLabels || [],
262
- commentBody: request.commentBody || "",
263
- sender: request.sender,
264
- // The bot's `@mention` handle (e.g. `@last-light`), for approval-gate and
265
- // command help strings in workflow YAML — `{{botMention}} approve`.
266
- botMention: `@${getBotName()}`,
267
- branch,
268
- taskId,
269
- issueDir,
270
- // True only in server mode — prompts gate their `git add .lastlight/ &&
271
- // commit` behind `{{#if !externalizeArtifacts}}` so the handoff docs are
272
- // never committed into the target repo (they're harvested to the server
273
- // store instead). Absent/false ⇒ repo behaviour (commit the docs).
274
- externalizeArtifacts: config.buildAssets === "server",
275
- // Dashboard base URL for the {{artifactUrl}} helper (server-mode doc links).
276
- publicUrl: callbacks.publicUrl,
277
- // Public, unauthenticated, image-only base URL for inline screenshot embeds
278
- // in the browser-QA comment (so GitHub's image proxy can fetch them without
279
- // a login). The agent appends `/<name>.png` per screenshot it saves. Empty
280
- // when no PUBLIC_URL is configured — the prompt then falls back to
281
- // filename-only references via `{{#if !artifactBaseUrl}}`. issueKey is
282
- // issueDir minus the `.lastlight/` prefix.
283
- artifactBaseUrl: callbacks.publicUrl
284
- ? `${String(callbacks.publicUrl).replace(/\/+$/, "")}/admin/api/public/artifacts/${owner}/${repo}/${issueDir.replace(/^\.lastlight\//, "")}`
285
- : "",
286
- bootstrapLabel,
287
- contextSnapshot,
288
- // Forwarded to the executor (via gitSandboxAccessForWorkflow) so the
289
- // harness pre-clones this branch into the sandbox workspace before
290
- // the agent starts. Stored on the workflow_run row above; also lives
291
- // on ctx so the runner can read it without an extra DB lookup.
292
- prePopulateBranch: effectivePrePopulateBranch,
293
- models: models,
294
- // Reasoning-effort overrides per phase. Empty/undefined entries skip
295
- // the --variant flag (model uses its default effort).
296
- variants: variants,
297
- // Slack-initiated runs need the runner to pause/resume on the thread id,
298
- // not on owner/repo#N. Passing the override through here keeps the
299
- // runner's triggerId derivation in one place.
300
- triggerIdOverride: request.triggerId,
301
- // Extra workflow-specific args (e.g. mode: scan from cron, or the PR fix
302
- // payload). These become top-level ctx keys so prompt templates can read
303
- // them directly via {{failedChecks}} etc.
304
- ...(request.extra || {}),
305
- };
306
- // In server mode, tag the run's config with its artifact identity so the
307
- // executor's stage-in/harvest seam can locate this run's docs in the store
308
- // at `<buildAssetsDir>/<owner>/<repo>/<issueKey>/`. issueKey is issueDir
309
- // without the `.lastlight/` prefix, so it tracks however issueDir was formed
310
- // (fresh derivation or recovered-from-context on resume).
311
- const runConfig = config.buildAssets === "server"
312
- ? {
313
- ...config,
314
- buildAssetsKey: {
315
- owner,
316
- repo,
317
- issueKey: issueDir.replace(/^\.lastlight\//, ""),
318
- },
319
- }
320
- : config;
321
- try {
322
- const result = await runWorkflow(definition, ctx, runConfig, callbacks, db, models, approvalConfig, workflowId, variants);
323
- if (result.success && !result.paused) {
324
- db.runs.finishRun(workflowId, "succeeded");
325
- }
326
- else if (!result.success && !result.paused) {
327
- db.runs.finishRun(workflowId, "failed", {
328
- error: result.phases.find((p) => !p.success)?.error || "workflow failed",
329
- });
330
- }
331
- return result;
332
- }
333
- catch (err) {
334
- const msg = err instanceof Error ? err.message : String(err);
335
- db.runs.finishRun(workflowId, "failed", { error: msg });
336
- throw err;
337
- }
338
- }
339
- /**
340
- * Short-circuit for a workflow run that already has state. Returns a
341
- * WorkflowResult to return directly (already complete / rejected / still
342
- * paused), or `null` to continue into `runWorkflow` for normal resume.
343
- */
344
- async function handleExistingRun(run, definition, notify, db) {
345
- // Workflow already completed: currentPhase is a terminal set_phase marker
346
- // (e.g. "complete") — i.e. not a declared phase, not a generated loop label
347
- // (`*_fix_N` / `*_recheck_N` / `*_iter_N`), and not the synthetic
348
- // "waiting_approval" pause marker. Don't re-run.
349
- if (run.currentPhase &&
350
- run.currentPhase !== "waiting_approval" &&
351
- !definition.phases.some((p) => p.name === run.currentPhase) &&
352
- PhaseRef.parse(run.currentPhase).kind === "phase") {
353
- await notify(`Workflow \`${run.workflowName}\` is already complete for this trigger.`);
354
- return {
355
- success: true,
356
- phases: [{ phase: "resume", success: true, output: "Already complete" }],
357
- };
358
- }
359
- // Paused awaiting approval — see if a human has responded.
360
- if (run.status === "paused" && run.currentPhase === "waiting_approval") {
361
- const pendingApproval = db.approvals.getPendingForWorkflow(run.id);
362
- if (pendingApproval?.status === "approved") {
363
- // Resume is ledger-driven: the runner re-runs from the top and every
364
- // completed phase skips via `shouldRunPhase` (the executions ledger).
365
- // No currentPhase manipulation is needed — for an approve gate the
366
- // gated phase is already `done` so the runner proceeds past it; for a
367
- // reply gate the loop node resumes from `scratch.iteration`.
368
- console.log(`[simple] ${pendingApproval.kind === "reply" ? "Reply" : "Approval"} received for gate ${pendingApproval.gate} — resuming ${run.workflowName}`);
369
- db.runs.setRunning(run.id);
370
- if (pendingApproval.kind !== "reply") {
371
- await notify(`**Approval received** — resuming \`${run.workflowName}\`.`);
372
- }
373
- return null; // fall through to runWorkflow
374
- }
375
- else if (pendingApproval?.status === "rejected") {
376
- const reason = pendingApproval.response || "no reason given";
377
- db.runs.finishRun(run.id, "failed", { error: `Rejected: ${reason}` });
378
- await notify(`Workflow \`${run.workflowName}\` was rejected. Reason: ${reason}`);
379
- return {
380
- success: false,
381
- phases: [{ phase: "rejected", success: false, output: `Rejected: ${reason}` }],
382
- };
383
- }
384
- else {
385
- await notify(`Workflow \`${run.workflowName}\` is paused, awaiting approval.`);
386
- return { success: true, phases: [], paused: true };
387
- }
388
- }
389
- // Normal resume — the runner's definition-driven resume takes over.
390
- console.log(`[simple] Resuming ${run.workflowName} for ${run.triggerId} (last phase: ${run.currentPhase})`);
391
- return null;
392
- }
393
- //# sourceMappingURL=simple.js.map
@@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their
3
- * workspace by (repo, issue/PR) and how a re-run treats an existing checkout.
4
- *
5
- * This is a leaf module (no imports of the runner or the simple entrypoint) so
6
- * both `simple.ts` (taskId keying) and `runner.ts` (`gitSandboxAccessForWorkflow`)
7
- * can read the same source of truth without an import cycle. `simple.ts`
8
- * re-exports these for existing callers (e.g. `src/index.ts`).
9
- */
10
- /**
11
- * Workflows whose workspace is keyed by **(repo, PR)** rather than per-run.
12
- * For these the taskId drops the run-id suffix so re-reviews of the same PR
13
- * (push → `synchronize`, cron PR-review fanout) reuse one sandbox dir — a
14
- * warm `node_modules` + an incremental `git fetch` instead of a fresh
15
- * 1.3G clone + full install each time, and N dirs/PR collapse to 1 (issue
16
- * #107, cutting the #106 churn at its source). Concurrency is held off by
17
- * the dispatcher's `isRunning(skill, triggerId)` guard plus
18
- * `runs.getByTrigger` reuse — two runs never share the dir live; the
19
- * cross-run refresh in `prePopulateWorkspace` resets it cleanly between them.
20
- * `build` is handled by `PER_TARGET_RECREATE_WORKFLOWS` instead — it must not
21
- * *refresh* a stale checkout (that would reset onto the old feature branch);
22
- * it recreates the workspace from the default branch.
23
- */
24
- export declare const PER_TARGET_REUSE_WORKFLOWS: Set<string>;
25
- /**
26
- * Workflows whose per-target workspace is **recreated from the default branch**
27
- * on a fresh run rather than refreshed onto an existing feature branch. Like
28
- * `PER_TARGET_REUSE_WORKFLOWS`, these key the taskId by (repo, issue) only (no
29
- * run-id suffix) so a re-run lands on the same dir — but a *different*-run
30
- * marker triggers a delete + fresh clone off the default branch, not a
31
- * `git fetch`/reset of the (stale) feature branch. This makes an incomplete
32
- * `build` disposable: re-triggering it starts again from current `main`
33
- * (issue #153). A genuine *resume* of the same run (approval gate) still
34
- * preserves the workspace via the same-run marker — the architect's `plan.md`
35
- * survives. Concurrency is held off by the dispatcher's
36
- * `isRunning(skill, triggerId)` guard, so the delete only ever hits a leftover
37
- * from a finished/abandoned run.
38
- */
39
- export declare const PER_TARGET_RECREATE_WORKFLOWS: Set<string>;
40
- /**
41
- * Workflows that synthesize their own `lastlight/N-slug` branch (which doesn't
42
- * exist on the remote at dispatch time) yet should still pre-populate the
43
- * sandbox: the agent's cwd becomes the repo root (no `git clone`/`cd`), and —
44
- * for the read-only `verify`/`qa-test` runs — server-mode artifacts the agent
45
- * writes to `.lastlight/<key>/` (e.g. browser-QA screenshots) land where
46
- * `serverArtifacts()` harvests them instead of being orphaned a level up.
47
- * `build` was the original member; verify/qa-test were added for the harvest
48
- * fix, and `demo` for the same reason (its `demo.mp4` is written under
49
- * `.lastlight/<key>/` and harvested into the Artifacts store). For a fresh
50
- * (issue-scoped) dispatch the dispatcher leaves `prePopulateBranch` unset and
51
- * the missing-branch fallback in `prePopulateWorkspace` clones the default
52
- * branch — correct for `build`/`demo`, which *create* the synth branch off the
53
- * default. But when the *same* workflow runs against an existing PR, the synth
54
- * `lastlight/<prNumber>-<title-slug>` name won't match the PR's real head ref
55
- * (named after the originating issue), so the fallback would clone the default
56
- * branch and test/demo code that lacks the PR — see
57
- * `PR_HEADREF_PREPOPULATE_WORKFLOWS`.
58
- */
59
- export declare const PREPOPULATE_SYNTH_WORKFLOWS: Set<string>;
60
- /**
61
- * The subset of PR-scoped read workflows the dispatcher pins to the PR's *real*
62
- * head ref (via `getPullRequest(...).head.ref`) before pre-populating, instead
63
- * of letting them fall back to the synthesized `lastlight/N-<title-slug>` name.
64
- * Each of these is meaningful only against an existing PR, and the synth name
65
- * never matches the PR's actual branch (which is named after the originating
66
- * issue, e.g. `lastlight/14-…` for a PR #15). Without this pinning:
67
- * - `qa-test` / `verify` QA the *base* branch and report the PR's feature
68
- * missing — a false-negative result.
69
- * - `demo`'s "after" collapses onto the default branch, matching "before".
70
- * `pr-fix` is handled separately (it plumbs `branch` through context for the
71
- * architect/executor to push to). See the resolution block in
72
- * `dispatchWorkflow` (src/index.ts).
73
- */
74
- export declare const PR_HEADREF_PREPOPULATE_WORKFLOWS: Set<string>;
@@ -1,80 +0,0 @@
1
- /**
2
- * Per-target sandbox-workspace provisioning policy — which workflows key their
3
- * workspace by (repo, issue/PR) and how a re-run treats an existing checkout.
4
- *
5
- * This is a leaf module (no imports of the runner or the simple entrypoint) so
6
- * both `simple.ts` (taskId keying) and `runner.ts` (`gitSandboxAccessForWorkflow`)
7
- * can read the same source of truth without an import cycle. `simple.ts`
8
- * re-exports these for existing callers (e.g. `src/index.ts`).
9
- */
10
- /**
11
- * Workflows whose workspace is keyed by **(repo, PR)** rather than per-run.
12
- * For these the taskId drops the run-id suffix so re-reviews of the same PR
13
- * (push → `synchronize`, cron PR-review fanout) reuse one sandbox dir — a
14
- * warm `node_modules` + an incremental `git fetch` instead of a fresh
15
- * 1.3G clone + full install each time, and N dirs/PR collapse to 1 (issue
16
- * #107, cutting the #106 churn at its source). Concurrency is held off by
17
- * the dispatcher's `isRunning(skill, triggerId)` guard plus
18
- * `runs.getByTrigger` reuse — two runs never share the dir live; the
19
- * cross-run refresh in `prePopulateWorkspace` resets it cleanly between them.
20
- * `build` is handled by `PER_TARGET_RECREATE_WORKFLOWS` instead — it must not
21
- * *refresh* a stale checkout (that would reset onto the old feature branch);
22
- * it recreates the workspace from the default branch.
23
- */
24
- export const PER_TARGET_REUSE_WORKFLOWS = new Set(["pr-review", "pr-fix"]);
25
- /**
26
- * Workflows whose per-target workspace is **recreated from the default branch**
27
- * on a fresh run rather than refreshed onto an existing feature branch. Like
28
- * `PER_TARGET_REUSE_WORKFLOWS`, these key the taskId by (repo, issue) only (no
29
- * run-id suffix) so a re-run lands on the same dir — but a *different*-run
30
- * marker triggers a delete + fresh clone off the default branch, not a
31
- * `git fetch`/reset of the (stale) feature branch. This makes an incomplete
32
- * `build` disposable: re-triggering it starts again from current `main`
33
- * (issue #153). A genuine *resume* of the same run (approval gate) still
34
- * preserves the workspace via the same-run marker — the architect's `plan.md`
35
- * survives. Concurrency is held off by the dispatcher's
36
- * `isRunning(skill, triggerId)` guard, so the delete only ever hits a leftover
37
- * from a finished/abandoned run.
38
- */
39
- export const PER_TARGET_RECREATE_WORKFLOWS = new Set(["build"]);
40
- /**
41
- * Workflows that synthesize their own `lastlight/N-slug` branch (which doesn't
42
- * exist on the remote at dispatch time) yet should still pre-populate the
43
- * sandbox: the agent's cwd becomes the repo root (no `git clone`/`cd`), and —
44
- * for the read-only `verify`/`qa-test` runs — server-mode artifacts the agent
45
- * writes to `.lastlight/<key>/` (e.g. browser-QA screenshots) land where
46
- * `serverArtifacts()` harvests them instead of being orphaned a level up.
47
- * `build` was the original member; verify/qa-test were added for the harvest
48
- * fix, and `demo` for the same reason (its `demo.mp4` is written under
49
- * `.lastlight/<key>/` and harvested into the Artifacts store). For a fresh
50
- * (issue-scoped) dispatch the dispatcher leaves `prePopulateBranch` unset and
51
- * the missing-branch fallback in `prePopulateWorkspace` clones the default
52
- * branch — correct for `build`/`demo`, which *create* the synth branch off the
53
- * default. But when the *same* workflow runs against an existing PR, the synth
54
- * `lastlight/<prNumber>-<title-slug>` name won't match the PR's real head ref
55
- * (named after the originating issue), so the fallback would clone the default
56
- * branch and test/demo code that lacks the PR — see
57
- * `PR_HEADREF_PREPOPULATE_WORKFLOWS`.
58
- */
59
- export const PREPOPULATE_SYNTH_WORKFLOWS = new Set(["build", "verify", "qa-test", "demo"]);
60
- /**
61
- * The subset of PR-scoped read workflows the dispatcher pins to the PR's *real*
62
- * head ref (via `getPullRequest(...).head.ref`) before pre-populating, instead
63
- * of letting them fall back to the synthesized `lastlight/N-<title-slug>` name.
64
- * Each of these is meaningful only against an existing PR, and the synth name
65
- * never matches the PR's actual branch (which is named after the originating
66
- * issue, e.g. `lastlight/14-…` for a PR #15). Without this pinning:
67
- * - `qa-test` / `verify` QA the *base* branch and report the PR's feature
68
- * missing — a false-negative result.
69
- * - `demo`'s "after" collapses onto the default branch, matching "before".
70
- * `pr-fix` is handled separately (it plumbs `branch` through context for the
71
- * architect/executor to push to). See the resolution block in
72
- * `dispatchWorkflow` (src/index.ts).
73
- */
74
- export const PR_HEADREF_PREPOPULATE_WORKFLOWS = new Set([
75
- "pr-review",
76
- "demo",
77
- "qa-test",
78
- "verify",
79
- ]);
80
- //# sourceMappingURL=target-policy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"target-policy.js","sourceRoot":"","sources":["../../src/workflows/target-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3F;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAC;IACtD,WAAW;IACX,MAAM;IACN,SAAS;IACT,QAAQ;CACT,CAAC,CAAC"}