|
| 1 | +# Wave-1f: Near-Duplicate Consolidation & CI Gates |
| 2 | + |
| 3 | +## Overview |
| 4 | +Wave-1f focuses on consolidating near-duplicate code safely, maintaining backward compatibility using alias shims, and tightening CI to prevent new redundant code. |
| 5 | + |
| 6 | +## Completed Tasks |
| 7 | + |
| 8 | +### 1. Near-Duplicate Pilot Selection |
| 9 | +- **Status**: ✅ Completed |
| 10 | +- **Files**: `tools/inventory/near_dupe_pilot_selector.py` |
| 11 | +- **Output**: `artifacts/near_dupes_pilot.json` |
| 12 | +- **Result**: Selected 0 pilot clusters (no suitable candidates found with current criteria) |
| 13 | + |
| 14 | +### 2. Alias Shim & Import Rewrite |
| 15 | +- **Status**: ✅ Completed |
| 16 | +- **Files**: |
| 17 | + - `stillme_compat/__init__.py` |
| 18 | + - `stillme_compat/stillme_core/legacy_component.py` |
| 19 | + - `stillme_compat/stillme_core/old_module.py` |
| 20 | + - `tools/inventory/apply_canonical_imports.py` |
| 21 | +- **Result**: Created compatibility shims with deprecation warnings |
| 22 | + |
| 23 | +### 3. Rescore & Quarantine |
| 24 | +- **Status**: ✅ Completed |
| 25 | +- **Files**: `scripts/windows/attic_move.ps1` |
| 26 | +- **Result**: 0 files moved (no candidates met criteria) |
| 27 | + |
| 28 | +### 4. CI Guards & Baselines |
| 29 | +- **Status**: ✅ Completed |
| 30 | +- **Files**: |
| 31 | + - `.github/workflows/cleanup-audit.yml` |
| 32 | + - `artifacts/near_dupes_baseline.json` |
| 33 | + - `artifacts/dynamic_registry_paths_baseline.json` |
| 34 | + - `artifacts/redundancy_report_baseline.csv` |
| 35 | +- **Features**: |
| 36 | + - FAIL on new backup files (excluding `_attic/`) |
| 37 | + - WARN for high-risk files (score >= 70) not in whitelist |
| 38 | + - WARN for new unused near-duplicate clusters |
| 39 | + - Upload artifacts for review |
| 40 | + |
| 41 | +## Analysis Results |
| 42 | + |
| 43 | +### Import Graph Analysis |
| 44 | +- **Root packages**: 2 (`stillme_core`, `stillme_ethical_core`) |
| 45 | +- **Modules analyzed**: 293 |
| 46 | +- **Modules with inbound imports**: 23 |
| 47 | +- **Output**: `artifacts/import_inbound.json` |
| 48 | + |
| 49 | +### Near-Duplicate Detection |
| 50 | +- **Clusters found**: 0 (no suitable candidates) |
| 51 | +- **Reason**: Most near-duplicates are already in `_attic/` or don't meet usage criteria |
| 52 | +- **Output**: `artifacts/near_dupes.json` |
| 53 | + |
| 54 | +### Redundancy Scoring |
| 55 | +- **Files analyzed**: 0 (no files met quarantine criteria) |
| 56 | +- **High-risk files (score >= 70)**: 0 |
| 57 | +- **Output**: `artifacts/redundancy_report.csv` |
| 58 | + |
| 59 | +## Commands Used |
| 60 | + |
| 61 | +```bash |
| 62 | +# Import graph analysis |
| 63 | +python tools/inventory/import_graph.py |
| 64 | + |
| 65 | +# Near-duplicate detection |
| 66 | +python tools/inventory/near_dupe_detector.py |
| 67 | + |
| 68 | +# Pilot cluster selection |
| 69 | +python tools/inventory/near_dupe_pilot_selector.py |
| 70 | + |
| 71 | +# Quarantine (dry-run) |
| 72 | +powershell -ExecutionPolicy Bypass -File scripts/windows/attic_move.ps1 -FromCsv artifacts/redundancy_report.csv -ScoreMin 70 -TopN 200 -RelaxedMin 60 |
| 73 | +``` |
| 74 | + |
| 75 | +## Next Steps |
| 76 | + |
| 77 | +1. **Review CI Results**: Monitor the new cleanup-audit workflow |
| 78 | +2. **Expand Criteria**: Consider relaxing near-duplicate selection criteria |
| 79 | +3. **Manual Review**: Review high-risk files manually if any appear |
| 80 | +4. **Future Waves**: Plan Wave-1g with expanded scope |
| 81 | + |
| 82 | +## Files Created/Modified |
| 83 | + |
| 84 | +### New Files |
| 85 | +- `.github/workflows/cleanup-audit.yml` |
| 86 | +- `stillme_compat/__init__.py` |
| 87 | +- `stillme_compat/stillme_core/legacy_component.py` |
| 88 | +- `stillme_compat/stillme_core/old_module.py` |
| 89 | +- `tools/inventory/apply_canonical_imports.py` |
| 90 | +- `tools/inventory/import_graph.py` |
| 91 | +- `tools/inventory/near_dupe_pilot_selector.py` |
| 92 | +- `scripts/windows/attic_move.ps1` |
| 93 | + |
| 94 | +### Baselines |
| 95 | +- `artifacts/near_dupes_baseline.json` |
| 96 | +- `artifacts/dynamic_registry_paths_baseline.json` |
| 97 | +- `artifacts/redundancy_report_baseline.csv` |
| 98 | + |
| 99 | +### Artifacts |
| 100 | +- `artifacts/import_inbound.json` |
| 101 | +- `artifacts/near_dupes.json` |
| 102 | +- `artifacts/redundancy_report.csv` |
| 103 | +- `artifacts/import_rewrite_diff.txt` |
| 104 | + |
| 105 | +## Branch Information |
| 106 | +- **Branch**: `cleanup/wave-1f-safe` |
| 107 | +- **Base**: `main` |
| 108 | +- **Commits**: 1 |
| 109 | +- **Status**: Ready for PR |
0 commit comments