This document describes the development tools available in the Piper Morgan codebase.
Location: tools/check_domain_db_consistency.py
Validates consistency between SQLAlchemy database models and domain dataclasses to prevent schema drift and ensure Domain-Driven Design integrity.
services.domain.models and services.database.models# Basic validation
PYTHONPATH=. python tools/check_domain_db_consistency.py
# Verbose output (shows all models being loaded)
PYTHONPATH=. python tools/check_domain_db_consistency.py --verbose
# JSON output format
PYTHONPATH=. python tools/check_domain_db_consistency.py --format json
0 - Validation passed, no inconsistencies found1 - Validation failed, inconsistencies detected2 - Tool execution errorThis tool should be run as part of the continuous integration pipeline to catch schema drift early:
# Example GitHub Actions workflow
- name: Validate Schema Consistency
run: |
PYTHONPATH=. python tools/check_domain_db_consistency.py
When adding new domain models or database tables:
scripts/pattern_sweep.py)Standalone automated pattern discovery and learning acceleration tool.
./scripts/run_pattern_sweep.sh --verbosescripts/init_db.py)Initialize the PostgreSQL database with proper schema.
Last updated: 2025-08-18 - TLDR deprecated, Pattern Sweep preserved as standalone tool