lastlight-core 0.18.5 → 0.18.6
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/dist/admin/routes.d.ts +7 -0
- package/dist/admin/routes.js +22 -0
- package/dist/admin/routes.js.map +1 -1
- package/dist/cron/dependabot-discovery.d.ts +53 -11
- package/dist/cron/dependabot-discovery.js +106 -32
- package/dist/cron/dependabot-discovery.js.map +1 -1
- package/dist/engine/dispatcher.js +1 -1
- package/dist/engine/dispatcher.js.map +1 -1
- package/dist/engine/github/git-auth.d.ts +2 -1
- package/dist/engine/github/git-auth.js.map +1 -1
- package/dist/engine/github/github.d.ts +32 -4
- package/dist/engine/github/github.js +52 -4
- package/dist/engine/github/github.js.map +1 -1
- package/dist/engine/github/profiles.js +1 -0
- package/dist/engine/github/profiles.js.map +1 -1
- package/dist/engine/router.d.ts +9 -0
- package/dist/engine/router.js +44 -0
- package/dist/engine/router.js.map +1 -1
- package/dist/engine/screen/classifier.d.ts +14 -0
- package/dist/engine/screen/classifier.js +13 -2
- package/dist/engine/screen/classifier.js.map +1 -1
- package/dist/index.js +29 -12
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/workflows/cron-dependabot-ci-fix.yaml +26 -0
- package/workflows/dependabot-ci-fix.yaml +5 -1
- package/workflows/dependabot-pr-merge.yaml +19 -7
- package/workflows/prompts/dependabot-assess.md +17 -0
- package/workflows/prompts/dependabot-ci-fix.md +9 -0
- package/workflows/prompts/dependabot-pr-merge.md +83 -29
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
You assess a **green** dependency-update PR (Dependabot / Renovate) and land it
|
|
2
|
-
if the change is trivial and safe. You never push code
|
|
3
|
-
auto-merge* — which GitHub honours once the
|
|
4
|
-
a red or still-running PR — and merge
|
|
5
|
-
|
|
6
|
-
wait on (see STEP 3).
|
|
2
|
+
if the change is trivial and safe. You never push code or rebase branches
|
|
3
|
+
yourself. You prefer to *enable auto-merge* — which GitHub honours once the
|
|
4
|
+
required checks pass, and refuses on a red or still-running PR — and merge
|
|
5
|
+
directly only in the one narrow case where GitHub rejects auto-merge because the
|
|
6
|
+
PR is already mergeable with no checks to wait on (see STEP 3). When a trivial PR
|
|
7
|
+
is merely **behind** the base branch or has a lockfile **conflict**, you don't
|
|
8
|
+
give up — you ask the bot that opened it (Dependabot / Renovate) to rebase or
|
|
9
|
+
recreate its own branch, then enable auto-merge so GitHub lands it once it goes
|
|
10
|
+
green (see STEP 3). You never rebase, merge from base, or push yourself.
|
|
7
11
|
|
|
8
12
|
You are working against `{{owner}}/{{repo}}`. Interact with GitHub through the
|
|
9
13
|
`github_*` tools only — there is no local checkout.
|
|
@@ -40,9 +44,13 @@ e. Confirm the PR is genuinely GREEN before you act on it. Call
|
|
|
40
44
|
`github_get_pull_request` and read `mergeable` + `mergeable_state`. Only
|
|
41
45
|
`mergeable_state: "clean"` means mergeable with all checks passing.
|
|
42
46
|
`unstable` = a check is failing or still running; `blocked` = a required
|
|
43
|
-
check/review is outstanding; `dirty` = a merge conflict; `behind
|
|
44
|
-
|
|
45
|
-
is never eligible for a direct merge
|
|
47
|
+
check/review is outstanding; `dirty` = a merge conflict; `behind` = the base
|
|
48
|
+
branch moved ahead (no conflict); `unknown` = not computed yet. A PR that is
|
|
49
|
+
not `clean` is NOT green, so it is never eligible for a *direct merge* — but
|
|
50
|
+
`behind`/`dirty` are still actionable: for a trivial bump you can ask the bot
|
|
51
|
+
to rebase/recreate its branch and enable auto-merge (STEP 3). Note the PR
|
|
52
|
+
**author** from this same `github_get_pull_request` response (`user.login`,
|
|
53
|
+
e.g. `dependabot[bot]` / `renovate[bot]`) — STEP 3 branches on it.
|
|
46
54
|
|
|
47
55
|
Apply the **code-review** skill's rubric to whatever you inspected.
|
|
48
56
|
|
|
@@ -58,13 +66,37 @@ Call it **TRIVIAL** only if ALL of these hold:
|
|
|
58
66
|
If you are unsure, or the change touches application logic, treat it as
|
|
59
67
|
**FUNCTIONAL**. When in doubt, do NOT auto-merge.
|
|
60
68
|
|
|
69
|
+
STEP 2b — Record the verdict as a label (state machine).
|
|
70
|
+
First ensure the label vocabulary exists in ONE idempotent `github_ensure_labels`
|
|
71
|
+
call (`{ owner: "{{owner}}", repo: "{{repo}}", labels: [...] }`) — it lists once
|
|
72
|
+
and creates only the missing ones, so it never errors on labels that exist:
|
|
73
|
+
- `dependency-trivial` — color `0e8a16` — "Trivial & safe dependency update (auto-merge path)."
|
|
74
|
+
- `dependency-functional` — color `fbca04` — "Dependency update has functional impact — needs human review."
|
|
75
|
+
- `requires-human` — color `b60205` — "Last Light can't proceed automatically; a maintainer must handle it."
|
|
76
|
+
If `github_ensure_labels` is denied (the token lacks the permission), fall back to
|
|
77
|
+
using only labels that already exist and skip the rest.
|
|
78
|
+
Then apply exactly the labels for your verdict via `github_add_labels`, and clear
|
|
79
|
+
the superseded ones with `github_remove_label` (only ever touch the three labels
|
|
80
|
+
above — never remove a label outside this vocabulary, e.g. Renovate's `rebase`):
|
|
81
|
+
- **TRIVIAL** → add `dependency-trivial`; remove `dependency-functional` and
|
|
82
|
+
`requires-human` if present (it's landing, so any stale human-needed flag is cleared).
|
|
83
|
+
- **FUNCTIONAL** → add `dependency-functional` and `requires-human`; remove
|
|
84
|
+
`dependency-trivial` if present.
|
|
85
|
+
|
|
61
86
|
STEP 3 — Act on the classification.
|
|
62
|
-
- If **
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
- If **FUNCTIONAL**: do NOT merge, and do NOT request a rebase. Post a short
|
|
88
|
+
comment (via `github_add_issue_comment`) summarising what changed and why it
|
|
89
|
+
warrants a human review before merging. Skip the comment if you have clearly
|
|
90
|
+
already commented on this PR.
|
|
91
|
+
- If **TRIVIAL**: land it, or move it toward landing, based on the
|
|
92
|
+
`mergeable_state` you read in STEP 1e.
|
|
93
|
+
|
|
94
|
+
CASE `clean` — mergeable now, checks green. Enable auto-merge by calling
|
|
95
|
+
`github_enable_auto_merge` with `{ owner: "{{owner}}", repo: "{{repo}}",
|
|
96
|
+
pull_number, merge_method: "squash" }`. This does NOT merge immediately —
|
|
97
|
+
GitHub merges the PR only once its required checks pass, and never while they
|
|
98
|
+
are failing or still running. If the tool returns `{ ok: false }`, read its
|
|
99
|
+
`reason` and branch — do NOT assume it means auto-merge is disabled:
|
|
68
100
|
- `reason` says the PR is in **"clean status"** (or is otherwise already
|
|
69
101
|
mergeable): GitHub refuses auto-merge because there is nothing to wait for.
|
|
70
102
|
Before you direct-merge, **confirm via `github_get_pull_request` that
|
|
@@ -75,21 +107,42 @@ STEP 3 — Act on the classification.
|
|
|
75
107
|
you judged it TRIVIAL, merge it directly with `github_merge_pull_request`
|
|
76
108
|
({ owner: "{{owner}}", repo: "{{repo}}", pull_number, merge_method:
|
|
77
109
|
"squash" }) — this is the ONE case where a direct merge is correct. If
|
|
78
|
-
`mergeable_state` is anything else
|
|
79
|
-
`unknown`), do NOT direct-merge: the PR is not green. Leave auto-merge
|
|
80
|
-
enabled (GitHub will merge it if/when it goes green) or post a brief comment
|
|
81
|
-
and leave it for a human.
|
|
110
|
+
`mergeable_state` is anything else, do NOT direct-merge: the PR is not green.
|
|
82
111
|
- `reason` says auto-merge is **not allowed for this repository**: the repo has
|
|
83
112
|
"Allow auto-merge" turned off. Post a brief comment via
|
|
84
113
|
`github_add_issue_comment` saying the update looks trivial but auto-merge is
|
|
85
114
|
disabled, so a maintainer should merge it.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
115
|
+
|
|
116
|
+
CASE `behind` or `dirty` — the bump is trivial but the branch isn't mergeable
|
|
117
|
+
as-is: it is behind the base branch (`behind`) or has merge conflicts (`dirty`,
|
|
118
|
+
almost always the lockfile). Do NOT push, rebase, or merge from base yourself —
|
|
119
|
+
ask the bot that opened the PR to update its OWN branch, which regenerates
|
|
120
|
+
lockfiles correctly. Branch on the PR **author** (`user.login`, from STEP 1e):
|
|
121
|
+
- `dependabot[bot]` → post a comment via `github_add_issue_comment` whose body
|
|
122
|
+
is exactly `@dependabot rebase` when `behind`, or `@dependabot recreate` when
|
|
123
|
+
`dirty` (recreate regenerates the PR from scratch and resolves lockfile
|
|
124
|
+
conflicts). That comment IS the command — don't add prose around it.
|
|
125
|
+
- `renovate[bot]` → add the `rebase` label via `github_add_labels`
|
|
126
|
+
({ owner: "{{owner}}", repo: "{{repo}}", issue_number: pull_number,
|
|
127
|
+
labels: ["rebase"] }). Renovate regenerates the branch on its next run, which
|
|
128
|
+
covers both `behind` and `dirty`. The label only works if the repo keeps
|
|
129
|
+
Renovate's default `rebaseLabel`, so ALSO post a one-line comment noting you
|
|
130
|
+
requested a rebase, so a maintainer notices if nothing happens.
|
|
131
|
+
- any other author (not Dependabot/Renovate) → do NOT nudge a bot. Post a brief
|
|
132
|
+
comment that the update looks trivial but is behind/conflicted and needs a
|
|
133
|
+
manual rebase before it can merge, and leave it for a human.
|
|
134
|
+
Then, for a Dependabot or Renovate PR only, ALSO call `github_enable_auto_merge`
|
|
135
|
+
(squash) so GitHub lands it automatically once the rebase makes it green. You do
|
|
136
|
+
NOT wait for the rebase, and you NEVER direct-merge a `behind`/`dirty` PR. If
|
|
137
|
+
auto-merge returns `{ ok: false }` with reason **"not allowed for this
|
|
138
|
+
repository"**, note in your comment that a maintainer will need to merge once
|
|
139
|
+
it's green.
|
|
140
|
+
|
|
141
|
+
CASE `unstable`, `blocked`, or `unknown` — a check is failing or still running
|
|
142
|
+
(`unstable`), a required check/review is outstanding (`blocked`), or the state
|
|
143
|
+
isn't computed yet (`unknown`). This is NOT a rebase problem, so do NOT nudge a
|
|
144
|
+
rebase. Call `github_enable_auto_merge` (squash) so GitHub merges it if/when it
|
|
145
|
+
goes green, and stop. Do NOT direct-merge.
|
|
93
146
|
|
|
94
147
|
You MUST reach an explicit outcome — enable auto-merge, merge, post a comment, or
|
|
95
148
|
note it was already handled (e.g. you already commented, or auto-merge is already
|
|
@@ -99,13 +152,14 @@ success — and that is now enforced (see the marker below), so an empty run is
|
|
|
99
152
|
recorded RED, not green.
|
|
100
153
|
|
|
101
154
|
OUTPUT: State the PR number, your verdict (TRIVIAL or FUNCTIONAL), a one-line
|
|
102
|
-
justification, and whether you enabled auto-merge, merged,
|
|
103
|
-
human.
|
|
155
|
+
justification, and whether you enabled auto-merge, merged, requested a rebase, or
|
|
156
|
+
left it for a human.
|
|
104
157
|
|
|
105
158
|
Then, as the FINAL line of your response, emit this machine-readable completion
|
|
106
|
-
marker — ALWAYS
|
|
159
|
+
marker — ALWAYS. Use `action=rebase` when you asked the bot to rebase/recreate
|
|
160
|
+
its branch (and enabled auto-merge to land it once green):
|
|
107
161
|
|
|
108
|
-
ASSESSMENT_COMPLETE: pr={{prNumber}} verdict=<TRIVIAL|FUNCTIONAL> action=<automerge|merge|comment|already-handled>
|
|
162
|
+
ASSESSMENT_COMPLETE: pr={{prNumber}} verdict=<TRIVIAL|FUNCTIONAL> action=<automerge|merge|rebase|comment|already-handled>
|
|
109
163
|
|
|
110
164
|
The run is recorded as FAILED if this marker is missing — deliberately: a run
|
|
111
165
|
that ends without it did not finish its work.
|