@node9/policy-engine 2.25.1 → 2.26.1

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.d.mts CHANGED
@@ -1351,7 +1351,7 @@ declare const LONG_OUTPUT_THRESHOLD_BYTES: number;
1351
1351
  * and fails CI when the hash drifts without a version bump — forgetting
1352
1352
  * is loud, not silent.
1353
1353
  */
1354
- declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v18";
1354
+ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v20";
1355
1355
  /**
1356
1356
  * SHA-256 prefix of the detector-source files
1357
1357
  * (canonical.ts + pii.ts + destructive-regex.ts).
@@ -1362,7 +1362,7 @@ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v18";
1362
1362
  * files changed, this hash must change too, and you must consciously
1363
1363
  * decide whether to bump CANONICAL_EXTRACTOR_VERSION."
1364
1364
  */
1365
- declare const CANONICAL_EXTRACTOR_HASH = "5b2e76537f368d99";
1365
+ declare const CANONICAL_EXTRACTOR_HASH = "074a11609f2cb39a";
1366
1366
  declare function extractCanonicalFindings(call: ToolCallEntry, ctx: ExtractContext): CanonicalFinding[];
1367
1367
  declare function extractSessionLevelFindings(calls: ReadonlyArray<SessionToolCall>, ctx: SessionExtractContext): CanonicalFinding[];
1368
1368
  /**
package/dist/index.d.ts CHANGED
@@ -1351,7 +1351,7 @@ declare const LONG_OUTPUT_THRESHOLD_BYTES: number;
1351
1351
  * and fails CI when the hash drifts without a version bump — forgetting
1352
1352
  * is loud, not silent.
1353
1353
  */
1354
- declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v18";
1354
+ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v20";
1355
1355
  /**
1356
1356
  * SHA-256 prefix of the detector-source files
1357
1357
  * (canonical.ts + pii.ts + destructive-regex.ts).
@@ -1362,7 +1362,7 @@ declare const CANONICAL_EXTRACTOR_VERSION = "canonical-v18";
1362
1362
  * files changed, this hash must change too, and you must consciously
1363
1363
  * decide whether to bump CANONICAL_EXTRACTOR_VERSION."
1364
1364
  */
1365
- declare const CANONICAL_EXTRACTOR_HASH = "5b2e76537f368d99";
1365
+ declare const CANONICAL_EXTRACTOR_HASH = "074a11609f2cb39a";
1366
1366
  declare function extractCanonicalFindings(call: ToolCallEntry, ctx: ExtractContext): CanonicalFinding[];
1367
1367
  declare function extractSessionLevelFindings(calls: ReadonlyArray<SessionToolCall>, ctx: SessionExtractContext): CanonicalFinding[];
1368
1368
  /**
package/dist/index.js CHANGED
@@ -2829,19 +2829,19 @@ var FS_OP_CACHE_MAX = 5e3;
2829
2829
  var fsOpCache = /* @__PURE__ */ new Map();
2830
2830
  function analyzeFsOperation(command) {
2831
2831
  const normalized = normalizeCommandForPolicy(command);
2832
- if (!FS_OP_PRESCREEN_RE.test(normalized)) return null;
2833
- if (fsOpCache.has(normalized)) {
2834
- const hit = fsOpCache.get(normalized) ?? null;
2835
- fsOpCache.delete(normalized);
2836
- fsOpCache.set(normalized, hit);
2832
+ if (!FS_OP_PRESCREEN_RE.test(normalized) && !FS_OP_PRESCREEN_RE.test(command)) return null;
2833
+ if (fsOpCache.has(command)) {
2834
+ const hit = fsOpCache.get(command) ?? null;
2835
+ fsOpCache.delete(command);
2836
+ fsOpCache.set(command, hit);
2837
2837
  return hit;
2838
2838
  }
2839
- const computed = analyzeFsOperationImpl(normalized);
2839
+ const computed = analyzeFsOperationImpl(command);
2840
2840
  if (fsOpCache.size >= FS_OP_CACHE_MAX) {
2841
2841
  const oldest = fsOpCache.keys().next().value;
2842
2842
  if (oldest !== void 0) fsOpCache.delete(oldest);
2843
2843
  }
2844
- fsOpCache.set(normalized, computed);
2844
+ fsOpCache.set(command, computed);
2845
2845
  return computed;
2846
2846
  }
2847
2847
  var stripDotSlash = (p) => p.replace(/^\.\//, "");
@@ -6058,8 +6058,8 @@ function matchCanaryArgs(args, values) {
6058
6058
 
6059
6059
  // src/scan/canonical.ts
6060
6060
  var LONG_OUTPUT_THRESHOLD_BYTES = 100 * 1024;
6061
- var CANONICAL_EXTRACTOR_VERSION = "canonical-v18";
6062
- var CANONICAL_EXTRACTOR_HASH = "5b2e76537f368d99";
6061
+ var CANONICAL_EXTRACTOR_VERSION = "canonical-v20";
6062
+ var CANONICAL_EXTRACTOR_HASH = "074a11609f2cb39a";
6063
6063
  var DEDUPE_PREVIEW_LEN = 120;
6064
6064
  function extractCanonicalFindings(call, ctx) {
6065
6065
  const out = [];
package/dist/index.mjs CHANGED
@@ -2687,19 +2687,19 @@ var FS_OP_CACHE_MAX = 5e3;
2687
2687
  var fsOpCache = /* @__PURE__ */ new Map();
2688
2688
  function analyzeFsOperation(command) {
2689
2689
  const normalized = normalizeCommandForPolicy(command);
2690
- if (!FS_OP_PRESCREEN_RE.test(normalized)) return null;
2691
- if (fsOpCache.has(normalized)) {
2692
- const hit = fsOpCache.get(normalized) ?? null;
2693
- fsOpCache.delete(normalized);
2694
- fsOpCache.set(normalized, hit);
2690
+ if (!FS_OP_PRESCREEN_RE.test(normalized) && !FS_OP_PRESCREEN_RE.test(command)) return null;
2691
+ if (fsOpCache.has(command)) {
2692
+ const hit = fsOpCache.get(command) ?? null;
2693
+ fsOpCache.delete(command);
2694
+ fsOpCache.set(command, hit);
2695
2695
  return hit;
2696
2696
  }
2697
- const computed = analyzeFsOperationImpl(normalized);
2697
+ const computed = analyzeFsOperationImpl(command);
2698
2698
  if (fsOpCache.size >= FS_OP_CACHE_MAX) {
2699
2699
  const oldest = fsOpCache.keys().next().value;
2700
2700
  if (oldest !== void 0) fsOpCache.delete(oldest);
2701
2701
  }
2702
- fsOpCache.set(normalized, computed);
2702
+ fsOpCache.set(command, computed);
2703
2703
  return computed;
2704
2704
  }
2705
2705
  var stripDotSlash = (p) => p.replace(/^\.\//, "");
@@ -5916,8 +5916,8 @@ function matchCanaryArgs(args, values) {
5916
5916
 
5917
5917
  // src/scan/canonical.ts
5918
5918
  var LONG_OUTPUT_THRESHOLD_BYTES = 100 * 1024;
5919
- var CANONICAL_EXTRACTOR_VERSION = "canonical-v18";
5920
- var CANONICAL_EXTRACTOR_HASH = "5b2e76537f368d99";
5919
+ var CANONICAL_EXTRACTOR_VERSION = "canonical-v20";
5920
+ var CANONICAL_EXTRACTOR_HASH = "074a11609f2cb39a";
5921
5921
  var DEDUPE_PREVIEW_LEN = 120;
5922
5922
  function extractCanonicalFindings(call, ctx) {
5923
5923
  const out = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@node9/policy-engine",
3
- "version": "2.25.1",
3
+ "version": "2.26.1",
4
4
  "description": "Shared policy evaluation engine for node9 — DLP, smart rules, AST shell parsing, shields, loop detection. Pure functions, no I/O. Used by both node9-proxy and the node9 SaaS firewall.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://node9.ai",