@decocms/parity 0.33.21 → 0.33.22

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/dist/cli.js +47 -20
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -39527,6 +39527,9 @@ var REPORT_CSS = `
39527
39527
  .dash-hero-info .verdict-text.pass { color: var(--state-good); }
39528
39528
  .dash-hero-info .verdict-text.warn { color: var(--state-warn); }
39529
39529
  .dash-hero-info .verdict-text.fail { color: var(--state-bad); }
39530
+ /* Muted on purpose: an inconclusive run has no result, so it should not compete for attention
39531
+ with a real pass/fail the way a red or green headline would. */
39532
+ .dash-hero-info .verdict-text.inconclusive { color: var(--text-muted); }
39530
39533
  .dash-hero-info .verdict-sub { color: var(--text-secondary); font-size: 14px; }
39531
39534
  .dash-hero-info .verdict-meta { color: var(--text-muted); font-size: 12px; margin-top: 8px; display: flex; gap: 16px; flex-wrap: wrap; }
39532
39535
  .dash-hero-info .verdict-meta span strong { color: var(--text-primary); font-weight: 600; }
@@ -39621,6 +39624,7 @@ var REPORT_CSS = `
39621
39624
  .status-warn { background: rgba(245, 166, 35, 0.15); color: var(--state-warn); }
39622
39625
  .status-fail { background: rgba(229, 72, 77, 0.15); color: var(--state-bad); }
39623
39626
  .status-skipped { background: rgba(138, 147, 166, 0.15); color: var(--text-muted); }
39627
+ .status-inconclusive { background: rgba(138, 147, 166, 0.15); color: var(--text-muted); }
39624
39628
 
39625
39629
  /* Issue card v2 */
39626
39630
  .issue {
@@ -41515,7 +41519,7 @@ var SeoSummary = z.object({
41515
41519
  pagesWithIssues: z.number()
41516
41520
  });
41517
41521
  var Verdict = z.object({
41518
- status: z.enum(["pass", "warn", "fail"]),
41522
+ status: z.enum(["pass", "warn", "fail", "inconclusive"]),
41519
41523
  score: z.number().min(0).max(100),
41520
41524
  scoreVersion: z.number().optional(),
41521
41525
  pagesAnalyzed: z.number().optional(),
@@ -54316,6 +54320,9 @@ function derivePagesAnalyzed(checks, issues) {
54316
54320
  const distinctPages = new Set(issues.filter((i) => i.page).map((i) => i.page));
54317
54321
  return Math.max(1, distinctPages.size);
54318
54322
  }
54323
+ function measuredNothing(checks) {
54324
+ return checks.length === 0;
54325
+ }
54319
54326
  function computeVerdict(checks, issues, opts) {
54320
54327
  const counts = { critical: 0, high: 0, medium: 0, low: 0 };
54321
54328
  for (const i of issues)
@@ -54326,9 +54333,11 @@ function computeVerdict(checks, issues, opts) {
54326
54333
  const checksWarn = checks.filter((c) => c.status === "warn").length;
54327
54334
  const pagesAnalyzed = opts?.pagesAnalyzed ?? derivePagesAnalyzed(checks, issues);
54328
54335
  let { score } = computeScore(issues, { pagesAnalyzed });
54329
- const status = counts.critical > 0 || checksFailed > 0 ? "fail" : counts.high > 0 || checksWarn > 0 ? "warn" : "pass";
54336
+ const status = measuredNothing(checks) ? "inconclusive" : counts.critical > 0 || checksFailed > 0 ? "fail" : counts.high > 0 || checksWarn > 0 ? "warn" : "pass";
54330
54337
  if (status === "fail")
54331
54338
  score = Math.min(score, FAIL_SCORE_CAP);
54339
+ if (status === "inconclusive")
54340
+ score = 0;
54332
54341
  return {
54333
54342
  status,
54334
54343
  score,
@@ -54408,8 +54417,9 @@ function computeCompositeVerdict(moduleVerdicts, checks, issues) {
54408
54417
  weightSum += weight;
54409
54418
  totalPagesAnalyzed = Math.max(totalPagesAnalyzed, mv.pagesAnalyzed);
54410
54419
  }
54411
- let score = weightSum > 0 ? Math.round(weightedScoreSum / weightSum) : 100;
54412
- const status = counts.critical > 0 || checksFailed > 0 || moduleVerdicts.some((mv) => mv.status === "fail") ? "fail" : counts.high > 0 || checksWarn > 0 || moduleVerdicts.some((mv) => mv.status === "warn") ? "warn" : "pass";
54420
+ const nothingMeasured = weightSum === 0 || measuredNothing(checks);
54421
+ let score = nothingMeasured ? 0 : Math.round(weightedScoreSum / weightSum);
54422
+ const status = nothingMeasured ? "inconclusive" : counts.critical > 0 || checksFailed > 0 || moduleVerdicts.some((mv) => mv.status === "fail") ? "fail" : counts.high > 0 || checksWarn > 0 || moduleVerdicts.some((mv) => mv.status === "warn") ? "warn" : "pass";
54413
54423
  if (status === "fail")
54414
54424
  score = Math.min(score, FAIL_SCORE_CAP);
54415
54425
  return {
@@ -54824,9 +54834,10 @@ function tabHelp(text) {
54824
54834
  }
54825
54835
  function renderDashboard2(run) {
54826
54836
  const v = run.verdict;
54827
- const statusLabel = v.status === "pass" ? "Excellent" : v.status === "warn" ? "Warnings" : "Critical";
54828
- const ringColor = v.status === "pass" ? "var(--state-good)" : v.status === "warn" ? "var(--state-warn)" : "var(--state-bad)";
54829
- const ringDeg = `${Math.round(v.score / 100 * 360)}deg`;
54837
+ const inconclusive = v.status === "inconclusive";
54838
+ const statusLabel = inconclusive ? "Inconclusive" : v.status === "pass" ? "Excellent" : v.status === "warn" ? "Warnings" : "Critical";
54839
+ const ringColor = inconclusive ? "var(--text-dim, #888)" : v.status === "pass" ? "var(--state-good)" : v.status === "warn" ? "var(--state-warn)" : "var(--state-bad)";
54840
+ const ringDeg = inconclusive ? "0deg" : `${Math.round(v.score / 100 * 360)}deg`;
54830
54841
  const prev = run.previousRun;
54831
54842
  const deltaChip = prev ? (() => {
54832
54843
  const up = prev.scoreDelta > 0;
@@ -54839,13 +54850,13 @@ function renderDashboard2(run) {
54839
54850
  return `
54840
54851
  <div class="dash-hero">
54841
54852
  <div class="health-score" style="--ring-color:${ringColor};--ring-deg:${ringDeg}">
54842
- <div class="score-num">${v.score}<small>/100</small></div>
54853
+ <div class="score-num">${inconclusive ? "—" : `${v.score}<small>/100</small>`}</div>
54843
54854
  <div class="score-label">Health</div>
54844
54855
  </div>
54845
54856
  <div class="dash-hero-info">
54846
54857
  <div class="verdict-text ${v.status}">${statusLabel}</div>
54847
- ${deltaChip}
54848
- <div class="verdict-sub">${v.critical + v.high} blocking issue${v.critical + v.high !== 1 ? "s" : ""} ${v.critical > 0 ? `(${v.critical} critical)` : ""}</div>
54858
+ ${inconclusive ? "" : deltaChip}
54859
+ <div class="verdict-sub">${inconclusive ? "Nothing was measured — 0 checks ran, so this run says nothing about parity." : `${v.critical + v.high} blocking issue${v.critical + v.high !== 1 ? "s" : ""} ${v.critical > 0 ? `(${v.critical} critical)` : ""}`}</div>
54849
54860
  <div class="verdict-meta">
54850
54861
  <span><strong>${v.checksPassed}</strong> checks pass</span>
54851
54862
  <span><strong>${v.checksFailed}</strong> fail</span>
@@ -64067,8 +64078,9 @@ function listCommand(output) {
64067
64078
  try {
64068
64079
  const run = loadRun(output, r.id);
64069
64080
  const v = run.verdict;
64070
- const status = v.status === "pass" ? chalk18.green(v.status) : v.status === "warn" ? chalk18.yellow(v.status) : chalk18.red(v.status);
64071
- console.log(` ${chalk18.bold(r.id)} ${status} score=${v.score} critical=${v.critical} high=${v.high} ${chalk18.dim(r.timestamp)}`);
64081
+ const status = v.status === "inconclusive" ? chalk18.dim(v.status) : v.status === "pass" ? chalk18.green(v.status) : v.status === "warn" ? chalk18.yellow(v.status) : chalk18.red(v.status);
64082
+ const score = v.status === "inconclusive" ? "—" : v.score;
64083
+ console.log(` ${chalk18.bold(r.id)} ${status} score=${score} critical=${v.critical} high=${v.high} ${chalk18.dim(r.timestamp)}`);
64072
64084
  } catch {
64073
64085
  console.log(` ${chalk18.bold(r.id)} ${chalk18.dim("(report.json ausente)")}`);
64074
64086
  }
@@ -68488,7 +68500,14 @@ function applyLlmOptions(opts) {
68488
68500
  }
68489
68501
  return null;
68490
68502
  }
68491
- function evaluateFailOnGate(allIssues, failOn) {
68503
+ function evaluateFailOnGate(allIssues, failOn, verdictStatus) {
68504
+ if (verdictStatus === "inconclusive") {
68505
+ return {
68506
+ exitCode: 1,
68507
+ message: `
68508
+ ✖ run inconclusivo — nenhum check executou, não há resultado para aprovar — exit 1`
68509
+ };
68510
+ }
68492
68511
  const blocking = allIssues.filter((i) => failOn.includes(i.severity));
68493
68512
  if (blocking.length === 0)
68494
68513
  return { exitCode: 0 };
@@ -69258,7 +69277,7 @@ ${formatTimingsSummary(partialTimings, buildFlowBreakdown(allFlowCaptures))}
69258
69277
  printSummary7(run, paths.reportHtml, { promotedCount, deprecatedCount, platform });
69259
69278
  console.log(`
69260
69279
  ${formatTimingsSummary(runTimings, buildFlowBreakdown(allFlowCaptures))}`);
69261
- const failOnGate = evaluateFailOnGate(allIssues, failOn);
69280
+ const failOnGate = evaluateFailOnGate(allIssues, failOn, verdict.status);
69262
69281
  if (failOnGate.exitCode === 1) {
69263
69282
  console.log(chalk22.red(failOnGate.message));
69264
69283
  return 1;
@@ -69484,12 +69503,17 @@ function hostOf3(url) {
69484
69503
  }
69485
69504
  function printSummary7(run, htmlPath, meta) {
69486
69505
  const { verdict } = run;
69487
- const emoji = verdict.status === "pass" ? chalk22.green("✔") : verdict.status === "warn" ? chalk22.yellow("⚠") : chalk22.red("✖");
69488
- const score = verdict.status === "pass" ? chalk22.green(verdict.score) : verdict.status === "warn" ? chalk22.yellow(verdict.score) : chalk22.red(verdict.score);
69506
+ const inconclusive = verdict.status === "inconclusive";
69507
+ const emoji = inconclusive ? chalk22.dim("○") : verdict.status === "pass" ? chalk22.green("✔") : verdict.status === "warn" ? chalk22.yellow("⚠") : chalk22.red("✖");
69508
+ const score = inconclusive ? chalk22.dim("—") : verdict.status === "pass" ? chalk22.green(verdict.score) : verdict.status === "warn" ? chalk22.yellow(verdict.score) : chalk22.red(verdict.score);
69489
69509
  const prev = run.previousRun;
69490
69510
  const scoreDelta = !prev ? chalk22.dim(" (sem run anterior comparável)") : prev.scoreDelta > 0 ? chalk22.green(` (+${prev.scoreDelta} vs run anterior: ${prev.score})`) : prev.scoreDelta < 0 ? chalk22.red(` (${prev.scoreDelta} vs run anterior: ${prev.score})`) : chalk22.dim(` (= run anterior: ${prev.score})`);
69491
69511
  console.log("");
69492
- console.log(` ${emoji} parity ${verdict.status.toUpperCase()} · score ${score}/100${scoreDelta}`);
69512
+ if (inconclusive) {
69513
+ console.log(` ${emoji} parity INCONCLUSIVE · nothing was measured (0 checks ran)`);
69514
+ } else {
69515
+ console.log(` ${emoji} parity ${verdict.status.toUpperCase()} · score ${score}/100${scoreDelta}`);
69516
+ }
69493
69517
  console.log(` checks: ${chalk22.green(verdict.checksPassed)} pass · ${chalk22.red(verdict.checksFailed)} fail · ${chalk22.dim(`${verdict.checksSkipped} skipped`)}`);
69494
69518
  console.log(` issues: ${chalk22.red(verdict.critical)} critical · ${chalk22.yellow(verdict.high)} high · ${verdict.medium} medium · ${chalk22.dim(`${verdict.low} low`)}`);
69495
69519
  for (const c of run.caveats ?? []) {
@@ -69586,10 +69610,11 @@ ${markdown}
69586
69610
  function buildPrComment(run, opts) {
69587
69611
  const lines = [];
69588
69612
  const v = run.verdict;
69589
- const status = v.status === "pass" ? "✅ **PASS**" : v.status === "warn" ? "⚠ **WARN**" : "❌ **FAIL**";
69613
+ const inconclusive = v.status === "inconclusive";
69614
+ const status = inconclusive ? "◻ **INCONCLUSIVE**" : v.status === "pass" ? "✅ **PASS**" : v.status === "warn" ? "⚠ **WARN**" : "❌ **FAIL**";
69590
69615
  const prev = run.previousRun;
69591
69616
  const delta = prev ? prev.scoreDelta > 0 ? ` (\uD83D\uDCC8 +${prev.scoreDelta} vs previous run)` : prev.scoreDelta < 0 ? ` (\uD83D\uDCC9 ${prev.scoreDelta} vs previous run)` : " (= previous run)" : "";
69592
- lines.push(`## Parity report — ${status} · score ${v.score}/100${delta}`);
69617
+ lines.push(inconclusive ? `## Parity report — ${status} · nothing was measured (0 checks ran)` : `## Parity report — ${status} · score ${v.score}/100${delta}`);
69593
69618
  lines.push("");
69594
69619
  lines.push(`- **prod:** ${opts.prod}`);
69595
69620
  lines.push(`- **preview:** ${opts.preview}`);
@@ -69964,7 +69989,7 @@ function renderDeckHtml(model, lang = "en") {
69964
69989
  const rows = model.caveats.map((c) => `<tr><td><span class="pill ${c.level === "warn" ? "pill-warn" : "pill-good"}">${esc3(c.level)}</span></td><td><b>${esc3(c.summary)}</b></td><td>${esc3(c.detail)}</td></tr>`).join("");
69965
69990
  pages.push(page(L2("Contexto", "Context", lang), L2("Como ler este run", "How to read this run", lang), `<table class="grid"><tbody>${rows}</tbody></table>`, L2("O que o número <b>não</b> mede. Vem de <code>report.json.caveats</code>.", "What the number does <b>not</b> measure. From <code>report.json.caveats</code>.", lang)));
69966
69991
  }
69967
- const moduleRows = model.modules.map((m) => `<tr><td>${esc3(m.module)}</td><td><b class="num">${m.score}</b></td><td><span class="pill pill-${m.tone === "good" ? "good" : m.tone === "warn" ? "warn" : "bad"}">${esc3(m.status)}</span></td></tr>`).join("");
69992
+ const moduleRows = model.modules.map((m) => `<tr><td>${esc3(m.module)}</td><td><b class="num">${m.score}</b></td><td><span class="pill pill-${m.tone === "good" ? "good" : m.tone === "warn" ? "warn" : m.tone === "neutral" ? "neutral" : "bad"}">${esc3(m.status)}</span></td></tr>`).join("");
69968
69993
  pages.push(page(L2("Sumário executivo", "Executive summary", lang), L2("Onde a migração está", "Where the migration stands", lang), tiles(model.headline, lang) + (moduleRows ? `<h3 class="sub">${L2("Score por módulo", "Score per module", lang)}</h3>` + `<table class="grid"><tbody>${moduleRows}</tbody></table>` : "")));
69969
69994
  pages.push(page(L2("Achados", "Findings", lang), L2("O que a validação encontrou", "What the validation found", lang), findingsTable(model.findings, model.findingsOmitted, lang)));
69970
69995
  if (model.visual) {
@@ -70025,6 +70050,8 @@ function toneForStatus(status) {
70025
70050
  return "good";
70026
70051
  if (status === "warn")
70027
70052
  return "warn";
70053
+ if (status === "inconclusive")
70054
+ return "neutral";
70028
70055
  return "bad";
70029
70056
  }
70030
70057
  function buildDeckModel(run) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/parity",
3
- "version": "0.33.21",
3
+ "version": "0.33.22",
4
4
  "description": "E2E parity validator for site migrations. Compares prod vs cand and reports UI, functional, SEO, visual, and Web Vitals deltas with an LLM-ranked HTML report.",
5
5
  "type": "module",
6
6
  "license": "MIT",