@cejel/cejel 0.6.8 → 0.6.10

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/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire as __cejelCreateRequire } from 'node:module';
3
3
  const require = __cejelCreateRequire(import.meta.url);
4
4
  import {
5
5
  serveCejelMcpOverStdio
6
- } from "./chunk-KNTBED5T.js";
6
+ } from "./chunk-U2VDSTIT.js";
7
7
  import {
8
8
  CALLER_CONTEXT_PRODUCT_IDENTITY_NOTICE,
9
9
  CERTIFICATE_GLOSSARY,
@@ -12,6 +12,7 @@ import {
12
12
  WITAN_RUBRIC_VERSION_V22,
13
13
  WitanReportSchema,
14
14
  assertSelectableRubricVersion,
15
+ buildPlainSummary,
15
16
  buildRelyingPartySummary,
16
17
  buildVerdictExplanation,
17
18
  computeApplicableMeasuredCoverage,
@@ -25,10 +26,14 @@ import {
25
26
  formatDimensionsMeasuredSentence,
26
27
  formatExternalSourceLine,
27
28
  formatLowConfidenceSentence,
29
+ formatVerdictCapSentence,
30
+ glossaryEntryForRubric,
28
31
  importedAdjustmentSentence,
29
32
  inheritedFindingNote,
30
33
  inputBindingHeadline,
31
34
  isProspectiveRubricVersion,
35
+ isWitanAbstentionLabel,
36
+ renderWitanAbstentionHeadline,
32
37
  renderWitanBadgeEndpoint,
33
38
  renderWitanBadgeSvg,
34
39
  renderWitanHtmlReport,
@@ -37,9 +42,10 @@ import {
37
42
  serializeWitanReport,
38
43
  stripTerminalControls,
39
44
  verifyRecordedInputDigests,
40
- verifyWitanAttestationBinding
41
- } from "./chunk-KJVFCZZ3.js";
42
- import "./chunk-NIWSYJ6N.js";
45
+ verifyWitanAttestationBinding,
46
+ witanHistoryAbstentionInstruction
47
+ } from "./chunk-YHJ7ICL4.js";
48
+ import "./chunk-2UMHJ23V.js";
43
49
  import {
44
50
  external_exports
45
51
  } from "./chunk-AMVP7L26.js";
@@ -652,9 +658,14 @@ function writeOutputFiles(dir, files, what) {
652
658
  // src/terminal.ts
653
659
  init_esm_shims();
654
660
  function renderMinScoreAbstentionFailure(summary, minScore) {
655
- if (summary.verdict !== "Insufficient source" && summary.verdict !== "Insufficient evidence") {
661
+ if (!isWitanAbstentionLabel(summary.verdict)) {
656
662
  throw new Error("A minimum-score abstention message requires an abstained Cejel summary.");
657
663
  }
664
+ const instruction = witanHistoryAbstentionInstruction(summary.verdict);
665
+ if (instruction !== void 0) {
666
+ return `Cejel: cannot evaluate the required minimum ${minScore.toFixed(1)}/4.0 because the scan is ${summary.verdict.toLowerCase()}, with no composite score and no verdict. ${instruction}
667
+ `;
668
+ }
658
669
  return `Cejel: cannot evaluate the required minimum ${minScore.toFixed(1)}/4.0 because this repository has ${summary.verdict.toLowerCase()}.
659
670
  `;
660
671
  }
@@ -673,20 +684,21 @@ function renderMinScoreCoverageFailure(coverage, minScore) {
673
684
  `;
674
685
  }
675
686
  function renderTerminalCertificate(summary, report) {
676
- const abstained = summary.verdict === "Insufficient source" || summary.verdict === "Insufficient evidence";
687
+ const abstained = isWitanAbstentionLabel(summary.verdict);
677
688
  if (!abstained && (summary.overallScore === null || summary.codeTrustScore === null || summary.processTrustScore === null)) {
678
689
  throw new Error("A scored Cejel summary must carry numeric headline scores.");
679
690
  }
680
691
  const lines = abstained ? [
681
692
  `Cejel Trust Certificate \u2014 ${stripTerminalControls(summary.productDisplayName)}`,
682
693
  "",
683
- `${summary.verdict} to certify.`,
694
+ renderWitanAbstentionHeadline(summary.verdict),
684
695
  ` ${summary.insufficientSourceReason === void 0 ? "No ratable source or measurable evidence was found." : stripTerminalControls(summary.insufficientSourceReason)}`,
685
696
  ""
686
697
  ] : [
687
698
  `Cejel Trust Certificate \u2014 ${stripTerminalControls(summary.productDisplayName)}`,
688
699
  "",
689
700
  `Overall: ${formatScore(summary.overallScore)}/4.0 (${summary.verdict})`,
701
+ ...report && formatVerdictCapSentence(report) ? [` ${formatVerdictCapSentence(report)}`] : [],
690
702
  ` Code trust: ${formatScore(summary.codeTrustScore)}/4.0`,
691
703
  ` Process trust: ${formatScore(summary.processTrustScore)}/4.0`,
692
704
  ...report ? [` ${formatDimensionsMeasuredSentence(report)}`] : [],
@@ -707,6 +719,7 @@ function renderTerminalCertificate(summary, report) {
707
719
  ""
708
720
  );
709
721
  }
722
+ if (report) lines.push(...renderPlainSummaryLines(buildPlainSummary(report), summary, abstained));
710
723
  if (summary.scanLimitations.length > 0) {
711
724
  lines.push(
712
725
  "LIMITED EVIDENCE \u2014 the score and verdict are qualified by scan limitations:",
@@ -716,7 +729,7 @@ function renderTerminalCertificate(summary, report) {
716
729
  }
717
730
  if (summary.historyLimitations?.length) {
718
731
  lines.push(
719
- "HISTORY LIMITATION \u2014 scored as usual, but some criteria read truncated history:",
732
+ abstained ? "HISTORY LIMITATION \u2014 some criteria read truncated history:" : "HISTORY LIMITATION \u2014 scored as usual, but some criteria read truncated history:",
720
733
  ...summary.historyLimitations.map((limitation) => ` - ${stripTerminalControls(limitation)}`),
721
734
  ""
722
735
  );
@@ -812,7 +825,7 @@ function renderTerminalCertificate(summary, report) {
812
825
  }
813
826
  }
814
827
  lines.push("", "Plain-language glossary:");
815
- for (const entry of CERTIFICATE_GLOSSARY) {
828
+ for (const entry of CERTIFICATE_GLOSSARY.map((curated) => glossaryEntryForRubric(curated, report?.rubricVersion))) {
816
829
  lines.push(` ${entry.term} \u2014 ${entry.definition}`);
817
830
  }
818
831
  if (report && isProspectiveRubricVersion(report.rubricVersion)) {
@@ -821,6 +834,43 @@ function renderTerminalCertificate(summary, report) {
821
834
  return `${lines.join("\n")}
822
835
  `;
823
836
  }
837
+ var PLAIN_TERMINAL_ITEM_LIMIT = 3;
838
+ function renderPlainSummaryLines(plain, summary, abstained) {
839
+ const section = (heading, leads, items, empty) => {
840
+ const shown = items.slice(0, PLAIN_TERMINAL_ITEM_LIMIT);
841
+ const remaining = items.length - shown.length;
842
+ return [
843
+ `${heading} (${items.length}):`,
844
+ ...leads.filter((lead) => lead !== void 0).map((lead) => ` ${lead}`),
845
+ ...items.length === 0 ? [` ${empty}`] : shown.map((item) => ` - ${stripTerminalControls(item)}`),
846
+ ...remaining > 0 ? [` ...and ${remaining} more in certificate.html.`] : []
847
+ ];
848
+ };
849
+ const itemLine = (item) => `${item.area} \u2014 ${item.text}${item.location !== void 0 ? ` (${item.location})` : ""}`;
850
+ const wrongFindings = plain.wrong.filter((item) => item.source.kind === "finding").length;
851
+ const otherFindings = summary.findingCount - wrongFindings;
852
+ const topFindingsNote = !abstained && otherFindings > 0 ? `Top findings below counts ${summary.findingCount} finding${summary.findingCount === 1 ? "" : "s"} in all, including ${otherFindings} informational finding${otherFindings === 1 ? "" : "s"} not listed here.` : void 0;
853
+ return [
854
+ "In plain words (the full lists, with links to the evidence, are in certificate.html):",
855
+ ...plain.prospectiveNotice !== void 0 ? [` ${plain.prospectiveNotice}`] : [],
856
+ ...section("What holds", [plain.areasLine, plain.holdsLead], plain.holds.map(itemLine), plain.holdsNote ?? ""),
857
+ ...section(
858
+ "What is wrong",
859
+ [plain.wrongNote, topFindingsNote],
860
+ plain.wrong.map((item) => `${item.level === "critical" ? "Critical" : "Warning"}: ${itemLine(item)}`),
861
+ "Cejel recorded no critical or warning-level problem in what it checked."
862
+ ),
863
+ ...section("What is not known", [], plain.notKnown.map(itemLine), "Cejel listed no gap here; anything it did not measure is still not established."),
864
+ ...section(
865
+ "What to check next",
866
+ [],
867
+ plain.checkNext.map((check) => `${check.area} \u2014 ${check.text}`),
868
+ "Nothing to check from these lists."
869
+ ),
870
+ plain.notCovered,
871
+ ""
872
+ ];
873
+ }
824
874
  function formatScore(score) {
825
875
  if (score === null) throw new Error("A scored Cejel summary must carry numeric scores.");
826
876
  return score.toFixed(1);
@@ -1095,7 +1145,13 @@ async function runWitanCli(args, rubricVersion) {
1095
1145
  },
1096
1146
  { name: "badge.json", contents: JSON.stringify(renderWitanBadgeEndpoint(report), null, 2) },
1097
1147
  { name: "badge.svg", contents: renderWitanBadgeSvg(report) },
1098
- { name: "summary.json", contents: JSON.stringify(summary, null, 2) }
1148
+ // plainSummary (goal_cejel_four_question_summary_2026-11-02) is added here, at the one place
1149
+ // summary.json is written, so buildWitanCliSummary's shape (the MCP and HTTP responses) and
1150
+ // every key before it are unchanged.
1151
+ {
1152
+ name: "summary.json",
1153
+ contents: JSON.stringify({ ...summary, plainSummary: buildPlainSummary(report) }, null, 2)
1154
+ }
1099
1155
  ],
1100
1156
  "scan output"
1101
1157
  );
package/dist/mcp/index.js CHANGED
@@ -3,9 +3,9 @@ import { createRequire as __cejelCreateRequire } from 'node:module';
3
3
  const require = __cejelCreateRequire(import.meta.url);
4
4
  import {
5
5
  serveCejelMcpOverStdio
6
- } from "../chunk-KNTBED5T.js";
7
- import "../chunk-KJVFCZZ3.js";
8
- import "../chunk-NIWSYJ6N.js";
6
+ } from "../chunk-U2VDSTIT.js";
7
+ import "../chunk-YHJ7ICL4.js";
8
+ import "../chunk-2UMHJ23V.js";
9
9
  import "../chunk-AMVP7L26.js";
10
10
  import {
11
11
  init_esm_shims
@@ -3,10 +3,10 @@ import { createRequire as __cejelCreateRequire } from 'node:module';
3
3
  const require = __cejelCreateRequire(import.meta.url);
4
4
  import {
5
5
  listCejelLlmPackFiles
6
- } from "../../chunk-WXPGEQBE.js";
6
+ } from "../../chunk-RRPQHEBU.js";
7
7
  import {
8
8
  execGit
9
- } from "../../chunk-NIWSYJ6N.js";
9
+ } from "../../chunk-2UMHJ23V.js";
10
10
  import {
11
11
  require_typescript
12
12
  } from "../../chunk-6LVNNJTG.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cejel/cejel",
3
- "version": "0.6.8",
3
+ "version": "0.6.10",
4
4
  "mcpName": "io.github.BargLabs/cejel",
5
5
  "private": false,
6
6
  "publishConfig": {