@hackerrank/astra-cli 0.1.14 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/report.js +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackerrank/astra-cli",
3
- "version": "0.1.14",
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.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
  }