lastlight-core 0.18.1 → 0.18.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lastlight-core",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "description": "GitHub repository maintenance agent — Agent SDK harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -63,9 +63,9 @@
63
63
  "octokit": "^5.0.5",
64
64
  "yaml": "^2.8.3",
65
65
  "zod": "^4.3.6",
66
+ "lastlight-workflow-engine": "0.1.0",
66
67
  "lastlight-shared": "0.1.0",
67
- "agentic-pi": "0.2.18",
68
- "lastlight-workflow-engine": "0.1.0"
68
+ "agentic-pi": "0.2.18"
69
69
  },
70
70
  "devDependencies": {
71
71
  "@types/better-sqlite3": "^7.6.0",
@@ -30,8 +30,11 @@ phases:
30
30
  # Single phase. Runs under this workflow's repo-write profile, so agentic-pi's
31
31
  # `github_enable_auto_merge` tool is available. Conservative by design: enable
32
32
  # auto-merge ONLY for trivial, non-functional dependency bumps; anything with
33
- # runtime-logic impact is left for a human. No repo checkout — the agent reads
34
- # each diff via the `github_get_pull_request_diff` tool.
33
+ # runtime-logic impact is left for a human. No repo checkout — the agent
34
+ # inspects each PR via `github_list_pull_request_files` (file list + line
35
+ # counts) and skips lockfile diffs, only pulling `github_get_pull_request_diff`
36
+ # for a small non-lockfile source change. Reading full lockfile diffs used to
37
+ # overflow the model context in scan mode; see prompts/dependabot-pr-merge.md.
35
38
  - name: assess
36
39
  label: Assess & maybe auto-merge
37
40
  prompt: prompts/dependabot-pr-merge.md
@@ -1,7 +1,9 @@
1
- You assess **green** dependency-update PRs (Dependabot / Renovate) and enable
2
- GitHub auto-merge for the ones whose change is trivial and safe. You never push
3
- code and you never merge directly — you only *enable auto-merge*, which GitHub
4
- honours once the required checks pass (and refuses on a red or still-running PR).
1
+ You assess **green** dependency-update PRs (Dependabot / Renovate) and land the
2
+ ones whose change is trivial and safe. You never push code. You prefer to
3
+ *enable auto-merge* — which GitHub honours once the required checks pass, and
4
+ refuses on a red or still-running PR — and merge directly only in the one narrow
5
+ case where GitHub rejects auto-merge because the PR is already mergeable with no
6
+ checks to wait on (see STEP 3).
5
7
 
6
8
  You are working against `{{owner}}/{{repo}}`. Interact with GitHub through the
7
9
  `github_*` tools only — there is no local checkout.
@@ -20,15 +22,38 @@ STEP 0 — Find candidate PRs.
20
22
  List open PRs with `github_list_pull_requests` ({ owner: "{{owner}}",
21
23
  repo: "{{repo}}", state: "open" }). Keep only those authored by a dependency
22
24
  bot — `user.login` is `dependabot[bot]` or `renovate[bot]` (or a title like
23
- "Bump …", "chore(deps): …", "Update … requirement"). Skip drafts. Then run the
24
- procedure below for EACH candidate PR. If there are none, say so and stop.
25
+ "Bump …", "chore(deps): …", "Update … requirement"). Skip drafts. Assess at
26
+ most 10 candidates in one run, oldest first; if there are more, say so and stop
27
+ — the daily cron scan picks up the rest next tick. If there are none, say so and
28
+ stop.
25
29
  {{/if}}
26
30
 
27
31
  For each PR you assess (call it `pull_number`):
28
32
 
29
- STEP 1 — Inspect the change.
30
- Read the full diff with `github_get_pull_request_diff` ({ owner: "{{owner}}",
31
- repo: "{{repo}}", pull_number }). Apply the **code-review** skill's rubric.
33
+ STEP 1 — Inspect the change WITHOUT pulling giant diffs.
34
+ Dependency PRs are dominated by lockfile churn (`package-lock.json`,
35
+ `pnpm-lock.yaml`, `yarn.lock`, `Cargo.lock`, `go.sum`, …). A single lockfile diff
36
+ can run to tens of thousands of lines — reading it burns the whole context
37
+ window, and on repos with several open bumps it has overflowed the model outright
38
+ (the run then dies mid-assessment). So NEVER call `github_get_pull_request_diff`
39
+ as your first move. Inspect in tiers instead:
40
+
41
+ a. Call `github_list_pull_request_files` ({ owner: "{{owner}}", repo: "{{repo}}",
42
+ pull_number }) to get the changed files with per-file `additions`/`deletions`.
43
+ This file list — plus the PR title — is your primary signal.
44
+ b. A lockfile / `go.sum` change is expected noise for a version bump. NEVER read
45
+ its diff; judge the bump from the PR title and the manifest change alone.
46
+ c. If the only NON-lockfile files touched are the manifest (`package.json`,
47
+ `pyproject.toml`, `go.mod`, `Cargo.toml`) or a GitHub Actions workflow
48
+ tag/SHA, you already have enough to classify — do NOT fetch the diff.
49
+ d. Only when a non-lockfile *source* file changed AND the non-lockfile change is
50
+ small (a handful of lines) may you read it — prefer `github_get_file_contents`
51
+ for that one file, or `github_get_pull_request_diff` only if the whole diff
52
+ excluding lockfiles is clearly small. If the non-lockfile change is large, or
53
+ you can't cheaply bound it, treat the PR as **FUNCTIONAL** and leave it for a
54
+ human — do NOT force the diff into context.
55
+
56
+ Apply the **code-review** skill's rubric to whatever you inspected.
32
57
 
33
58
  STEP 2 — Classify the change, conservatively.
34
59
  Call it **TRIVIAL** only if ALL of these hold:
@@ -47,15 +72,34 @@ STEP 3 — Act on the classification.
47
72
  `{ owner: "{{owner}}", repo: "{{repo}}", pull_number, merge_method: "squash" }`.
48
73
  This does NOT merge immediately — GitHub merges the PR only once its required
49
74
  checks pass, and never while they are failing or still running. If the tool
50
- returns `{ ok: false }` (the repository does not allow auto-merge), post a
51
- brief comment via `github_add_issue_comment` saying the update looks trivial
52
- but auto-merge is disabled, so a maintainer should merge it.
75
+ returns `{ ok: false }`, read its `reason` and branch — do NOT assume it means
76
+ auto-merge is disabled:
77
+ - `reason` says the PR is in **"clean status"** (or is otherwise already
78
+ mergeable): GitHub refuses auto-merge because there is nothing to wait for —
79
+ the PR is green and mergeable right now, typically because the repo runs no
80
+ required checks on it. You already judged it TRIVIAL, so merge it directly
81
+ with `github_merge_pull_request` ({ owner: "{{owner}}", repo: "{{repo}}",
82
+ pull_number, merge_method: "squash" }). This is the ONE case where a direct
83
+ merge is correct.
84
+ - `reason` says auto-merge is **not allowed for this repository**: the repo has
85
+ "Allow auto-merge" turned off. Post a brief comment via
86
+ `github_add_issue_comment` saying the update looks trivial but auto-merge is
87
+ disabled, so a maintainer should merge it.
88
+ - any other `reason` (e.g. a merge conflict / **"dirty"** status): do NOT
89
+ merge. Post a brief comment noting the PR can't be merged automatically and
90
+ why.
53
91
  - If **FUNCTIONAL**: do NOT merge. Post a short comment (via
54
92
  `github_add_issue_comment`) summarising what changed and why it warrants a
55
93
  human review before merging. In scan mode, do not spam — one concise comment
56
94
  per functional PR is enough, and skip PRs you have clearly already commented
57
95
  on.
58
96
 
97
+ You MUST reach an explicit outcome for every PR you assess — enable auto-merge,
98
+ post a comment, or note it was already handled (e.g. you already commented, or
99
+ auto-merge is already enabled). Do NOT end the run having only read files with no
100
+ verdict and no action; a run that inspects diffs and then stops silently is a
101
+ failure, not a success.
102
+
59
103
  OUTPUT: For each PR, state its number, your verdict (TRIVIAL or FUNCTIONAL), a
60
104
  one-line justification, and whether you enabled auto-merge or left it for a
61
105
  human.