lastlight-core 0.18.5 → 0.19.0
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/deploy/sandbox-entrypoint.sh +12 -26
- 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/executors/orchestrator.js +1 -1
- package/dist/engine/executors/orchestrator.js.map +1 -1
- package/dist/engine/github/git-auth.d.ts +7 -6
- package/dist/engine/github/git-auth.js +26 -71
- 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/dist/sandbox/git-http-auth.d.ts +30 -0
- package/dist/sandbox/git-http-auth.js +37 -0
- package/dist/sandbox/git-http-auth.js.map +1 -0
- package/dist/sandbox/index.d.ts +4 -3
- package/dist/sandbox/index.js +52 -20
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/sandbox.d.ts +9 -1
- package/dist/sandbox/sandbox.js +17 -2
- package/dist/sandbox/sandbox.js.map +1 -1
- package/package.json +4 -4
- package/workflows/cron-dependabot-ci-fix.yaml +26 -0
- package/workflows/dependabot-ci-fix.yaml +9 -16
- package/workflows/dependabot-pr-merge.yaml +19 -7
- package/workflows/prompts/dependabot-ci-fix.md +24 -3
- package/workflows/prompts/dependabot-pr-merge.md +83 -29
- package/workflows/prompts/dependabot-assess.md +0 -38
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
kind: cron
|
|
2
|
+
name: fix-red-dependency-prs
|
|
3
|
+
# Once a day, one hour after the 14:00 green sweep (merge-green-dependency-prs).
|
|
4
|
+
# The pr.checks_failed webhook does the real-time fixing; this sweep is only a
|
|
5
|
+
# backstop for dependency PRs that went red before boot or during a missed
|
|
6
|
+
# delivery. dependabot-ci-fix is the EXPENSIVE dependency path — it pre-clones
|
|
7
|
+
# the PR head and runs the full install + test/lint/typecheck gate per PR — so a
|
|
8
|
+
# daily cadence is plenty, and offsetting it from the green sweep keeps the two
|
|
9
|
+
# bounded (concurrency-3) heavy fan-outs from stacking on the host.
|
|
10
|
+
schedule: "0 15 * * *"
|
|
11
|
+
workflow: dependabot-ci-fix
|
|
12
|
+
context:
|
|
13
|
+
# `discover: red-dependency-prs` makes the cron runner (src/index.ts) find the
|
|
14
|
+
# SETTLED-red dependency PRs across managed repos IN CODE
|
|
15
|
+
# (src/cron/dependabot-discovery.ts → discoverRedDependencyPrs) and fan out one
|
|
16
|
+
# bounded single-PR `dependabot-ci-fix` run per PR — the same shape the
|
|
17
|
+
# pr.checks_failed webhook produces. Each context carries the PR head `branch`
|
|
18
|
+
# so dispatchWorkflow pre-clones the checkout the fix phase needs. "Red" is a
|
|
19
|
+
# settled failing check conclusion (GitHubClient.getChecksConclusion), NOT
|
|
20
|
+
# mergeable_state, so we never fire while checks are still running.
|
|
21
|
+
discover: red-dependency-prs
|
|
22
|
+
# NOTE: like merge-green-dependency-prs, and unlike cron-review, this sweep
|
|
23
|
+
# intentionally has NO `condition.unless: webhooksEnabled`. It's an additive
|
|
24
|
+
# backstop that also runs with webhooks on. Per-PR runs dedup by (repo, PR), and
|
|
25
|
+
# the discovery step skips any PR carrying the `requires-human` label, so it
|
|
26
|
+
# won't re-attempt fixes Last Light already gave up on.
|
|
@@ -2,8 +2,10 @@ kind: pr-fix
|
|
|
2
2
|
name: dependabot-ci-fix
|
|
3
3
|
description: |
|
|
4
4
|
Fix a dependency-update PR (Dependabot / Renovate) whose CI checks have
|
|
5
|
-
failed
|
|
6
|
-
|
|
5
|
+
failed: bring the branch up to date with its base, make CI green, and push.
|
|
6
|
+
It does NOT classify, label, or merge — once the pushed fix turns the checks
|
|
7
|
+
green the `pr.checks_passed` webhook hands off to `dependabot-pr-merge`, the
|
|
8
|
+
single owner of the classify → label → auto-merge decision.
|
|
7
9
|
|
|
8
10
|
Triggered by:
|
|
9
11
|
- pr.checks_failed webhook (a check_suite completed with a failure
|
|
@@ -19,10 +21,14 @@ classification:
|
|
|
19
21
|
Renovate, e.g. "Bump <pkg> from X to Y", "chore(deps): update <pkg>") whose
|
|
20
22
|
CI checks have FAILED and needs its build / lockfile / call sites repaired so
|
|
21
23
|
the update can land. Choose this over REVIEW or BUILD when the subject is a
|
|
22
|
-
red dependency-bump PR.
|
|
24
|
+
red dependency-bump PR. Also choose it when a maintainer's comment asks the
|
|
25
|
+
bot to handle/look at/fix such a PR and `PR CHECKS` is `failing` (with a
|
|
26
|
+
`PR AUTHOR` of dependabot[bot]/renovate[bot]) — but keep REVIEW when they
|
|
27
|
+
explicitly ask for a review.
|
|
23
28
|
examples:
|
|
24
29
|
- 'PR "Bump lodash from 4.17.20 to 4.17.21" by dependabot[bot] — its CI checks have failed. → INTENT: DEPENDABOTCIFIX, REPO: NONE, ISSUE: NONE, REASON: NONE'
|
|
25
30
|
- 'PR "chore(deps): bump actions/checkout from 3 to 4" by dependabot[bot] — its CI checks have failed. → INTENT: DEPENDABOTCIFIX, REPO: NONE, ISSUE: NONE, REASON: NONE'
|
|
31
|
+
- 'PR AUTHOR: dependabot[bot], PR CHECKS: failing, COMMENT: "@bot can you take a look at this?" → INTENT: DEPENDABOTCIFIX, REPO: NONE, ISSUE: NONE, REASON: NONE'
|
|
26
32
|
|
|
27
33
|
phases:
|
|
28
34
|
- name: fix
|
|
@@ -36,16 +42,3 @@ phases:
|
|
|
36
42
|
on_start: "On it — investigating the failing checks on PR #{{prNumber}}..."
|
|
37
43
|
on_success: "**Fix pushed** to `{{branch}}`."
|
|
38
44
|
on_failure: "**Couldn't auto-fix** the failing checks on PR #{{prNumber}} — leaving it for a human."
|
|
39
|
-
|
|
40
|
-
# Assess the size of the fix, then act. Runs under this workflow's repo-write
|
|
41
|
-
# profile, so agentic-pi's `github_enable_auto_merge` tool is available.
|
|
42
|
-
# Conservative by design: enable auto-merge ONLY for trivial, non-functional
|
|
43
|
-
# changes; anything with runtime-logic impact is left for a human.
|
|
44
|
-
- name: assess
|
|
45
|
-
label: Assess & maybe auto-merge
|
|
46
|
-
prompt: prompts/dependabot-assess.md
|
|
47
|
-
# `code-review`: the finding-tier / what-to-check rubric for reading a diff.
|
|
48
|
-
skill: code-review
|
|
49
|
-
model: "{{models.review}}"
|
|
50
|
-
messages:
|
|
51
|
-
on_success: "Assessed PR #{{prNumber}} — auto-merge enabled if the fix was trivial, else left for review."
|
|
@@ -3,8 +3,12 @@ name: dependabot-pr-merge
|
|
|
3
3
|
description: |
|
|
4
4
|
Assess an already-GREEN dependency-update PR (Dependabot / Renovate) and, when
|
|
5
5
|
the change is trivial, enable GitHub auto-merge (squash) so it lands once its
|
|
6
|
-
checks pass.
|
|
7
|
-
|
|
6
|
+
checks pass. When a trivial bump is merely behind the base branch or has a
|
|
7
|
+
lockfile conflict, it asks the bot that opened the PR to rebase/recreate its
|
|
8
|
+
own branch (@dependabot rebase|recreate, or Renovate's rebase label) and enables
|
|
9
|
+
auto-merge to land it once green — it never pushes or rebases itself. The
|
|
10
|
+
companion to dependabot-ci-fix: that one repairs a RED bump and pushes a fix;
|
|
11
|
+
this one merges a GREEN one that needs no fix at all.
|
|
8
12
|
|
|
9
13
|
Always runs against a SINGLE PR (`{{prNumber}}`). Triggered by:
|
|
10
14
|
- pr.checks_passed webhook (a check_suite completed with a success
|
|
@@ -24,21 +28,29 @@ classification:
|
|
|
24
28
|
<pkg>") whose CI checks have PASSED and which may be safe to auto-merge with
|
|
25
29
|
no code change. Choose this ONLY for a passing dependency-bump PR that needs
|
|
26
30
|
no fix; prefer DEPENDABOTCIFIX when a dependency PR's checks have FAILED, and
|
|
27
|
-
REVIEW for a normal (non-dependency) PR.
|
|
31
|
+
REVIEW for a normal (non-dependency) PR. Also choose it when a maintainer's
|
|
32
|
+
comment asks the bot to handle/look at/land such a PR and `PR CHECKS` is
|
|
33
|
+
`passing` (with a `PR AUTHOR` of dependabot[bot]/renovate[bot]) — but keep
|
|
34
|
+
REVIEW when they explicitly ask for a review.
|
|
28
35
|
examples:
|
|
29
36
|
- 'PR "Bump lodash from 4.17.20 to 4.17.21" by dependabot[bot] — its CI checks have passed. → INTENT: DEPENDABOTPRMERGE, REPO: NONE, ISSUE: NONE, REASON: NONE'
|
|
30
37
|
- 'PR "chore(deps): bump actions/checkout from 3 to 4" by renovate[bot] — its CI checks have passed. → INTENT: DEPENDABOTPRMERGE, REPO: NONE, ISSUE: NONE, REASON: NONE'
|
|
38
|
+
- 'PR AUTHOR: renovate[bot], PR CHECKS: passing, COMMENT: "@bot can you look at this?" → INTENT: DEPENDABOTPRMERGE, REPO: NONE, ISSUE: NONE, REASON: NONE'
|
|
31
39
|
|
|
32
40
|
phases:
|
|
33
41
|
# Single phase. Runs under this workflow's repo-write profile, so agentic-pi's
|
|
34
|
-
# `github_enable_auto_merge`
|
|
42
|
+
# `github_enable_auto_merge` (+ `github_add_issue_comment` / `github_add_labels`
|
|
43
|
+
# for the rebase nudge) tools are available. Conservative by design: enable
|
|
35
44
|
# auto-merge ONLY for trivial, non-functional dependency bumps; anything with
|
|
36
45
|
# runtime-logic impact is left for a human. No repo checkout — the agent
|
|
37
46
|
# inspects the ONE PR via `github_list_pull_request_files` (file list + line
|
|
38
47
|
# counts) and skips lockfile diffs, only pulling `github_get_pull_request_diff`
|
|
39
|
-
# for a small non-lockfile source change.
|
|
40
|
-
# PR
|
|
41
|
-
#
|
|
48
|
+
# for a small non-lockfile source change. It never pushes or rebases itself: a
|
|
49
|
+
# trivial PR that is `behind`/`dirty` is nudged to rebase via the bot's own
|
|
50
|
+
# command (@dependabot rebase|recreate) or Renovate's rebase label, with
|
|
51
|
+
# auto-merge enabled to land it once GitHub re-runs the checks green. Because
|
|
52
|
+
# each run assesses a single PR, its context is bounded — the overflow that
|
|
53
|
+
# killed the old whole-repo scan can't happen. See prompts/dependabot-pr-merge.md.
|
|
42
54
|
- name: assess
|
|
43
55
|
label: Assess & maybe auto-merge
|
|
44
56
|
prompt: prompts/dependabot-pr-merge.md
|
|
@@ -13,16 +13,27 @@ CONTEXT:
|
|
|
13
13
|
{{ciSection}}
|
|
14
14
|
|
|
15
15
|
INSTRUCTIONS:
|
|
16
|
-
1.
|
|
16
|
+
1. FIRST bring the branch up to date with its base, so your fix is built on the
|
|
17
|
+
current base and a `behind` PR is made mergeable (so the merge step later sees
|
|
18
|
+
a `clean` PR, not `behind`). Merge — do NOT rebase or force-push:
|
|
19
|
+
- `git fetch origin {{baseBranch}}`
|
|
20
|
+
- `git merge --no-edit origin/{{baseBranch}}`
|
|
21
|
+
If the merge conflicts (almost always the lockfile), resolve it by
|
|
22
|
+
**regenerating** the lockfile with the repo's package manager, then
|
|
23
|
+
`git add -A && git commit --no-edit` to complete the merge — never hand-edit a
|
|
24
|
+
lockfile. If the branch is already up to date this is a no-op. (The workspace
|
|
25
|
+
is a shallow clone; if the merge base isn't reachable, run `git fetch --deepen
|
|
26
|
+
100 origin {{baseBranch}}` — or `--unshallow` — and retry the merge.)
|
|
27
|
+
2. Read the CI failures above (and the workspace) to understand WHY the update
|
|
17
28
|
broke the build — common causes for a dependency bump:
|
|
18
29
|
- the lockfile is stale or inconsistent with the manifest (regenerate it with
|
|
19
30
|
the repo's package manager),
|
|
20
31
|
- a breaking change in the new version needs call sites / types updated,
|
|
21
32
|
- a peer-dependency or engines constraint needs a matching bump.
|
|
22
|
-
|
|
33
|
+
3. Make the **smallest** change that makes CI pass. Prefer a lockfile
|
|
23
34
|
regeneration or a mechanical call-site/type update over a behavioural change.
|
|
24
35
|
Do NOT widen the scope beyond making this update green.
|
|
25
|
-
|
|
36
|
+
4. Follow the **building** skill: install dependencies with the repo's package
|
|
26
37
|
manager, then run the full test / lint / typecheck gate. Do NOT commit until
|
|
27
38
|
it all passes locally.
|
|
28
39
|
|
|
@@ -32,6 +43,16 @@ AFTER FIXING:
|
|
|
32
43
|
|
|
33
44
|
If you cannot make CI pass with a small, safe change, STOP without pushing a
|
|
34
45
|
speculative fix and say so in your summary — a human will take it from here.
|
|
46
|
+
Before you stop, flag the PR for a human so the nightly red-dependency sweep
|
|
47
|
+
won't keep re-attempting it: ensure the `requires-human` label exists with one
|
|
48
|
+
idempotent `github_ensure_labels` call (`{ owner: "{{owner}}", repo: "{{repo}}",
|
|
49
|
+
labels: [{ name: "requires-human", color: "b60205", description: "Last Light
|
|
50
|
+
can't proceed automatically; a maintainer must handle it." }] }`), then add it
|
|
51
|
+
with `github_add_labels` (`{ owner: "{{owner}}", repo: "{{repo}}", issue_number:
|
|
52
|
+
{{prNumber}}, labels: ["requires-human"] }`). If label writes are denied, just
|
|
53
|
+
say so in your summary. (This isn't permanent: once a later fix lands and turns
|
|
54
|
+
the checks green, the `dependabot-pr-merge` workflow re-assesses the PR and
|
|
55
|
+
clears `requires-human` if the update is trivial.)
|
|
35
56
|
|
|
36
57
|
OUTPUT: A brief summary of the root cause, exactly what you changed, and the
|
|
37
58
|
local test/lint/typecheck results.
|
|
@@ -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.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
You just fixed and pushed a dependency-update PR. Now assess how big the change
|
|
2
|
-
was and decide whether it is safe to auto-merge.
|
|
3
|
-
|
|
4
|
-
You are inside the {{repo}} repo at branch `{{branch}}` (cwd = repo root).
|
|
5
|
-
|
|
6
|
-
CONTEXT:
|
|
7
|
-
- PR #{{prNumber}}: {{issueTitle}}
|
|
8
|
-
- Repository: {{owner}}/{{repo}}
|
|
9
|
-
|
|
10
|
-
STEP 1 — Inspect the change.
|
|
11
|
-
Review the FULL diff of this PR against its base branch — the dependency bump
|
|
12
|
-
plus any fix you pushed. Use `git diff origin/{{baseBranch}}...HEAD` (or the
|
|
13
|
-
`github_get_pull_request_diff` tool). Apply the **code-review** skill's rubric.
|
|
14
|
-
|
|
15
|
-
STEP 2 — Classify the change, conservatively.
|
|
16
|
-
Call it **TRIVIAL** only if ALL of these hold:
|
|
17
|
-
- it is limited to dependency metadata (lockfile / manifest version bumps),
|
|
18
|
-
type-only edits, comments, or mechanical rename/signature updates, AND
|
|
19
|
-
- there is NO change to runtime logic, control flow, or behaviour, AND
|
|
20
|
-
- nothing security-sensitive (auth, crypto, deserialization, network, file I/O)
|
|
21
|
-
changed in a meaningful way.
|
|
22
|
-
If you are unsure, or the change touches application logic, treat it as
|
|
23
|
-
**FUNCTIONAL**. When in doubt, do NOT auto-merge.
|
|
24
|
-
|
|
25
|
-
STEP 3 — Act on the classification.
|
|
26
|
-
- If **TRIVIAL**: enable auto-merge by calling the `github_enable_auto_merge`
|
|
27
|
-
tool with `{ owner: "{{owner}}", repo: "{{repo}}", pull_number: {{prNumber}},
|
|
28
|
-
merge_method: "squash" }`. This does NOT merge immediately — GitHub merges the
|
|
29
|
-
PR only once the re-run checks pass. If the tool returns `{ ok: false }` (the
|
|
30
|
-
repository does not allow auto-merge), post a brief comment on the PR saying the
|
|
31
|
-
fix looks trivial but auto-merge is disabled, so a maintainer should merge it,
|
|
32
|
-
using `github_add_issue_comment`.
|
|
33
|
-
- If **FUNCTIONAL**: do NOT merge. Post a short comment on the PR (via
|
|
34
|
-
`github_add_issue_comment`) summarising what changed and why it warrants a human
|
|
35
|
-
review before merging.
|
|
36
|
-
|
|
37
|
-
OUTPUT: State your verdict (TRIVIAL or FUNCTIONAL), a one-line justification, and
|
|
38
|
-
whether you enabled auto-merge or left the PR for a human.
|