@hackerrank/astra-cli 0.1.13 → 0.1.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackerrank/astra-cli",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Minimal zero-dependency AI coding agent for the HackerRank AI Gateway.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/report.html CHANGED
@@ -285,9 +285,6 @@
285
285
  { key: "slug", label: "Model · reasoning", render: function (r) { return esc(r.slug); } },
286
286
  { key: "runs", label: "Runs", render: function (r) { return fmt(r.runs); } },
287
287
  { key: "average_score", label: "Score", render: function (r) { return r.average_score == null ? '<span class="n-a">n/a</span>' : fmt1(r.average_score) + "%"; } },
288
- { key: "criteria_pass_rate", label: "Test cases", render: function (r) { return r.criteria_pass_rate == null ? '<span class="n-a">n/a</span>' : pct(r.criteria_pass_rate); } },
289
- { key: "verification_runs", label: "Verified", render: function (r) { return fmt(r.verification_runs) + " / " + fmt(r.runs); } },
290
- { key: "hard_passes", label: "Hard passes", render: function (r) { return fmt(r.hard_passes); } },
291
288
  { key: "sum_steps", label: "Total steps", render: function (r) { return fmt(r.sum_steps); } },
292
289
  { key: "sum_elapsed_seconds", label: "Time taken", render: function (r) { return fmt(r.sum_elapsed_seconds) + "s"; } },
293
290
  { key: "sum_tokens", label: "Tokens", render: function (r) { return fmt(r.sum_tokens); } },
package/src/report.js CHANGED
@@ -507,11 +507,13 @@ function flattenCriteria(criteria) {
507
507
  if (!Array.isArray(criterion?.checks) || criterion.checks.length === 0) {
508
508
  return [criterion];
509
509
  }
510
+ const leafWeight = Math.max(0, Number(criterion.weight) || 0) / criterion.checks.length;
510
511
  return criterion.checks.map((check, index) => ({
511
512
  id: `${criterion.id}.${check.name || `check-${index + 1}`}`,
512
513
  title: check.description || check.name || criterion.title || criterion.id,
513
514
  status: check.passed === true ? "passed" : check.status === "blocked" ? "blocked" : check.status === "error" ? "error" : "failed",
514
515
  parentId: criterion.id,
516
+ weight: leafWeight,
515
517
  }));
516
518
  });
517
519
  }