@allenpan2026/harshjudge 0.4.1 → 0.4.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/.claude-plugin/plugin.json +1 -1
- package/README.md +4 -1
- package/dist/cli.js +28 -14
- package/dist/cli.js.map +1 -1
- package/dist/dashboard-worker.js.map +1 -1
- package/dist/ux-dist/assets/index-CRmmB-pA.js +118 -0
- package/dist/ux-dist/assets/index-DF_aOVSg.css +1 -0
- package/dist/ux-dist/index.html +14 -0
- package/package.json +2 -2
- package/skills/harshjudge/references/run-browser.md +63 -0
- package/skills/harshjudge/references/run-step-agent.md +2 -2
- package/skills/harshjudge/references/run.md +26 -1
- package/skills/harshjudge/references/run-playwright.md +0 -41
package/README.md
CHANGED
|
@@ -34,7 +34,10 @@ harshjudge init my-app
|
|
|
34
34
|
|
|
35
35
|
- **Node.js**: 18+ LTS
|
|
36
36
|
- **Claude Code**: Latest version
|
|
37
|
-
- **
|
|
37
|
+
- **A browser automation tool** (any one of):
|
|
38
|
+
- Playwright MCP (default, most common)
|
|
39
|
+
- browser-use MCP (token efficient alternative)
|
|
40
|
+
- Chrome DevTools MCP
|
|
38
41
|
|
|
39
42
|
## Installation
|
|
40
43
|
|
package/dist/cli.js
CHANGED
|
@@ -1471,7 +1471,7 @@ function extractScenarioSlug(runPath) {
|
|
|
1471
1471
|
const parts = runPath.split("/");
|
|
1472
1472
|
const scenariosIdx = parts.indexOf("scenarios");
|
|
1473
1473
|
if (scenariosIdx >= 0 && parts.length > scenariosIdx + 1) {
|
|
1474
|
-
return parts[scenariosIdx + 1];
|
|
1474
|
+
return parts[scenariosIdx + 1] ?? "unknown";
|
|
1475
1475
|
}
|
|
1476
1476
|
return "unknown";
|
|
1477
1477
|
}
|
|
@@ -1488,7 +1488,9 @@ async function handleCompleteRun(params, fs = new FileSystemService()) {
|
|
|
1488
1488
|
const resultPath = `${runPath}/${RESULT_FILE4}`;
|
|
1489
1489
|
let existingResult = null;
|
|
1490
1490
|
if (await fs.exists(resultPath)) {
|
|
1491
|
-
existingResult = await fs.readJson(
|
|
1491
|
+
existingResult = await fs.readJson(
|
|
1492
|
+
resultPath
|
|
1493
|
+
);
|
|
1492
1494
|
if (existingResult.status !== "running") {
|
|
1493
1495
|
throw new Error(`Run "${validated.runId}" is already completed.`);
|
|
1494
1496
|
}
|
|
@@ -1506,7 +1508,8 @@ async function handleCompleteRun(params, fs = new FileSystemService()) {
|
|
|
1506
1508
|
duration: 0,
|
|
1507
1509
|
// Unknown for v1 compat
|
|
1508
1510
|
error: validated.failedStep === se.stepId ? validated.errorMessage ?? null : null,
|
|
1509
|
-
evidenceFiles: se.evidenceFiles
|
|
1511
|
+
evidenceFiles: se.evidenceFiles,
|
|
1512
|
+
summary: null
|
|
1510
1513
|
}));
|
|
1511
1514
|
}
|
|
1512
1515
|
let startedAt;
|
|
@@ -1520,11 +1523,21 @@ async function handleCompleteRun(params, fs = new FileSystemService()) {
|
|
|
1520
1523
|
startedAt = runData.startedAt;
|
|
1521
1524
|
}
|
|
1522
1525
|
}
|
|
1526
|
+
let effectiveStatus = validated.status;
|
|
1527
|
+
let warning;
|
|
1528
|
+
if (steps.length > 0) {
|
|
1529
|
+
const anyFailed = steps.some((s) => s.status === "fail");
|
|
1530
|
+
const derivedStatus = anyFailed ? "fail" : "pass";
|
|
1531
|
+
if (derivedStatus !== validated.status) {
|
|
1532
|
+
warning = `Status mismatch: --status "${validated.status}" contradicts step results (derived: "${derivedStatus}"). Using derived status.`;
|
|
1533
|
+
effectiveStatus = derivedStatus;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1523
1536
|
const scenarioSlug = extractScenarioSlug(runPath);
|
|
1524
1537
|
const result = {
|
|
1525
1538
|
runId: validated.runId,
|
|
1526
1539
|
scenarioSlug,
|
|
1527
|
-
status:
|
|
1540
|
+
status: effectiveStatus,
|
|
1528
1541
|
startedAt: startedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
1529
1542
|
completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1530
1543
|
duration: validated.duration,
|
|
@@ -1539,16 +1552,16 @@ async function handleCompleteRun(params, fs = new FileSystemService()) {
|
|
|
1539
1552
|
existingMeta = await fs.readYaml(metaPath);
|
|
1540
1553
|
}
|
|
1541
1554
|
const currentStats = {
|
|
1542
|
-
totalRuns: existingMeta
|
|
1543
|
-
passCount: existingMeta
|
|
1544
|
-
failCount: existingMeta
|
|
1545
|
-
lastRun: existingMeta
|
|
1546
|
-
lastResult: existingMeta
|
|
1547
|
-
avgDuration: existingMeta
|
|
1555
|
+
totalRuns: existingMeta["totalRuns"] ?? 0,
|
|
1556
|
+
passCount: existingMeta["passCount"] ?? 0,
|
|
1557
|
+
failCount: existingMeta["failCount"] ?? 0,
|
|
1558
|
+
lastRun: existingMeta["lastRun"] ?? null,
|
|
1559
|
+
lastResult: existingMeta["lastResult"] ?? null,
|
|
1560
|
+
avgDuration: existingMeta["avgDuration"] ?? 0
|
|
1548
1561
|
};
|
|
1549
1562
|
const newTotalRuns = currentStats.totalRuns + 1;
|
|
1550
|
-
const newPassCount = currentStats.passCount + (
|
|
1551
|
-
const newFailCount = currentStats.failCount + (
|
|
1563
|
+
const newPassCount = currentStats.passCount + (effectiveStatus === "pass" ? 1 : 0);
|
|
1564
|
+
const newFailCount = currentStats.failCount + (effectiveStatus === "fail" ? 1 : 0);
|
|
1552
1565
|
const totalDuration = currentStats.avgDuration * currentStats.totalRuns + validated.duration;
|
|
1553
1566
|
const newAvgDuration = Math.round(totalDuration / newTotalRuns);
|
|
1554
1567
|
const updatedMeta = {
|
|
@@ -1557,7 +1570,7 @@ async function handleCompleteRun(params, fs = new FileSystemService()) {
|
|
|
1557
1570
|
passCount: newPassCount,
|
|
1558
1571
|
failCount: newFailCount,
|
|
1559
1572
|
lastRun: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1560
|
-
lastResult:
|
|
1573
|
+
lastResult: effectiveStatus,
|
|
1561
1574
|
avgDuration: newAvgDuration
|
|
1562
1575
|
};
|
|
1563
1576
|
await fs.writeYaml(metaPath, updatedMeta);
|
|
@@ -1569,7 +1582,8 @@ async function handleCompleteRun(params, fs = new FileSystemService()) {
|
|
|
1569
1582
|
passCount: newPassCount,
|
|
1570
1583
|
failCount: newFailCount,
|
|
1571
1584
|
avgDuration: newAvgDuration
|
|
1572
|
-
}
|
|
1585
|
+
},
|
|
1586
|
+
...warning !== void 0 ? { warning } : {}
|
|
1573
1587
|
};
|
|
1574
1588
|
}
|
|
1575
1589
|
|