/** * Workspace validation logic. * * This module validates a Quonfig workspace directory against the StoredConfig * schema. It can be used from both the oclif CLI (`qfg verify`) and the * standalone compiled binary (git pre-receive hook). * * Validation checks: * - Valid JSON * - Schema compliance (StoredConfigSchema from Zod) * - Key matches filename * - Key constraints (1-200 chars, no slashes, not "new", FS-safety floor) * - Case-insensitive key uniqueness (no Foo/foo collisions) * - Config type matches directory * - Segment constraints (valueType=bool, sendToClientSdk=false) * - Log level constraints (valueType=log_level) * - Referential integrity (IN_SEG/NOT_IN_SEG reference existing segments) * - schemaKey references existing schemas * - Rule structure (criteria + value present) * - Value type consistency * - Weighted values non-empty and consistent */ export declare const OPERATORS: readonly ["ALWAYS_TRUE", "PROP_IS_ONE_OF", "PROP_IS_NOT_ONE_OF", "PROP_STARTS_WITH_ONE_OF", "PROP_DOES_NOT_START_WITH_ONE_OF", "PROP_ENDS_WITH_ONE_OF", "PROP_DOES_NOT_END_WITH_ONE_OF", "PROP_CONTAINS_ONE_OF", "PROP_DOES_NOT_CONTAIN_ONE_OF", "PROP_LESS_THAN", "PROP_LESS_THAN_OR_EQUAL", "PROP_GREATER_THAN", "PROP_GREATER_THAN_OR_EQUAL", "PROP_SEMVER_LESS_THAN", "PROP_SEMVER_EQUAL", "PROP_SEMVER_GREATER_THAN", "PROP_BEFORE", "PROP_AFTER", "PROP_MATCHES", "PROP_DOES_NOT_MATCH", "IS_PRESENT", "IS_NOT_PRESENT", "IN_SEG", "NOT_IN_SEG", "IN_INT_RANGE", "LOOKUP_KEY_IN", "LOOKUP_KEY_NOT_IN"]; export type Severity = 'error' | 'warning'; export interface ValidationIssue { file: string; message: string; severity: Severity; suggestion?: string; } export interface ValidationStats { configs: number; envRefsChecked: number; environmentOverrides: number; featureFlags: number; logLevels: number; rules: number; schemaRefsChecked: number; schemas: number; segmentRefsChecked: number; segments: number; uniqueKeysVerified: number; } export interface ValidationResult { filesChecked: number; issues: ValidationIssue[]; stats: ValidationStats; valid: boolean; } /** * Validate an entire workspace directory on disk. */ export declare function validateWorkspace(workspaceDir: string): ValidationResult; /** * Validate configs provided as a map of { "dir/file.json": jsonString }. * Used by the pre-receive hook which reads files from git objects. */ export declare function validateFileMap(files: Map): ValidationResult; export declare function validateKey(key: string, file: string, issues: ValidationIssue[]): void; export declare function formatResult(result: ValidationResult): string;