lastlight-core 0.22.0 → 0.23.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 (103) hide show
  1. package/config/default.yaml +70 -2
  2. package/dist/config/config.d.ts +35 -0
  3. package/dist/config/config.js +152 -3
  4. package/dist/config/config.js.map +1 -1
  5. package/dist/config/repo-config.d.ts +7 -0
  6. package/dist/config/repo-config.js +15 -0
  7. package/dist/config/repo-config.js.map +1 -1
  8. package/dist/connectors/github-webhook.d.ts +17 -0
  9. package/dist/connectors/github-webhook.js +150 -17
  10. package/dist/connectors/github-webhook.js.map +1 -1
  11. package/dist/connectors/types.d.ts +48 -1
  12. package/dist/cron/dependabot-discovery.d.ts +68 -11
  13. package/dist/cron/dependabot-discovery.js +78 -20
  14. package/dist/cron/dependabot-discovery.js.map +1 -1
  15. package/dist/cron/jobs.d.ts +4 -0
  16. package/dist/cron/jobs.js +38 -4
  17. package/dist/cron/jobs.js.map +1 -1
  18. package/dist/cron/review-discovery.d.ts +33 -20
  19. package/dist/cron/review-discovery.js +23 -30
  20. package/dist/cron/review-discovery.js.map +1 -1
  21. package/dist/engine/agent-executor.d.ts +1 -1
  22. package/dist/engine/agent-executor.js +1 -1
  23. package/dist/engine/agent-executor.js.map +1 -1
  24. package/dist/engine/dispatcher.d.ts +98 -1
  25. package/dist/engine/dispatcher.js +248 -231
  26. package/dist/engine/dispatcher.js.map +1 -1
  27. package/dist/engine/executors/shared.d.ts +43 -0
  28. package/dist/engine/executors/shared.js +65 -0
  29. package/dist/engine/executors/shared.js.map +1 -1
  30. package/dist/engine/fix-harvest.d.ts +169 -0
  31. package/dist/engine/fix-harvest.js +345 -0
  32. package/dist/engine/fix-harvest.js.map +1 -0
  33. package/dist/engine/fix-markers.d.ts +184 -0
  34. package/dist/engine/fix-markers.js +329 -0
  35. package/dist/engine/fix-markers.js.map +1 -0
  36. package/dist/engine/fix-scratch.d.ts +76 -0
  37. package/dist/engine/fix-scratch.js +77 -0
  38. package/dist/engine/fix-scratch.js.map +1 -0
  39. package/dist/engine/github/github.d.ts +212 -5
  40. package/dist/engine/github/github.js +481 -54
  41. package/dist/engine/github/github.js.map +1 -1
  42. package/dist/engine/pr-decisions.d.ts +342 -0
  43. package/dist/engine/pr-decisions.js +721 -0
  44. package/dist/engine/pr-decisions.js.map +1 -0
  45. package/dist/engine/pr-escalation.d.ts +152 -0
  46. package/dist/engine/pr-escalation.js +320 -0
  47. package/dist/engine/pr-escalation.js.map +1 -0
  48. package/dist/engine/pr-notes.d.ts +175 -0
  49. package/dist/engine/pr-notes.js +315 -0
  50. package/dist/engine/pr-notes.js.map +1 -0
  51. package/dist/engine/pr-state.d.ts +313 -0
  52. package/dist/engine/pr-state.js +515 -0
  53. package/dist/engine/pr-state.js.map +1 -0
  54. package/dist/engine/review-check.d.ts +200 -0
  55. package/dist/engine/review-check.js +305 -0
  56. package/dist/engine/review-check.js.map +1 -0
  57. package/dist/engine/router.d.ts +27 -0
  58. package/dist/engine/router.js +156 -22
  59. package/dist/engine/router.js.map +1 -1
  60. package/dist/evals-api.d.ts +7 -0
  61. package/dist/evals-api.js +30 -0
  62. package/dist/evals-api.js.map +1 -1
  63. package/dist/index.js +268 -20
  64. package/dist/index.js.map +1 -1
  65. package/dist/sandbox/index.d.ts +13 -0
  66. package/dist/sandbox/index.js +30 -0
  67. package/dist/sandbox/index.js.map +1 -1
  68. package/dist/sandbox/k8s/init-clone.d.ts +5 -0
  69. package/dist/sandbox/k8s/init-clone.js +27 -0
  70. package/dist/sandbox/k8s/init-clone.js.map +1 -1
  71. package/dist/state/execution-store.d.ts +27 -0
  72. package/dist/state/execution-store.js +45 -0
  73. package/dist/state/execution-store.js.map +1 -1
  74. package/dist/state/workflow-run-store.d.ts +73 -0
  75. package/dist/state/workflow-run-store.js +106 -24
  76. package/dist/state/workflow-run-store.js.map +1 -1
  77. package/dist/workflows/pr-scope.d.ts +63 -0
  78. package/dist/workflows/pr-scope.js +113 -0
  79. package/dist/workflows/pr-scope.js.map +1 -0
  80. package/dist/workflows/resume.js +17 -4
  81. package/dist/workflows/resume.js.map +1 -1
  82. package/dist/workflows/simple.d.ts +94 -1
  83. package/dist/workflows/simple.js +206 -3
  84. package/dist/workflows/simple.js.map +1 -1
  85. package/dist/workflows/target-policy.d.ts +0 -12
  86. package/dist/workflows/target-policy.js +9 -15
  87. package/dist/workflows/target-policy.js.map +1 -1
  88. package/package.json +4 -4
  89. package/skills/README.md +11 -5
  90. package/skills/dependency-impact/SKILL.md +83 -0
  91. package/skills/fixing/SKILL.md +194 -0
  92. package/skills/pr-comment/SKILL.md +4 -1
  93. package/skills/pr-review/SKILL.md +26 -9
  94. package/workflows/cron-dependabot-ci-fix.yaml +8 -5
  95. package/workflows/cron-review.yaml +14 -5
  96. package/workflows/dependabot-ci-fix.yaml +86 -2
  97. package/workflows/dependabot-pr-merge.yaml +13 -1
  98. package/workflows/pr-fix.yaml +84 -1
  99. package/workflows/pr-review.yaml +7 -0
  100. package/workflows/prompts/dependabot-ci-fix.md +70 -17
  101. package/workflows/prompts/dependabot-pr-merge.md +209 -81
  102. package/workflows/prompts/diagnose-ci.md +96 -0
  103. package/workflows/prompts/pr-fix.md +63 -4
@@ -29,6 +29,17 @@ export interface GitHubWebhookConfig {
29
29
  * its legacy per-suite behaviour.
30
30
  */
31
31
  getChecksConclusion?: (owner: string, repo: string, ref: string) => Promise<"passing" | "failing" | "pending" | "none">;
32
+ /**
33
+ * The OPERATOR's `review.trigger`, read live.
34
+ *
35
+ * `check_suite.completed` is broadened past dependency PRs — to
36
+ * `pr.checks_settled` — only under `after-checks`, because that is the only
37
+ * mode with a consumer. Emitting is what costs event volume, and a repo that
38
+ * opts itself into `after-checks` under an `eager` operator is covered by the
39
+ * 30-minute `check-prs-awaiting-review` sweep. Unset (standalone unit tests)
40
+ * reads as "not after-checks".
41
+ */
42
+ reviewTrigger?: () => "eager" | "after-checks" | "on-request";
32
43
  }
33
44
  export declare class GitHubWebhookConnector extends EventEmitter implements Connector {
34
45
  readonly name = "github";
@@ -57,6 +68,12 @@ export declare class GitHubWebhookConnector extends EventEmitter implements Conn
57
68
  * genuine event.
58
69
  */
59
70
  private settledConclusion;
71
+ /**
72
+ * Is the operator running `review.trigger: after-checks`? Only then does a
73
+ * settled check suite on a PR neither check-outcome route claimed become a
74
+ * `pr.checks_settled` event; every other mode has no consumer for it.
75
+ */
76
+ private afterChecks;
60
77
  private verifySignature;
61
78
  private normalize;
62
79
  start(): Promise<void>;
@@ -2,6 +2,8 @@ import { EventEmitter } from "events";
2
2
  import { Hono } from "hono";
3
3
  import { createHmac, timingSafeEqual } from "crypto";
4
4
  import { isManagedRepo, setInstallationRepos, addInstallationRepos, removeInstallationRepos, } from "../managed-repos.js";
5
+ /** The check-run name whose "Re-run" button is a review request. */
6
+ const REVIEW_CHECK_NAME = "last-light/review";
5
7
  /**
6
8
  * GitHub webhook actions we skip — these are noisy and never need agent work.
7
9
  *
@@ -11,11 +13,18 @@ import { isManagedRepo, setInstallationRepos, addInstallationRepos, removeInstal
11
13
  * would block merges after a REQUEST_CHANGES + fix-commit cycle (the new
12
14
  * SHA would never get a check posted against it). The handler maps it to
13
15
  * `pr.synchronize` and routes to pr-review.
16
+ *
17
+ * `labeled` left this set in Phase 7: `review.requestLabel` is the real
18
+ * `on-request` mechanism (GitHub App bot users are not selectable in the
19
+ * reviewer picker, so `review_requested` cannot be). Everything that is not a
20
+ * `pull_request` label still falls out of `normalize()` with a null type and is
21
+ * answered `{ filtered: true, reason: "unmapped event" }`, and the router drops
22
+ * every PR label that is not the configured one — so the widening costs a
23
+ * normalize call, not a dispatch.
14
24
  */
15
25
  const IGNORED_ACTIONS = new Set([
16
26
  "deleted",
17
27
  "edited",
18
- "labeled",
19
28
  "unlabeled",
20
29
  "assigned",
21
30
  "unassigned",
@@ -99,7 +108,17 @@ export class GitHubWebhookConnector extends EventEmitter {
99
108
  senderLogin === this.config.botLogin ||
100
109
  senderLogin.endsWith("[bot]");
101
110
  const isPrAttention = eventType === "pull_request" &&
102
- (action === "opened" || action === "synchronize" || action === "reopened");
111
+ (action === "opened" ||
112
+ action === "synchronize" ||
113
+ action === "reopened" ||
114
+ // A draft becoming ready is exactly when a deferred review should
115
+ // fire, so it carries the same exemption as `opened` — which it maps
116
+ // to (07 §7.3). Pairs with `review.skipDraft`.
117
+ action === "ready_for_review");
118
+ // The two new review-request signals. They do NOT get the bot-sender
119
+ // exemption above (a human applies a label or asks for a review), but they
120
+ // DO get the bot-authored-PR filter below — we can never review our own PR.
121
+ const isPrReviewSignal = eventType === "pull_request" && (action === "labeled" || action === "review_requested");
103
122
  // A `check_suite.completed` (CI went red) is always sent by a bot — the
104
123
  // CI app / github-actions[bot] — so it would be dropped by the bot-sender
105
124
  // filter below without this exception. It carries nothing the agent
@@ -118,7 +137,7 @@ export class GitHubWebhookConnector extends EventEmitter {
118
137
  // sender, so a bot `synchronize` on a human-authored PR still flows
119
138
  // through while the bot's own PRs are dropped before any sandbox spawns.
120
139
  const prAuthor = payload.pull_request?.user?.login || "";
121
- const isBotAuthoredPr = isPrAttention &&
140
+ const isBotAuthoredPr = (isPrAttention || isPrReviewSignal) &&
122
141
  (prAuthor === this.config.botLogin || prAuthor.endsWith("[bot]"));
123
142
  if (isBotAuthoredPr) {
124
143
  return c.json({ filtered: true, reason: "bot-authored PR (self-review)" }, 200);
@@ -195,6 +214,19 @@ export class GitHubWebhookConnector extends EventEmitter {
195
214
  return fallback;
196
215
  }
197
216
  }
217
+ /**
218
+ * Is the operator running `review.trigger: after-checks`? Only then does a
219
+ * settled check suite on a PR neither check-outcome route claimed become a
220
+ * `pr.checks_settled` event; every other mode has no consumer for it.
221
+ */
222
+ afterChecks() {
223
+ try {
224
+ return this.config.reviewTrigger?.() === "after-checks";
225
+ }
226
+ catch {
227
+ return false;
228
+ }
229
+ }
198
230
  verifySignature(body, signature) {
199
231
  const expected = "sha256=" + createHmac("sha256", this.config.webhookSecret)
200
232
  .update(body)
@@ -218,6 +250,16 @@ export class GitHubWebhookConnector extends EventEmitter {
218
250
  let labels = [];
219
251
  let issueAuthor;
220
252
  let headSha;
253
+ // The dependency discriminator, CARRIED rather than discarded. The
254
+ // connector has to compute it to decide whether to emit at all; the router
255
+ // used to pay an LLM classifier call to re-guess it from a prose sentence,
256
+ // and got it wrong — see the `pr.checks_failed` case in `engine/router.ts`
257
+ // (09-state-machine.md → D5).
258
+ let isDependencyPr;
259
+ /** `pr.labeled` only — the label just added, for `review.requestLabel`. */
260
+ let addedLabel;
261
+ /** `pr.review_requested` only — who the review was asked of. */
262
+ let requestedReviewer;
221
263
  switch (githubEvent) {
222
264
  case "issues":
223
265
  issueNumber = payload.issue?.number;
@@ -248,6 +290,34 @@ export class GitHubWebhookConnector extends EventEmitter {
248
290
  // reopened: closed-then-reopened PRs deserve a fresh look too.
249
291
  else if (action === "reopened")
250
292
  type = "pr.reopened";
293
+ // A draft marked ready maps to `pr.opened` SEMANTICS — it is the moment
294
+ // the PR first asks to be looked at. This is what un-defers a review
295
+ // `review.skipDraft` held back; without it a PR opened as a draft and
296
+ // later marked ready would get no webhook-driven review at all.
297
+ else if (action === "ready_for_review")
298
+ type = "pr.opened";
299
+ // A label was added. The router drops every label that is not the
300
+ // configured `review.requestLabel`, so this only ever reaches a
301
+ // dispatch when somebody asked for a review by label.
302
+ else if (action === "labeled") {
303
+ const name = payload.label?.name;
304
+ if (typeof name === "string" && name) {
305
+ type = "pr.labeled";
306
+ addedLabel = name;
307
+ }
308
+ }
309
+ // Opportunistic (07 §7.1's caveat): GitHub App bot users are not
310
+ // selectable in the reviewer picker, so `on-request` must NOT depend on
311
+ // this — it costs almost nothing and future-proofs. The router discards
312
+ // a request naming anybody else.
313
+ else if (action === "review_requested") {
314
+ const reviewer = payload.requested_reviewer?.login ??
315
+ (payload.requested_team?.slug ? `team/${payload.requested_team.slug}` : undefined);
316
+ if (reviewer) {
317
+ type = "pr.review_requested";
318
+ requestedReviewer = reviewer;
319
+ }
320
+ }
251
321
  break;
252
322
  case "issue_comment":
253
323
  issueNumber = payload.issue?.number;
@@ -295,8 +365,21 @@ export class GitHubWebhookConnector extends EventEmitter {
295
365
  if (action === "rerequested" || action === "requested_action") {
296
366
  prNumber = payload.check_run?.pull_requests?.[0]?.number;
297
367
  issueNumber = prNumber;
298
- if (prNumber)
299
- type = "pr.synchronize";
368
+ if (prNumber) {
369
+ // Re-running OUR OWN review check is an explicit review request,
370
+ // not "the code changed". That distinction is what makes the
371
+ // `on-request` placeholder check work as advertised: `neutral`
372
+ // never blocks a merge and its Re-run button IS the affordance —
373
+ // but only if pressing it overrides the mode, which `pr.synchronize`
374
+ // (an attention event) would not.
375
+ if (payload.check_run?.name === REVIEW_CHECK_NAME) {
376
+ type = "pr.review_requested";
377
+ requestedReviewer = this.config.botLogin;
378
+ }
379
+ else {
380
+ type = "pr.synchronize";
381
+ }
382
+ }
300
383
  }
301
384
  break;
302
385
  case "check_suite":
@@ -325,15 +408,21 @@ export class GitHubWebhookConnector extends EventEmitter {
325
408
  const headCommit = payload.check_suite?.head_commit;
326
409
  const commitAuthor = headCommit?.author?.name || "";
327
410
  const headBranch = payload.check_suite?.head_branch || "";
328
- // GATE: only a dependency-update PR (Dependabot / Renovate) may kick
329
- // off the red-CI fix path — the exact deterministic check the green
330
- // `pr.checks_passed` path below applies. Without it, EVERY red PR
331
- // (including a human's) reached the router's LLM classifier as the
332
- // sole authority, which misfired human PRs onto `dependabot-ci-fix`
333
- // (a repo-write sandbox run). Commit author OR branch prefix, so a
334
- // squashed/proxied bot commit still matches via its branch.
335
- const isDependencyPr = /^(dependabot|renovate)\[bot\]$/.test(commitAuthor) ||
411
+ // GATE: which red PRs may kick off the fix path at all. Commit author
412
+ // OR branch prefix for the dependency case, so a squashed/proxied bot
413
+ // commit still matches via its branch.
414
+ const isDependency = /^(dependabot|renovate)\[bot\]$/.test(commitAuthor) ||
336
415
  /^(dependabot|renovate)\//.test(headBranch);
416
+ // ...plus a head commit WE pushed. `git-auth.ts` stamps
417
+ // `user.name = <botName>[bot]` on the agent's own commits and the
418
+ // check_suite payload carries the same field, so this is precisely
419
+ // "did my fix work?" — the CI feedback loop `pr-fix` has never had
420
+ // (it could push a fix and never learn whether the build went green,
421
+ // because this event only ever fired for dependency PRs). It stays
422
+ // bounded: it cannot fire for an ordinary human PR the bot has not
423
+ // touched. It is nonetheless the one change here that can increase
424
+ // run volume on non-dependency PRs — watch it after rollout.
425
+ const isOurOwnPush = !!this.config.botLogin && commitAuthor === this.config.botLogin;
337
426
  // Only fire once the PR's checks have FULLY SETTLED red — a repo with
338
427
  // several check-reporting apps completes one suite at a time, and a
339
428
  // failure in one while another is still running should not kick off a
@@ -341,8 +430,8 @@ export class GitHubWebhookConnector extends EventEmitter {
341
430
  // nothing is pending and ≥1 check concluded red, so exactly one event
342
431
  // fires per SHA (the last suite to settle). Absent a wired client
343
432
  // (standalone tests) we keep the legacy per-suite behaviour. Gated
344
- // behind isDependencyPr so a human's red PR never even makes the call.
345
- if (pr?.number && isDependencyPr) {
433
+ // behind the emit check so an untouched human PR never makes the call.
434
+ if (pr?.number && (isDependency || isOurOwnPush)) {
346
435
  const settled = await this.settledConclusion(repoFullName, sha, "failing");
347
436
  if (settled === "failing") {
348
437
  prNumber = pr.number;
@@ -351,6 +440,28 @@ export class GitHubWebhookConnector extends EventEmitter {
351
440
  type = "pr.checks_failed";
352
441
  title = (headCommit?.message || "").split("\n")[0] || title;
353
442
  issueAuthor = commitAuthor || issueAuthor;
443
+ // The router routes on THIS, deterministically: dependency →
444
+ // `dependabot-ci-fix`, everything else → `pr-fix`. Without it a
445
+ // human's red PR would run a dependency-bump prompt, the
446
+ // `dependency-*` label vocabulary and a `requires-human`
447
+ // preflight it was never designed for.
448
+ isDependencyPr = isDependency;
449
+ }
450
+ }
451
+ else if (pr?.number && this.afterChecks()) {
452
+ // FIX OUTRANKS REVIEW (09 → S2). A settled-red PR the fix family can
453
+ // act on has already been claimed above; only what is LEFT becomes a
454
+ // review settle. One envelope per delivery is all `normalize()` can
455
+ // return, so this precedence is not a policy choice bolted on later
456
+ // — it is the shape of the pipeline.
457
+ const settled = await this.settledConclusion(repoFullName, sha, "failing");
458
+ if (settled === "failing" || settled === "passing") {
459
+ prNumber = pr.number;
460
+ issueNumber = prNumber;
461
+ headSha = sha;
462
+ type = "pr.checks_settled";
463
+ title = (headCommit?.message || "").split("\n")[0] || title;
464
+ isDependencyPr = isDependency;
354
465
  }
355
466
  }
356
467
  }
@@ -367,7 +478,7 @@ export class GitHubWebhookConnector extends EventEmitter {
367
478
  const headCommit = payload.check_suite?.head_commit;
368
479
  const commitAuthor = headCommit?.author?.name || "";
369
480
  const headBranch = payload.check_suite?.head_branch || "";
370
- const isDependencyPr = /^(dependabot|renovate)\[bot\]$/.test(commitAuthor) ||
481
+ const isDependency = /^(dependabot|renovate)\[bot\]$/.test(commitAuthor) ||
371
482
  /^(dependabot|renovate)\//.test(headBranch);
372
483
  // Fire ONLY when the head SHA's checks have fully settled green. A
373
484
  // suite going green while sibling suites are still running reports
@@ -375,7 +486,7 @@ export class GitHubWebhookConnector extends EventEmitter {
375
486
  // aggregate to "passing", so exactly one `pr.checks_passed` fires per
376
487
  // SHA instead of one per check-reporting app. (Legacy per-suite
377
488
  // behaviour is preserved when no client is wired — standalone tests.)
378
- if (pr?.number && isDependencyPr) {
489
+ if (pr?.number && isDependency) {
379
490
  const settled = await this.settledConclusion(repoFullName, sha, "passing");
380
491
  if (settled === "passing") {
381
492
  prNumber = pr.number;
@@ -384,6 +495,25 @@ export class GitHubWebhookConnector extends EventEmitter {
384
495
  type = "pr.checks_passed";
385
496
  title = (headCommit?.message || "").split("\n")[0] || title;
386
497
  issueAuthor = commitAuthor || issueAuthor;
498
+ // Always true on this branch (the green route is dependency-only),
499
+ // set for symmetry so the envelope's discriminator is never
500
+ // undefined on a check-outcome event.
501
+ isDependencyPr = true;
502
+ }
503
+ }
504
+ else if (pr?.number && this.afterChecks()) {
505
+ // The green half of the same broadening. A non-dependency PR whose
506
+ // CI has fully settled green is the canonical `after-checks` review:
507
+ // nothing is going to change about this head, and the review can now
508
+ // say so.
509
+ const settled = await this.settledConclusion(repoFullName, sha, "passing");
510
+ if (settled === "passing") {
511
+ prNumber = pr.number;
512
+ issueNumber = prNumber;
513
+ headSha = sha;
514
+ type = "pr.checks_settled";
515
+ title = (headCommit?.message || "").split("\n")[0] || title;
516
+ isDependencyPr = isDependency;
387
517
  }
388
518
  }
389
519
  }
@@ -405,6 +535,9 @@ export class GitHubWebhookConnector extends EventEmitter {
405
535
  issueNumber,
406
536
  prNumber,
407
537
  headSha,
538
+ isDependencyPr,
539
+ addedLabel,
540
+ requestedReviewer,
408
541
  sender,
409
542
  issueAuthor,
410
543
  senderIsBot: false, // already filtered bots above
@@ -1 +1 @@
1
- {"version":3,"file":"github-webhook.js","sourceRoot":"","sources":["../../src/connectors/github-webhook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAErD,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAoC7B;;;;;;;;;GASG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,SAAS;IACT,QAAQ;IACR,SAAS;IACT,WAAW;IACX,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,UAAU;IACV,aAAa;IACb,QAAQ;IACR,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,OAAO,sBAAuB,SAAQ,YAAY;IAC7C,IAAI,GAAG,QAAQ,CAAC;IACjB,GAAG,CAAO;IACV,MAAM,CAAsB;IAEpC,YAAY,MAA2B;QACrC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAC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1E,4EAA4E;QAC5E,sEAAsE;QACtE,qBAAqB;QACrB,OAAO,CAAC,GAAG,CAAC,0DAA0D,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,IAAI;QACR,wCAAwC;IAC1C,CAAC;CACF"}
@@ -23,6 +23,28 @@ export interface EventEnvelope {
23
23
  * dedup guard to skip a PR already assessed at this exact SHA.
24
24
  */
25
25
  headSha?: string;
26
+ /**
27
+ * Is this a dependency-update (Dependabot / Renovate) PR? Set on the
28
+ * check-outcome events, where the connector already computes it — from the
29
+ * head commit's author and the suite's head branch — to decide whether to
30
+ * emit at all.
31
+ *
32
+ * It is carried rather than discarded so the router can route
33
+ * `pr.checks_failed` DETERMINISTICALLY (dependency → `dependabot-ci-fix`,
34
+ * everything else → `pr-fix`) instead of paying a classifier call to
35
+ * re-derive it from a prose sentence. That call could never select `pr-fix`
36
+ * — `pr-fix.yaml` has no `classification:` block — so every red PR resolved
37
+ * to the dependency workflow (09-state-machine.md → D5).
38
+ */
39
+ isDependencyPr?: boolean;
40
+ /** The label just added, on a `pr.labeled` event. */
41
+ addedLabel?: string;
42
+ /**
43
+ * Who the review was requested FROM, on a `pr.review_requested` event — a
44
+ * login, or a `team/<slug>` for a team request. Set to our own `botLogin`
45
+ * when the request arrived as a Re-run on the `last-light/review` check.
46
+ */
47
+ requestedReviewer?: string;
26
48
  /** Login/username of the sender */
27
49
  sender: string;
28
50
  /** Login of the issue/PR original author (distinct from `sender`, the commenter) */
@@ -51,7 +73,32 @@ export interface EventEnvelope {
51
73
  /** Timestamp of the event */
52
74
  timestamp: Date;
53
75
  }
54
- export type EventType = "issue.opened" | "issue.reopened" | "issue.closed" | "pr.opened" | "pr.synchronize" | "pr.reopened" | "pr.closed" | "pr.merged" | "pr.checks_failed" | "pr.checks_passed" | "comment.created" | "pr_review.submitted" | "pr_review_comment.created" | "message";
76
+ export type EventType = "issue.opened" | "issue.reopened" | "issue.closed" | "pr.opened" | "pr.synchronize" | "pr.reopened" | "pr.closed" | "pr.merged" | "pr.checks_failed" | "pr.checks_passed"
77
+ /**
78
+ * The head SHA's checks have SETTLED — either colour — on a PR that neither
79
+ * check-outcome route above claimed.
80
+ *
81
+ * This is `review.trigger: after-checks`'s trigger, and it exists as its own
82
+ * type because a single `check_suite.completed` delivery cannot become two
83
+ * envelopes: `normalize()` returns ONE per delivery and `route()` returns one
84
+ * handler, so "broaden `pr.checks_failed`" is a fan-out the pipeline cannot
85
+ * express (09 → S2). FIX OUTRANKS REVIEW is therefore a property of which
86
+ * type the connector emits: a settled-red PR the fix family can act on stays
87
+ * `pr.checks_failed`, and only what is left becomes this.
88
+ */
89
+ | "pr.checks_settled"
90
+ /**
91
+ * A label was added to a PR. Carries {@link EventEnvelope.addedLabel} so
92
+ * `review.requestLabel` works; the router ignores every other label, which is
93
+ * what keeps this from becoming a firehose.
94
+ */
95
+ | "pr.labeled"
96
+ /**
97
+ * A review was explicitly requested from US — either through GitHub's
98
+ * reviewer picker (opportunistic: App bot users are not generally selectable
99
+ * there) or through the Re-run button on our own `last-light/review` check.
100
+ */
101
+ | "pr.review_requested" | "comment.created" | "pr_review.submitted" | "pr_review_comment.created" | "message";
55
102
  /**
56
103
  * Connector interface — all event sources implement this.
57
104
  * The core engine registers a handler via on('event', ...) and
@@ -36,12 +36,15 @@
36
36
  * `unknown` and kicks off the recompute; both sweeps re-poll it with a
37
37
  * widening backoff (`resolveMergeableState`, issue #204) before giving up.
38
38
  *
39
- * Both sweeps SKIP any PR carrying the `requires-human` label — the terminal
40
- * flag the dependabot prompts apply when Last Light can't proceed automatically
41
- * (a functional merge left for a human, or a CI fix it couldn't complete). That
42
- * stops the nightly crons re-attempting things we already know we can't land.
43
- * The webhooks are NOT label-gated, so a genuinely new bot push is still handled
44
- * live and the success path clears the label.
39
+ * **These are candidate finders, not policy** (09-state-machine.md → S1/S2).
40
+ * They answer "does this PR look like it needs this workflow?" — a fact about
41
+ * the pull request. Whether we may ACT on it (the `requires-human` escalation
42
+ * guard, the attempt counter, the cost cap, the per-SHA dedup, the fork guard)
43
+ * is decided once by `resolvePrState` + `resolveDispatchDisposition` at the
44
+ * `dispatchWorkflow` choke point, which the webhook route crosses too. The
45
+ * `requires-human` filter used to live here AND in the dispatcher, and the two
46
+ * disagreed by construction: the label was a one-way door on the cron side
47
+ * while the webhook cleared it on success. Now there is one answer.
45
48
  */
46
49
  /**
47
50
  * Last Light dependency-PR lifecycle labels. THE single source of truth for
@@ -54,6 +57,31 @@
54
57
  export declare const DEP_TRIVIAL_LABEL = "dependency-trivial";
55
58
  export declare const DEP_FUNCTIONAL_LABEL = "dependency-functional";
56
59
  export declare const REQUIRES_HUMAN_LABEL = "requires-human";
60
+ /**
61
+ * MAJOR-bump impact tiers (issue #252, 05-impact.md §5.4). Additive: the two
62
+ * labels above keep their meaning, because both are load-bearing for discovery
63
+ * — `dependency-functional` + `requires-human` still means "high impact, a
64
+ * human decides", so nothing about the escalated case changed.
65
+ *
66
+ * These say what the trivial/functional pair cannot: WHY a major was safe to
67
+ * land, or why it was not. Exactly one is ever applied at a time; the merge
68
+ * prompt clears the other two in the same idempotent pass.
69
+ *
70
+ * The hex colours are part of the contract — `github_ensure_labels` creates a
71
+ * missing label with them, so a rename here without the same edit in
72
+ * `workflows/prompts/dependabot-pr-merge.md` produces two label vocabularies on
73
+ * the same repo. `tests/cron/label-vocab.test.ts` pins names and colours
74
+ * against that prompt.
75
+ */
76
+ /** Green, matching `dependency-trivial` — a major that reads as trivial. */
77
+ export declare const DEP_MAJOR_LOW_LABEL = "dependency-major-low";
78
+ export declare const DEP_MAJOR_LOW_COLOR = "0e8a16";
79
+ /** Amber, matching `dependency-functional` — landed, but worth a glance. */
80
+ export declare const DEP_MAJOR_MEDIUM_LABEL = "dependency-major-medium";
81
+ export declare const DEP_MAJOR_MEDIUM_COLOR = "fbca04";
82
+ /** Red, matching `requires-human` — never auto-merged. */
83
+ export declare const DEP_MAJOR_HIGH_LABEL = "dependency-major-high";
84
+ export declare const DEP_MAJOR_HIGH_COLOR = "b60205";
57
85
  /** The subset of the harness GitHub client this module needs — keeps it fake-able. */
58
86
  export interface PrDiscoveryClient {
59
87
  listOpenPullRequests(owner: string, repo: string): Promise<Array<{
@@ -68,7 +96,9 @@ export interface PrDiscoveryClient {
68
96
  getPullRequest(owner: string, repo: string, pullNumber: number): Promise<{
69
97
  mergeable_state?: string;
70
98
  }>;
71
- getChecksConclusion(owner: string, repo: string, ref: string): Promise<"passing" | "failing" | "pending" | "none">;
99
+ getChecksConclusion(owner: string, repo: string, ref: string, opts?: {
100
+ excludeApp?: string;
101
+ }): Promise<"passing" | "failing" | "pending" | "none">;
72
102
  }
73
103
  /** Why the red sweep summoned a PR — rendered into the ci-fix prompt as `{{reason}}`. */
74
104
  export type RedReason = "checks-failing" | "behind" | "dirty" | "blocked";
@@ -119,19 +149,46 @@ export interface DiscoverOptions {
119
149
  /** Injectable sleep for the re-poll backoff (default real `setTimeout`); tests
120
150
  * pass a no-op so the poll loop runs without real delay. */
121
151
  sleep?: (ms: number) => Promise<void>;
152
+ /**
153
+ * `dependencies.requireSettledChecks` — when on, the GREEN sweep additionally
154
+ * requires the head SHA's checks to be settled-`passing`, not just
155
+ * `mergeable_state: "clean"`.
156
+ *
157
+ * `clean` alone is not proof: on a repo with **no required status checks** a
158
+ * PR whose checks are FAILING still reports mergeable — the exact hazard the
159
+ * merge prompt documents ("a direct merge would land a RED PR — this has
160
+ * happened"), and the reason the cron's notion of green and the webhook's
161
+ * settle logic must not be allowed to diverge. Costs one extra API call per
162
+ * green candidate, which is why it is config-gated rather than unconditional.
163
+ */
164
+ requireSettledChecks?: boolean;
165
+ /**
166
+ * Our own App slug (`botName`), excluded from every check aggregate here.
167
+ *
168
+ * Both sweeps are TRIGGER-side settle computations, so the uniform rule of
169
+ * 07 §7.2 applies: a `last-light/review` check that is queued or in progress
170
+ * on the head SHA would otherwise report the suite `pending` and strand the
171
+ * PR on both sweeps — the green one because `pending` is not `passing`, the
172
+ * red one because it is not `failing` either.
173
+ */
174
+ botName?: string;
122
175
  }
123
176
  /**
124
177
  * Find every green (`mergeable_state: "clean"`) dependency PR across `repos`
125
- * (`owner/repo` full names), EXCLUDING any carrying the `requires-human` label.
126
- * A cold `unknown` read is re-polled (`resolveMergeableState`) before giving up,
178
+ * (`owner/repo` full names). No `requires-human` filter — that is a POLICY
179
+ * question, answered once at the dispatch gate off the PR-state snapshot (see
180
+ * the module header), which is what lets a maintainer's push re-arm a PR we
181
+ * gave up on. A cold `unknown` read is re-polled (`resolveMergeableState`) before giving up,
127
182
  * so a genuinely-mergeable-but-uncomputed PR isn't stranded for want of a second
128
183
  * read (issue #204). Per-repo failures are logged and skipped, never fatal.
129
184
  */
130
185
  export declare function discoverGreenDependencyPrs(repos: string[], gh: PrDiscoveryClient, opts?: DiscoverOptions): Promise<DependencyPr[]>;
131
186
  /**
132
187
  * Find every RED dependency PR across `repos` (`owner/repo` full names) that
133
- * `dependabot-ci-fix` can act on, EXCLUDING any carrying the `requires-human`
134
- * label. A PR qualifies when its checks are settled-FAILING, OR its
188
+ * `dependabot-ci-fix` can act on. No `requires-human` filter — see
189
+ * `discoverGreenDependencyPrs` and the module header: whether we may act on an
190
+ * escalated PR is decided at the dispatch gate, not here.
191
+ * A PR qualifies when its checks are settled-FAILING, OR its
135
192
  * `mergeable_state` is `behind` / `dirty` / `blocked` (a merge it can't make on
136
193
  * its own but ci-fix can push toward — see `MERGE_BLOCKED_STATES`). Failing CI
137
194
  * takes precedence in the reported `reason` (there's a concrete build to fix).