Files
proxmox/docs/archive/00-meta-pruned/PRUNING_STRATEGY_DECISION.md
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- 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>
2026-02-12 15:46:57 -08:00

146 lines
3.4 KiB
Markdown

# 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:
1. **Reduced Workload**
- Current: 590 scripts need IP centralization
- After pruning: ~300-400 scripts (estimated 30-50% reduction)
- Saves time and effort
2. **Better Focus**
- Work on relevant, active scripts only
- Don't waste time on obsolete code
- Clearer project structure
3. **Easier Modularization**
- Fewer scripts to analyze for duplicates
- Easier to identify common patterns
- Better shared module design
4. **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:**
1. **Test Scripts** (~30+ found)
- `test-*.sh` scripts
- Integration test scripts
- May keep some, archive others
2. **Backup/Old Scripts** (~10+ found)
- `backup-*.sh`
- `old-*.sh`
- `temp-*.sh`
- `deprecated-*.sh`
3. **Small Scripts** (< 10 lines)
- Likely stubs or incomplete
- Only 1 found so far
4. **Duplicate Functionality**
- Multiple deployment scripts
- Similar configuration scripts
- Need manual review
5. **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
1.**Analysis Script Created** - `analyze-scripts-for-pruning.sh`
2.**Run Analysis** - Identify all candidates
3.**Review & Categorize** - Manual review of candidates
4.**Archive Obsolete** - Move to archive/ directory
5.**Delete Truly Unnecessary** - Remove broken/duplicate scripts
6.**Create Shared Modules** - Extract common functionality
7.**Update Remaining Scripts** - Use modules, IP centralization
---
## Next Steps
1. Fix analysis script date calculation bug
2. Run complete analysis
3. Generate pruning report
4. Review and categorize candidates
5. Execute pruning (archive/delete)
6. Begin modularization
---
**Status:** ✅ Strategy approved, analysis in progress