@cejel/cejel 0.6.5 → 0.6.6

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/README.md CHANGED
@@ -92,7 +92,7 @@ if (-not $expected -or $actual -ne $expected.ToLowerInvariant()) {
92
92
  ```
93
93
 
94
94
  > **Windows signing status:** `cejel-Windows-x86_64.exe` is intentionally unsigned in
95
- > 0.6.5 and may trigger Microsoft SmartScreen. The release build removes Node's inherited
95
+ > 0.6.6 and may trigger Microsoft SmartScreen. The release build removes Node's inherited
96
96
  > signature before SEA injection and fails unless Windows reports the result as `NotSigned`;
97
97
  > it does not ship an invalid signature. Before running it, verify `SHA256SUMS` and the
98
98
  > GitHub build-provenance attestation. Each binary also has an attached SPDX SBOM (the packages
@@ -116,7 +116,7 @@ docker run --rm --network=none -v "$PWD:/w" -w /w -v "$PWD/cejel:/cejel:ro" debi
116
116
  npx @cejel/cejel@latest .
117
117
  ```
118
118
 
119
- > **Distribution note:** Cejel `0.6.5` is the coordinated release version for npm,
119
+ > **Distribution note:** Cejel `0.6.6` is the coordinated release version for npm,
120
120
  > standalone binaries, Docker/OCI, GitHub Action, Homebrew, and MCP Registry. A GitLab CI
121
121
  > template and Code Quality export live in [`docs/gitlab-ci.md`](./docs/gitlab-ci.md).
122
122
 
@@ -187,16 +187,16 @@ gh attestation verify ./cejel-Windows-x86_64.exe -R BargLabs/cejel
187
187
  This is cryptographically signed provenance. It is distinct from Apple Developer ID or
188
188
  Microsoft Authenticode code-signing.
189
189
 
190
- **Docker / OCI.** The current container release is `0.6.5`:
190
+ **Docker / OCI.** The current container release is `0.6.6`:
191
191
 
192
192
  ```bash
193
- docker run --rm -i -v "$PWD:/workspace:ro" ghcr.io/barglabs/cejel:0.6.5
193
+ docker run --rm -i -v "$PWD:/workspace:ro" ghcr.io/barglabs/cejel:0.6.6
194
194
  ```
195
195
 
196
196
  The image defaults to `cejel-mcp` over stdio. To use the CLI instead:
197
197
 
198
198
  ```bash
199
- docker run --rm -v "$PWD:/workspace:ro" --entrypoint cejel ghcr.io/barglabs/cejel:0.6.5 .
199
+ docker run --rm -v "$PWD:/workspace:ro" --entrypoint cejel ghcr.io/barglabs/cejel:0.6.6 .
200
200
  ```
201
201
 
202
202
  The OCI image carries an SBOM of its base-image packages, maximum-mode build provenance, and a
@@ -571,7 +571,7 @@ The OCI image is an alternative when Docker is the preferred execution boundary.
571
571
  the host path with the repository OpenClaw should allow Cejel to read:
572
572
 
573
573
  ```bash
574
- npx -y openclaw@latest mcp set cejel-oci '{"command":"docker","args":["run","--rm","-i","-v","/absolute/path/to/repo:/workspace:ro","ghcr.io/barglabs/cejel:0.6.5"]}'
574
+ npx -y openclaw@latest mcp set cejel-oci '{"command":"docker","args":["run","--rm","-i","-v","/absolute/path/to/repo:/workspace:ro","ghcr.io/barglabs/cejel:0.6.6"]}'
575
575
  npx -y openclaw@latest mcp doctor cejel-oci --probe
576
576
  ```
577
577
 
@@ -5,11 +5,11 @@ import {
5
5
  deriveProductIdentity,
6
6
  runCejelScan,
7
7
  serializeWitanReport
8
- } from "../chunk-7XQVE76B.js";
8
+ } from "../chunk-JNTTFAHQ.js";
9
9
  import {
10
10
  listCejelLlmPackFiles
11
- } from "../chunk-M6YYPJSN.js";
12
- import "../chunk-63XQDYQ5.js";
11
+ } from "../chunk-5PFYOIOS.js";
12
+ import "../chunk-VGBFZBZQ.js";
13
13
  import {
14
14
  external_exports
15
15
  } from "../chunk-FSMZV3Y6.js";
@@ -5,7 +5,7 @@ import {
5
5
  describeGitFailure,
6
6
  execGit,
7
7
  isExpectedGitAbsence
8
- } from "./chunk-63XQDYQ5.js";
8
+ } from "./chunk-VGBFZBZQ.js";
9
9
  import {
10
10
  init_esm_shims
11
11
  } from "./chunk-O3MHSK25.js";
@@ -5,7 +5,7 @@ import {
5
5
  renderWitanBadgeSvg,
6
6
  renderWitanHtmlReport,
7
7
  runCejelScan
8
- } from "./chunk-7XQVE76B.js";
8
+ } from "./chunk-JNTTFAHQ.js";
9
9
  import {
10
10
  ZodFirstPartyTypeKind,
11
11
  ZodOptional,
@@ -5,7 +5,7 @@ import {
5
5
  describeGitFailure,
6
6
  execGit,
7
7
  isExpectedGitAbsence
8
- } from "./chunk-63XQDYQ5.js";
8
+ } from "./chunk-VGBFZBZQ.js";
9
9
  import {
10
10
  external_exports
11
11
  } from "./chunk-FSMZV3Y6.js";
@@ -8408,22 +8408,7 @@ function packageScriptReferences(command, scripts) {
8408
8408
  const names = /* @__PURE__ */ new Set();
8409
8409
  let dynamic = false;
8410
8410
  for (const segment of splitShellCommandSegments(command)) {
8411
- for (const match of segment.matchAll(
8412
- /\bpnpm\s+run\s+\/((?:\\.|[^/])+)\/([dgimsuvy]*)/giu
8413
- )) {
8414
- const source = match[1];
8415
- if (!source) continue;
8416
- try {
8417
- const flags = (match[2] ?? "").replace(/[dgy]/g, "");
8418
- const selector = new RegExp(source, flags);
8419
- for (const name of scripts.keys()) {
8420
- if (selector.test(name)) names.add(name);
8421
- selector.lastIndex = 0;
8422
- }
8423
- } catch {
8424
- dynamic = true;
8425
- }
8426
- }
8411
+ if (/\bpnpm\s+run\s+\//iu.test(segment)) dynamic = true;
8427
8412
  for (const match of segment.matchAll(
8428
8413
  /\b(?:npm|pnpm|yarn)\s+(?:run\s+)?([A-Za-z0-9][A-Za-z0-9:._-]*)/giu
8429
8414
  )) {
@@ -9430,19 +9415,19 @@ function findDeclaredWorkspaceManifests(repoPath, repoFiles, rootPackageJson) {
9430
9415
  const exclude = [];
9431
9416
  for (const pattern of patterns) {
9432
9417
  const negated = pattern.startsWith("!");
9433
- const regex = workspaceGlobToRegExp(negated ? pattern.slice(1) : pattern);
9418
+ const matcher = workspaceGlobMatcher(negated ? pattern.slice(1) : pattern);
9434
9419
  if (negated) {
9435
- if (regex === null) return NO_DECLARED_WORKSPACE_MANIFESTS;
9436
- exclude.push(regex);
9437
- } else if (regex !== null) {
9438
- include.push(regex);
9420
+ if (matcher === null) return NO_DECLARED_WORKSPACE_MANIFESTS;
9421
+ exclude.push(matcher);
9422
+ } else if (matcher !== null) {
9423
+ include.push(matcher);
9439
9424
  }
9440
9425
  }
9441
9426
  const matched = repoFiles.filter((file) => {
9442
9427
  if (file === rootPackageJson || !file.endsWith("/package.json")) return false;
9443
9428
  if (!isAuthoredProductionPath(file)) return false;
9444
9429
  const dir = file.slice(0, -"/package.json".length);
9445
- return include.some((regex) => regex.test(dir)) && !exclude.some((regex) => regex.test(dir));
9430
+ return include.some((matches) => matches(dir)) && !exclude.some((matches) => matches(dir));
9446
9431
  }).sort();
9447
9432
  return { read: matched.slice(0, WORKSPACE_PACKAGE_MANIFEST_LIMIT), declared: matched.length };
9448
9433
  }
@@ -9503,27 +9488,69 @@ function yamlScalar(raw) {
9503
9488
  const plain = stripYamlLineComment(raw).trim();
9504
9489
  return plain === "" || /^["'[{&*|>]/.test(plain) ? null : plain;
9505
9490
  }
9506
- function workspaceGlobToRegExp(pattern) {
9491
+ var WORKSPACE_GLOB_MAX_LENGTH = 256;
9492
+ var WORKSPACE_GLOB_MAX_SEGMENTS = 32;
9493
+ function workspaceGlobMatcher(pattern) {
9494
+ if (pattern.length > WORKSPACE_GLOB_MAX_LENGTH) return null;
9507
9495
  const normalised = pattern.trim().replace(/^\.\//, "").replace(/\/+$/, "");
9508
9496
  if (normalised === "" || normalised.startsWith("/") || /(^|\/)\.\.?(\/|$)/.test(normalised) || /[[\]{}()!+@\\]/.test(normalised)) {
9509
9497
  return null;
9510
9498
  }
9511
- const segments = normalised.split("/").filter((segment, index, all) => !(segment === "**" && all[index - 1] === "**"));
9512
- const anySegment = "(?!\\.)[^/]+";
9513
- if (segments.length === 1 && segments[0] === "**") return new RegExp(`^${anySegment}(?:/${anySegment})*$`);
9514
- let source = "";
9515
- segments.forEach((segment, index) => {
9516
- if (segment === "**") {
9517
- source += index === 0 ? `(?:${anySegment}/)*` : `(?:/${anySegment})*`;
9518
- return;
9499
+ const split = normalised.split("/");
9500
+ if (split.length > WORKSPACE_GLOB_MAX_SEGMENTS) return null;
9501
+ const segments = split.filter((segment, index, all) => !(segment === "**" && all[index - 1] === "**"));
9502
+ const isAnySegment = (part) => part !== "" && !part.startsWith(".");
9503
+ if (segments.length === 1 && segments[0] === "**") {
9504
+ return (dir) => dir.split("/").every(isAnySegment);
9505
+ }
9506
+ return (dir) => {
9507
+ let reachable = withGlobstarSkips(segments, [true, ...segments.map(() => false)]);
9508
+ for (const part of dir.split("/")) {
9509
+ const next = segments.map(() => false).concat(false);
9510
+ segments.forEach((segment, index) => {
9511
+ if (!reachable[index]) return;
9512
+ if (segment === "**") {
9513
+ if (isAnySegment(part)) next[index] = true;
9514
+ } else if (matchesWildcardSegment(segment, part)) {
9515
+ next[index + 1] = true;
9516
+ }
9517
+ });
9518
+ reachable = withGlobstarSkips(segments, next);
9519
+ if (!reachable.includes(true)) return false;
9519
9520
  }
9520
- if (index > 0 && !(index === 1 && segments[0] === "**")) source += "/";
9521
- const body = segment.split("").map(
9522
- (char) => char === "*" ? "[^/]*" : char === "?" ? "[^/]" : char.replace(/[.^$|]/g, "\\$&")
9523
- ).join("");
9524
- source += /^[*?]/.test(segment) ? `(?!\\.)${body}` : body;
9521
+ return reachable[segments.length] === true;
9522
+ };
9523
+ }
9524
+ function withGlobstarSkips(segments, reachable) {
9525
+ segments.forEach((segment, index) => {
9526
+ if (segment === "**" && reachable[index]) reachable[index + 1] = true;
9525
9527
  });
9526
- return new RegExp(`^${source}$`);
9528
+ return reachable;
9529
+ }
9530
+ function matchesWildcardSegment(glob, part) {
9531
+ if ((glob.startsWith("*") || glob.startsWith("?")) && part.startsWith(".")) return false;
9532
+ let g = 0;
9533
+ let p = 0;
9534
+ let starGlob = -1;
9535
+ let starPart = 0;
9536
+ while (p < part.length) {
9537
+ if (g < glob.length && glob[g] === "*") {
9538
+ starGlob = g;
9539
+ starPart = p;
9540
+ g += 1;
9541
+ } else if (g < glob.length && (glob[g] === "?" || glob[g] === part[p])) {
9542
+ g += 1;
9543
+ p += 1;
9544
+ } else if (starGlob !== -1) {
9545
+ g = starGlob + 1;
9546
+ starPart += 1;
9547
+ p = starPart;
9548
+ } else {
9549
+ return false;
9550
+ }
9551
+ }
9552
+ while (g < glob.length && glob[g] === "*") g += 1;
9553
+ return g === glob.length;
9527
9554
  }
9528
9555
  function ciWorkflowCitationLabel(baseLabel, verb, considered, cited, unread, delegated = NO_DELEGATED_CI_STEPS) {
9529
9556
  const unreadTotal = [...unread.values()].reduce((sum, count) => sum + count, 0);
@@ -8,7 +8,8 @@ import {
8
8
  // src/witan/git-exec.ts
9
9
  init_esm_shims();
10
10
  import { execFileSync } from "child_process";
11
- import { resolve } from "path";
11
+ import { realpathSync } from "fs";
12
+ import { dirname, resolve } from "path";
12
13
  var GIT_EXEC_MAX_BUFFER_BYTES = 8 * 1024 * 1024;
13
14
  var GIT_EXEC_TIMEOUT_MS = 3e4;
14
15
  var HARDENED_GIT_ARGUMENTS = [
@@ -52,6 +53,7 @@ var HARDENED_GIT_ARGUMENTS = [
52
53
  "-c",
53
54
  "protocol.ssh.allow=never"
54
55
  ];
56
+ var discoveryCeiling;
55
57
  function hardenedGitEnvironment(cwd) {
56
58
  const environment = {};
57
59
  for (const key of ["PATH", "HOME", "TZ"]) {
@@ -78,7 +80,8 @@ function hardenedGitEnvironment(cwd) {
78
80
  // still excluded below.
79
81
  GIT_CONFIG_COUNT: "1",
80
82
  GIT_CONFIG_KEY_0: "safe.directory",
81
- GIT_CONFIG_VALUE_0: cwd
83
+ GIT_CONFIG_VALUE_0: cwd,
84
+ ...discoveryCeiling === void 0 ? {} : { GIT_CEILING_DIRECTORIES: discoveryCeiling }
82
85
  };
83
86
  }
84
87
  function errorField(error, key) {
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-35TRRAEC.js";
6
+ } from "./chunk-BG4ZRBQ5.js";
7
7
  import {
8
8
  CALLER_CONTEXT_PRODUCT_IDENTITY_NOTICE,
9
9
  CERTIFICATE_GLOSSARY,
@@ -29,8 +29,8 @@ import {
29
29
  runCejelScan,
30
30
  serializeWitanReport,
31
31
  verifyWitanAttestationBinding
32
- } from "./chunk-7XQVE76B.js";
33
- import "./chunk-63XQDYQ5.js";
32
+ } from "./chunk-JNTTFAHQ.js";
33
+ import "./chunk-VGBFZBZQ.js";
34
34
  import {
35
35
  external_exports
36
36
  } from "./chunk-FSMZV3Y6.js";
@@ -601,19 +601,22 @@ function renderMinScoreCoverageFailure(coverage, minScore) {
601
601
  return `Cejel: cannot evaluate the required minimum ${minScore.toFixed(1)}/4.0 because fewer than half of the applicable dimensions were measured in at least one score (${formatCoverageSummary(coverage)}). Resolve the reported evidence gaps and re-scan.
602
602
  `;
603
603
  }
604
+ function stripTerminalControls(text) {
605
+ return text.replace(/[\t\n]/g, " ").replace(/[\u0000-\u001f\u007f-\u009f]/g, "");
606
+ }
604
607
  function renderTerminalCertificate(summary, report) {
605
608
  const abstained = summary.verdict === "Insufficient source" || summary.verdict === "Insufficient evidence";
606
609
  if (!abstained && (summary.overallScore === null || summary.codeTrustScore === null || summary.processTrustScore === null)) {
607
610
  throw new Error("A scored Cejel summary must carry numeric headline scores.");
608
611
  }
609
612
  const lines = abstained ? [
610
- `Cejel Trust Certificate \u2014 ${summary.productDisplayName}`,
613
+ `Cejel Trust Certificate \u2014 ${stripTerminalControls(summary.productDisplayName)}`,
611
614
  "",
612
615
  `${summary.verdict} to certify.`,
613
- ` ${summary.insufficientSourceReason ?? "No ratable source or measurable evidence was found."}`,
616
+ ` ${summary.insufficientSourceReason === void 0 ? "No ratable source or measurable evidence was found." : stripTerminalControls(summary.insufficientSourceReason)}`,
614
617
  ""
615
618
  ] : [
616
- `Cejel Trust Certificate \u2014 ${summary.productDisplayName}`,
619
+ `Cejel Trust Certificate \u2014 ${stripTerminalControls(summary.productDisplayName)}`,
617
620
  "",
618
621
  `Overall: ${formatScore(summary.overallScore)}/4.0 (${summary.verdict})`,
619
622
  ` Code trust: ${formatScore(summary.codeTrustScore)}/4.0`,
@@ -629,7 +632,7 @@ function renderTerminalCertificate(summary, report) {
629
632
  2,
630
633
  0,
631
634
  `Scope: ${relyingPartySummary.scope}`,
632
- `What was examined: ${relyingPartySummary.examined}`,
635
+ `What was examined: ${stripTerminalControls(relyingPartySummary.examined)}`,
633
636
  `What was established: ${relyingPartySummary.established}`,
634
637
  `What was not established: ${relyingPartySummary.notEstablished}`,
635
638
  `What to do next: ${relyingPartySummary.next}`,
@@ -639,14 +642,14 @@ function renderTerminalCertificate(summary, report) {
639
642
  if (summary.scanLimitations.length > 0) {
640
643
  lines.push(
641
644
  "LIMITED EVIDENCE \u2014 the score and verdict are qualified by scan limitations:",
642
- ...summary.scanLimitations.map((limitation) => ` - ${limitation}`),
645
+ ...summary.scanLimitations.map((limitation) => ` - ${stripTerminalControls(limitation)}`),
643
646
  ""
644
647
  );
645
648
  }
646
649
  if (summary.historyLimitations?.length) {
647
650
  lines.push(
648
651
  "HISTORY LIMITATION \u2014 scored as usual, but some criteria read truncated history:",
649
- ...summary.historyLimitations.map((limitation) => ` - ${limitation}`),
652
+ ...summary.historyLimitations.map((limitation) => ` - ${stripTerminalControls(limitation)}`),
650
653
  ""
651
654
  );
652
655
  }
@@ -664,9 +667,11 @@ function renderTerminalCertificate(summary, report) {
664
667
  lines.push("");
665
668
  }
666
669
  if (summary.contributingSources.length > 0) {
667
- lines.push(`Incorporates findings from: ${summary.contributingSources.join(", ")}`);
670
+ lines.push(
671
+ `Incorporates findings from: ${summary.contributingSources.map(stripTerminalControls).join(", ")}`
672
+ );
668
673
  for (const source of summary.externalSources) {
669
- lines.push(` ${formatExternalSourceLine(source)}`);
674
+ lines.push(` ${stripTerminalControls(formatExternalSourceLine(source))}`);
670
675
  }
671
676
  lines.push("");
672
677
  }
@@ -697,7 +702,7 @@ function renderTerminalCertificate(summary, report) {
697
702
  );
698
703
  for (const finding of summary.topFindings) {
699
704
  lines.push(
700
- ` [finding severity: ${finding.severity}] ${finding.criterionId} [dimension band: ${finding.dimensionBand}]: ${finding.displaySummary ?? finding.summary}`
705
+ ` [finding severity: ${finding.severity}] ${finding.criterionId} [dimension band: ${finding.dimensionBand}]: ${stripTerminalControls(finding.displaySummary ?? finding.summary)}`
701
706
  );
702
707
  }
703
708
  const remaining = summary.findingCount - summary.topFindings.length;
@@ -714,7 +719,7 @@ function renderTerminalCertificate(summary, report) {
714
719
  );
715
720
  for (const finding of summary.topExternalFindings) {
716
721
  lines.push(
717
- ` [${finding.severity}] ${finding.label} \u2192 ${finding.dimension}: ${finding.ruleId} \u2014 ${finding.message}${finding.location ? ` (${finding.location})` : ""}`
722
+ ` [${finding.severity}] ${stripTerminalControls(finding.label)} \u2192 ${finding.dimension}: ${stripTerminalControls(finding.ruleId)} \u2014 ${stripTerminalControls(finding.message)}${finding.location ? ` (${stripTerminalControls(finding.location)})` : ""}`
718
723
  );
719
724
  }
720
725
  const remaining = summary.externalFindingCount - summary.topExternalFindings.length;
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-35TRRAEC.js";
7
- import "../chunk-7XQVE76B.js";
8
- import "../chunk-63XQDYQ5.js";
6
+ } from "../chunk-BG4ZRBQ5.js";
7
+ import "../chunk-JNTTFAHQ.js";
8
+ import "../chunk-VGBFZBZQ.js";
9
9
  import "../chunk-FSMZV3Y6.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-M6YYPJSN.js";
6
+ } from "../../chunk-5PFYOIOS.js";
7
7
  import {
8
8
  execGit
9
- } from "../../chunk-63XQDYQ5.js";
9
+ } from "../../chunk-VGBFZBZQ.js";
10
10
  import {
11
11
  require_typescript
12
12
  } from "../../chunk-RH6FKREX.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cejel/cejel",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "mcpName": "io.github.BargLabs/cejel",
5
5
  "private": false,
6
6
  "publishConfig": {