import { z } from 'zod'; import { TotemParseError } from '../errors.js'; /** Base: any Prop 310 record-grammar parse failure. Carries file + key path. */ export declare class RuleRecordParseError extends TotemParseError { readonly filePath: string; readonly keyPath: string; constructor(filePath: string, keyPath: string, detail: string, recoveryHint: string, cause?: unknown); } /** The § Design 2 no-silent-skip constructs a V1 consumer may never drop silently. */ export type NoSilentSkipConstruct = 'schemaVersion' | 'target.type' | 'requires.scope'; /** * § Design 2 (R5) — unknown `schemaVersion`, unknown `target.type`, or a * reserved-unimplemented construct (`requires.scope: block`, § Design 8). A V1 * consumer that cannot declare a degraded mode enumerating every skipped rule * MUST fail; Prop 270 §6.3's warn-and-ignore is superseded (a silent * warn-and-ignore is a fail-open rule drop in a governance compiler). */ export declare class RuleRecordNoSilentSkipError extends RuleRecordParseError { readonly construct: NoSilentSkipConstruct; constructor(filePath: string, construct: NoSilentSkipConstruct, detail: string); } /** * § Design 4 — a producer-owned / intake-seam key is INEXPRESSIBLE in a record at * any depth. Distinct from a generic unknown-key rejection: the author needs to * be told the key belongs to the ADR-112 producer or the intake invocation * (§ Design 1), not that they typo'd a grammar field. */ export declare class RuleRecordProducerKeyError extends RuleRecordParseError { readonly producerKey: string; constructor(filePath: string, keyPath: string, producerKey: string); } /** * A mapping key that is JS prototype machinery. NOT a § Design 4 violation — * these are rejected on security grounds, not because a producer owns them — so * it carries its own diagnostic and never says "producer-owned". */ export declare class RuleRecordPrototypeKeyError extends RuleRecordParseError { readonly prototypeKey: string; constructor(filePath: string, keyPath: string, prototypeKey: string); } /** § Design 4 — keys a record may never carry, at any depth. */ export declare const RULE_RECORD_INEXPRESSIBLE_KEYS: ReadonlySet; /** * SECURITY FLOOR — mapping keys that are JS prototype machinery, rejected at any * depth including the opaque `target.rule` interior. DELIBERATELY a separate set * from `RULE_RECORD_INEXPRESSIBLE_KEYS`: that one is spec-defined at exactly 21 * producer-owned keys (§ Design 4) and size-guarded, while these three are not a * grammar rule at all. * * The floor is needed because IR-2 keeps the payload interior OPAQUE: `yaml` * materializes `__proto__` as an OWN ENUMERABLE property, so it survives into * whatever slice 2's lowering builds — a spread carries it forward as a real key, * and an `Object.assign` reparents the destination's prototype while silently * DROPPING the key. Both are structural corruption a parser must not hand * downstream. No legitimate ast-grep construct is named any of these. */ export declare const RULE_RECORD_FORBIDDEN_PROTOTYPE_KEYS: ReadonlySet; /** * The closed set of § Design 7 rules a glob can violate. A runtime value, not a * bare type union, so the conformance suite can assert every rule has a negative * fixture — an unexercised rule is an unpinned rule (§ Design 14). */ export declare const GLOB_DIALECT_RULES: readonly ["empty", "surrounding-whitespace", "separator", "absolute-path", "drive-letter", "brace-expansion", "negation", "regex-syntax", "empty-segment", "current-segment", "parent-segment", "embedded-globstar", "adjacent-globstar"]; /** The § Design 7 rule a glob violated. Each maps to one negative conformance fixture. */ export type GlobDialectRule = (typeof GLOB_DIALECT_RULES)[number]; /** A dialect violation: the rule broken + a message citing it. */ export interface GlobDialectViolation { rule: GlobDialectRule; message: string; } /** * § Design 7 — validate one glob against the normative dialect. Returns the first * violation (checks run in a fixed order, so the diagnostic is deterministic) or * `null` when the glob is dialect-clean. Pure: it never rewrites the glob. * * Allowed: literal segments; `*` as a single-segment wildcard (including * extension forms like `*.ts`); `**` as a whole-segment globstar, non-adjacent * and non-nested. Anything outside that closed set is a parse error — an empty * segment is not a literal segment, so it is rejected too. */ export declare function checkGlobDialect(glob: string): GlobDialectViolation | null; /** § Design 2 — the only `schemaVersion` this V1 grammar admits. */ export declare const RULE_RECORD_SCHEMA_VERSION = 1; /** § Design 4 — closed severity vocabulary; NO default (the census's silent warning-default is killed). */ export declare const RuleSeveritySchema: z.ZodEnum<["error", "warning"]>; export type RuleSeverity = z.infer; /** * § Design 6 (R16) — the V1 authoring enum. `ast` is dropped from the AUTHORING * surface (0 of 485 corpus rules) while reader/compiled enums keep it inert; * `rego` and ADR-109's action-rule type join by grammar version bump. */ export declare const RuleTargetTypeSchema: z.ZodEnum<["ast-grep", "regex"]>; export type RuleTargetType = z.infer; /** * § Design 6 (R16) — the S-expression tier. Reader/compiled enums keep it as an * inert legacy member with a deprecation diagnostic; the AUTHORING surface drops * it, and unlike `rego` / ADR-109's action-rule type it does NOT return by version * bump. Exported with its diagnostic so the conformance suite pins the wording: * pointing an author at a bump that will never carry `ast` is a wrong answer, not * a terse one. */ export declare const LEGACY_INERT_ENGINE = "ast"; export declare const LEGACY_ENGINE_DETAIL = "`ast` (the S-expression tier) is DROPPED from the V1 authoring surface and does NOT return by version bump \u2014 0 of the 485 corpus rules used it. Reader and compiled enums keep `ast` as an inert legacy member with a deprecation diagnostic, but no record may declare it (\u00A7 Design 6, R16)"; /** * § Design 8 — the absence unit. The closed name space RESERVES `line | block | * file`; `line` and `file` are implemented at V1 and `block` is * reserved-unimplemented pending a language adapter's boundary definition, so it * hits the § Design 2 gate rather than parsing. NO default — omitting `scope:` * is a parse error (a file-as-default is a silent default reborn). */ export declare const RequiresScopeSchema: z.ZodEnum<["line", "file"]>; export type RequiresScope = z.infer; /** § Design 8 — the reserved-unimplemented member of the `requires.scope` name space. */ export declare const REQUIRES_SCOPE_RESERVED = "block"; /** § Design 4 — `target.scope`: positive globs only, with first-class structural exclusions. */ export declare const RuleScopeSchema: z.ZodObject<{ fileGlobs: z.ZodArray, "many">; /** * Applied as `positiveMatch && !excludeMatch` — positive-form entries, never * `!`-negation. Min-1 WHEN PRESENT: an empty list is a silent no-op, and * "no exclusions" is expressed by OMITTING the key (§ Design 4 — no key in * this grammar carries a do-nothing value). */ excludeGlobs: z.ZodOptional, "many">>; }, "strict", z.ZodTypeAny, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }>; export type RuleScope = z.infer; /** * § Design 4 — `target`. `language` is REQUIRED for ast-grep and FORBIDDEN for * regex (§ Design 6: one declared language, validated under exactly that grammar * — replacing the try-each-glob-derived-Lang cross-grammar acceptance). The * payload is exactly one of `pattern` (flat) or `rule` (compound) for ast-grep, * and `pattern` only for regex. */ export declare const RuleTargetSchema: z.ZodEffects; /** § Design 6 — an identifier TOKEN at parse; it resolves against the Map-backed registry at compile (slice 2), never a spec-frozen enum. */ language: z.ZodOptional>; pattern: z.ZodOptional>; rule: z.ZodOptional, Record, Record>>; scope: z.ZodObject<{ fileGlobs: z.ZodArray, "many">; /** * Applied as `positiveMatch && !excludeMatch` — positive-form entries, never * `!`-negation. Min-1 WHEN PRESENT: an empty list is a silent no-op, and * "no exclusions" is expressed by OMITTING the key (§ Design 4 — no key in * this grammar carries a do-nothing value). */ excludeGlobs: z.ZodOptional, "many">>; }, "strict", z.ZodTypeAny, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }>; }, "strict", z.ZodTypeAny, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }>, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }>; export type RuleTarget = z.infer; /** * § Design 5/§ Design 10 — one bad/good exemplar pair. IR-1: both sides are * non-empty. `examples` is certification's PRIMARY PREIMAGE SOURCE (ADR-112 §4) * and Amendment 1 makes the record the EDITABLE home, so a zero-byte exemplar * cannot serve as the fire-on-bad ∧ silent-on-good differential it exists to be. * * Named `RuleRecordExample`, not `RuleExample`: the shipped LEGACY * `RuleExamples` (`lesson-pattern.ts`, on the same barrel) is the hit/miss shape * of the frozen lesson path this grammar supersedes, and two barrel exports one * character apart is a mis-import waiting to happen. */ export declare const RuleRecordExampleSchema: z.ZodObject<{ bad: z.ZodEffects; good: z.ZodEffects; }, "strict", z.ZodTypeAny, { bad: string; good: string; }, { bad: string; good: string; }>; export type RuleRecordExample = z.infer; /** * § Design 8 — the absence / must-contain block. Fires on a `target` match at * locus L iff `requires.pattern` does NOT match within the declared scope * containing L. V1 carries EXACTLY ONE block (multi-requires is a version-bump * extension), so this is a single mapping, never a list. */ export declare const RuleRequiresSchema: z.ZodObject<{ /** A safe-regex2-gated regex evaluated TEXTUALLY at the declared scope (gate is slice 2), independent of `target.type`. */ pattern: z.ZodEffects; scope: z.ZodEnum<["line", "file"]>; }, "strict", z.ZodTypeAny, { pattern: string; scope: "line" | "file"; }, { pattern: string; scope: "line" | "file"; }>; export type RuleRequires = z.infer; /** * § Design 4 (R8) — Prop 270 §8's curation-provenance block, carried under the * name `curation:` (renamed there because `provenance` is the ADR-112 producer's * own output field). Keys are camelCase, normalized from Prop 270 §8's snake_case * — a casing normalization, not a semantic change. The block is optional for * direct-authored rules and REQUIRED for Baseline-5-curated ones. * * SHAPE, per OPERATOR RULING 2026-08-21 (superseding IR-4's build-time * complete-or-absent reading, which rejected a lone `sourceLesson`): * * - `sourceLesson` is REQUIRED whenever the block is present. It is § Design 1's * record→lesson link — the one thing every curated rule has, since a curated * rule always derives from a lesson — so a block without it is incoherent. * - `curatedBy` / `curatedAt` / `baseline5Phase` are the Baseline-5 PROCESS * trio (Prop 270 §8), optional as a GROUP but ALL-OR-NONE together: a * direct-authored rule carries the link alone, a Baseline-5-curated rule * carries the whole process record, and a PARTIAL trio is a parse error * naming the missing members. * * No defaults are introduced by the relaxation, and the key space stays closed — * "optional" here means absent, never silently filled in. */ /** Prop 270 §8's Baseline-5 process trio — optional as a group, all-or-none together. */ export declare const CURATION_PROCESS_FIELDS: readonly ["curatedBy", "curatedAt", "baseline5Phase"]; export declare const RuleCurationSchema: z.ZodEffects; curatedBy: z.ZodOptional>; curatedAt: z.ZodOptional>; baseline5Phase: z.ZodOptional; }, "strict", z.ZodTypeAny, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }>, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }>; export type RuleCuration = z.infer; /** * § Design 9 (Amendment R4) — the optional classification block. Parsed under its * closed keys and retained VERBATIM; never evaluated at V1. The snake_case name * is a deliberate, named exception to the grammar's camelCase (§ Design 4): the * key is already reserved in shipped forward-compat readers, so renaming it would * buy consistency at the price of a pointless migration. NEVER rename it. */ export declare const VerificationShadowSchema: z.ZodObject<{ type: z.ZodEffects; source: z.ZodEffects; }, "strict", z.ZodTypeAny, { type: string; source: string; }, { type: string; source: string; }>; export type VerificationShadow = z.infer; /** * Prop 310 § Design 4 — the V1 rule record. `.strict()` at every depth of the * record's own key space; no field anywhere has a default. The § Design 5 * mandatory set is `schemaVersion`, `severity`, `message`, `target.type`, * `target.`, `target.scope.fileGlobs`, and a non-empty `examples`. */ export declare const RuleRecordSchema: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; severity: z.ZodEnum<["error", "warning"]>; /** REQUIRED, non-empty (R8) — the census found `message` on 4 of 140 hand-authored lessons. */ message: z.ZodEffects; recoveryHint: z.ZodOptional>; target: z.ZodEffects; /** § Design 6 — an identifier TOKEN at parse; it resolves against the Map-backed registry at compile (slice 2), never a spec-frozen enum. */ language: z.ZodOptional>; pattern: z.ZodOptional>; rule: z.ZodOptional, Record, Record>>; scope: z.ZodObject<{ fileGlobs: z.ZodArray, "many">; /** * Applied as `positiveMatch && !excludeMatch` — positive-form entries, never * `!`-negation. Min-1 WHEN PRESENT: an empty list is a silent no-op, and * "no exclusions" is expressed by OMITTING the key (§ Design 4 — no key in * this grammar carries a do-nothing value). */ excludeGlobs: z.ZodOptional, "many">>; }, "strict", z.ZodTypeAny, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }>; }, "strict", z.ZodTypeAny, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }>, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }>; examples: z.ZodArray; good: z.ZodEffects; }, "strict", z.ZodTypeAny, { bad: string; good: string; }, { bad: string; good: string; }>, "many">; requires: z.ZodOptional; scope: z.ZodEnum<["line", "file"]>; }, "strict", z.ZodTypeAny, { pattern: string; scope: "line" | "file"; }, { pattern: string; scope: "line" | "file"; }>>; curation: z.ZodOptional; curatedBy: z.ZodOptional>; curatedAt: z.ZodOptional>; baseline5Phase: z.ZodOptional; }, "strict", z.ZodTypeAny, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }>, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }>>; verification_shadow: z.ZodOptional; source: z.ZodEffects; }, "strict", z.ZodTypeAny, { type: string; source: string; }, { type: string; source: string; }>>; }, "strict", z.ZodTypeAny, { message: string; severity: "error" | "warning"; examples: { bad: string; good: string; }[]; schemaVersion: 1; target: { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }; requires?: { pattern: string; scope: "line" | "file"; } | undefined; recoveryHint?: string | undefined; curation?: { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; } | undefined; verification_shadow?: { type: string; source: string; } | undefined; }, { message: string; severity: "error" | "warning"; examples: { bad: string; good: string; }[]; schemaVersion: 1; target: { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }; requires?: { pattern: string; scope: "line" | "file"; } | undefined; recoveryHint?: string | undefined; curation?: { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; } | undefined; verification_shadow?: { type: string; source: string; } | undefined; }>; export type RuleRecord = z.infer; /** One exemplar pair's drift sensor, keyed by its ordinal within the record (§ Design 10). */ export interface RuleExamplePairHash { /** The `examples[i]` ordinal — half of the `(ruleId, ordinal)` join key; the producer supplies `ruleId` at intake (slice 3). */ ordinal: number; /** sha256 hex over the LF-image of the pair's material. */ hash: string; } /** * Amendment 1 item 3 — the § Design 10 per-pair content hash is CR-BLIND, * computed over the LF-image of its material, so a CRLF-authored and an * LF-authored variant of the same exemplar hash IDENTICALLY. The trial's P3 row * (`serialization-admit`) is exactly the class this defeats: a writer that * escape-smuggles `\r` past the admit hop must not fire a false drift alarm. * * This is a DIFFERENT EDGE from the authoring-ledger's material hash (Amendment 1 * item 3's own note) — different inputs, different consumers, different drift * meaning. Only the LF-image PRIMITIVE is shared, single-homed at * `lfDeepNormalize` (Tenet 20): mirroring the normalizer would let the two edges * drift apart on the one thing they must agree about. */ export declare function ruleExamplePairHash(example: RuleRecordExample): string; /** * The parser's output — a pure VALUE, per-invocation, never cached (§ Data model * deltas): the validated record, the § Design 3 derived engine, and the * Amendment 1 item 3 per-pair hashes. */ export interface ParsedRuleRecord { record: RuleRecord; /** * § Design 3 / R17 — derived from `target.type`, NEVER author-mirrored (a * mirrored engine field is Tenet 20's prohibited copy at record scale). */ derivedEngine: RuleTargetType; /** One entry per `examples[i]`, in ordinal order (§ Design 10 drift sensors). */ examplePairHashes: RuleExamplePairHash[]; } /** One `examples[i]` ordinal and its § Design 10 drift-sensor digest. */ export declare const RuleExamplePairHashSchema: z.ZodObject<{ ordinal: z.ZodNumber; hash: z.ZodString; }, "strict", z.ZodTypeAny, { ordinal: number; hash: string; }, { ordinal: number; hash: string; }>; /** * The `ParsedRuleRecord` value as a Zod schema — the parser's OUTPUT expressed at * a schema boundary so `AuthoredRuleRecord` can carry it under closed keys like * every other field on that envelope (slice 3, § Data model deltas). * * NOT a second grammar: it is composed from the SAME `RuleRecordSchema` and * `RuleTargetTypeSchema` the parser validates with, plus the pair-hash shape, so * there is nothing here that could accept a record the parser rejects. * * IN-MEMORY ONLY, and never hash material: the ledger binds the record by its * file `contentHash`, so re-serialising this value into a hash basis would be a * second statement of the same bytes (Tenet 20) that could drift from them. */ export declare const ParsedRuleRecordSchema: z.ZodObject<{ record: z.ZodObject<{ schemaVersion: z.ZodLiteral<1>; severity: z.ZodEnum<["error", "warning"]>; /** REQUIRED, non-empty (R8) — the census found `message` on 4 of 140 hand-authored lessons. */ message: z.ZodEffects; recoveryHint: z.ZodOptional>; target: z.ZodEffects; /** § Design 6 — an identifier TOKEN at parse; it resolves against the Map-backed registry at compile (slice 2), never a spec-frozen enum. */ language: z.ZodOptional>; pattern: z.ZodOptional>; rule: z.ZodOptional, Record, Record>>; scope: z.ZodObject<{ fileGlobs: z.ZodArray, "many">; /** * Applied as `positiveMatch && !excludeMatch` — positive-form entries, never * `!`-negation. Min-1 WHEN PRESENT: an empty list is a silent no-op, and * "no exclusions" is expressed by OMITTING the key (§ Design 4 — no key in * this grammar carries a do-nothing value). */ excludeGlobs: z.ZodOptional, "many">>; }, "strict", z.ZodTypeAny, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }, { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }>; }, "strict", z.ZodTypeAny, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }>, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }, { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }>; examples: z.ZodArray; good: z.ZodEffects; }, "strict", z.ZodTypeAny, { bad: string; good: string; }, { bad: string; good: string; }>, "many">; requires: z.ZodOptional; scope: z.ZodEnum<["line", "file"]>; }, "strict", z.ZodTypeAny, { pattern: string; scope: "line" | "file"; }, { pattern: string; scope: "line" | "file"; }>>; curation: z.ZodOptional; curatedBy: z.ZodOptional>; curatedAt: z.ZodOptional>; baseline5Phase: z.ZodOptional; }, "strict", z.ZodTypeAny, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }>, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }, { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; }>>; verification_shadow: z.ZodOptional; source: z.ZodEffects; }, "strict", z.ZodTypeAny, { type: string; source: string; }, { type: string; source: string; }>>; }, "strict", z.ZodTypeAny, { message: string; severity: "error" | "warning"; examples: { bad: string; good: string; }[]; schemaVersion: 1; target: { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }; requires?: { pattern: string; scope: "line" | "file"; } | undefined; recoveryHint?: string | undefined; curation?: { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; } | undefined; verification_shadow?: { type: string; source: string; } | undefined; }, { message: string; severity: "error" | "warning"; examples: { bad: string; good: string; }[]; schemaVersion: 1; target: { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }; requires?: { pattern: string; scope: "line" | "file"; } | undefined; recoveryHint?: string | undefined; curation?: { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; } | undefined; verification_shadow?: { type: string; source: string; } | undefined; }>; derivedEngine: z.ZodEnum<["ast-grep", "regex"]>; examplePairHashes: z.ZodArray, "many">; }, "strict", z.ZodTypeAny, { record: { message: string; severity: "error" | "warning"; examples: { bad: string; good: string; }[]; schemaVersion: 1; target: { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }; requires?: { pattern: string; scope: "line" | "file"; } | undefined; recoveryHint?: string | undefined; curation?: { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; } | undefined; verification_shadow?: { type: string; source: string; } | undefined; }; derivedEngine: "regex" | "ast-grep"; examplePairHashes: { ordinal: number; hash: string; }[]; }, { record: { message: string; severity: "error" | "warning"; examples: { bad: string; good: string; }[]; schemaVersion: 1; target: { type: "regex" | "ast-grep"; scope: { fileGlobs: string[]; excludeGlobs?: string[] | undefined; }; rule?: Record | undefined; pattern?: string | undefined; language?: string | undefined; }; requires?: { pattern: string; scope: "line" | "file"; } | undefined; recoveryHint?: string | undefined; curation?: { sourceLesson: string; curatedBy?: string | undefined; curatedAt?: string | undefined; baseline5Phase?: number | undefined; } | undefined; verification_shadow?: { type: string; source: string; } | undefined; }; derivedEngine: "regex" | "ast-grep"; examplePairHashes: { ordinal: number; hash: string; }[]; }>; /** * Parse one `.totem/rules/.rule.yaml` document into a validated * `ParsedRuleRecord`. Pure and total in the § Design 12 sense: it either returns * a fully-validated value or THROWS a `RuleRecordParseError` naming the file and * the offending record key path. There is no partial, degraded, or * best-effort result — V1 declares no degraded mode (§ Design 2). * * Gate order is load-bearing: the § Design 2 no-silent-skip probes and the * § Design 4 inexpressible-key scan run BEFORE full schema validation, so an * unknown version / type / reserved construct and a producer-owned key each * surface their OWN diagnostic instead of a misleading shape failure against a * V1-shaped schema. */ export declare function parseRuleRecord(content: string, filePath: string): ParsedRuleRecord; //# sourceMappingURL=rule-record.d.ts.map