lastlight-core 0.16.1 → 0.17.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/config/default.yaml +9 -0
- package/deploy/.env.production.example +5 -2
- package/dist/admin/routes.js +4 -2
- package/dist/admin/routes.js.map +1 -1
- package/dist/config/config.d.ts +4 -0
- package/dist/config/config.js +16 -0
- package/dist/config/config.js.map +1 -1
- package/dist/connectors/github-webhook.js +31 -1
- package/dist/connectors/github-webhook.js.map +1 -1
- package/dist/connectors/types.d.ts +1 -1
- package/dist/engine/dispatcher.d.ts +12 -0
- package/dist/engine/dispatcher.js +20 -4
- package/dist/engine/dispatcher.js.map +1 -1
- package/dist/engine/executors/orchestrator.js +16 -3
- package/dist/engine/executors/orchestrator.js.map +1 -1
- package/dist/engine/executors/shared.js +13 -6
- package/dist/engine/executors/shared.js.map +1 -1
- package/dist/engine/router.js +36 -0
- package/dist/engine/router.js.map +1 -1
- package/dist/index.js +40 -8
- package/dist/index.js.map +1 -1
- package/dist/state/workflow-run-store.d.ts +32 -3
- package/dist/state/workflow-run-store.js +62 -4
- package/dist/state/workflow-run-store.js.map +1 -1
- package/dist/workflows/admission.d.ts +44 -0
- package/dist/workflows/admission.js +138 -0
- package/dist/workflows/admission.js.map +1 -0
- package/dist/workflows/resume.js +9 -2
- package/dist/workflows/resume.js.map +1 -1
- package/dist/workflows/runner.js +1 -0
- package/dist/workflows/runner.js.map +1 -1
- package/dist/workflows/simple.d.ts +22 -3
- package/dist/workflows/simple.js +59 -15
- package/dist/workflows/simple.js.map +1 -1
- package/dist/workflows/target-policy.d.ts +10 -0
- package/dist/workflows/target-policy.js +11 -1
- package/dist/workflows/target-policy.js.map +1 -1
- package/package.json +4 -4
- package/sandbox.Dockerfile +3 -2
- package/workflows/dependabot-ci-fix.yaml +51 -0
- package/workflows/prompts/dependabot-assess.md +38 -0
- package/workflows/prompts/dependabot-ci-fix.md +37 -0
- package/workflows/prompts/executor.md +1 -1
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
kind: pr-fix
|
|
2
|
+
name: dependabot-ci-fix
|
|
3
|
+
description: |
|
|
4
|
+
Fix a dependency-update PR (Dependabot / Renovate) whose CI checks have
|
|
5
|
+
failed, push the fix, then assess how big the change was — enabling GitHub
|
|
6
|
+
auto-merge (merge-once-green) only when the fix is trivial.
|
|
7
|
+
|
|
8
|
+
Triggered by:
|
|
9
|
+
- pr.checks_failed webhook (a check_suite completed with a failure
|
|
10
|
+
conclusion) → routed here by the classifier when it recognises a
|
|
11
|
+
dependency-update PR (src/engine/router.ts + this file's `classification`).
|
|
12
|
+
# One in-place task-list comment that updates as the fix/assess phases run,
|
|
13
|
+
# rather than a comment per phase.
|
|
14
|
+
status_checklist: true
|
|
15
|
+
classification:
|
|
16
|
+
intent: dependabot-ci-fix
|
|
17
|
+
description: |
|
|
18
|
+
DEPENDABOTCIFIX — a dependency-update pull request (opened by Dependabot or
|
|
19
|
+
Renovate, e.g. "Bump <pkg> from X to Y", "chore(deps): update <pkg>") whose
|
|
20
|
+
CI checks have FAILED and needs its build / lockfile / call sites repaired so
|
|
21
|
+
the update can land. Choose this over REVIEW or BUILD when the subject is a
|
|
22
|
+
red dependency-bump PR.
|
|
23
|
+
examples:
|
|
24
|
+
- '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
|
+
- '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'
|
|
26
|
+
|
|
27
|
+
phases:
|
|
28
|
+
- name: fix
|
|
29
|
+
label: Fix failing checks
|
|
30
|
+
prompt: prompts/dependabot-ci-fix.md
|
|
31
|
+
# `building`: install deps with the repo's package manager, then run the
|
|
32
|
+
# test/lint/typecheck gate before committing.
|
|
33
|
+
skill: building
|
|
34
|
+
model: "{{models.pr-fix}}"
|
|
35
|
+
messages:
|
|
36
|
+
on_start: "On it — investigating the failing checks on PR #{{prNumber}}..."
|
|
37
|
+
on_success: "**Fix pushed** to `{{branch}}`."
|
|
38
|
+
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."
|
|
@@ -0,0 +1,38 @@
|
|
|
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.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
You are fixing a dependency-update pull request whose CI has gone red.
|
|
2
|
+
|
|
3
|
+
You are already inside the {{repo}} repo at branch `{{branch}}` — the harness
|
|
4
|
+
pre-cloned the PR's head ref and your cwd is the repo root. Git is configured to
|
|
5
|
+
push. Read CLAUDE.md (and CONTRIBUTING.md if present) for project-specific
|
|
6
|
+
guidance.
|
|
7
|
+
|
|
8
|
+
CONTEXT:
|
|
9
|
+
- PR #{{prNumber}}: {{issueTitle}}
|
|
10
|
+
- This is an automated dependency update (Dependabot / Renovate). The dependency
|
|
11
|
+
bump itself is already committed on this branch — do NOT revert it. Your job is
|
|
12
|
+
to make the update pass CI.
|
|
13
|
+
{{ciSection}}
|
|
14
|
+
|
|
15
|
+
INSTRUCTIONS:
|
|
16
|
+
1. Read the CI failures above (and the workspace) to understand WHY the update
|
|
17
|
+
broke the build — common causes for a dependency bump:
|
|
18
|
+
- the lockfile is stale or inconsistent with the manifest (regenerate it with
|
|
19
|
+
the repo's package manager),
|
|
20
|
+
- a breaking change in the new version needs call sites / types updated,
|
|
21
|
+
- a peer-dependency or engines constraint needs a matching bump.
|
|
22
|
+
2. Make the **smallest** change that makes CI pass. Prefer a lockfile
|
|
23
|
+
regeneration or a mechanical call-site/type update over a behavioural change.
|
|
24
|
+
Do NOT widen the scope beyond making this update green.
|
|
25
|
+
3. Follow the **building** skill: install dependencies with the repo's package
|
|
26
|
+
manager, then run the full test / lint / typecheck gate. Do NOT commit until
|
|
27
|
+
it all passes locally.
|
|
28
|
+
|
|
29
|
+
AFTER FIXING:
|
|
30
|
+
1. git add -A && git commit -m "fix(deps): resolve CI failures for #{{prNumber}}"
|
|
31
|
+
2. git push origin HEAD
|
|
32
|
+
|
|
33
|
+
If you cannot make CI pass with a small, safe change, STOP without pushing a
|
|
34
|
+
speculative fix and say so in your summary — a human will take it from here.
|
|
35
|
+
|
|
36
|
+
OUTPUT: A brief summary of the root cause, exactly what you changed, and the
|
|
37
|
+
local test/lint/typecheck results.
|
|
@@ -33,7 +33,7 @@ AFTER THE GATE PASSES:
|
|
|
33
33
|
- Test / lint / typecheck results (paste actual output)
|
|
34
34
|
- Any deviations from the plan, known issues
|
|
35
35
|
2. Update {{issueDir}}/status.md: current_phase = executor
|
|
36
|
-
3. git add -A && git commit -m "feat: implement #{{issueNumber}}
|
|
36
|
+
3. git add -A{{#if externalizeArtifacts}} && git reset -q -- .lastlight{{/if}} && git commit -m "feat: implement #{{issueNumber}}
|
|
37
37
|
|
|
38
38
|
Tested: {test command} -> {result}
|
|
39
39
|
Scope-risk: {low|medium|high}"
|