|
| 1 | +# Wave-2a: Attic Eviction Planning & CI Hardening |
| 2 | + |
| 3 | +## Overview |
| 4 | +Wave-2a focuses on establishing a clean baseline after Wave-1f, planning safe eviction of old attic files, and hardening CI gates to prevent redundant code from returning. |
| 5 | + |
| 6 | +## Configuration |
| 7 | +- **EVICTION_MIN_DAYS**: 30 (minimum days in attic before eviction consideration) |
| 8 | +- **TRACKED_ONLY**: true |
| 9 | +- **ATTIC_PATH**: "_attic" |
| 10 | +- **ROOT_PACKAGES**: ["stillme_core", "stillme_ethical_core"] |
| 11 | + |
| 12 | +## Baseline after Wave-1f |
| 13 | + |
| 14 | +### Import Graph Analysis |
| 15 | +- **Root packages**: 2 (`stillme_core`, `stillme_ethical_core`) |
| 16 | +- **Modules analyzed**: 293 |
| 17 | +- **Modules with inbound imports**: 23 |
| 18 | +- **Baseline saved**: `artifacts/baseline/import_inbound.json` |
| 19 | + |
| 20 | +### Near-Duplicate Detection |
| 21 | +- **Clusters found**: 0 (no suitable candidates) |
| 22 | +- **Baseline saved**: `artifacts/baseline/near_dupes_baseline.json` |
| 23 | + |
| 24 | +### Redundancy Scoring |
| 25 | +- **Files analyzed**: 0 (no files met quarantine criteria) |
| 26 | +- **High-risk files (score >= 70)**: 0 |
| 27 | +- **Baseline saved**: `artifacts/baseline/redundancy_report_baseline.csv` |
| 28 | + |
| 29 | +## Attic Eviction Planning |
| 30 | + |
| 31 | +### Decision Rules |
| 32 | +A file in `_attic/` becomes an eviction candidate if: |
| 33 | +- Exists in `_attic/` **≥ 30 days** (from `artifacts/attic_moves.csv`) |
| 34 | +- NOT in `ALWAYS_PROTECT_*` paths |
| 35 | +- **No reverse references** in current repo (grep import/module/name) |
| 36 | +- **Not in recent rollback list** (compare attic_moves vs rollback log) |
| 37 | + |
| 38 | +### Always Protected Paths |
| 39 | +- `tools/**` |
| 40 | +- `.github/**` |
| 41 | +- `scripts/windows/attic_move.ps1` |
| 42 | +- `scripts/windows/attic_rollback.ps1` |
| 43 | +- `config/cleanup/whitelist.yml` |
| 44 | +- `stillme_compat/**` |
| 45 | +- All `__init__.py` files |
| 46 | + |
| 47 | +## CI Gates & Scheduled Dry-Run |
| 48 | + |
| 49 | +### Updated CI Features |
| 50 | +- **FAIL** on new backup files: `*_backup.py|*_old.py|*_copy.py|*_tmp.py|*.py~|*.py.save` (excluding `_attic/`) |
| 51 | +- **WARN** on new unused near-duplicate clusters |
| 52 | +- **Weekly dry-run** of attic sweeper with artifact upload |
| 53 | + |
| 54 | +## Commands Used |
| 55 | + |
| 56 | +```bash |
| 57 | +# Create baseline directory |
| 58 | +mkdir -p artifacts/baseline |
| 59 | + |
| 60 | +# Save baselines |
| 61 | +cp artifacts/redundancy_report.csv artifacts/baseline/redundancy_report_baseline.csv |
| 62 | +cp artifacts/near_dupes.json artifacts/baseline/near_dupes_baseline.json |
| 63 | + |
| 64 | +# Run attic sweeper (dry-run) |
| 65 | +python tools/inventory/attic_sweeper.py --days 30 --dry-run |
| 66 | +``` |
| 67 | + |
| 68 | +## Files Created/Modified |
| 69 | + |
| 70 | +### New Files |
| 71 | +- `tools/inventory/attic_sweeper.py` |
| 72 | +- `artifacts/attic_eviction_candidates.csv` |
| 73 | +- `.github/workflows/attic-dryrun.yml` |
| 74 | +- `docs/cleanup/wave-2a.md` |
| 75 | + |
| 76 | +### Baselines |
| 77 | +- `artifacts/baseline/redundancy_report_baseline.csv` |
| 78 | +- `artifacts/baseline/near_dupes_baseline.json` |
| 79 | + |
| 80 | +### Updated Files |
| 81 | +- `.github/workflows/cleanup-audit.yml` (enhanced gates) |
| 82 | + |
| 83 | +## Next Steps |
| 84 | + |
| 85 | +1. **Review eviction candidates** in `artifacts/attic_eviction_candidates.csv` |
| 86 | +2. **Monitor weekly dry-runs** for new candidates |
| 87 | +3. **Plan Wave-2b**: Controlled deletion after 1-2 weeks of monitoring |
| 88 | +4. **Validate CI gates** are working correctly |
| 89 | + |
| 90 | +## Branch Information |
| 91 | +- **Branch**: `cleanup/wave-2a-safe` |
| 92 | +- **Base**: `main` |
| 93 | +- **Status**: Ready for PR |
0 commit comments