lastlight-evals 0.2.1 → 0.4.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/README.md +37 -1
- package/dashboard/dist/assets/index-D6qxQ8uN.js +258 -0
- package/dashboard/dist/assets/index-DYwJHkLo.css +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/add-case.js +532 -0
- package/dist/add-case.js.map +1 -0
- package/dist/clean.js +127 -0
- package/dist/clean.js.map +1 -0
- package/dist/grade.js +58 -8
- package/dist/grade.js.map +1 -1
- package/dist/init.js +6 -2
- package/dist/init.js.map +1 -1
- package/dist/mechanism.test.js +135 -2
- package/dist/mechanism.test.js.map +1 -1
- package/dist/report.js +34 -9
- package/dist/report.js.map +1 -1
- package/dist/run-instance.js +108 -17
- package/dist/run-instance.js.map +1 -1
- package/dist/run.js +126 -9
- package/dist/run.js.map +1 -1
- package/dist/seed.js +120 -16
- package/dist/seed.js.map +1 -1
- package/dist/serve.js +2 -0
- package/dist/serve.js.map +1 -1
- package/package.json +2 -2
- package/dashboard/dist/assets/index-YwScAAxm.js +0 -238
- package/dashboard/dist/assets/index-uU9Sj3M4.css +0 -1
package/dist/add-case.js
ADDED
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `lastlight-evals add-case` — scaffold an eval instance from a real GitHub PR
|
|
3
|
+
* (code-fix) or issue (triage).
|
|
4
|
+
*
|
|
5
|
+
* This does the MECHANICAL, reproducible extraction; the `lastlight-evals` agent
|
|
6
|
+
* skill drives it and refines the fuzzy parts (held-out test selection, the
|
|
7
|
+
* problem statement, FAIL_TO_PASS names). From a PR it derives:
|
|
8
|
+
* - `repo` + `base_commit` (the true fork point: merge-base of base & head)
|
|
9
|
+
* + `head_commit`,
|
|
10
|
+
* - `test_patch` — the diff of the PR's TEST files (held out at grade time),
|
|
11
|
+
* - gold `patch` — the diff of the non-test files (reference only),
|
|
12
|
+
* - `FAIL_TO_PASS` / `PASS_TO_PASS` — auto-detected by running the tests at
|
|
13
|
+
* base (red) vs head (green) when validation is enabled,
|
|
14
|
+
* - the issue fixture + `expect_github`.
|
|
15
|
+
*
|
|
16
|
+
* The produced instance is a **git-source** case: no `repos/<id>/` fixture is
|
|
17
|
+
* written — at run time the harness clones the real repo into the repo-local
|
|
18
|
+
* cache and checks out `base_commit` (see `seedWorkspaceFromGit`).
|
|
19
|
+
*
|
|
20
|
+
* Validation and the run-time checkout execute the repo's own code (`setup_cmd`
|
|
21
|
+
* / `test_cmd` / its tests). Only point this at repos you trust.
|
|
22
|
+
*/
|
|
23
|
+
import { execFileSync } from "node:child_process";
|
|
24
|
+
import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
25
|
+
import { tmpdir } from "node:os";
|
|
26
|
+
import { join, resolve } from "node:path";
|
|
27
|
+
import chalk from "chalk";
|
|
28
|
+
import { ensureRepoCache } from "./seed.js";
|
|
29
|
+
const ADD_CASE_USAGE = `lastlight-evals add-case --pr <url> | --issue <url> [options]
|
|
30
|
+
|
|
31
|
+
Scaffold an eval instance from a real GitHub PR (code-fix) or issue (triage).
|
|
32
|
+
|
|
33
|
+
Options:
|
|
34
|
+
--pr <url> GitHub PR url → a code-fix (build) case
|
|
35
|
+
--issue <url> GitHub issue url → a triage case
|
|
36
|
+
--tier <name> Target tier dir (default: code-fix for --pr, triage for --issue)
|
|
37
|
+
--id <slug> instance_id (default: derived from repo + number)
|
|
38
|
+
--datasets <dir> Datasets root to write into (a <tier>/ subdir)
|
|
39
|
+
--overlay <dir> Write into <dir>/evals/datasets instead
|
|
40
|
+
--test-cmd "<cmd>" Held-out test command (default: node --test). Stored as test_cmd.
|
|
41
|
+
--setup-cmd "<cmd>" Install/build run before tests (e.g. "npm ci"). Stored as setup_cmd.
|
|
42
|
+
--hold-out SWE-bench style: hold the PR's test files out of the agent's
|
|
43
|
+
repo and apply them only at grade time, scored by named
|
|
44
|
+
FAIL_TO_PASS. Default is SUITE mode — grade on the repo's own
|
|
45
|
+
test_cmd run against the agent's final tree (nothing held out).
|
|
46
|
+
--pass-list (hold-out only) Enumerate every green test in PASS_TO_PASS.
|
|
47
|
+
Default is PASS_TO_PASS=["*"] (the whole suite must stay green).
|
|
48
|
+
--no-validate Don't run the repo's tests to validate the case (just scaffold)
|
|
49
|
+
--dry-run Print the proposed instance JSON; don't write
|
|
50
|
+
-h, --help Show this help
|
|
51
|
+
|
|
52
|
+
The repo's tests/setup run real code — only use trusted repos.`;
|
|
53
|
+
// ── small shells ────────────────────────────────────────────────────────────
|
|
54
|
+
function sh(bin, args, cwd) {
|
|
55
|
+
return execFileSync(bin, args, { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], maxBuffer: 64 * 1024 * 1024 });
|
|
56
|
+
}
|
|
57
|
+
function ghJson(args) {
|
|
58
|
+
return JSON.parse(sh("gh", args));
|
|
59
|
+
}
|
|
60
|
+
/** Run a test/setup command, recovering output + exit status (never throws). */
|
|
61
|
+
function runCmd(argv, cwd) {
|
|
62
|
+
try {
|
|
63
|
+
const raw = execFileSync(argv[0], argv.slice(1), { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 600_000, maxBuffer: 64 * 1024 * 1024 });
|
|
64
|
+
return { ok: true, raw };
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
const e = err;
|
|
68
|
+
return { ok: false, raw: (e.stdout ?? "") + (e.stderr ?? "") };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const TAP_LINE = /^(ok|not ok)\s+\d+\s+-\s+(.+?)(?:\s+#.*)?$/;
|
|
72
|
+
function parseTap(raw) {
|
|
73
|
+
const out = new Map();
|
|
74
|
+
for (const line of raw.split("\n")) {
|
|
75
|
+
const m = line.trim().match(TAP_LINE);
|
|
76
|
+
if (m)
|
|
77
|
+
out.set(m[2].trim(), m[1] === "ok");
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
// ── helpers ─────────────────────────────────────────────────────────────────
|
|
82
|
+
function parseRepoFromUrl(url) {
|
|
83
|
+
const m = url.match(/github\.com[/:]+([^/]+)\/([^/]+)\/(?:pull|issues)\/(\d+)/i);
|
|
84
|
+
if (!m)
|
|
85
|
+
throw new Error(`Not a GitHub PR/issue url: ${url}`);
|
|
86
|
+
return { owner: m[1], name: m[2].replace(/\.git$/, ""), number: Number(m[3]) };
|
|
87
|
+
}
|
|
88
|
+
function slugify(s) {
|
|
89
|
+
return s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60);
|
|
90
|
+
}
|
|
91
|
+
const TEST_PATH = /(^|\/)(tests?|__tests__|spec)\/|[._-](test|spec)\.[a-z0-9]+$/i;
|
|
92
|
+
function isTestPath(p) {
|
|
93
|
+
return TEST_PATH.test(p);
|
|
94
|
+
}
|
|
95
|
+
/** Split argv from a `--test-cmd "npm test"` style flag (whitespace split). */
|
|
96
|
+
function parseCmd(s) {
|
|
97
|
+
if (!s)
|
|
98
|
+
return undefined;
|
|
99
|
+
const parts = s.trim().split(/\s+/).filter(Boolean);
|
|
100
|
+
return parts.length ? parts : undefined;
|
|
101
|
+
}
|
|
102
|
+
/** Resolve the datasets root to write the tier into. */
|
|
103
|
+
function resolveWriteRoot(opts) {
|
|
104
|
+
if (opts.datasets)
|
|
105
|
+
return resolve(opts.datasets);
|
|
106
|
+
if (opts.overlay)
|
|
107
|
+
return resolve(opts.overlay, "evals", "datasets");
|
|
108
|
+
if (existsSync(resolve("datasets")))
|
|
109
|
+
return resolve("datasets");
|
|
110
|
+
return resolve("evals", "datasets");
|
|
111
|
+
}
|
|
112
|
+
/** Append (or replace by id) an instance into `<root>/<tier>/instances.json`,
|
|
113
|
+
* creating the tier dir + a `tier.json` when absent. */
|
|
114
|
+
function writeInstance(root, tier, defaultWorkflow, inst) {
|
|
115
|
+
const tierDir = join(root, tier);
|
|
116
|
+
mkdirSync(tierDir, { recursive: true });
|
|
117
|
+
const tierJson = join(tierDir, "tier.json");
|
|
118
|
+
if (!existsSync(tierJson)) {
|
|
119
|
+
writeFileSync(tierJson, JSON.stringify({ name: tier, defaultWorkflow, description: `${tier} cases.` }, null, 2) + "\n");
|
|
120
|
+
}
|
|
121
|
+
const instancesPath = join(tierDir, "instances.json");
|
|
122
|
+
const arr = existsSync(instancesPath)
|
|
123
|
+
? JSON.parse(readFileSync(instancesPath, "utf8"))
|
|
124
|
+
: [];
|
|
125
|
+
const at = arr.findIndex((i) => i.instance_id === inst.instance_id);
|
|
126
|
+
if (at >= 0)
|
|
127
|
+
arr[at] = inst;
|
|
128
|
+
else
|
|
129
|
+
arr.push(inst);
|
|
130
|
+
writeFileSync(instancesPath, JSON.stringify(arr, null, 2) + "\n");
|
|
131
|
+
return instancesPath;
|
|
132
|
+
}
|
|
133
|
+
/** Fetch a linked closing issue's title/body. `gh pr view`'s
|
|
134
|
+
* `closingIssuesReferences` omits them (it returns only number/url/id/repository),
|
|
135
|
+
* so a bare interpolation of `linked.title`/`linked.body` would yield the literal
|
|
136
|
+
* string "undefined". Returns undefined if the issue can't be read (private/gone),
|
|
137
|
+
* letting the caller fall back to the PR's own title/body. */
|
|
138
|
+
function fetchLinkedIssue(repo, number) {
|
|
139
|
+
try {
|
|
140
|
+
const iss = ghJson([
|
|
141
|
+
"issue", "view", String(number), "--repo", repo, "--json", "number,title,body",
|
|
142
|
+
]);
|
|
143
|
+
return { number: iss.number, title: iss.title, body: iss.body ?? "" };
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
async function fromPr(url, o) {
|
|
150
|
+
const { owner, name } = parseRepoFromUrl(url);
|
|
151
|
+
const repo = `${owner}/${name}`;
|
|
152
|
+
console.log(chalk.dim(`Resolving PR ${repo}#${parseRepoFromUrl(url).number}…`));
|
|
153
|
+
const pr = ghJson([
|
|
154
|
+
"pr", "view", url,
|
|
155
|
+
"--json", "number,title,body,baseRefName,headRefName,headRefOid,url,closingIssuesReferences",
|
|
156
|
+
]);
|
|
157
|
+
// Mirror the repo locally and pull in the PR head ref (it may live on a fork).
|
|
158
|
+
const mirror = ensureRepoCache({ repo });
|
|
159
|
+
const headRef = `refs/eval/pr-${pr.number}`;
|
|
160
|
+
sh("git", ["fetch", "--quiet", "origin", `pull/${pr.number}/head:${headRef}`], mirror);
|
|
161
|
+
const head = pr.headRefOid || sh("git", ["rev-parse", headRef], mirror).trim();
|
|
162
|
+
// Make sure the base branch is present (default mirror has refs/heads/*).
|
|
163
|
+
const base = sh("git", ["merge-base", `refs/heads/${pr.baseRefName}`, head], mirror).trim();
|
|
164
|
+
// The non-test code change is the gold patch (reference only) in both modes.
|
|
165
|
+
const changed = sh("git", ["diff", "--name-only", base, head], mirror).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
166
|
+
const testFiles = changed.filter(isTestPath);
|
|
167
|
+
const codeFiles = changed.filter((f) => !isTestPath(f));
|
|
168
|
+
const goldPatch = codeFiles.length ? sh("git", ["diff", base, head, "--", ...codeFiles], mirror) : "";
|
|
169
|
+
// Grading fields differ by mode:
|
|
170
|
+
// - default (suite): nothing held out — grade on the repo's own `test_cmd`
|
|
171
|
+
// run against the agent's final tree (resolved iff it exits 0).
|
|
172
|
+
// - `--hold-out`: SWE-bench — the PR's test files are held out and applied
|
|
173
|
+
// only at grade time, scored by named FAIL_TO_PASS / PASS_TO_PASS.
|
|
174
|
+
let gradeFields = {};
|
|
175
|
+
if (o.holdOut) {
|
|
176
|
+
const testPatch = testFiles.length ? sh("git", ["diff", base, head, "--", ...testFiles], mirror) : "";
|
|
177
|
+
if (!testFiles.length) {
|
|
178
|
+
console.log(chalk.yellow("⚠ --hold-out but no test files detected in the PR diff — set test_patch by hand or rely on --test-cmd."));
|
|
179
|
+
}
|
|
180
|
+
let failToPass = [];
|
|
181
|
+
let passToPass = ["*"];
|
|
182
|
+
if (o.validate) {
|
|
183
|
+
const verdicts = validate({ mirror, base, head, testPatch, testCmd: o.testCmd, setupCmd: o.setupCmd });
|
|
184
|
+
failToPass = verdicts.failToPass;
|
|
185
|
+
if (o.passList)
|
|
186
|
+
passToPass = verdicts.passToPass;
|
|
187
|
+
if (verdicts.note)
|
|
188
|
+
console.log(chalk.yellow(`⚠ ${verdicts.note}`));
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
console.log(chalk.dim("Skipping validation (--no-validate) — FAIL_TO_PASS left empty."));
|
|
192
|
+
}
|
|
193
|
+
console.log(chalk.dim(o.passList ? "PASS_TO_PASS enumerated." : 'PASS_TO_PASS = ["*"] (whole suite must stay green; --pass-list to enumerate).'));
|
|
194
|
+
gradeFields = {
|
|
195
|
+
hold_out_tests: true,
|
|
196
|
+
...(testPatch ? { test_patch: testPatch } : {}),
|
|
197
|
+
FAIL_TO_PASS: failToPass,
|
|
198
|
+
PASS_TO_PASS: passToPass,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
console.log(chalk.dim("Suite mode (default): grade on the repo's own test_cmd at the agent's final tree — nothing held out. (--hold-out for SWE-bench style.)"));
|
|
203
|
+
if (o.validate) {
|
|
204
|
+
const probe = probeSuite({ mirror, base, head, testCmd: o.testCmd, setupCmd: o.setupCmd });
|
|
205
|
+
if (probe.headGreen)
|
|
206
|
+
console.log(chalk.dim("✓ Reference suite passes at head."));
|
|
207
|
+
else
|
|
208
|
+
console.log(chalk.yellow("⚠ The reference solution's suite did NOT pass at head (test_cmd exit ≠ 0) — check --test-cmd / --setup-cmd; the case may be ungradeable."));
|
|
209
|
+
if (probe.baseGreen) {
|
|
210
|
+
console.log(chalk.yellow("⚠ The suite is ALREADY green at base — a no-op solution would resolve this case. Consider --hold-out, or a case whose failing test already exists at base."));
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// No test_patch / FAIL_TO_PASS / PASS_TO_PASS — pure suite-exit-code grading.
|
|
214
|
+
}
|
|
215
|
+
// Issue fixture: the linked issue if the PR closes one, else the PR itself.
|
|
216
|
+
// `closingIssuesReferences` carries only the issue number, so fetch title/body.
|
|
217
|
+
const linkedRef = pr.closingIssuesReferences?.[0];
|
|
218
|
+
const linked = linkedRef ? fetchLinkedIssue(repo, linkedRef.number) : undefined;
|
|
219
|
+
if (linkedRef && !linked) {
|
|
220
|
+
console.log(chalk.yellow(`⚠ PR closes #${linkedRef.number} but its title/body couldn't be read — falling back to the PR's own title/body.`));
|
|
221
|
+
}
|
|
222
|
+
const issueNumber = linked?.number ?? pr.number;
|
|
223
|
+
const issue = {
|
|
224
|
+
number: issueNumber,
|
|
225
|
+
title: linked?.title ?? pr.title,
|
|
226
|
+
body: linked?.body ?? pr.body ?? "",
|
|
227
|
+
labels: ["bug", "ready-for-agent"],
|
|
228
|
+
user: "reporter",
|
|
229
|
+
};
|
|
230
|
+
const id = o.id ?? `codefix__${slugify(name)}-pr${pr.number}`;
|
|
231
|
+
const inst = {
|
|
232
|
+
instance_id: id,
|
|
233
|
+
repo,
|
|
234
|
+
workflow: "build",
|
|
235
|
+
base_commit: base,
|
|
236
|
+
head_commit: head,
|
|
237
|
+
problem_statement: linked ? `${linked.title}\n\n${linked.body ?? ""}`.trim() : `${pr.title}\n\n${pr.body ?? ""}`.trim(),
|
|
238
|
+
...(goldPatch ? { patch: goldPatch } : {}),
|
|
239
|
+
...gradeFields,
|
|
240
|
+
...(o.testCmd ? { test_cmd: o.testCmd } : {}),
|
|
241
|
+
...(o.setupCmd ? { setup_cmd: o.setupCmd } : {}),
|
|
242
|
+
issue,
|
|
243
|
+
expect_github: { pr_opened: { base: pr.baseRefName, head_is_branch: true } },
|
|
244
|
+
};
|
|
245
|
+
return emit(inst, "code-fix", "build", o);
|
|
246
|
+
}
|
|
247
|
+
/** Run the held-out tests at base (red) and head (green); diff TAP to verdicts. */
|
|
248
|
+
function validate(opts) {
|
|
249
|
+
const tmp = mkdtempSync(join(tmpdir(), "ll-addcase-"));
|
|
250
|
+
const wt = join(tmp, "wt");
|
|
251
|
+
console.log(chalk.dim("Validating: running the repo's tests at base (red) and head (green)…"));
|
|
252
|
+
try {
|
|
253
|
+
sh("git", ["worktree", "add", "--quiet", "--detach", wt, opts.base], opts.mirror);
|
|
254
|
+
const run = () => {
|
|
255
|
+
if (opts.setupCmd)
|
|
256
|
+
runCmd(opts.setupCmd, wt);
|
|
257
|
+
const argv = opts.testCmd ?? defaultTestArgv(wt);
|
|
258
|
+
return runCmd(argv, wt);
|
|
259
|
+
};
|
|
260
|
+
// Base + held-out tests applied → expect failures.
|
|
261
|
+
if (opts.testPatch) {
|
|
262
|
+
const pf = join(wt, ".eval-test.patch");
|
|
263
|
+
writeFileSync(pf, opts.testPatch);
|
|
264
|
+
try {
|
|
265
|
+
sh("git", ["apply", pf], wt);
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
return { failToPass: [], passToPass: [], note: "Could not apply test_patch onto base; verify FAIL_TO_PASS manually." };
|
|
269
|
+
}
|
|
270
|
+
rmSync(pf, { force: true });
|
|
271
|
+
}
|
|
272
|
+
const baseTap = parseTap(run().raw);
|
|
273
|
+
// Head state already includes the tests → expect green.
|
|
274
|
+
sh("git", ["checkout", "--quiet", "--force", opts.head], wt);
|
|
275
|
+
const headRun = run();
|
|
276
|
+
const headTap = parseTap(headRun.raw);
|
|
277
|
+
if (headTap.size === 0) {
|
|
278
|
+
// No TAP names → suite mode. Resolved is graded on exit code at run time.
|
|
279
|
+
return {
|
|
280
|
+
failToPass: [],
|
|
281
|
+
passToPass: [],
|
|
282
|
+
note: headRun.ok
|
|
283
|
+
? "No TAP test names parsed — case will use suite mode (graded on the test command's exit code). " +
|
|
284
|
+
"For per-test FAIL_TO_PASS grading, point --test-cmd at a TAP-emitting runner (e.g. \"npx vitest run --reporter=tap\", \"npx mocha --reporter tap\")."
|
|
285
|
+
: "Tests did not pass at head and emitted no TAP — check the test command / setup; case left in suite mode.",
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
const failToPass = [];
|
|
289
|
+
const passToPass = [];
|
|
290
|
+
for (const [naam, greenAtHead] of headTap) {
|
|
291
|
+
if (!greenAtHead)
|
|
292
|
+
continue;
|
|
293
|
+
if (baseTap.get(naam) === false || !baseTap.has(naam))
|
|
294
|
+
failToPass.push(naam);
|
|
295
|
+
else
|
|
296
|
+
passToPass.push(naam);
|
|
297
|
+
}
|
|
298
|
+
if (!failToPass.length) {
|
|
299
|
+
return { failToPass, passToPass, note: "No test flipped red→green — the fix may not be exercised by these tests; review before using." };
|
|
300
|
+
}
|
|
301
|
+
return { failToPass, passToPass };
|
|
302
|
+
}
|
|
303
|
+
catch (err) {
|
|
304
|
+
return { failToPass: [], passToPass: [], note: `Validation failed (${err.message}); fill FAIL_TO_PASS manually.` };
|
|
305
|
+
}
|
|
306
|
+
finally {
|
|
307
|
+
try {
|
|
308
|
+
sh("git", ["worktree", "remove", "--force", wt], opts.mirror);
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
/* best effort */
|
|
312
|
+
}
|
|
313
|
+
rmSync(tmp, { recursive: true, force: true });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/** Suite-mode sanity probe: run the repo's own `test_cmd` at base and head. A
|
|
317
|
+
* green head means the reference solution's suite passes (case is gradeable); a
|
|
318
|
+
* green base means a no-op would already resolve it (the author should reconsider). */
|
|
319
|
+
function probeSuite(opts) {
|
|
320
|
+
const tmp = mkdtempSync(join(tmpdir(), "ll-addcase-suite-"));
|
|
321
|
+
const wt = join(tmp, "wt");
|
|
322
|
+
console.log(chalk.dim("Probing the repo suite at base and head…"));
|
|
323
|
+
try {
|
|
324
|
+
sh("git", ["worktree", "add", "--quiet", "--detach", wt, opts.base], opts.mirror);
|
|
325
|
+
const run = () => {
|
|
326
|
+
if (opts.setupCmd)
|
|
327
|
+
runCmd(opts.setupCmd, wt);
|
|
328
|
+
const argv = opts.testCmd ?? defaultTestArgv(wt);
|
|
329
|
+
return runCmd(argv, wt).ok;
|
|
330
|
+
};
|
|
331
|
+
const baseGreen = run();
|
|
332
|
+
sh("git", ["checkout", "--quiet", "--force", opts.head], wt);
|
|
333
|
+
const headGreen = run();
|
|
334
|
+
return { baseGreen, headGreen };
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
return { baseGreen: false, headGreen: false };
|
|
338
|
+
}
|
|
339
|
+
finally {
|
|
340
|
+
try {
|
|
341
|
+
sh("git", ["worktree", "remove", "--force", wt], opts.mirror);
|
|
342
|
+
}
|
|
343
|
+
catch {
|
|
344
|
+
/* best effort */
|
|
345
|
+
}
|
|
346
|
+
rmSync(tmp, { recursive: true, force: true });
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
function defaultTestArgv(dir) {
|
|
350
|
+
const files = listTestFiles(dir);
|
|
351
|
+
return [process.execPath, "--test", "--test-reporter=tap", "--experimental-strip-types", ...files];
|
|
352
|
+
}
|
|
353
|
+
function listTestFiles(dir, prefix = "") {
|
|
354
|
+
const out = [];
|
|
355
|
+
let entries = [];
|
|
356
|
+
try {
|
|
357
|
+
entries = readdirSync(dir);
|
|
358
|
+
}
|
|
359
|
+
catch {
|
|
360
|
+
return out;
|
|
361
|
+
}
|
|
362
|
+
for (const ent of entries) {
|
|
363
|
+
if (ent === "node_modules" || ent === ".git")
|
|
364
|
+
continue;
|
|
365
|
+
const rel = prefix ? `${prefix}/${ent}` : ent;
|
|
366
|
+
const abs = join(dir, ent);
|
|
367
|
+
let isDir = false;
|
|
368
|
+
try {
|
|
369
|
+
isDir = statSync(abs).isDirectory();
|
|
370
|
+
}
|
|
371
|
+
catch {
|
|
372
|
+
continue;
|
|
373
|
+
}
|
|
374
|
+
if (isDir)
|
|
375
|
+
out.push(...listTestFiles(abs, rel));
|
|
376
|
+
else if (/\.test\.(ts|tsx|mts|js|mjs)$/.test(ent))
|
|
377
|
+
out.push(rel);
|
|
378
|
+
}
|
|
379
|
+
return out;
|
|
380
|
+
}
|
|
381
|
+
/** Best-effort: who applied which label (the human triage decision). Returns a
|
|
382
|
+
* net label→actor map (labels later removed are dropped). Empty if the events
|
|
383
|
+
* API isn't reachable. */
|
|
384
|
+
function labelActors(repo, number) {
|
|
385
|
+
const out = new Map();
|
|
386
|
+
try {
|
|
387
|
+
const events = ghJson(["api", "--paginate", `repos/${repo}/issues/${number}/events`]);
|
|
388
|
+
for (const e of events) {
|
|
389
|
+
const ln = e.label?.name;
|
|
390
|
+
if (!ln)
|
|
391
|
+
continue;
|
|
392
|
+
if (e.event === "labeled")
|
|
393
|
+
out.set(ln, e.actor?.login ?? "?");
|
|
394
|
+
else if (e.event === "unlabeled")
|
|
395
|
+
out.delete(ln);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
catch {
|
|
399
|
+
/* events API unavailable — fall back to bare label names */
|
|
400
|
+
}
|
|
401
|
+
return out;
|
|
402
|
+
}
|
|
403
|
+
async function fromIssue(url, o) {
|
|
404
|
+
const { owner, name } = parseRepoFromUrl(url);
|
|
405
|
+
const repo = `${owner}/${name}`;
|
|
406
|
+
const iv = ghJson(["issue", "view", url, "--json", "number,title,body,url,state,labels,comments,author"]);
|
|
407
|
+
const labels = (iv.labels ?? []).map((l) => l.name);
|
|
408
|
+
const comments = (iv.comments ?? []).filter((c) => c.body?.trim());
|
|
409
|
+
const closed = (iv.state ?? "").toUpperCase() === "CLOSED";
|
|
410
|
+
const issueAuthor = iv.author?.login ?? "reporter";
|
|
411
|
+
const actors = labelActors(repo, iv.number);
|
|
412
|
+
const id = o.id ?? `triage__${slugify(name)}-${iv.number}`;
|
|
413
|
+
const inst = {
|
|
414
|
+
instance_id: id,
|
|
415
|
+
repo,
|
|
416
|
+
workflow: "issue-triage",
|
|
417
|
+
problem_statement: `${iv.title}\n\n${iv.body ?? ""}`.trim(),
|
|
418
|
+
// Seed the issue as the agent would FIRST see it: its content, but WITHOUT
|
|
419
|
+
// the triage labels (those are the gold the agent must reproduce). The skill
|
|
420
|
+
// can add back any genuinely pre-existing, non-triage label.
|
|
421
|
+
issue: {
|
|
422
|
+
number: iv.number,
|
|
423
|
+
title: iv.title,
|
|
424
|
+
body: iv.body ?? "",
|
|
425
|
+
labels: [],
|
|
426
|
+
user: issueAuthor,
|
|
427
|
+
},
|
|
428
|
+
// gradeTriage maps category/state to label strings — which depends on the
|
|
429
|
+
// deployment's taxonomy, so the skill assigns them from `labels` below.
|
|
430
|
+
triage_gold: {},
|
|
431
|
+
// The human outcome to reproduce: the labels that were applied (+ closed).
|
|
432
|
+
expect_github: {
|
|
433
|
+
...(labels.length ? { labels_added: labels } : {}),
|
|
434
|
+
...(closed ? { issue_closed: true } : {}),
|
|
435
|
+
},
|
|
436
|
+
};
|
|
437
|
+
// Evidence block — the raw triage signal the skill turns into triage_gold and
|
|
438
|
+
// (optionally) a comment_matches assertion.
|
|
439
|
+
console.log(chalk.bold(`\n# Triage evidence for ${repo}#${iv.number}`));
|
|
440
|
+
if (labels.length) {
|
|
441
|
+
console.log(chalk.dim("\nLabels applied (→ split into triage_gold.category / .state):"));
|
|
442
|
+
for (const l of labels)
|
|
443
|
+
console.log(` • ${l}${actors.has(l) ? chalk.dim(` (by ${actors.get(l)})`) : ""}`);
|
|
444
|
+
}
|
|
445
|
+
else {
|
|
446
|
+
console.log(chalk.yellow("\n⚠ No labels on the issue — no labels_added expectation; set triage_gold by hand."));
|
|
447
|
+
}
|
|
448
|
+
if (comments.length) {
|
|
449
|
+
console.log(chalk.dim(`\nReviewer comments (${comments.length}) — use to seed context or a comment_matches regex:`));
|
|
450
|
+
for (const c of comments.slice(0, 8)) {
|
|
451
|
+
const who = c.author?.login ?? "?";
|
|
452
|
+
const first = (c.body ?? "").trim().split("\n")[0].slice(0, 120);
|
|
453
|
+
console.log(` ${chalk.cyan(who)}: ${first}`);
|
|
454
|
+
}
|
|
455
|
+
if (comments.length > 8)
|
|
456
|
+
console.log(chalk.dim(` …and ${comments.length - 8} more`));
|
|
457
|
+
}
|
|
458
|
+
console.log(chalk.yellow("\n⚠ triage_gold is empty — assign category/state from the labels above per the deployment's taxonomy before running."));
|
|
459
|
+
return emit(inst, "triage", "issue-triage", o);
|
|
460
|
+
}
|
|
461
|
+
// ── output ──────────────────────────────────────────────────────────────────
|
|
462
|
+
function emit(inst, defaultTier, defaultWorkflow, o) {
|
|
463
|
+
const tier = o.tier ?? defaultTier;
|
|
464
|
+
if (o.dryRun) {
|
|
465
|
+
console.log(chalk.bold(`\n# ${inst.instance_id} → ${tier}/instances.json (dry-run)\n`));
|
|
466
|
+
console.log(JSON.stringify(inst, null, 2));
|
|
467
|
+
return 0;
|
|
468
|
+
}
|
|
469
|
+
const root = resolveWriteRoot(o);
|
|
470
|
+
const path = writeInstance(root, tier, defaultWorkflow, inst);
|
|
471
|
+
console.log(chalk.green(`✓ wrote ${inst.instance_id} → ${path}`));
|
|
472
|
+
return 0;
|
|
473
|
+
}
|
|
474
|
+
export async function runAddCase(args = []) {
|
|
475
|
+
if (args.includes("-h") || args.includes("--help")) {
|
|
476
|
+
console.log(ADD_CASE_USAGE);
|
|
477
|
+
return 0;
|
|
478
|
+
}
|
|
479
|
+
const val = (name) => {
|
|
480
|
+
for (let i = 0; i < args.length; i++) {
|
|
481
|
+
if (args[i] === name)
|
|
482
|
+
return args[i + 1];
|
|
483
|
+
if (args[i].startsWith(`${name}=`))
|
|
484
|
+
return args[i].slice(name.length + 1);
|
|
485
|
+
}
|
|
486
|
+
return undefined;
|
|
487
|
+
};
|
|
488
|
+
const pr = val("--pr");
|
|
489
|
+
const issue = val("--issue");
|
|
490
|
+
const o = {
|
|
491
|
+
tier: val("--tier"),
|
|
492
|
+
id: val("--id"),
|
|
493
|
+
datasets: val("--datasets"),
|
|
494
|
+
overlay: val("--overlay"),
|
|
495
|
+
testCmd: parseCmd(val("--test-cmd")),
|
|
496
|
+
setupCmd: parseCmd(val("--setup-cmd")),
|
|
497
|
+
holdOut: args.includes("--hold-out"),
|
|
498
|
+
passList: args.includes("--pass-list"),
|
|
499
|
+
validate: !args.includes("--no-validate"),
|
|
500
|
+
dryRun: args.includes("--dry-run"),
|
|
501
|
+
};
|
|
502
|
+
if ((pr && issue) || (!pr && !issue)) {
|
|
503
|
+
console.error("add-case: pass exactly one of --pr <url> or --issue <url>.\n");
|
|
504
|
+
console.error(ADD_CASE_USAGE);
|
|
505
|
+
return 2;
|
|
506
|
+
}
|
|
507
|
+
// `gh` is required for PR/issue metadata — check presence AND auth up front so
|
|
508
|
+
// a missing/unauthenticated setup fails cleanly before any work, rather than
|
|
509
|
+
// partway through with a raw "Command failed" from the first API call.
|
|
510
|
+
try {
|
|
511
|
+
sh("gh", ["--version"]);
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
console.error("add-case needs the GitHub CLI (`gh`) on PATH. Install it from https://cli.github.com, then run `gh auth login`.");
|
|
515
|
+
return 2;
|
|
516
|
+
}
|
|
517
|
+
try {
|
|
518
|
+
sh("gh", ["auth", "status"]);
|
|
519
|
+
}
|
|
520
|
+
catch {
|
|
521
|
+
console.error("add-case needs `gh` authenticated to read PRs/issues — run `gh auth login` and retry.");
|
|
522
|
+
return 2;
|
|
523
|
+
}
|
|
524
|
+
try {
|
|
525
|
+
return pr ? await fromPr(pr, o) : await fromIssue(issue, o);
|
|
526
|
+
}
|
|
527
|
+
catch (err) {
|
|
528
|
+
console.error(chalk.red(`add-case failed: ${err.message}`));
|
|
529
|
+
return 1;
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
//# sourceMappingURL=add-case.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-case.js","sourceRoot":"","sources":["../src/add-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACzH,O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