lastlight-core 0.25.2 → 0.25.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/agent-context/rules.md +17 -4
- package/dist/cron/scheduler.js +26 -9
- package/dist/cron/scheduler.js.map +1 -1
- package/dist/engine/router.js +26 -2
- package/dist/engine/router.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/sandbox/k8s/reclaim.d.ts +33 -0
- package/dist/sandbox/k8s/reclaim.js +50 -19
- package/dist/sandbox/k8s/reclaim.js.map +1 -1
- package/dist/sandbox/k8s/sweep.d.ts +8 -0
- package/dist/sandbox/k8s/sweep.js +84 -21
- package/dist/sandbox/k8s/sweep.js.map +1 -1
- package/dist/telemetry/index.d.ts +26 -0
- package/dist/telemetry/index.js +38 -0
- package/dist/telemetry/index.js.map +1 -1
- package/package.json +3 -3
- package/skills/building/SKILL.md +16 -3
- package/skills/fixing/SKILL.md +19 -10
- package/skills/security-feedback/SKILL.md +9 -2
- package/workflows/issue-triage.yaml +18 -7
- package/workflows/prompts/architect.md +1 -2
- package/workflows/prompts/dependabot-ci-fix.md +48 -30
- package/workflows/prompts/executor.md +9 -7
- package/workflows/prompts/fix.md +5 -1
- package/workflows/prompts/guardrails.md +1 -2
- package/workflows/prompts/pr-fix.md +34 -19
- package/workflows/prompts/pr.md +1 -1
- package/workflows/prompts/re-reviewer.md +1 -1
- package/workflows/prompts/reviewer.md +1 -1
|
@@ -4,9 +4,10 @@ is otherwise blocked. Your job is to get it into a mergeable, green state (or,
|
|
|
4
4
|
if you can't, hand it to a human — see the end).
|
|
5
5
|
|
|
6
6
|
You are already inside the {{repo}} repo at branch `{{branch}}` — the harness
|
|
7
|
-
pre-cloned the PR's head ref and your cwd is the repo root. Git is configured
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
pre-cloned the PR's head ref and your cwd is the repo root. Git is configured
|
|
8
|
+
for fetches and local commits; publishing goes through `github_publish` (see
|
|
9
|
+
AFTER FIXING below), never `git push`. Read CLAUDE.md (and CONTRIBUTING.md if
|
|
10
|
+
present) for project-specific guidance.
|
|
10
11
|
|
|
11
12
|
CONTEXT:
|
|
12
13
|
- PR #{{prNumber}}: {{issueTitle}}
|
|
@@ -54,7 +55,7 @@ promoted this run to a real repair attempt. Treat the failure as reproducible
|
|
|
54
55
|
and look for the actual difference — a version, an ordering, a shared fixture, a
|
|
55
56
|
race — rather than re-running the job and hoping. If you genuinely cannot make
|
|
56
57
|
it green, `outcome=gave-up` with what you ruled out is the honest answer; do not
|
|
57
|
-
|
|
58
|
+
publish a speculative fix.
|
|
58
59
|
{{/if}}
|
|
59
60
|
|
|
60
61
|
INSTRUCTIONS:
|
|
@@ -82,15 +83,16 @@ one slow or unreproducible check. Run tests cheaply per the **building** skill
|
|
|
82
83
|
**This step IS the job here.** No diagnosis ran, which means you were
|
|
83
84
|
summoned to unblock a MERGE rather than to repair a red build — the reason
|
|
84
85
|
above is `dirty` (conflict), `behind` or `blocked`. CI is not red; the PR
|
|
85
|
-
simply cannot merge. So completing the merge and
|
|
86
|
+
simply cannot merge. So completing the merge and publishing it is the whole
|
|
86
87
|
repair, and there was no failure to diagnose. Do not hunt for a broken test
|
|
87
88
|
to justify the run, and do not stand up a CI-sized gate for a lockfile.
|
|
88
89
|
Land the merge, let a small gate confirm the repair is coherent (no conflict
|
|
89
|
-
markers left, the lockfile installs),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
markers left, the lockfile installs), then go straight to AFTER FIXING
|
|
91
|
+
below to publish it and report `outcome=pushed`. CI is what tells you the
|
|
92
|
+
branch is green, and it runs on the commit AFTER FIXING publishes, without
|
|
93
|
+
being asked. A `dirty` PR whose conflict you resolved is a SUCCESS even if
|
|
94
|
+
the only file you changed was the lockfile. If the gate then comes back
|
|
95
|
+
red, you have a real failure and step 2 onwards applies.
|
|
94
96
|
{{/if}}
|
|
95
97
|
2. {{#if phaseOutputs.diagnosis}}Work from the diagnosis above. It already names
|
|
96
98
|
the cause and which checks can't be reproduced here — don't re-derive either.
|
|
@@ -107,17 +109,17 @@ one slow or unreproducible check. Run tests cheaply per the **building** skill
|
|
|
107
109
|
which is the checkout — holding the **narrowest** command that would have
|
|
108
110
|
failed before your fix and passes after it: one test file, one lint rule, one
|
|
109
111
|
build target, or, for a lockfile you regenerated, the install itself. Exit 0
|
|
110
|
-
means green. NOT the repo's CI pipeline: CI runs on the commit you
|
|
111
|
-
is the authority, so a gate that mirrors it delays the
|
|
112
|
-
nothing new — aim for under two minutes, skip anything you already
|
|
113
|
-
pass this session, and never try to start docker or a database
|
|
114
|
-
none here). If step 1's merge was the whole repair and nothing
|
|
115
|
-
failing, gate on the repair being coherent — no conflict markers
|
|
116
|
-
the lockfile installs — rather than leaving the script unwritten:
|
|
117
|
-
script is `gate=skipped`, which counts as RED and would throw a
|
|
118
|
-
resolution away. The script is not there yet — the harness clears
|
|
119
|
-
start of every attempt. Write it before you start repairing. See
|
|
120
|
-
**fixing** skill's "The gate" for the full shape.
|
|
112
|
+
means green. NOT the repo's CI pipeline: CI runs on the commit you publish
|
|
113
|
+
and is the authority, so a gate that mirrors it delays the publish and
|
|
114
|
+
tells you nothing new — aim for under two minutes, skip anything you already
|
|
115
|
+
watched pass this session, and never try to start docker or a database
|
|
116
|
+
(there is none here). If step 1's merge was the whole repair and nothing
|
|
117
|
+
was ever failing, gate on the repair being coherent — no conflict markers
|
|
118
|
+
left, and the lockfile installs — rather than leaving the script unwritten:
|
|
119
|
+
a missing script is `gate=skipped`, which counts as RED and would throw a
|
|
120
|
+
correct resolution away. The script is not there yet — the harness clears
|
|
121
|
+
it at the start of every attempt. Write it before you start repairing. See
|
|
122
|
+
the **fixing** skill's "The gate" for the full shape.
|
|
121
123
|
4. Make the **smallest** change that makes CI pass, per the **fixing** skill.
|
|
122
124
|
Prefer a lockfile regeneration or a mechanical call-site/type update over a
|
|
123
125
|
behavioural change. Do NOT widen the scope beyond making this update green.
|
|
@@ -126,25 +128,41 @@ one slow or unreproducible check. Run tests cheaply per the **building** skill
|
|
|
126
128
|
before you commit. Breadth is CI's job — don't also run the full suite here.
|
|
127
129
|
|
|
128
130
|
AFTER FIXING:
|
|
129
|
-
1.
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
1. Publish with `github_publish` — `{ owner: "{{owner}}", repo: "{{repo}}",
|
|
132
|
+
message: "fix(deps): make #{{prNumber}} mergeable" }`. It commits the whole
|
|
133
|
+
working tree (the merge from step 1 and/or your CI fix) and pushes it in one
|
|
134
|
+
step. Do NOT use `git commit` / `git push`: a commit built by git here is
|
|
135
|
+
unsigned, and on a repo that requires signed commits one unsigned commit
|
|
136
|
+
anywhere in the branch blocks the PR permanently and cannot be cleared by a
|
|
137
|
+
later run. Local commits you made while working are folded in automatically.
|
|
138
|
+
- A successful publish IS this phase's push: emit `outcome=pushed`. The
|
|
139
|
+
commit is on the branch and CI is running on it. You did not invoke
|
|
140
|
+
`git push` and were right not to — publishing through the tool is what
|
|
141
|
+
"pushed" means here, so do not downgrade the outcome because no `git push`
|
|
142
|
+
ran. This is the same whether the repair was step 1's merge or a CI fix.
|
|
143
|
+
- If it reports `published: false`, there was nothing to publish. That is the
|
|
144
|
+
"nothing to commit or push" case in the STOP section below — flag it for a
|
|
145
|
+
human rather than looping.
|
|
146
|
+
- If it refuses because a change needs a file mode it cannot set (a new
|
|
147
|
+
executable file, a symlink, a submodule pointer), do NOT work around the
|
|
148
|
+
refusal with `git push`: nothing was published, and pushing would land
|
|
149
|
+
the unsigned commit the refusal exists to prevent. Flag it for a human.
|
|
150
|
+
2. Once the publish re-runs CI and it goes green, the `dependabot-pr-merge`
|
|
133
151
|
workflow takes over the merge — you do NOT merge or label a healthy PR.
|
|
134
152
|
|
|
135
|
-
|
|
153
|
+
PUBLISH DISCIPLINE — the gate decides, and it is checked after you finish:
|
|
136
154
|
{{#if iteration}}- This is local iteration {{iteration}} of {{maxIterations}}. When `{{verifyScript}}`
|
|
137
155
|
exits non-zero you get another iteration to keep working; when it exits 0 the
|
|
138
156
|
phase ends.{{/if}}
|
|
139
|
-
-
|
|
140
|
-
and `skipped` counts as RED — it never authorises a
|
|
157
|
+
- Publish **only** on a green local gate. A gate that did not run is `gate=skipped`,
|
|
158
|
+
and `skipped` counts as RED — it never authorises a publish.
|
|
141
159
|
- On the LAST iteration with the gate still red: emit `outcome=gave-up`,
|
|
142
|
-
`gate=red`, and do **not**
|
|
160
|
+
`gate=red`, and do **not** publish a speculative fix — flag it for a human
|
|
143
161
|
instead (below). An unverified push costs a full CI cycle to prove nothing.
|
|
144
162
|
|
|
145
163
|
STOP and flag for a human when you CAN'T land it, so the nightly red-dependency
|
|
146
164
|
sweep won't keep re-attempting it. That covers two cases:
|
|
147
|
-
- you can't make CI pass with a small, safe change (don't
|
|
165
|
+
- you can't make CI pass with a small, safe change (don't publish a speculative
|
|
148
166
|
fix); or
|
|
149
167
|
- there is **nothing to commit or push** and the PR still can't merge — e.g. it
|
|
150
168
|
was `blocked` on a required *human* review or a gate outside this repo that
|
|
@@ -33,10 +33,12 @@ 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.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
3. Publish with `github_publish` — `{ owner: "{{owner}}", repo: "{{repo}}", message: "feat: implement #{{issueNumber}}\n\nTested: {test command} -> {result}\nScope-risk: {low|medium|high}"{{#if externalizeArtifacts}}, exclude: [".lastlight"]{{/if}} }`.
|
|
37
|
+
The message's first line is the headline and everything after it is the body,
|
|
38
|
+
so fill in the actual test command, its result, and your scope-risk judgement.
|
|
39
|
+
It commits the working tree and pushes it as ONE signed commit, and folds in
|
|
40
|
+
any local commits you already made. Do NOT use `git commit` / `git push`: a
|
|
41
|
+
commit built by git here is unsigned, and a repo that requires signed commits
|
|
42
|
+
blocks it permanently.
|
|
43
|
+
|
|
44
|
+
OUTPUT: List of files changed, test/lint/typecheck results, the published commit hash.
|
package/workflows/prompts/fix.md
CHANGED
|
@@ -13,6 +13,10 @@ once before committing — all of it must pass before you commit.
|
|
|
13
13
|
AFTER THE GATE PASSES:
|
|
14
14
|
1. APPEND to {{issueDir}}/executor-summary.md under heading "## Fix Cycle {{fixCycle}}" (what was fixed, test/lint/typecheck results)
|
|
15
15
|
2. Update status.md: current_phase = fix_loop_{{fixCycle}}
|
|
16
|
-
3.
|
|
16
|
+
3. Publish with `github_publish` — `{ owner: "{{owner}}", repo: "{{repo}}",
|
|
17
|
+
message: "fix: address review feedback for #{{issueNumber}} (cycle {{fixCycle}})" }`.
|
|
18
|
+
It commits the working tree and pushes it as ONE signed commit. Do NOT use
|
|
19
|
+
`git commit` / `git push` — a commit built by git here is unsigned, and a repo
|
|
20
|
+
that requires signed commits blocks it permanently.
|
|
17
21
|
|
|
18
22
|
OUTPUT: What was fixed, test/lint/typecheck results.
|
|
@@ -52,8 +52,7 @@ AFTER CHECKING:
|
|
|
52
52
|
1. mkdir -p {{issueDir}}
|
|
53
53
|
2. Write {{issueDir}}/guardrails-report.md with the status of each check
|
|
54
54
|
3. Write {{issueDir}}/status.md with current_phase: guardrails AND guardrails_status: READY or BLOCKED
|
|
55
|
-
{{#if !externalizeArtifacts}}4.
|
|
56
|
-
5. git push -u origin HEAD{{/if}}{{#if externalizeArtifacts}}4. Do NOT git add or commit {{issueDir}}/ — the harness persists it to the Last Light server automatically.{{/if}}
|
|
55
|
+
{{#if !externalizeArtifacts}}4. `github_publish` with `{ owner: "{{owner}}", repo: "{{repo}}", message: "docs: guardrails check for #{{issueNumber}}", include: [".lastlight"] }` — one signed commit of `.lastlight/` only, so the dependency install you just ran does not ride along. It also creates the branch on GitHub if it isn't there yet. Write the report and status file first: with nothing under `.lastlight/` it reports `published: false` and creates no branch.{{/if}}{{#if externalizeArtifacts}}4. Do NOT git add or commit {{issueDir}}/ — the harness persists it to the Last Light server automatically.{{/if}}
|
|
57
56
|
|
|
58
57
|
ESCAPE HATCH — bootstrap tasks (CHECK THIS FIRST):
|
|
59
58
|
If THE ISSUE ABOVE is itself asking to ADD the tooling you're checking for —
|
|
@@ -41,7 +41,7 @@ promoted this run to a real repair attempt. Treat the failure as reproducible
|
|
|
41
41
|
and look for the actual difference — a version, an ordering, a shared fixture, a
|
|
42
42
|
race — rather than re-running the job and hoping. If you genuinely cannot make
|
|
43
43
|
it green, `outcome=gave-up` with what you ruled out is the honest answer; do not
|
|
44
|
-
|
|
44
|
+
publish a speculative fix.
|
|
45
45
|
{{/if}}
|
|
46
46
|
INSTRUCTIONS:
|
|
47
47
|
1. Understand what the maintainer is asking for, and what the diagnosis says
|
|
@@ -51,15 +51,15 @@ INSTRUCTIONS:
|
|
|
51
51
|
cwd, which is the checkout — holding the **narrowest** command that would
|
|
52
52
|
have failed before your fix and passes after it: one test file, one lint
|
|
53
53
|
rule, one build target, one install. Exit 0 means green. NOT the repo's CI
|
|
54
|
-
pipeline: CI runs on the commit you
|
|
55
|
-
mirrors it delays the
|
|
56
|
-
minutes, skip anything you already watched pass this session, and never
|
|
57
|
-
to start docker or a database (there is none here). If the diagnosed
|
|
58
|
-
has no reproducible check at all, gate on the repair being coherent
|
|
59
|
-
than leaving the script unwritten: a missing script is `gate=skipped`,
|
|
60
|
-
counts as RED and never authorises a
|
|
61
|
-
clears it at the start of every attempt. See the **fixing** skill's
|
|
62
|
-
gate" for the full shape.
|
|
54
|
+
pipeline: CI runs on the commit you publish and is the authority, so a gate
|
|
55
|
+
that mirrors it delays the publish and tells you nothing new — aim for under
|
|
56
|
+
two minutes, skip anything you already watched pass this session, and never
|
|
57
|
+
try to start docker or a database (there is none here). If the diagnosed
|
|
58
|
+
problem has no reproducible check at all, gate on the repair being coherent
|
|
59
|
+
rather than leaving the script unwritten: a missing script is `gate=skipped`,
|
|
60
|
+
which counts as RED and never authorises a publish. It is not there yet — the
|
|
61
|
+
harness clears it at the start of every attempt. See the **fixing** skill's
|
|
62
|
+
"The gate" for the full shape.
|
|
63
63
|
3. Read the relevant code and make the fix — per the **fixing** skill, the
|
|
64
64
|
smallest change that addresses the diagnosed cause. Don't widen the scope.
|
|
65
65
|
4. Follow the **building** skill for the install, then run your gate script and
|
|
@@ -67,20 +67,35 @@ INSTRUCTIONS:
|
|
|
67
67
|
also run the full suite here
|
|
68
68
|
|
|
69
69
|
AFTER FIXING:
|
|
70
|
-
1.
|
|
70
|
+
1. Publish with `github_publish` — `{ owner: "{{owner}}", repo: "{{repo}}",
|
|
71
|
+
message: "fix: address feedback on PR #{{prNumber}}" }`. It commits the whole
|
|
72
|
+
working tree and pushes it as one signed commit; do NOT use `git commit` /
|
|
73
|
+
`git push`: a commit built by git here is unsigned, and on a repo that
|
|
74
|
+
requires signed commits one unsigned commit anywhere in the branch blocks the
|
|
75
|
+
PR permanently and cannot be cleared by a later run. Local commits you made
|
|
76
|
+
while working are folded in automatically.
|
|
77
|
+
- A successful publish IS this phase's push: emit `outcome=pushed`. The
|
|
78
|
+
commit is on the branch and CI is running on it. You did not invoke
|
|
79
|
+
`git push` and were right not to — publishing through the tool is what
|
|
80
|
+
"pushed" means here, so do not downgrade the outcome because no `git push`
|
|
81
|
+
ran.
|
|
82
|
+
- If it reports `published: false`, there was nothing to publish. Emit
|
|
83
|
+
`outcome=no-change` and say so in your summary rather than looping.
|
|
84
|
+
- If it refuses because a change needs a file mode it cannot set (a new
|
|
85
|
+
executable file, a symlink, a submodule pointer), do NOT work around the
|
|
86
|
+
refusal with `git push`: nothing was published, and pushing would land the
|
|
87
|
+
unsigned commit the refusal exists to prevent. Emit `outcome=gave-up` and
|
|
88
|
+
name the file.
|
|
71
89
|
|
|
72
|
-
|
|
73
|
-
2. git push origin HEAD
|
|
74
|
-
|
|
75
|
-
PUSH DISCIPLINE — the gate decides, and it is checked after you finish:
|
|
90
|
+
PUBLISH DISCIPLINE — the gate decides, and it is checked after you finish:
|
|
76
91
|
{{#if iteration}}- This is local iteration {{iteration}} of {{maxIterations}}. When `{{verifyScript}}`
|
|
77
92
|
exits non-zero you get another iteration to keep working; when it exits 0 the
|
|
78
93
|
phase ends.{{/if}}
|
|
79
|
-
-
|
|
80
|
-
and `skipped` counts as RED — it never authorises a
|
|
94
|
+
- Publish **only** on a green local gate. A gate that did not run is `gate=skipped`,
|
|
95
|
+
and `skipped` counts as RED — it never authorises a publish.
|
|
81
96
|
- On the LAST iteration with the gate still red: emit `outcome=gave-up`,
|
|
82
|
-
`gate=red`, and do **not**
|
|
83
|
-
full CI cycle to prove nothing; dispatch-time escalation owns what happens
|
|
97
|
+
`gate=red`, and do **not** publish a speculative fix. An unverified push costs
|
|
98
|
+
a full CI cycle to prove nothing; dispatch-time escalation owns what happens
|
|
84
99
|
next, not you.
|
|
85
100
|
|
|
86
101
|
OUTPUT: Brief summary of what was fixed and test results, then the
|
package/workflows/prompts/pr.md
CHANGED
|
@@ -34,6 +34,6 @@ Do NOT post a comment with the PR link — the harness adds it to the status
|
|
|
34
34
|
checklist on the issue automatically. Just create the PR.
|
|
35
35
|
|
|
36
36
|
Update status.md: current_phase = complete, add pr_number.
|
|
37
|
-
{{#if !externalizeArtifacts}}
|
|
37
|
+
{{#if !externalizeArtifacts}}Then `github_publish` with `{ owner: "{{owner}}", repo: "{{repo}}", message: "status: PR created for #{{issueNumber}}", include: [".lastlight"] }` — one signed commit of `.lastlight/` only, so nothing else in the checkout rides along.{{/if}}{{#if externalizeArtifacts}}Do NOT git add or commit {{issueDir}}/ — the harness persists it to the Last Light server automatically.{{/if}}
|
|
38
38
|
|
|
39
39
|
OUTPUT: The PR number and URL (so the harness can link the PR from the checklist).
|
|
@@ -19,7 +19,7 @@ the typecheck command and the tests covering the fixed files.
|
|
|
19
19
|
AFTER REVIEW:
|
|
20
20
|
1. APPEND to {{issueDir}}/reviewer-verdict.md under heading "## Re-review after Fix Cycle {{fixCycle}}" (preserve the original verdict above). The new section MUST itself contain a "VERDICT: APPROVED" or "VERDICT: REQUEST_CHANGES" line.
|
|
21
21
|
2. Update status.md with reviewer_status: APPROVED or REQUEST_CHANGES
|
|
22
|
-
{{#if !externalizeArtifacts}}3.
|
|
22
|
+
{{#if !externalizeArtifacts}}3. `github_publish` with `{ owner: "{{owner}}", repo: "{{repo}}", message: "review: re-review after fix cycle {{fixCycle}} for #{{issueNumber}}", include: [".lastlight"] }` — one signed commit of `.lastlight/` only, so nothing your test run left in the checkout rides along.{{/if}}{{#if externalizeArtifacts}}3. Do NOT git add or commit {{issueDir}}/ — the harness persists it to the Last Light server automatically.{{/if}}
|
|
23
23
|
|
|
24
24
|
OUTPUT FORMAT — your stdout MUST start with one of these two lines, EXACTLY, on its own line, with no leading whitespace:
|
|
25
25
|
|
|
@@ -39,7 +39,7 @@ AFTER REVIEW:
|
|
|
39
39
|
(paste actual output)
|
|
40
40
|
|
|
41
41
|
2. Update status.md with reviewer_status: APPROVED or REQUEST_CHANGES (matching the verdict)
|
|
42
|
-
{{#if !externalizeArtifacts}}3.
|
|
42
|
+
{{#if !externalizeArtifacts}}3. `github_publish` with `{ owner: "{{owner}}", repo: "{{repo}}", message: "review: verdict for #{{issueNumber}}", include: [".lastlight"] }` — one signed commit of `.lastlight/` only, so nothing your test run left in the checkout rides along.{{/if}}{{#if externalizeArtifacts}}3. Do NOT git add or commit {{issueDir}}/ — the harness persists it to the Last Light server automatically.{{/if}}
|
|
43
43
|
|
|
44
44
|
OUTPUT FORMAT — after you have written the files above, your LAST action MUST be
|
|
45
45
|
a final text message (NOT a tool call). Do not end your turn on a file write or
|