5.2 KiB
Target Cell Selection Implementation Plan
For agentic workers: Use superpowers:subagent-driven-development in this session; user has approved explicit rule selection and blocking when missing. Do not ask for repeated approval.
Goal: Bind explicit, authoritative target Cell selection to rules and verified execution.
Architecture: An isolated read-only library catalog supplies rule choices. Persist a target_cell string through batch defaults and per-target plans. The queue, native transaction, restore and saved readback all bind that selection; existing C/A/U/G protections remain complete.
Tech Stack: Python 3.12, SQLite, PySide6, installed EE 7.9.5 COM, VBScript.
Spec: ../specs/2026-10-19-target-cell-selection.md
Global Constraints
- Preserve the default 11-column BOM; no inferred Cell choice.
- Keep current branch codex/bom-import-state and preserve feedback/.
- No packaging/release, no source-project/library writes, no user desktop CAD control.
- Real execution only in build/ disposable copies with owned desktops.
- Libraries must have complete PDB/Cell dependencies; failed/rebuilding copies fail closed.
Task 1: Complete and commit native selected capture separately (root)
Files: NativeSnapshotReader.vbs, QuickPartReplace.vbs, test_native_selected_capture.py.
- Reuse original QPSnapshotComponent within one correlated NR2 capture; NR1 verify stays unchanged.
- Reject incomplete/foreign/duplicate selected C/A and scope drift; compare focused tests and independent review.
- Complete same-source legal BOM baseline/native runs and field/graph equivalence; commit evidence separately.
Task 2: Rule and target-plan persistence/UI (cell_rules agent)
Files: models.py, store.py, store_schema.py, service.py rule methods, batch_rules.py, target_plan.py, BOM merge code, ui/dialogs.py, ui/main_window.py, ui/mapping_table.py, relevant tests.
Interfaces: target_cell: str = ''; service.target_cell_choices(task_id, new_part_number) -> tuple[str,...] delegates cell_catalog.read_project_cell_choices; RuleRecord and target plan compilation preserve target_cell. Root owns quick_run.py, recovery.py, native_helper.py and VBS.
- Write meaningful red tests for migration, batch propagation, BOM-preserved selection, selected target compilation, PN change invalidation and UI stale choices.
- Implement field, editing dropdown/load action and async current-PN binding; preserve existing dialog.values() tuple for callers if practical.
- Add cheap service.validate_target_cells(task_id) for GUI preflight, before CAD startup. Missing target_cell is actionable and cannot start execution from UI.
- Run scoped tests, self-review and commit only owned files. Root will review and integrate.
Task 3: Isolated authoritative catalog (cell_catalog agent)
Files: new cell_catalog.py, new cell_catalog_worker.py if needed, application.py hidden CLI dispatch, catalog tests. Do not edit service/UI/quick_run/native_helper/VBS.
Interfaces are exactly the spec's CellChoice, CellCatalog and read functions. Cache/evidence root supplied by caller. Helpers launch using the frozen EXE hidden action or source -m module; every process is owned by PrivateDesktop.
- Reproduce incomplete dependency/old fingerprint/duplicate target behavior with fakes; test failures are explicit.
- Implement complete shadow copy with metadata preservation, source proof, exact numeric COM enumeration and all cleanup.
- Use installed IMGCLMPart.AssociatedCells; no raw DLL ABI guessing. Reuse probe findings; do not operate on originals.
- Run focused tests and a tiny read-only owned-library probe if needed; commit only owned files.
Task 4: Transport and native Cell proof (root)
Files: quick_run.py, recovery.py, native_helper.py, QuickPartReplace.vbs, execution tests.
- Add target_cell queue option and separate L snapshot row; mismatch/changes cannot resume old work.
- Verify current catalog and selected value before mutation; bind catalog/choice in native evidence.
- Write selected Cell instance within existing restore transaction; validate full targets, untouched baseline, save/reopen and saved recovery.
- Red/green tests for missing/invalid/changed choice, no broad writes and restoration failure.
Task 5: Integrated review and real acceptance (root + independent reviewer)
- Review each task against spec and quality; resolve important findings.
- Run appropriate combined regressions, final GUI interaction and representative BOM/cross-cell copy execution.
- Record actual timings, known research failures, mapping/graph/desktop proofs and limits; update docs.
- Commit and push; verify remote HEAD and only feedback/ untracked. No release.
Completion evidence
Implemented through ec75445; final fixwave177 focused checks passed. Final warmed rule-read/BOM/explicit0402-to0603/save/reopen/independentASCII acceptance passed in201.015s, sourceproject/library unchanged, owned resources released. All task reviews plus final scoped re-review clean. Source commit ec75445 pushed and remoteSHA verified. No packaging/release, no whole-suite or generic speed claim. See ../../testing/2026-10-19-target-cell-acceptance.md for full evidence and remaining performance/release gates.