3.5 KiB
V1.1.0 Project Tasks Implementation Plan
For agentic workers: Use superpowers:subagent-driven-development task-by-task. Steps use checkbox syntax.
Goal: Iterate the existing replacement application with single-project tasks, editable per-component plans, optional Excel imports and serial task execution.
Architecture: Reuse the existing desktop service/store and native replacement helper. Add focused plan/inventory/queue modules with stable target identities and transactional persistence. Keep historic jobs and an explicit legacy test entry point.
Tech Stack: Python 3.12, SQLite, PySide6, ASCII VBScript; openpyxl for XLSX files.
Spec: docs/superpowers/specs/2026-10-14-v1.1.0-project-tasks-design.md
Global Constraints
- Version 1.1.0; retain existing task view and direct editing.
- Each directory-created task owns exactly one .prj; historical tasks are preserved.
- Explicit empty targets never mean all matches.
- UID + schematic + sheet + expected RefDes + old Part Number identify targets.
- Default NC synchronization remains on and is editable in UI/import; independent /NC only.
- Existing Replace Part + Library Wins, backup and saved readback remain required.
- No production CAD writes for interface research or tests.
- Default tests are fast behavior tests; historic regressions are explicit and preserved.
Task 1: Persistence, inventory, plans and target execution
Files: models.py, store.py, service.py, quick_run.py, recovery.py, QuickPartReplace.vbs; create target_plan.py, inventory.py, spreadsheet_plan.py and project_tasks.py as focused modules; tests/v1_1/test_project_tasks.py, test_target_plan.py, test_inventory.py, test_spreadsheet_plan.py, test_target_execution.py.
Interfaces consumed: TaskStore transaction(), create_task(), sync_projects(); QuickRunPreparer and existing sheet discovery. Produced: directory task creation, task inventory, target plan edit/import/export APIs and versioned target-aware queue preparation. Define exact signatures in the implementation report for UI/task queue integration.
- Write failing behavior tests for two .prj files creating two single-project tasks, duplicate scanning not duplicating active tasks, same names differentiated by relative path; run these tests and observe missing APIs.
- Implement transaction-backed group/order/project binding and migrations; maintain legacy constructor defaults. Test transaction rollback and reopen.
- Write failing tests using injected inventory rows for same old part on R1/R2/R3: selecting R1/R3 yields only those UIDs; R2 stays excluded; missing target errors, empty target errors, conflicting imports and equal/chain/cycle rules error.
- Implement component inventory read mode on existing discovery route, collecting effective Value and all stable identifiers without pin/attribute full snapshots; do not save while scanning.
- Implement target rule grouping and target-aware command/snapshot/recovery freeze validation in both Python and VBS. Run isolated VBS contract tests and native_helper mocks; tests must prove selectors survive recovery and stale targets do not become no_match.
- Add openpyxl reader/writer using explicit columns and literal values; parse whole workbook, validate identity and duplicates, then commit atomically. Test roundtrip editing new part, Value and NC plus forged UID and duplicate row rejection.
- Run V1.1 behavior tests and relevant existing inputs/value/recovery tests; commit this task only after covering tests pass and report API signatures and validation limits.