lastlight-core 0.24.0 → 0.24.2

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 (50) hide show
  1. package/config/default.yaml +24 -0
  2. package/dist/admin/routes.js +9 -1
  3. package/dist/admin/routes.js.map +1 -1
  4. package/dist/config/config.js +5 -0
  5. package/dist/config/config.js.map +1 -1
  6. package/dist/connectors/github-webhook.js +1 -1
  7. package/dist/connectors/github-webhook.js.map +1 -1
  8. package/dist/connectors/index.d.ts +1 -1
  9. package/dist/connectors/index.js +1 -1
  10. package/dist/connectors/index.js.map +1 -1
  11. package/dist/connectors/messaging/index.d.ts +1 -0
  12. package/dist/connectors/messaging/index.js +1 -0
  13. package/dist/connectors/messaging/index.js.map +1 -1
  14. package/dist/connectors/messaging/session-manager.d.ts +32 -1
  15. package/dist/connectors/messaging/session-manager.js +43 -9
  16. package/dist/connectors/messaging/session-manager.js.map +1 -1
  17. package/dist/connectors/messaging/thread-transcript.d.ts +57 -0
  18. package/dist/connectors/messaging/thread-transcript.js +113 -0
  19. package/dist/connectors/messaging/thread-transcript.js.map +1 -0
  20. package/dist/engine/dispatcher.d.ts +1 -1
  21. package/dist/engine/dispatcher.js +28 -3
  22. package/dist/engine/dispatcher.js.map +1 -1
  23. package/dist/engine/github/github.d.ts +40 -0
  24. package/dist/engine/github/github.js +58 -3
  25. package/dist/engine/github/github.js.map +1 -1
  26. package/dist/engine/github/installations.d.ts +19 -1
  27. package/dist/engine/github/installations.js +38 -6
  28. package/dist/engine/github/installations.js.map +1 -1
  29. package/dist/engine/pr-decisions.d.ts +59 -2
  30. package/dist/engine/pr-decisions.js +147 -2
  31. package/dist/engine/pr-decisions.js.map +1 -1
  32. package/dist/engine/pr-state.d.ts +23 -0
  33. package/dist/engine/pr-state.js +23 -6
  34. package/dist/engine/pr-state.js.map +1 -1
  35. package/dist/engine/review-check.d.ts +23 -0
  36. package/dist/engine/review-check.js +51 -13
  37. package/dist/engine/review-check.js.map +1 -1
  38. package/dist/engine/router.js +7 -0
  39. package/dist/engine/router.js.map +1 -1
  40. package/dist/index.js +18 -2
  41. package/dist/index.js.map +1 -1
  42. package/dist/workflows/handlers/post-review.d.ts +55 -0
  43. package/dist/workflows/handlers/post-review.js +104 -9
  44. package/dist/workflows/handlers/post-review.js.map +1 -1
  45. package/package.json +1 -1
  46. package/skills/code-review/SKILL.md +61 -9
  47. package/skills/pr-review/SKILL.md +69 -7
  48. package/skills/pr-review/references/findings-schema.md +1 -1
  49. package/workflows/answer.yaml +24 -3
  50. package/workflows/prompts/classifier.md +1 -1
@@ -52,6 +52,61 @@ export declare class GitHubPostReviewHandler implements PhaseTypeHandler {
52
52
  private readonly reporter;
53
53
  constructor(run: PostReviewRunScope, reporter: PhaseReporter);
54
54
  execute(phase: PhaseDefinition, _node: DagNode, _outputs: Readonly<Record<string, unknown>>): Promise<PhaseOutcome>;
55
+ /**
56
+ * Would this review be a WORD-FOR-WORD repeat of the one we already posted
57
+ * (issue #271)? Returns the summary line to succeed with, or `null` to post.
58
+ *
59
+ * nearform/skillspro#1641 is the case, and it is worth being exact about why
60
+ * the trigger-gate half of #271 does not cover it. Two APPROVEs, six minutes
61
+ * and 400 identical bytes apart, on two head SHAs whose two-dot delta is
62
+ * `package-lock.json` **plus** `package.json` and `jest.config.js` — a force-
63
+ * push amend, materially different by any file-level test, so
64
+ * `resolveReviewTrigger`'s generated-only gate correctly lets it through. The
65
+ * only thing that identifies it as a duplicate is the review text itself, and
66
+ * that is not knowable until the agent has written it.
67
+ *
68
+ * So this saves the DUPLICATE COMMENT, not the money — the run has already
69
+ * happened by the time we get here. It is deliberately the narrowest rule
70
+ * that catches the observed shape:
71
+ *
72
+ * - the same `body`, byte for byte, as our last posted review;
73
+ * - `APPROVE` with **no** inline comments on both sides.
74
+ *
75
+ * The APPROVE restriction is not squeamishness, it is the check run. Skipping
76
+ * the post means `concludeReviewCheck` finds no review at this head and
77
+ * concludes `neutral`. `neutral` and `success` both pass branch protection, so
78
+ * suppressing a duplicate APPROVE changes nothing; suppressing a duplicate
79
+ * CHANGES_REQUESTED would turn a `failure` check into a passing one and open
80
+ * a merge gate the review deliberately closed.
81
+ */
82
+ private repeatOfLastReview;
83
+ /**
84
+ * Has the PR moved on since the SHA this run actually reviewed (issue #271)?
85
+ *
86
+ * Returns the summary line to succeed with when the review should NOT be
87
+ * posted, or `null` to post. Posting a review of a tree that no longer exists
88
+ * spends the maintainer's attention on findings GitHub will immediately mark
89
+ * outdated — nearform/skillspro#1587's churn is full of them.
90
+ *
91
+ * Three conditions, ALL required, because dropping a review is only
92
+ * acceptable when a replacement is guaranteed:
93
+ *
94
+ * 1. **The head really moved.** Any read failure leaves it unknown and posts.
95
+ * 2. **The trigger is automatic.** Under `on-request` nothing re-dispatches on
96
+ * its own, so the human who asked would simply never get an answer.
97
+ * 3. **The delta is MATERIAL** — at least one changed path is not generated.
98
+ * That is exactly `resolveReviewTrigger`'s generated-only gate read the
99
+ * other way round: a material push is one that gate will let through, so a
100
+ * fresh review of the new head is guaranteed; a generated-only push is one
101
+ * it will suppress, and dropping this review would mean the PR gets none at
102
+ * all.
103
+ *
104
+ * Operator-layer `review` config on purpose: this runs in-process against a
105
+ * run whose repo-clamped block isn't threaded here, and the clamp only ever
106
+ * ADDS generated paths — so the operator list is the subset, which resolves
107
+ * more deltas as "material" and therefore drops fewer reviews.
108
+ */
109
+ private staleAgainstCurrentHead;
55
110
  /** Host path of the run's repo checkout — mirrors sandbox/index.ts layout. */
56
111
  private resolveHostRepoDir;
57
112
  /** Build the GitHub client for the post: token+baseUrl in evals, App auth in prod. */
@@ -4,6 +4,7 @@ import { join, resolve } from "node:path";
4
4
  import { GitHubClient } from "../../engine/github/github.js";
5
5
  import { buildReview, buildBodyOnlyReview, parseDiff, } from "../../engine/github/review-poster.js";
6
6
  import { getRuntimeConfig } from "../../config/config.js";
7
+ import { hasMaterialChange } from "../../engine/pr-decisions.js";
7
8
  import { logger } from "../../logging/logger.js";
8
9
  const log = logger("post-review");
9
10
  /**
@@ -132,17 +133,24 @@ export class GitHubPostReviewHandler {
132
133
  let headSha = localHeadSha;
133
134
  if (!headSha)
134
135
  headSha = await github.getPullRequestHeadSha(owner, repo, prNumber).catch(() => undefined);
135
- // Idempotency: skip if a bot review already exists on this head SHA (guards
136
- // resume / re-entry from double-posting).
136
+ // One pass over our review history answers both questions asked below: is
137
+ // there already a review on THIS head (idempotency), and what did we last
138
+ // actually say (the duplicate guard). Both used to be their own paginated
139
+ // `listReviews`.
140
+ let history = { atHead: null, latest: null };
137
141
  if (headSha) {
138
- try {
139
- const existing = await github.getLatestBotReview(owner, repo, prNumber, headSha, getRuntimeConfig()?.botLogin);
140
- if (existing)
141
- return succeed(`already reviewed head ${headSha.slice(0, 7)} (${existing.state})`);
142
- }
143
- catch {
144
- /* best-effort — fall through and attempt the post */
142
+ // Best-effort: a failed read leaves both null, which posts.
143
+ history = await github
144
+ .getBotReviewHistory(owner, repo, prNumber, headSha, getRuntimeConfig()?.botLogin)
145
+ .catch(() => ({ atHead: null, latest: null }));
146
+ // Idempotency: skip if a bot review already exists on this head SHA
147
+ // (guards resume / re-entry from double-posting).
148
+ if (history.atHead) {
149
+ return succeed(`already reviewed head ${headSha.slice(0, 7)} (${history.atHead.state})`);
145
150
  }
151
+ const stale = await this.staleAgainstCurrentHead(github, owner, repo, prNumber, headSha);
152
+ if (stale)
153
+ return succeed(stale);
146
154
  }
147
155
  // Commentable line set from the local checkout diff. Failure → null → all
148
156
  // findings demoted to the body (the review still posts). Gated on a local
@@ -157,6 +165,11 @@ export class GitHubPostReviewHandler {
157
165
  if (!commentable)
158
166
  commentable = await this.apiCommentableDiff(github, owner, repo, prNumber);
159
167
  const review = buildReview(doc, commentable);
168
+ const repeat = this.repeatOfLastReview(history.latest, review);
169
+ if (repeat) {
170
+ log.info("Skipping a duplicate review post", { repo: `${owner}/${repo}`, prNumber, summary: repeat });
171
+ return succeed(repeat);
172
+ }
160
173
  try {
161
174
  await github.createPullRequestReview(owner, repo, prNumber, {
162
175
  body: review.body,
@@ -186,6 +199,88 @@ export class GitHubPostReviewHandler {
186
199
  }
187
200
  }
188
201
  }
202
+ /**
203
+ * Would this review be a WORD-FOR-WORD repeat of the one we already posted
204
+ * (issue #271)? Returns the summary line to succeed with, or `null` to post.
205
+ *
206
+ * nearform/skillspro#1641 is the case, and it is worth being exact about why
207
+ * the trigger-gate half of #271 does not cover it. Two APPROVEs, six minutes
208
+ * and 400 identical bytes apart, on two head SHAs whose two-dot delta is
209
+ * `package-lock.json` **plus** `package.json` and `jest.config.js` — a force-
210
+ * push amend, materially different by any file-level test, so
211
+ * `resolveReviewTrigger`'s generated-only gate correctly lets it through. The
212
+ * only thing that identifies it as a duplicate is the review text itself, and
213
+ * that is not knowable until the agent has written it.
214
+ *
215
+ * So this saves the DUPLICATE COMMENT, not the money — the run has already
216
+ * happened by the time we get here. It is deliberately the narrowest rule
217
+ * that catches the observed shape:
218
+ *
219
+ * - the same `body`, byte for byte, as our last posted review;
220
+ * - `APPROVE` with **no** inline comments on both sides.
221
+ *
222
+ * The APPROVE restriction is not squeamishness, it is the check run. Skipping
223
+ * the post means `concludeReviewCheck` finds no review at this head and
224
+ * concludes `neutral`. `neutral` and `success` both pass branch protection, so
225
+ * suppressing a duplicate APPROVE changes nothing; suppressing a duplicate
226
+ * CHANGES_REQUESTED would turn a `failure` check into a passing one and open
227
+ * a merge gate the review deliberately closed.
228
+ */
229
+ repeatOfLastReview(last, review) {
230
+ if (review.event !== "APPROVE" || review.comments.length > 0)
231
+ return null;
232
+ if (!last || last.state !== "APPROVED" || last.body !== review.body)
233
+ return null;
234
+ return `duplicate: this APPROVE is word-for-word the one we posted on ${last.sha.slice(0, 7)}`;
235
+ }
236
+ /**
237
+ * Has the PR moved on since the SHA this run actually reviewed (issue #271)?
238
+ *
239
+ * Returns the summary line to succeed with when the review should NOT be
240
+ * posted, or `null` to post. Posting a review of a tree that no longer exists
241
+ * spends the maintainer's attention on findings GitHub will immediately mark
242
+ * outdated — nearform/skillspro#1587's churn is full of them.
243
+ *
244
+ * Three conditions, ALL required, because dropping a review is only
245
+ * acceptable when a replacement is guaranteed:
246
+ *
247
+ * 1. **The head really moved.** Any read failure leaves it unknown and posts.
248
+ * 2. **The trigger is automatic.** Under `on-request` nothing re-dispatches on
249
+ * its own, so the human who asked would simply never get an answer.
250
+ * 3. **The delta is MATERIAL** — at least one changed path is not generated.
251
+ * That is exactly `resolveReviewTrigger`'s generated-only gate read the
252
+ * other way round: a material push is one that gate will let through, so a
253
+ * fresh review of the new head is guaranteed; a generated-only push is one
254
+ * it will suppress, and dropping this review would mean the PR gets none at
255
+ * all.
256
+ *
257
+ * Operator-layer `review` config on purpose: this runs in-process against a
258
+ * run whose repo-clamped block isn't threaded here, and the clamp only ever
259
+ * ADDS generated paths — so the operator list is the subset, which resolves
260
+ * more deltas as "material" and therefore drops fewer reviews.
261
+ */
262
+ async staleAgainstCurrentHead(github, owner, repo, prNumber, reviewedSha) {
263
+ const review = getRuntimeConfig()?.review;
264
+ if (!review || review.trigger === "on-request")
265
+ return null;
266
+ const currentSha = await github.getPullRequestHeadSha(owner, repo, prNumber).catch(() => undefined);
267
+ if (!currentSha || currentSha === reviewedSha)
268
+ return null;
269
+ const changed = await github
270
+ .getChangedPathsBetween(owner, repo, reviewedSha, currentSha)
271
+ .catch((err) => {
272
+ log.warn("Could not compare the reviewed head with the current one; posting anyway", { err });
273
+ return null;
274
+ });
275
+ // `null` (degraded/truncated) and `[]` both mean "no material change proven",
276
+ // so both post — the same fail-open direction the trigger gate takes.
277
+ if (!hasMaterialChange(changed, review.generatedPaths))
278
+ return null;
279
+ const summary = `stale: reviewed ${reviewedSha.slice(0, 7)} but the head is now ${currentSha.slice(0, 7)}; ` +
280
+ `a review of the new head will be dispatched instead`;
281
+ log.info("Skipping a stale review post", { repo: `${owner}/${repo}`, prNumber, summary });
282
+ return summary;
283
+ }
189
284
  /** Host path of the run's repo checkout — mirrors sandbox/index.ts layout. */
190
285
  resolveHostRepoDir(repo) {
191
286
  const config = this.run.config;
@@ -1 +1 @@
1
- {"version":3,"file":"post-review.js","sourceRoot":"","sources":["../../../src/workflows/handlers/post-review.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,SAAS,GAEV,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,GAAG,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAuBlC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,yBAAyB,CAAC,SAAwC;IAChF,MAAM,OAAO,GAAG,SAAS,CAAC,gBAAgB,CAAC;IAC3C,IAAI,OAAO,EAAE,CAAC;QACZ,mEAAmE;QACnE,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,iBAAiB,CAAC;QACpF,OAAO,YAAY,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IACD,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAC/B,IAAI,GAAG,EAAE,SAAS;QAAE,OAAO,IAAI,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC3D,IAAI,GAAG,EAAE,WAAW;QAAE,OAAO,YAAY,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACrE,gFAAgF;IAChF,OAAO,IAAI,YAAY,CAAC;QACtB,KAAK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HANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lastlight-core",
3
- "version": "0.24.0",
3
+ "version": "0.24.2",
4
4
  "description": "GitHub repository maintenance agent — Agent SDK harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: code-review
3
- description: The shared rubric for reviewing a code change — precision-first, high-signal findings only (Critical/Important), plus what to check (correctness, security, edge cases, regression risk, test coverage). Use when reviewing a PR or a branch diff.
4
- version: 2.0.0
3
+ description: The shared rubric for reviewing a code change — precision-first, high-signal findings only (Critical/Important), plus what to check (correctness, contracts between producer and consumer, security, edge cases, regression risk, test coverage). Use when reviewing a PR or a branch diff.
4
+ version: 2.1.0
5
5
  tags: [review, code-quality]
6
6
  ---
7
7
 
@@ -29,10 +29,36 @@ the bar is **high-signal only**:
29
29
  - **If you cannot name the concrete impact — what breaks, and for which input or
30
30
  caller — do not post it.** "This could be cleaner" is not a finding; "this
31
31
  crashes when `items` is empty because line 42 indexes `[0]`" is.
32
- - **Confidence gate.** Before you finalise, re-read each finding against the
33
- actual code and try to *refute your own claim*. If you can't defend it against
34
- what the code actually does (not what you assumed), drop it. A missed marginal
35
- issue costs far less than a wrong one.
32
+ - **Confidence gate — refute, don't doubt.** Before you finalise, re-read each
33
+ finding against the actual code and try to *refute your own claim*. Dropping
34
+ it requires naming the specific thing that makes it wrong: the guard you
35
+ missed, the caller that already validates, the type that makes the case
36
+ unreachable. **Unease is not a refutation.** "I'm not certain" is an
37
+ instruction to go and read the other side of the contract, not to delete the
38
+ finding.
39
+
40
+ ### The gate cuts both ways
41
+
42
+ The gate above exists to stop *speculative* findings. It is not a reason to
43
+ approve a change you have not actually checked. Two failure modes, equally bad:
44
+
45
+ | Failure | What it looks like | Cost |
46
+ |---|---|---|
47
+ | **Noise** | posting a worry you can't ground in the code | the review gets muted |
48
+ | **Rubber-stamping** | an APPROVE with no findings on a change you only skimmed | the bug ships, and the approval is the thing that let it |
49
+
50
+ An **empty APPROVE is a positive claim**: "I checked this and found nothing."
51
+ Only make it when you did the work below — read each changed file in context and
52
+ checked the consumers of everything whose contract moved. A review that
53
+ approves every PR carries exactly as much information as no review at all.
54
+
55
+ Severity decides how hard you must work to refute, not how sure you must feel:
56
+
57
+ - **Critical-tier claims** (contract mismatch, data loss, security, breaking
58
+ change) — go and *read the other side* before dropping it. The refutation has
59
+ to come from the consumer's code, not from an assumption about it.
60
+ - **Important-tier claims** — one careful re-read against the diff is enough.
61
+ - **Below the bar** — drop it, as above.
36
62
 
37
63
  ## Finding tiers
38
64
 
@@ -59,6 +85,19 @@ what makes a comment actionable rather than a vague worry.
59
85
  input the code doesn't support is a correctness bug, not graceful handling** —
60
86
  flag any unsupported case that is silently defaulted, skipped, or omitted
61
87
  instead of warned-and-skipped or warned-and-surfaced.
88
+ - **Contracts — check the other side. Mandatory, not optional.** Whenever the
89
+ diff changes what a unit *produces or accepts* — a return shape, a field name,
90
+ an enum value, an event payload, a header, a status code, a units/format
91
+ convention, a nullability, an ordering guarantee — **grep for the consumers
92
+ and read them**, including consumers the diff does not touch. Then state the
93
+ two sides explicitly to yourself: *producer now emits X; consumer at
94
+ `path:line` still reads Y*. A mismatch is **Critical** and it is the single
95
+ highest-value thing a reviewer catches, because it is invisible in the diff:
96
+ each side looks correct alone. Do the same for a value that has to be enforced
97
+ in more than one place (a limit, an expiry, a max-age, an auth check) — a
98
+ constant defined client-side and never checked server-side is not enforced at
99
+ all. If the change spans modules and you have *not* opened the other side, you
100
+ have not finished the review.
62
101
  - **Edge cases** — empty/null inputs, boundaries, error paths, concurrency.
63
102
  - **Security** — injection, auth/authorization, secret handling, untrusted input.
64
103
  - **Complexity** — flag functions past ~15 cyclomatic complexity or that mix
@@ -70,7 +109,12 @@ what makes a comment actionable rather than a vague worry.
70
109
  silence the compiler or to bypass a validator the same code path defines.
71
110
  - **Regression risk** — existing callers of changed functions; behaviour changes
72
111
  that ripple.
73
- - **Test coverage** — do the tests exercise the real risk, or just the happy path?
112
+ - **Test coverage** — do the tests exercise the real risk, or just the happy
113
+ path? **A test that asserts the buggy behaviour is not a fix — it is the bug,
114
+ pinned.** If you raised a finding and the change adds a test that encodes the
115
+ wrong answer as the expected one, the finding still stands and the test is a
116
+ second, worse finding: it makes the bug look deliberate to the next reader.
117
+ Say so explicitly, quoting the assertion.
74
118
  - **Fit** — does it match the codebase's existing patterns and conventions?
75
119
 
76
120
  ## Calibration
@@ -78,5 +122,13 @@ what makes a comment actionable rather than a vague worry.
78
122
  - Don't nitpick generated files (lockfiles, compiled assets).
79
123
  - Don't repeat what linters/CI already catch.
80
124
  - Don't block over style preferences alone.
81
- - Read the room: if a human reviewer already approved, lower the bar for blocking
82
- — prefer a comment over requesting changes on non-critical findings.
125
+ - Read the room, in **both** directions:
126
+ - a human reviewer already **approved** → lower the bar for blocking; prefer a
127
+ comment over requesting changes on non-critical findings;
128
+ - a human reviewer has an **open `CHANGES_REQUESTED`** (not dismissed, not
129
+ superseded by a later approval from the same person) → **raise** the bar for
130
+ approving. Somebody with more context than you has said this is not ready.
131
+ Never post an APPROVE over the top of it: a bot approval sitting above an
132
+ open human block reads as a second opinion overruling the first. Post a
133
+ COMMENT instead, and say which of their concerns the current diff does and
134
+ does not address.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: pr-review
3
3
  description: Review a GitHub pull request and post one formal review — advance the existing discussion and give precision-first, high-signal feedback. A pure code review — no building. Use when asked to review a PR or on a cron PR scan.
4
- version: 7.1.0
4
+ version: 7.2.0
5
5
  tags: [github, review, code-quality]
6
6
  ---
7
7
 
@@ -60,7 +60,45 @@ A review advances the conversation, don't restart it. Fetch and absorb:
60
60
  `github_list_pull_request_review_comments`. Done when you can say: which findings
61
61
  were already raised (don't repeat them), which threads the author resolved
62
62
  (treat as done unless the fix is wrong), which are still open (surface those —
63
- higher signal than a fresh nit), and whether a human already approved.
63
+ higher signal than a fresh nit), and what the humans' review states are.
64
+
65
+ **Two states change what you're allowed to conclude:**
66
+
67
+ - A **human APPROVE** lowers the bar for blocking — prefer COMMENT over
68
+ REQUEST_CHANGES on anything non-critical.
69
+ - An **open human `CHANGES_REQUESTED`** (their latest review on this PR, not
70
+ dismissed and not replaced by a later APPROVE from the same person) means your
71
+ `event` **must not be `APPROVE`** — use `COMMENT`, or `REQUEST_CHANGES` if you
72
+ have your own blocking finding. Say in the summary which of their points the
73
+ current diff addresses and which it doesn't. A bot APPROVE stacked on top of
74
+ an open human block is the review reading as an override of a person who knows
75
+ the codebase better than you.
76
+
77
+ ### 2b. If you have reviewed this PR before — re-derive, don't assume
78
+
79
+ You have already reviewed this PR whenever §2 turned up a `last-light[bot]`
80
+ review at an earlier SHA. A re-review is **not** "what's new since last time";
81
+ it is a fresh verdict on the whole current diff, and the prior findings are its
82
+ starting point rather than settled history.
83
+
84
+ For **every** finding in your previous review, work out which of these it is and
85
+ say so in the summary:
86
+
87
+ - **Fixed** — you re-read the code at `path:line` *as it is now* and the problem
88
+ is genuinely gone. Not "the author replied that they fixed it", not "the
89
+ thread is resolved", not "a commit message says so". Re-read it.
90
+ - **Still open** — re-raise it as a finding. A finding that survives a round trip
91
+ is higher signal than anything new you might find, not lower.
92
+ - **Pinned by a test** — the change added or edited a test that asserts the
93
+ *current, wrong* behaviour. That is not a fix; it is the bug made permanent.
94
+ Re-raise the original finding and flag the test as its own Critical/Important
95
+ finding, quoting the assertion.
96
+ - **Withdrawn** — you now believe the finding was wrong. Name what refuted it.
97
+
98
+ Only once every prior finding lands in one of those four may you approve.
99
+ "Nothing new since the last push" is not a review; if the current diff still
100
+ contains a problem you raised, the correct `event` is still
101
+ `REQUEST_CHANGES`/`COMMENT`, whoever pushed last.
64
102
 
65
103
  ### 3. Get the diff
66
104
 
@@ -91,7 +129,8 @@ speculate about whether this builds.**
91
129
  ### 5. Assess and write your findings
92
130
 
93
131
  Apply the **code-review** skill's rubric — read each changed file in context;
94
- check correctness / edge-cases / security / regression-risk / test-coverage.
132
+ check correctness / **contracts** / edge-cases / security / regression-risk /
133
+ test-coverage.
95
134
  Reason about the code statically; **don't build or run it** — CI is the build
96
135
  gate and it has already spoken (§4); spend your effort on what a human reviewer
97
136
  sees.
@@ -99,10 +138,24 @@ Follow that skill's **precision-first** rule: keep **only Critical and Important
99
138
  findings, each anchored to a `path:line` with a one-line concrete impact (what
100
139
  breaks, for which input or caller). Drop Suggestions and Nits.
101
140
 
141
+ **Do the cross-file pass before you decide anything.** For every unit the diff
142
+ changed the *shape* of — return value, field name, enum, event payload, status
143
+ code, header, units, nullability, ordering — grep the repo for its consumers and
144
+ open them, including ones the diff doesn't touch. Then state both halves:
145
+ *producer now emits X; consumer at `path:line` still reads Y*. Same for a rule
146
+ that has to hold on more than one side (a limit, an expiry/max-age, an auth
147
+ check): a value the client sets and the server never verifies is not enforced.
148
+ These mismatches are invisible in the diff — each file reads fine alone — and
149
+ they are the findings a human most needs from you.
150
+
102
151
  Before writing anything, run the **confidence gate**: re-read each finding
103
- against the actual code and try to refute it; drop any you can't defend against
104
- what the code really does. A clean PR should be approved with few or no
105
- findings — that is a good review, not a lazy one.
152
+ against the actual code and try to refute it. Dropping one requires naming what
153
+ refutes it — the guard, the validating caller, the unreachable type. Being
154
+ unsure about a Critical-tier claim means *go read the other side*, not delete it.
155
+
156
+ A clean PR approved with no findings is a good review — **when it is clean.**
157
+ An empty `APPROVE` is you claiming you did the cross-file pass above and found
158
+ nothing, so only write one when that is true.
106
159
 
107
160
  **Do not call `github_create_pull_request_review` (or any review-submitting
108
161
  tool).** Write your findings to `.lastlight/pr-review/findings.json` instead. A
@@ -147,7 +200,16 @@ Rules:
147
200
  nothing else; GitHub renders it as an applyable suggestion.
148
201
  - `event` is `APPROVE` / `REQUEST_CHANGES` / `COMMENT`, matching what survived
149
202
  the gate. A clean PR is an `APPROVE` with an empty `findings` array and a short
150
- `summary`.
203
+ `summary`. Two hard constraints on it:
204
+ - **Never `APPROVE` over an open human `CHANGES_REQUESTED`** (§2) — downgrade
205
+ to `COMMENT`.
206
+ - **Never `APPROVE` while one of your own prior findings is still open** (§2b)
207
+ — including one the change only "fixed" by adding a test that asserts the
208
+ broken behaviour.
209
+ - On a re-review, the `summary` opens with the prior-findings ledger from §2b —
210
+ one line per earlier finding, each marked fixed / still open / pinned by a test
211
+ / withdrawn. That is what makes the second review worth its cost; a re-review
212
+ whose summary is interchangeable with the first one had nothing to say.
151
213
  - Create the dir and keep the file out of git first:
152
214
  `mkdir -p .lastlight/pr-review && echo '.lastlight/' >> .git/info/exclude`.
153
215
 
@@ -23,7 +23,7 @@ how you submit.
23
23
  |---|---|---|---|
24
24
  | `skip` | boolean | no | `true` → you decided not to review (bot-authored / merged / already reviewed at head). The action posts nothing. |
25
25
  | `summary` | string | yes | One or two sentences on what the PR does + your overall assessment. Becomes the review body. |
26
- | `event` | string | yes | `APPROVE` \| `REQUEST_CHANGES` \| `COMMENT`. A clean PR is `APPROVE` with an empty `findings` array. |
26
+ | `event` | string | yes | `APPROVE` \| `REQUEST_CHANGES` \| `COMMENT`. A clean PR is `APPROVE` with an empty `findings` array — but never `APPROVE` over an open human `CHANGES_REQUESTED`, or while one of your own prior findings is still open (SKILL.md §2/§2b). |
27
27
  | `findings` | array | yes | The surviving Critical/Important findings (may be empty). |
28
28
 
29
29
  ## Finding object
@@ -3,10 +3,26 @@ name: answer
3
3
  classification:
4
4
  intent: question
5
5
  description: |
6
- QUESTION — The user is asking a substantive INFORMATIONAL question that warrants research to answer well: "how does X work?", "what's the difference between X and Y?", "how does <repo> compare to <other tool>?", "is it possible to do Z?", "why does X happen?". The deliverable is an ANSWER, not code and not a spec. QUESTION is for real questions that benefit from reading docs/code or searching the web — NOT casual chat, thanks, or one-word replies (those stay CHAT). EXPLORE shapes a NEW idea into a spec; QUESTION answers an EXISTING question about how something works or compares.
6
+ QUESTION — A substantive informational question whose answer needs research the CHAT path cannot do. The deliverable is an ANSWER, not code and not a spec. Exactly two things qualify it:
7
+ (a) THE WEB — comparisons against other tools or products, upstream/third-party documentation, current external facts, anything outside the repo.
8
+ (b) REAL EXPLORATION OF A CHECKOUT — tracing a behaviour across many files, following call paths, reading build/test/config output, "why does X actually happen?" where finding out means grepping around the tree rather than opening a file or two.
9
+ Chat already reads GitHub directly: repo metadata, issues and their comments, pull requests AND their diffs, file contents, commit history, and both code and issue search. A question answerable from those reads is CHAT — even when it names a repo, and even when it is a serious technical question. Naming a repo is not evidence a question is heavy; needing the web or a checkout is.
10
+ This downgrade applies to CHAT/SLACK MESSAGES ONLY, where a chat path exists to catch it. A newly-opened GitHub ISSUE that asks a question is always QUESTION: an issue has no chat surface, and the alternative is silently triaging a question as a work item.
11
+ EXPLORE shapes a NEW idea into a spec; QUESTION answers an EXISTING question that needs research beyond a few file reads.
7
12
  examples:
13
+ # (a) the web — no amount of repo reading answers this.
8
14
  - '"how does cliftonc/lastlight compare to Vercel''s Eve framework?" → INTENT: QUESTION, REPO: cliftonc/lastlight, ISSUE: NONE, REASON: NONE'
9
- - '"what''s the difference between a sandbox phase and a chat session in cliftonc/lastlight?" → INTENT: QUESTION, REPO: cliftonc/lastlight, ISSUE: NONE, REASON: NONE'
15
+ # (b) a checkout — "actually" / "trace it" is asking for the code path, not a file.
16
+ - '"why does the dependency cron sometimes skip a PR in cliftonc/lastlight? trace it through the code" → INTENT: QUESTION, REPO: cliftonc/lastlight, ISSUE: NONE, REASON: NONE'
17
+ # Counter-examples: serious, repo-scoped, and answerable from chat''s own
18
+ # GitHub reads. These are the ones that used to burn a sandbox.
19
+ - '"what does the pr-review workflow do in cliftonc/lastlight?" → INTENT: CHAT, REPO: cliftonc/lastlight, ISSUE: NONE, REASON: NONE'
20
+ - '"what changed in cliftonc/lastlight#273?" → INTENT: CHAT, REPO: cliftonc/lastlight, ISSUE: 273, REASON: NONE'
21
+ - '"why was cliftonc/lastlight#40 closed?" → INTENT: CHAT, REPO: cliftonc/lastlight, ISSUE: 40, REASON: NONE'
22
+ # The GitHub carve-out, deliberately near-identical to the CHAT
23
+ # counter-example above: on an ISSUE there is no chat to downgrade TO, and
24
+ # the alternative is triaging a question as a work item.
25
+ - '"what does the pr-review workflow actually do?" with ISSUE TITLE "Question: what does pr-review do?" → INTENT: QUESTION, REPO: NONE, ISSUE: NONE, REASON: NONE'
10
26
  description: |
11
27
  Answer a question issue directly. Used when a newly-opened issue asks for
12
28
  information, an explanation, or a comparison rather than a code change — the
@@ -22,7 +38,12 @@ description: |
22
38
 
23
39
  Triggered by:
24
40
  - issue.opened webhook when the router classifies the issue as a question
25
- - a Slack message classified as a question against a managed repo
41
+ - a Slack message classified as a question against a managed repo — only
42
+ one chat cannot answer itself; see the `classification:` block above.
43
+ Chat reads GitHub directly (issues, PR diffs, file contents, code
44
+ search), so this workflow's edge is the WEB (`web_search: true`) and a
45
+ real checkout to explore. A question needing neither is CHAT, which
46
+ answers in-process in seconds instead of provisioning a sandbox.
26
47
  - manual override via routes.github.issue_answer / routes.slack.answer
27
48
 
28
49
  phases:
@@ -16,7 +16,7 @@ message has no clear action verb. Presence of "security review", "triage", "revi
16
16
  "scan for vulnerabilities", etc. makes the intent unambiguous regardless of politeness.
17
17
 
18
18
  When ambiguous between EXPLORE and CHAT, prefer CHAT. Only pick EXPLORE when the user is explicitly asking for brainstorming / spec-shaping / design exploration — OR gives a bare "explore"/"explore this" command (see the issue-reply rule below), which is unambiguous, not chat.
19
- When ambiguous between QUESTION and CHAT, prefer CHAT — only pick QUESTION for a substantive informational question that genuinely benefits from research (reading docs/code or a web search). Casual conversation, greetings, thanks, and trivial one-liners stay CHAT.
19
+ When ambiguous between QUESTION and CHAT, prefer CHAT. The test is CAPABILITY, not seriousness: pick QUESTION only when answering needs the WEB or real exploration of a repo checkout. CHAT can already read repos, issues, comments, pull requests and their diffs, file contents, commit history, and search code — so a question answerable from those reads is CHAT even when it names a repo and even when it is technical. Casual conversation, greetings, thanks, and trivial one-liners are of course CHAT too. (A newly-opened GitHub ISSUE that asks a question is the exception — there is no chat surface on an issue, so it stays QUESTION.)
20
20
  When ambiguous between BUILD and CHAT, prefer CHAT.
21
21
  When ambiguous between VERIFY/QATEST and REVIEW/CHAT, prefer the existing category — only pick VERIFY or QATEST when the user explicitly asks you to test, run, confirm, or exercise a behaviour/flow.
22
22
  When ambiguous between DEMO and VERIFY/QATEST, prefer the existing category — only pick DEMO when the user explicitly asks for a video, a recording, or to "demo"/"show" the feature.