/** * Shared evidence sanitizer for durable pain signal storage. * * Used by: * - pain-signal-observability.ts (core package) * - message-sanitize.ts (openclaw-plugin package) * * Design contract (EP-08 Security Boundary Placement): * - Sanitization happens at the PERSISTENCE boundary, not at evaluation boundary * - Enforcement input (raw params, error text) stays available for gate/score computation * - All strings are token-redacted and bounded before durable storage * - Unknown-first: never throws on malformed input; returns {} or bounded preview * - Recursive with depth/key/array limits to prevent infinite traversal * * ERR checklist: * - ERR-001: no `as` casts — input is `unknown`, narrowed with typeof guards * - ERR-055: ANY-segment sensitive field matching, not ALL-segment * - ERR-056: token redaction runs on ALL strings, not just truncation * - ERR-051: redaction is at persistence output path, not evaluation input path * - EP-08: platform-agnostic path basename — uses split on both `\\` and `/`, * never relies on nodePath.basename which only splits on the host OS separator. */ export declare const MAX_EVIDENCE_VALUE_CHARS = 200; /** * PRI-825: bound for execute-command evidence (`command` / string `args`). * * RuleCode anchor semantics (e.g. baseline-anchor gates) scan durable command * history for evidence keywords; head-only truncation at the generic evidence * bound systematically hid anchors placed late in long one-liner commands. * A command-specific bound preserves head AND tail. * * Sizing: DEFAULT_HISTORY_LIMIT of 20 calls × 2KB ≤ 40KB worst-case evidence * window per evaluation — 1/8 of the trajectory blob inline threshold * (16KB) already accepted per result preview. Bounded, never unbounded. */ export declare const MAX_COMMAND_PREVIEW_CHARS = 2000; /** * Converges a single absolute path to a safe representation. * - Under workspaceDir → repo-relative * - Other absolute → basename only (platform-agnostic) * - Relative paths → kept as-is */ export declare function convergePath(value: string, workspaceDir?: string): string; /** * Sanitize a single string value (PD tags, tokens, embedded paths) WITHOUT * applying any length bound. Bounds are applied by the callers so each * evidence face can pick its own bounded shape (head-only vs head+tail). */ export declare function sanitizeStringUnbounded(value: string, workspaceDir?: string): string; /** * Sanitize a single string value: * 1. Strip internal PD tags * 2. Redact token-like patterns * 3. Replace absolute paths embedded in the string * 4. Bound length (head-only — generic evidence face) */ export declare function sanitizeString(value: string, workspaceDir?: string): string; /** * Recursively sanitize any value for durable evidence storage. * - Primitives: string → redact+bound; number/boolean → pass-through * - Objects: recurse with key limit * - Arrays: recurse with item limit * - Depth limit prevents infinite traversal * * ERR-001: input is `unknown`, narrowed with typeof guards (no `as` casts) */ export declare function sanitizeValue(value: unknown, depth?: number, workspaceDir?: string): unknown; /** * Sanitize tool-call params for evidence/trajectory storage. * * ERR-001: accepts `unknown`, not `Record`. Runtime guards only. * ERR-055: ANY-segment sensitive field matching. * ERR-056: token redaction runs on ALL strings via recursive sanitizeValue. * PRI-825: string `command`/`args` keep a larger head+tail bounded preview so * RuleCode anchor evidence survives the durable round-trip. */ export declare function sanitizeToolParams(params: unknown, workspaceDir?: string): Record; //# sourceMappingURL=evidence-sanitizer.d.ts.map