Close out step 6c + record final roadmap state

This commit is contained in:
admin
2026-05-23 11:19:24 +02:00
parent d0a2def788
commit 0e230320a9
+2 -2
View File
@@ -143,9 +143,9 @@ Done in rc-jav catalog loading. Catalog CSV/XML paths are normalized from Window
(Step 4 in the plan is a paired-extraction sub-task of step 6; folded into step 6 ship.)
**Pending (in execution order):**
6c. **options.js split — Diagnostics + Profiles + Rules Editors extracted.** Final mechanical split. Three new files: `options-diagnostics.js` (245 lines — extension ID display, runDiagnostics, host status, host repair, native messaging failure renderer), `options-profiles.js` (265 lines — `_knownRemotes`, `_cfgDefaults`, fetchRemotes, buildRemotePicker, profile modal), `options-rules-editors.js` (328 lines — adapters + ID normalizers + custom part detectors with their feedback UI). `options.js` is now **1014 lines** — entry IIFE, settings load/save, backup/restore, recent activity, search test bench, element picker, overlay previews, no-match overlay, `escapeHtml`, and paths. The picker + overlay-preview code stays because it's tightly coupled across multiple settings panes and the JS-DOM call graph would have to be untangled to extract cleanly. Script-tag order in `options.html` now: cache → dupe-review → library-issues → diagnostics → profiles → rules-editors → options.js (entry). `node --check` clean on each file individually and on the concatenated load-order stream. Concat = 3144 lines, matching the pre-6c sum exactly.
- **Step 6c — finish options.js split (optional).** Remaining options.js (1852 lines) still holds: settings load/save, backup/restore, recent activity, search test bench, adapters, ID normalizers, part detectors, element picker, overlay previews, diagnostics, profiles, paths, and the bottom-entry IIFE. Candidates for extraction: Diagnostics (~250 lines), Profiles (~265 lines), Adapters + ID normalizers + Part detectors as a "rules editors" file (~330 lines combined). Diminishing returns past this point — bottom IIFE + load/save core should stay in `options.js` as the entry point.
**Pending:** none. Original roadmap closed. Follow-ups recorded inline above (e.g. step 11's `_load_host_cache` memoization is already shipped via the `_cache_mem` stamp dict). Node-side fixture runner (`fixtures/run-node.mjs`) added so `shared-normalization.json` now genuinely guards cross-side drift — the original step 8 ship noted the gap; it's closed.
10. **`rc-jav.py` package split — done (sub-steps 10a10i, shipped across two sessions).** Python repo at `D:\DEV\Project\rclone-jav\` is now git-tracked (baseline `e029e89`); `rc-jav.py` went from 2230 lines to a 25-line shim. New `rcjav/` package contains: `model.py` (24, FileEntry), `ids.py` (243, ID extraction + part detection + normalization + describe_id_match + expand_range), `cache.py` (76, cache.json I/O), `catalog.py` (178, WinCatalog CSV/XML), `dupes.py` (264, keep-ranking + find_dupes + variant alerts), `rclone_io.py` (298, subprocess wrappers + walk_remote + glob escaping), `library.py` (176, library-issues + safe rename), `output.py` (495, rich console + renderers + plain/CSV/JSON outputs), `cli.py` (845, main() + collectors + arg parsing). Pattern across all sub-steps: top-level mutable globals (`PART_RES`, `_KEEP_RANKING`, `BASIC`, `RCLONE_BIN`, `console`, `USE_ANSI`) are read/written only inside their owning module — callers go through setters (`configure_part_patterns`, `set_keep_ranking`, `set_basic`, `set_rclone_bin`, `set_console_no_color`, `set_use_ansi`) so no in-tree code ever sees a stale captured binding. `rc-jav.py` shim does `from rcjav import *` + `from rcjav.cli import main`, so `importlib.spec_from_file_location("rcjav_script", "rc-jav.py")` (used by tests/fixtures/native host) still finds every previously-top-level name. Each sub-step verified at commit time via `python rc-jav.py --help`, `python -m rcjav.cli --help`, `python fixtures/run.py` (17/17 cases), and `python -m unittest tests.test_rules` (5/5).
(Step 10's cache-contract implementation is split off as step 10j below — design from step 9 is locked, implementation hasn't shipped.)