Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
3.4 KiB
3.4 KiB
Script Pruning Strategy Decision
Last Updated: 2026-01-31
Document Version: 1.0
Status: Active Documentation
Date: 2026-01-22
Decision: ✅ YES - Prune First, Then Optimize
Analysis
Current Situation:
- 800 total scripts
- 590+ scripts need IP centralization
- Many duplicates and obsolete scripts likely exist
User's Insight:
"Would this be faster to review all scripts, delete and prune all old and irrelevant scripts first; then take an approach which would further optimize and modularize all remaining scripts thus removing duplicates"
Answer: ✅ YES - This is the optimal approach!
Why Prune First?
Benefits:
-
Reduced Workload
- Current: 590 scripts need IP centralization
- After pruning: ~300-400 scripts (estimated 30-50% reduction)
- Saves time and effort
-
Better Focus
- Work on relevant, active scripts only
- Don't waste time on obsolete code
- Clearer project structure
-
Easier Modularization
- Fewer scripts to analyze for duplicates
- Easier to identify common patterns
- Better shared module design
-
Faster Completion
- Pruning: 1-2 days
- Optimization: 2-3 days
- IP Centralization: 1-2 days (reduced scope)
- Total: 4-7 days vs 10+ days for current approach
Pruning Strategy
Phase 1: Identify Candidates (Current)
Categories to Review:
-
Test Scripts (~30+ found)
test-*.shscripts- Integration test scripts
- May keep some, archive others
-
Backup/Old Scripts (~10+ found)
backup-*.shold-*.shtemp-*.shdeprecated-*.sh
-
Small Scripts (< 10 lines)
- Likely stubs or incomplete
- Only 1 found so far
-
Duplicate Functionality
- Multiple deployment scripts
- Similar configuration scripts
- Need manual review
-
Obsolete Scripts
- Not modified in 6+ months
- Referenced old VMIDs
- Superseded by newer versions
Phase 2: Archive Structure
scripts/
archive/
deprecated/ # Old versions
backups/ # Backup scripts
test/ # Test scripts (keep for reference)
duplicates/ # Duplicate functionality
experimental/ # Experimental scripts
Phase 3: Modularization
After Pruning:
- Create shared modules
- Consolidate duplicates
- Update remaining scripts to use modules
Expected Results
Before Pruning:
- 800 scripts
- 590 need IP centralization
- Many duplicates
- Hard to maintain
After Pruning:
- ~400-500 active scripts (estimated 30-40% reduction)
- ~200-300 need IP centralization (50% reduction)
- Shared modules reduce duplication
- Clear, maintainable structure
Implementation Plan
- ✅ Analysis Script Created -
analyze-scripts-for-pruning.sh - ⏳ Run Analysis - Identify all candidates
- ⏳ Review & Categorize - Manual review of candidates
- ⏳ Archive Obsolete - Move to archive/ directory
- ⏳ Delete Truly Unnecessary - Remove broken/duplicate scripts
- ⏳ Create Shared Modules - Extract common functionality
- ⏳ Update Remaining Scripts - Use modules, IP centralization
Next Steps
- Fix analysis script date calculation bug
- Run complete analysis
- Generate pruning report
- Review and categorize candidates
- Execute pruning (archive/delete)
- Begin modularization
Status: ✅ Strategy approved, analysis in progress