@agent-inspect/eval 6.31.10 → 6.31.12
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.cjs +12 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +12 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -735,6 +735,15 @@ function actionForRule(rule) {
|
|
|
735
735
|
if (rule.strategy === "full") return "replace";
|
|
736
736
|
return rule.strategy;
|
|
737
737
|
}
|
|
738
|
+
function isCompleteRedactionMarker(value, replacement = "[REDACTED]") {
|
|
739
|
+
if (typeof value !== "string") return false;
|
|
740
|
+
const trimmed = value.trim();
|
|
741
|
+
if (trimmed.length === 0) return false;
|
|
742
|
+
if (trimmed === replacement) return true;
|
|
743
|
+
if (/^\[HASH:[A-Za-z0-9_-]+\]$/.test(trimmed)) return true;
|
|
744
|
+
if (/^\[REDACTED:[^\]]*\]$/.test(trimmed)) return true;
|
|
745
|
+
return false;
|
|
746
|
+
}
|
|
738
747
|
function applyRule(rule, value, replacement) {
|
|
739
748
|
if (rule.strategy === "full") return replacement;
|
|
740
749
|
const asString = stringifyScalar(value);
|
|
@@ -849,6 +858,9 @@ var Redactor = class {
|
|
|
849
858
|
if (key !== void 0) {
|
|
850
859
|
const rule = findCompiledKeyRule(key, this.#rules);
|
|
851
860
|
if (rule) {
|
|
861
|
+
if (isCompleteRedactionMarker(value, this.#replacement)) {
|
|
862
|
+
return value;
|
|
863
|
+
}
|
|
852
864
|
this.#recordFinding(
|
|
853
865
|
state,
|
|
854
866
|
makeFinding(path, `key.${rule.key}`, actionForRule(rule), "key", "warning")
|