/** * PRI-484 — Phase 5 BehaviorExamplePack (behavior-example-pack.ts) * * Pure logic: type + validator for the Artificer BehaviorExamplePack. * Zero I/O — this module MUST NOT import node:fs / node:path / better-sqlite3 / * any network module. The runtime-v2 architecture-regression test enforces the * file boundary. * * Err-prevention: * - ERR-001 (validate-as-unknown): validator takes `unknown` and validates * structurally. No `as` bypass on parsed input. * - ERR-069 (Artificer shared schema): fail loud on invalid pack, no silent * fallback to empty pack. * - ERR-076 (prototype-pollution / host-realm independence): structural checks * use Object.keys + a PROTO_KEYS set. We never touch the host realm's * prototype chain (no `instanceof`, no `in`). * - rc-2: no `as` casts on parsed input. * - rc-5: Object.hasOwn / Object.keys over the `in` operator. * * Spec: docs/superpowers/specs/2026-06-27-rulecode-context-vision-design.md §7.2 */ import type { GoldenTraceCaseInput } from './artificer-output.js'; /** * BehaviorExamplePack — bounded, validated evidence pack for Artificer. * * Contains only evidence from the current pain lineage; no general memory * or arbitrary codebase search. * * First-version limits (spec §7.2): * - 1 source negative case * - ≤3 positive counterexamples * - ≤5 evidenceRefs * - each string follows existing evidence sanitizer boundaries */ export interface BehaviorExamplePack { readonly sourceNegativeCase: GoldenTraceCaseInput; readonly ownerDesiredOutcome: string; readonly positiveCounterexamples: readonly GoldenTraceCaseInput[]; readonly evidenceRefs: readonly string[]; readonly redactionNotes: readonly string[]; } export interface BehaviorExamplePackValidationResult { readonly valid: boolean; readonly errors: readonly string[]; } /** * Validate an untrusted BehaviorExamplePack. * * Accepts `unknown` and validates structurally (ERR-001). Rejects hostile * primitives (null, arrays, wrong types) and prototype-pollution keys * (__proto__, constructor, prototype). * * First-version limits enforced: * - positiveCounterexamples: 1..3 items, each kind='positive' * - evidenceRefs: 1..5 non-empty strings * - ownerDesiredOutcome: non-empty string * - sourceNegativeCase: kind='negative' * - redactionNotes: string array (may be empty) * * Returns `{ valid: true, errors: [] }` on success, or * `{ valid: false, errors: [...] }` on failure — never throws (ERR-069 fail * loud is the caller's responsibility: an invalid pack must not silently * produce an empty pack). */ export declare function validateBehaviorExamplePack(value: unknown): BehaviorExamplePackValidationResult; //# sourceMappingURL=behavior-example-pack.d.ts.map