/** * PRI-485 Phase 6 — v2 adversarial case generator (pure logic). * * Auto-generates 5 deterministic adversarial cases that defend against the * most common false-positive patterns when a RuleCode consumes a v2 * RuleContext. Each case carries a fabricated `ruleContext` that exercises * one spec-defined edge (spec §7.4, §10.1): * * 1. v2-unavailable — host provided no history; rule must allow. * 2. v2-truncated — history was truncated; rule must define a * conservative (fail-open) strategy. * 3. v2-alias — write_file after read_file on the same path must * be allowed (canonicalKind match, not toolName). * 4. v2-path-boundary — targetPath.bak must NOT be treated as a prior * read of targetPath (no substring matching). * 5. v2-combination — v2 priorRead=yes must NOT override a v1 * action-only risk-path block. * * Pure logic: zero I/O. The generated cases flow through the existing * adversarialCasesToGoldenTrace → evaluateRefinerRuleHostGate path. * * Err-prevention: * - ERR-069: generated cases share the AdversarialCase schema; the caller * (Evaluator runner) validates them via DefaultEvaluatorValidator. * - ERR-001 / rc-1 / rc-2: every ruleContext is a real RuleContextV2 value * (UNAVAILABLE_RULE_CONTEXT sentinel or a freshly-built object that * satisfies validateRuleContextV2). No `as` casts. * - rc-9: every case carries a non-empty rationale explaining the edge. * * Spec: docs/superpowers/specs/2026-06-27-rulecode-context-vision-design.md * §7.4 Evaluator responsibilities, §10.1 acceptance scenarios. */ import type { CanonicalKind } from './rule-context-v2.js'; import type { AdversarialCase } from './evaluator-output.js'; /** * Inputs the generator needs to fabricate path-realistic cases. * - `toolName` is the action tool the rule governs (e.g. 'write_file'). * - `targetPath` is the workspace path used in positive cases. * - `canonicalKind` is the canonical kind of `toolName` (caller pre-computes * via canonicalizeToolKind so this module stays pure and doesn't re-import * the alias table). */ export interface V2AdversarialCaseSpec { readonly toolName: string; readonly targetPath: string; readonly canonicalKind: CanonicalKind; } /** * Generate the 5 canonical v2 adversarial cases for the given spec. * * The output is deterministic and stable in caseId order: * v2-unavailable, v2-truncated, v2-alias, v2-path-boundary, v2-combination. */ export declare function generateV2ContextAdversarialCases(spec: V2AdversarialCaseSpec): readonly AdversarialCase[]; //# sourceMappingURL=v2-adversarial-cases.d.ts.map