/** * Rule Code Validator — Pure forbidden-pattern detection * * PURPOSE: Check rule implementation source code for forbidden API patterns. * This is the pure (non-VM) part of code validation that can run without * filesystem, sandbox, or OpenClaw infrastructure. * * PRI-44: Pure validation logic, zero infrastructure dependency. * VM-dependent checks remain in the plugin layer. * * PRI-668: pattern matching examines EXECUTABLE source only — comments and * string-literal contents are masked first (maskNonExecutableText). A string * literal is DATA; it can only become code through the dynamic-evaluation * and bracket-access primitives, each of which is its own forbidden pattern, * so the masking creates no escape. Template `${...}` interpolation stays * un-masked (executable). */ export interface ValidationResult { valid: boolean; errors: string[]; warnings: string[]; } export declare function checkForbiddenPatterns(code: string): string[]; /** * Best-effort static check: find `return { ... }` statements where * `matched: false` is paired with a decision other than 'allow'. * * PRI-439 Phase 2: when matched=false, the only valid decision is 'allow'. * A `return { matched: false, decision: 'block' }` is contradictory — * "the rule did not match, but I want to block" makes no sense. * * Only matches simple return objects without nested braces (same limitation * as checkReturnStatementsMissingFields). Complex returns with nested braces * are skipped — no false positives. The runtime validator * (validateRuleHostResult) is the authoritative check. * * Returns an array of violation messages (empty if no violations found). */ export declare function checkMatchedFalseDecisions(code: string): string[]; /** * Best-effort static check: find `return { ... }` statements in rule code that * are missing required RuleHostResult fields (decision, matched, reason). * * Only matches simple return objects without nested braces. Complex returns * (with nested objects like correctionProposal) are skipped — no false positives. * The sandbox's runtime type guard (isValidRuleHostResult) is the authoritative * check; this is an early-warning static layer that catches the most common * LLM mistake pattern (e.g. `return { matched: false }`) before VM execution. * * Returns an array of violation messages (empty if no violations found). */ export declare function checkReturnStatementsMissingFields(code: string): string[]; //# sourceMappingURL=rule-code-validator.d.ts.map