@cejel/cejel 0.6.11 → 0.7.0-rc.2
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.
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
deriveProductIdentity,
|
|
6
6
|
runCejelScan,
|
|
7
7
|
serializeWitanReport
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-G6AN4EDL.js";
|
|
9
9
|
import {
|
|
10
10
|
listCejelLlmPackFiles
|
|
11
11
|
} from "../chunk-RRPQHEBU.js";
|
|
@@ -4855,8 +4855,27 @@ var CejelLlmPackStatusSchema = external_exports.enum([
|
|
|
4855
4855
|
"assessed_with_limitations",
|
|
4856
4856
|
"not_applicable"
|
|
4857
4857
|
]);
|
|
4858
|
+
var CEJEL_LLM_EVIDENCE_PATH_MAX = 700;
|
|
4859
|
+
var CEJEL_LLM_OVER_LIMIT_EVIDENCE = Object.freeze({
|
|
4860
|
+
path: ".",
|
|
4861
|
+
line: null,
|
|
4862
|
+
label: `Path longer than the artifact's ${CEJEL_LLM_EVIDENCE_PATH_MAX}-character limit; not cited`
|
|
4863
|
+
});
|
|
4864
|
+
function cejelLlmOverLimitPathsLimitation(count) {
|
|
4865
|
+
const one = count === 1;
|
|
4866
|
+
return `Cejel did not cite ${count} repository ${one ? "path" : "paths"} because ${one ? "it is" : "they are"} longer than the artifact's ${CEJEL_LLM_EVIDENCE_PATH_MAX}-character path limit. Every finding that cited ${one ? "it" : "one"} is kept, with its rule, severity, confidence and summary, anchored on the repository ('.') instead. No path is shortened, since a shortened path would name a file that does not exist.`;
|
|
4867
|
+
}
|
|
4868
|
+
function fitCejelLlmFindingPaths(findings) {
|
|
4869
|
+
const dropped = /* @__PURE__ */ new Set();
|
|
4870
|
+
const fitted = findings.map((finding5) => {
|
|
4871
|
+
if (finding5.evidence.path.length <= CEJEL_LLM_EVIDENCE_PATH_MAX) return finding5;
|
|
4872
|
+
dropped.add(finding5.evidence.path);
|
|
4873
|
+
return { ...finding5, evidence: { ...CEJEL_LLM_OVER_LIMIT_EVIDENCE } };
|
|
4874
|
+
});
|
|
4875
|
+
return dropped.size === 0 ? { findings, droppedPaths: 0 } : { findings: fitted, droppedPaths: dropped.size };
|
|
4876
|
+
}
|
|
4858
4877
|
var CejelLlmEvidenceSchema = external_exports.object({
|
|
4859
|
-
path: external_exports.string().min(1).max(
|
|
4878
|
+
path: external_exports.string().min(1).max(CEJEL_LLM_EVIDENCE_PATH_MAX).refine(
|
|
4860
4879
|
(path) => !path.startsWith("/") && !/^[A-Za-z]:[\\/]/.test(path) && !path.split(/[\\/]/).some((member) => member === ".."),
|
|
4861
4880
|
{ message: "Evidence paths must be repository-relative and cannot traverse parents." }
|
|
4862
4881
|
),
|
|
@@ -5112,7 +5131,7 @@ function collectCejelLlmPack(repoPath, repoFiles) {
|
|
|
5112
5131
|
(rule) => (rule.id === "LLM-AGY-002" ? sourceFiles.filter((file) => isPythonSource(file)) : pythonLlmFiles).flatMap((file) => rule.detect(file))
|
|
5113
5132
|
);
|
|
5114
5133
|
const applicable = javascriptLlmFiles.length > 0 || pythonLlmFiles.length > 0 || actionSurfaceFiles.length > 0 || hasEvaluationSurface || pythonLineageFindings.length > 0 || pythonRuleFindings.length > 0;
|
|
5115
|
-
const
|
|
5134
|
+
const detectedFindings = applicable ? [
|
|
5116
5135
|
...CEJEL_LLM_V1_RULES.flatMap(
|
|
5117
5136
|
(rule) => (rule.id === "LLM-IOH-001" ? javascriptUnsafeSinkFiles : javascriptLlmFiles).flatMap((file) => rule.detect(file))
|
|
5118
5137
|
),
|
|
@@ -5129,6 +5148,7 @@ function collectCejelLlmPack(repoPath, repoFiles) {
|
|
|
5129
5148
|
// evidence that an unrelated metrics writer is an LLM evaluation.
|
|
5130
5149
|
...detectCejelLlmEvaluationRules(sourceFiles)
|
|
5131
5150
|
] : [];
|
|
5151
|
+
const { findings, droppedPaths } = fitCejelLlmFindingPaths(detectedFindings);
|
|
5132
5152
|
const ruleResults = CEJEL_LLM_ENABLED_RULE_IDS.map((ruleId) => {
|
|
5133
5153
|
const ruleFindings = findings.filter((finding5) => finding5.ruleId === ruleId);
|
|
5134
5154
|
const confidence = RULE_CONFIDENCE.get(ruleId) ?? "low";
|
|
@@ -5182,7 +5202,7 @@ function collectCejelLlmPack(repoPath, repoFiles) {
|
|
|
5182
5202
|
...pythonLlmFiles.map((file) => file.path),
|
|
5183
5203
|
...actionSurfaceFiles.map((file) => file.path),
|
|
5184
5204
|
...evaluationSurfaceFiles.map((file) => file.path),
|
|
5185
|
-
...
|
|
5205
|
+
...detectedFindings.map((finding5) => finding5.evidence.path)
|
|
5186
5206
|
]);
|
|
5187
5207
|
const integrationSet = new Set(integrations);
|
|
5188
5208
|
if (actionSurfaceFiles.length > 0) integrationSet.add("Model-facing tool registration");
|
|
@@ -5209,7 +5229,8 @@ function collectCejelLlmPack(repoPath, repoFiles) {
|
|
|
5209
5229
|
"Alpha coverage is limited to fixture-backed JavaScript, TypeScript, and Python source patterns in files up to 1 MB.",
|
|
5210
5230
|
"Rules use bounded, observable source patterns and do not claim whole-program data-flow analysis.",
|
|
5211
5231
|
"Action-governance and evaluation-hygiene rules require one of the explicitly supported complete local JavaScript, TypeScript, or Python evidence paths.",
|
|
5212
|
-
"No model-quality, factuality, prompt-injection-resistance, or general hallucination rate is measured."
|
|
5232
|
+
"No model-quality, factuality, prompt-injection-resistance, or general hallucination rate is measured.",
|
|
5233
|
+
...droppedPaths > 0 ? [cejelLlmOverLimitPathsLimitation(droppedPaths)] : []
|
|
5213
5234
|
]
|
|
5214
5235
|
},
|
|
5215
5236
|
notes: applicable ? "Static LLM application-integrity alpha; findings require calibration before public release." : "No supported LLM application surface was detected; LLM controls were not scored."
|