Skip to content

Validation & Repair Engine #192

Description

@kubrickcode

Validate settings and auto-recover.

type ValidationRule = {
  id: string;
  name: string;
  severity: "error" | "warning" | "info";
  validate: (config: ConfigData) => ValidationIssue[];
  fix?: (config: ConfigData) => ConfigData;
};

const validationRules: ValidationRule[] = [
  {
    id: "unique-button-names",
    name: "Unique Button Names",
    severity: "error",
    validate: (config) => {
      /* ... */
    },
    fix: (config) => {
      /* Auto-rename duplicates */
    },
  },
  {
    id: "command-security",
    name: "Command Security Check",
    severity: "warning",
    validate: (config) => {
      /* Detect dangerous patterns */
    },
  },
];

Reason: Data Integrity
Current: Runtime error when incorrect settings are entered
Improvement: Validation before saving → Auto-recovery or clear error

  • Easier to trace the cause of bugs
  • Prevents user data corruption

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

improvementImprovements to existing featuresrefactorRefactoring code

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions