CAsMan

Safety Features

CAsMan includes comprehensive safety features to prevent accidental data loss and ensure reliable operation.

Database Safety Features

Visual Warning System

CAsMan provides prominent visual warnings for destructive operations:

Stop Sign Warning:

Double Confirmation System

All destructive database operations require double confirmation:

  1. First Confirmation: User must type β€œyes” to proceed
  2. Second Confirmation: User must type β€œyes” again to confirm the irreversible action
  3. Immediate Abort: Any other input immediately cancels the operation

Example Workflow:

$ casman database clear --parts

πŸ›‘ STOP SIGN WARNING DISPLAYED

WARNING: This will DELETE ALL records from the parts database at: /path/to/parts.db
Are you sure you want to clear the parts database? (yes/no): yes
This action is IRREVERSIBLE. Type 'yes' again to confirm: yes
All records deleted from parts database.

Database Integrity Checks

Before performing operations, CAsMan verifies:

Error Handling

Comprehensive error handling provides:

Assembly Chain Validation

Connection Rules Enforcement

CAsMan enforces strict assembly chain rules:

Sequence Validation:

Directionality Enforcement:

Duplicate Prevention:

Real-time Validation

During interactive scanning:

User Interface Safety

Confirmation Prompts

All potentially destructive actions require explicit confirmation:

Help and Documentation

Safety through information:

Terminal Adaptation

Safe display across environments:

Data Protection

Backup Strategies

When possible, CAsMan creates backups:

Transaction Safety

Database operations use transactions:

Input Validation

All user input is validated:

Recovery Features

Error Recovery

When errors occur:

Database Recovery

For database issues:

Best Practices

Safe operation practices:

  1. Regular Backups: Use provided backup tools regularly
  2. Test Operations: Use --dry-run flags when available
  3. Read Help: Always check --help for unfamiliar commands
  4. Verify Inputs: Double-check part numbers and parameters
  5. Monitor Output: Pay attention to warnings and confirmations

Development Safety

For developers:

Emergency Procedures

Data Recovery

If data loss occurs:

  1. Stop Operations: Immediately stop any ongoing operations
  2. Check Backups: Look for automatic backups in database directory
  3. Database Restoration: Use backup files to restore databases
  4. Validation: Verify restored data integrity
  5. Resume Operations: Carefully resume normal operations

System Issues

For system-level problems:

  1. Check Logs: Review any available log files
  2. Verify Environment: Ensure Python environment is correct
  3. Reinstall Package: Clean reinstall of CAsMan if needed
  4. Contact Support: Use GitHub issues for persistent problems

Configuration

Safety Settings

Available safety configurations:

Environment Variables

Safety-related environment variables: