lastlight-core 0.40.1 → 0.40.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/admin/routes.d.ts +1 -1
  2. package/dist/admin/routes.js +9 -0
  3. package/dist/admin/routes.js.map +1 -1
  4. package/dist/engine/dispatcher.d.ts +1 -1
  5. package/dist/engine/dispatcher.js +14 -0
  6. package/dist/engine/dispatcher.js.map +1 -1
  7. package/dist/engine/github/github.d.ts +18 -9
  8. package/dist/engine/github/github.js +46 -12
  9. package/dist/engine/github/github.js.map +1 -1
  10. package/dist/engine/review-ledger.d.ts +7 -0
  11. package/dist/engine/review-ledger.js +3 -0
  12. package/dist/engine/review-ledger.js.map +1 -1
  13. package/dist/engine/supersede.d.ts +1 -1
  14. package/dist/engine/supersede.js +14 -0
  15. package/dist/engine/supersede.js.map +1 -1
  16. package/dist/state/db.d.ts +1 -0
  17. package/dist/state/db.js +1 -0
  18. package/dist/state/db.js.map +1 -1
  19. package/dist/state/schema/pg.d.ts +17 -0
  20. package/dist/state/schema/pg.js +1 -0
  21. package/dist/state/schema/pg.js.map +1 -1
  22. package/dist/state/schema/sqlite.d.ts +19 -0
  23. package/dist/state/schema/sqlite.js +5 -0
  24. package/dist/state/schema/sqlite.js.map +1 -1
  25. package/dist/state/workflow-run-store.d.ts +52 -2
  26. package/dist/state/workflow-run-store.js +93 -17
  27. package/dist/state/workflow-run-store.js.map +1 -1
  28. package/dist/workflows/handlers/post-review.js +10 -2
  29. package/dist/workflows/handlers/post-review.js.map +1 -1
  30. package/dist/workflows/resume.d.ts +1 -1
  31. package/dist/workflows/resume.js +24 -1
  32. package/dist/workflows/resume.js.map +1 -1
  33. package/dist/workflows/simple.d.ts +1 -1
  34. package/dist/workflows/simple.js +20 -0
  35. package/dist/workflows/simple.js.map +1 -1
  36. package/drizzle/pg/0003_needy_obadiah_stane.sql +1 -0
  37. package/drizzle/pg/meta/0003_snapshot.json +1900 -0
  38. package/drizzle/pg/meta/_journal.json +7 -0
  39. package/drizzle/sqlite/0004_adorable_puck.sql +1 -0
  40. package/drizzle/sqlite/meta/0004_snapshot.json +1732 -0
  41. package/drizzle/sqlite/meta/_journal.json +7 -0
  42. package/package.json +4 -4
  43. package/workflows/dependabot-ci-fix.yaml +4 -1
  44. package/workflows/prompts/dependabot-ci-fix.md +146 -0
@@ -1,6 +1,6 @@
1
1
  import { Hono } from "hono";
2
2
  import type { SessionSource } from "./sessions.js";
3
- import type { StateDb, WorkflowRun } from "../state/db.js";
3
+ import { type StateDb, type WorkflowRun } from "../state/db.js";
4
4
  import type { CronScheduler } from "../cron/scheduler.js";
5
5
  import { type PrPolicyConfig } from "../engine/pr-decisions.js";
6
6
  import type { GitHubClient } from "../engine/github/github.js";
@@ -3,6 +3,7 @@ import { timingSafeEqual, randomBytes, randomUUID } from "node:crypto";
3
3
  import { streamSSE } from "hono/streaming";
4
4
  import { getCookie, setCookie, deleteCookie } from "hono/cookie";
5
5
  import { Slack, GitHub } from "arctic";
6
+ import { foreignEngineMessage, isOwnedRun } from "../state/db.js";
6
7
  import { tailJsonl } from "./tail.js";
7
8
  import { listRunningContainers, killContainer, getContainerStats, getHostStats, listServerContainers, resolveServerContainer, getContainerLogs, streamContainerLogs, } from "./docker.js";
8
9
  import { authMiddleware, createToken, verifyTokenForRefresh, decodeToken, actorFromContext, actorTypeFromContext } from "./auth.js";
@@ -1470,6 +1471,8 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
1470
1471
  if (run.status !== "running" && run.status !== "paused" && run.status !== "queued") {
1471
1472
  return c.json({ error: `cannot cancel a run with status '${run.status}'` }, 400);
1472
1473
  }
1474
+ if (!isOwnedRun(run))
1475
+ return c.json({ error: foreignEngineMessage(run) }, 409);
1473
1476
  // Actor logging (issue #205): the canceller lands on the append-only
1474
1477
  // executions ledger (via the finish error below), never overwriting the
1475
1478
  // run's original `triggered_by`.
@@ -1599,6 +1602,8 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
1599
1602
  if (run.status !== "failed" && run.status !== "cancelled") {
1600
1603
  return c.json({ error: `cannot retry a run with status '${run.status}'` }, 400);
1601
1604
  }
1605
+ if (!isOwnedRun(run))
1606
+ return c.json({ error: foreignEngineMessage(run) }, 409);
1602
1607
  if (!config.retryWorkflow) {
1603
1608
  return c.json({ error: "retry not available (runner not wired)" }, 503);
1604
1609
  }
@@ -2353,6 +2358,10 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
2353
2358
  return c.json({ error: "approval not found" }, 404);
2354
2359
  if (approval.status !== "pending")
2355
2360
  return c.json({ error: `already ${approval.status}` }, 400);
2361
+ // Another engine's gate stays pending for that engine (KNOWN_RUN_ENGINES).
2362
+ const gatedRun = await db.runs.getRun(approval.workflowRunId);
2363
+ if (gatedRun && !isOwnedRun(gatedRun))
2364
+ return c.json({ error: foreignEngineMessage(gatedRun) }, 409);
2356
2365
  // Actor logging (issue #205): attribute the approval to the authenticated
2357
2366
  // user, falling back to `admin` for password/anonymous sessions.
2358
2367
  const actor = actorFromContext(c) ?? "admin";