Import DxPartReplace 1.2.0-beta.31 and Windows x64 dependencies
This commit is contained in:
1 parent
12895e9868
commit
427095212b
154 files changed
+8079
-267
No files matched your search
@@ -0,0 +1,38 @@
|
||||
# Workspace Redesign Implementation Plan
|
||||
|
||||
> **For agentic workers:** Use superpowers:executing-plans inline. Track the checked tasks and evidence here.
|
||||
|
||||
**Goal:** 实现讨论确认的白色工作区、可重复导入和 Value/NC 规则,同时保持原生器件替换机制。
|
||||
|
||||
**Architecture:** 原生 VBS 继续负责替换与属性核验;Python 导入层负责每次实时库存、路径映射与按工程校验;新的 Qt 工作区复用已验证服务、后台 worker 和持久化接口。
|
||||
|
||||
**Tech Stack:** Python 3.12, PySide6, pywin32, openpyxl, VBScript, pytest, PyInstaller.
|
||||
|
||||
**Spec:** docs/superpowers/specs/2026-10-27-workspace-redesign.md
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 固定白色,工程列表/器件明细独立卡片,紧凑进度。
|
||||
- 原生替换和连接/身份核验不移除;开发不修改真实 CAD 工程。
|
||||
- 源码无 Git;在当前目录工作,ZIP 是原始回退点。
|
||||
|
||||
## Review Focus
|
||||
|
||||
- 新旧料号并存、同位号跨图页、其他料号不能被误认已完成。
|
||||
- 已完成或删除任务不能让新导入使用陈旧库存。
|
||||
- 多文件重复器件和工程重名必须报告而不重复替换。
|
||||
- 缺少/空白 Part Label 的赋值、保存回读和恢复路径须一致。
|
||||
- 后台资源释放失败不能抹掉已核验结果,未核验不能当成功。
|
||||
|
||||
## Tasks
|
||||
|
||||
- [ ] 1. 环境/基线:保存源码备份,建立 Python 3.12 环境,运行现有 pytest;建立本文件作为进度账本。
|
||||
- [ ] 2. Value/NC:添加并运行真实 cscript 替身回归(先失败),实现缺失 Part Label 使用快照旧 Value,独立 NC 不分大小写,正常/恢复/验证一致。
|
||||
- [ ] 3. 导入:添加新旧料号混合回归(先失败);增加实时新旧料号库存和逐器件已达目标跳过、工程路径映射、多表合并、独立工程错误隔离。
|
||||
- [ ] 4. Qt 工作区:添加界面行为回归(先失败);新建白色桌面 shell,单工程/批量入口、独立工程与器件框、内嵌结果/历史、紧凑进度与日志导出,接入实际后台服务。
|
||||
- [ ] 5. 集成/交付:运行完整默认测试及受影响 VBS/应用/打包回归,截图检查桌面,构建 EXE 和说明;复核核心接口和未决实机风险。
|
||||
|
||||
## Ledger
|
||||
|
||||
Ruling: 用户已明确批准界面及功能并要求开始实现,因此不再要求重复批准实施计划。
|
||||
Ruling: 没有 Git 元数据,原位修改并保留同级源码 ZIP,不能创建 Git worktree 或提交。
|
||||
@@ -0,0 +1,45 @@
|
||||
# Interrupted import recovery implementation plan
|
||||
|
||||
> **For agentic workers:** Use superpowers:executing-plans to implement this plan task-by-task.
|
||||
|
||||
**Goal:** Permit CBB import after a crashed read session once resource exit is proven, retaining write uncertainty and improving the approved white workspace.
|
||||
|
||||
**Architecture:** Reconcile abandoned ownership under the existing supervisor lease before native admission; use the same path for manual cleanup. Keep business protection independent from physical resource release.
|
||||
|
||||
**Tech Stack:** Python 3.12, PySide6, Win32, PyInstaller.
|
||||
|
||||
**Spec:** ../specs/2026-10-29-interrupted-import-design.md
|
||||
|
||||
## Global constraints
|
||||
|
||||
- Do not change replacement/property rules or delete engineering data.
|
||||
- Retain uncertain-write markers and previously saved results.
|
||||
- Keep fixed white theme, left project list, compact progress and portable runtime.
|
||||
- The workspace has no Git metadata; edit in place and preserve user data.
|
||||
|
||||
## Review focus
|
||||
|
||||
- Dead read supervisors must not permanently block unrelated imports.
|
||||
- Interrupted writes must stay protected after physical cleanup.
|
||||
- Live or unknown process/desktop ownership must remain blocked.
|
||||
- A cleanup request must not create another stale cleanup supervisor.
|
||||
- Pending cleanup must not be presented as successful release.
|
||||
|
||||
## Tasks
|
||||
|
||||
- [x] Add failing crash-record/admission, empty-desktop and UI cleanup-feedback regression tests.
|
||||
- [x] Implement preflight reconciliation in batch_supervisor.py and proven orphan checks in batch_resources.py; run the targeted tests and existing safety coverage.
|
||||
- [x] Refine workspace_window.py/workspace_styles.py with compact status/notice, project list delegate, empty state and accurate cleanup feedback; render the actual Qt window.
|
||||
- [x] Review changes, run relevant checks, update version/release notes, build and inspect the portable beta.9 ZIP.
|
||||
|
||||
## Execution ledger
|
||||
|
||||
- Investigation: uploaded application.log contains only recent overview reads and export_diagnostics, without the shown earlier exception. Screenshot identifies batch_resources_pending; source confirms unconditional pending-supervisor admission and manual-only reconciliation.
|
||||
- Ruling: apply established UI choices and authorized repair directly; no new UX workflow or approval round needed.
|
||||
- Investigation: wait_for_resolution retained an interactive wait even after the actual GUI parent exited. Added durable owner-exit notification; pipe loss with a live parent only requests ordinary stop.
|
||||
- RED/GREEN: old admission reproduced batch_resources_pending; old manual cleanup unnecessarily launched another supervisor; old orphan empty-desktop recovery remained blocked. Regression tests now pass. A real temporary GUI was killed while its worker awaited reconciliation; worker exit and next batch admission passed without CAD.
|
||||
- Review: fixed exact CAD identity preference for PID reuse and gated orphan marker publication on confirmed parent exit. Fresh read-only reviewer found no remaining medium/high issues.
|
||||
- Ruling: corrected existing test fixtures for atomic PID observation, explicit extended-path directory creation and intended empty-residue semantics; no safety assertions for live windows were removed.
|
||||
- Ruling: native junction creation uses an existing 8.3 DOS target when available; direct extended-prefix targets are not valid for CPython's helper. Canonical target verification remains mandatory. Existing regression failed before correction and passes afterward.
|
||||
- Verification: 162 tests passed in 45.83s across interrupted-import recovery, supervisor/runtime, safe stop, isolated desktop/CAD, workspace import/operations/feedback/window and packaging. Real Qt screenshots inspected at 1400x940 and 1280x800.
|
||||
- Packaging: PyInstaller build and frozen EXE runtime smoke passed (real child process identity and private-desktop release, environment Python variables removed). ZIP CRC, required runtime files, beta.9 version and SHA256 sidecar verified; 254 files, including 229 dependency files, no user data. Archive SHA256: 79741a786ca8cf8cac3e7d5b28e0044d852b95432da96d40215874e8eb30691d.
|
||||
@@ -0,0 +1,32 @@
|
||||
# Value readback and collapsible project groups
|
||||
|
||||
User-authorized scope: display original and actual readback Value in results/export; three independently collapsible, clearly colored project groups. Existing white layout and replacement/attribute rules remain binding.
|
||||
|
||||
Design: collect Value using a read-only report after existing restore/save verification. Bind reports to the exact job/state and persist structured values in task events before the next queue item starts. Missing historical evidence displays “未记录”; do not derive actual Value from Part Label or a planned new value. Preserve existing five-column result parser callers through an optional detailed mode. The workspace/export use eight columns.
|
||||
|
||||
Sidebar groups: 正在替换 (blue), 未完成 (amber), 已完成 (green), including counts. Running and unfinished default expanded; completed defaults collapsed. Remember each group's preference. Only the active queue project is running; completed and validated already-target-only projects belong to completed. Failures/paused/unconfigured remain unfinished. Group headings do not select an engineering project or change execution order. Feedback moves projects between groups and refreshes terminal statuses.
|
||||
|
||||
- [x] Add failing structured Value parsing/report correlation tests and real WSH read-only report tests.
|
||||
- [x] Record and ingest Value readback, extend workspace result and Excel columns; preserve historical/failed-result honesty.
|
||||
- [x] Add collapsible groups, backgrounds, persistence and active-project updates with UI regression tests.
|
||||
- [x] Render actual results/group states, review, run relevant checks, build and verify portable beta.10.
|
||||
|
||||
Constraints: no actual user CAD project writes during verification; preserve old data and interrupted-write protections. No Git metadata is present.
|
||||
|
||||
## Steering and execution ledger
|
||||
|
||||
- User added corrupt-project cancellation/restart failure, then explicitly requested skip/no recovery for read failures, then immediate current-project Stop without waiting for COM. These are part of this delivery.
|
||||
- Read cancellation/runtime work was delegated under subagent-driven-development; Value/UI and final integration stayed in the parent. Read task limits: startup45s, no-progress45s +5s grace; cancel5s, bounded owned Quit/Job cleanup. Failed read sessions release before skip; no automatic failed-project retry.
|
||||
- Task reviews caught and resolved native CLI nonzero skip semantics, exact request/claim provenance for orphan termination, recovered Value reporting, first-project Running rendering and same-window old-round duplication. Reviewer usage limit prevented a final independent reread; parent finishes with regression and integration checks.
|
||||
- Immediate Stop uses one existing supervised engine per project. It durably protects only that project, exits owned processes, marks persistent manual_stop and leaves later projects unlaunched. Existing mixed/write interruption handling remains.
|
||||
|
||||
## Final verification — 2026-10-29
|
||||
|
||||
- Combined regression: **365 passed in 91.44s**, covering read/restart resource admission, real owned-process cancellation and forced Stop, isolated CAD lifecycle, native inventory handling, grouped UI, results/export, recovery evidence, real WSH Value reports, unchanged Value policy and packaging tests. Uses base Python with project/venv packages and offscreen Qt; does not open user CAD projects.
|
||||
- Initial concurrent build/regression run had one failure in the 1-second native-sidecar liveness timing test (364 passed). No monitor logic was changed to suppress it: the full monitor module passed 33/33, then the complete combined selection passed serially as above. Heavy concurrent build load is suspected, not proven, as the initial timing cause.
|
||||
- Actual Qt previews inspected at 1280 and 1400 widths: `build/beta10-workspace-1280.png`, `build/beta10-workspace.png`, `build/beta10-workspace-results.png`. Red current-project Stop remains visible in the compact bottom toolbar.
|
||||
- PyInstaller completed successfully; EXE FileVersion `1.2.0.10`, ProductVersion `1.2.0-beta.10`.
|
||||
- `tools/verify_packaged_runtime.py dist/DxPartReplace/DxPartReplace.exe build/beta10-frozen-check` passed with Python environment overrides removed. Actual frozen supervisor launched, process creation time read, owned desktop and process resources positively released, clean application exit recorded.
|
||||
- ZIP verified: 254 files, bundled Python DLL and native VBS present; VBS byte-identical to source; no `data/` user records; CRC test and SHA-256 sidecar match.
|
||||
- Deliverable: `dist/DxPartReplace-1.2.0-beta.10-Windows-x64.zip` (51,642,840 bytes), SHA-256 `ab4585e1580cbf638ccfab5e45cb8c44144619fafe55559095467553a8cc0151`.
|
||||
- Boundary: no real user DxDesigner project was replaced during verification. Existing developer-machine long-path fixture failures remain outside this change and are disclosed in the bundled instructions.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Discovery fingerprint and signal ports
|
||||
|
||||
Evidence from `DxPartReplace-诊断-20261030-132517.zip`: the LDO_S2032_SOT23_1V5 native reader rejected the named `POWER_EN` symbol of type `in.1`. The fallback CAD reader opened the project and completed twice, each time returning ten component identities. The second native snapshot got `PermissionError` on `database/icdb.dat`; the same read-only CAD session remained alive. The task then failed in DiscoveryCache after its post-read fingerprint could not be verified. This indicates a locked/unreadable database; the bundle cannot prove which process held the lock. No CAD replacement occurred in this import.
|
||||
|
||||
Fix: recognize named in.1/out.1 ports independent of their names, retaining empty-reference, unique symbol-type, empty path, and paired-report count checks. For a post-discovery fingerprint that is unavailable, request release only from the active owned read-only CAD session after validating its matching project, session and closed-project/worker checkpoint. Recompute the entire fingerprint after confirmed release, then keep existing design-change, database-churn, equal-inventory, and cache-admission guards. A failed release or still-unreadable/changed project is not treated as valid; write sessions are never terminated by this path.
|
||||
|
||||
Diagnostic export: the supplied bundle reached the 512-file cap and omitted current task evidence, and application.log exceeded the per-file limit. Export a bounded redacted tail of the current application log, prioritize recently active tasks and recent batch sessions, and raise the still-bounded count to 4096 while retaining the existing 32 MiB and symlink/allowlist limits.
|
||||
|
||||
Tests: reproduce an owned CAD database lock, ensure real project modifications remain rejected, verify per-read database churn requires two equal inventories, verify failed cleanup is not cached, test the actual runtime checkpoint/ownership guard and write-session exclusion, cover POWER_EN and other named ports plus ambiguous symbol cases, and test bundle prioritization/tail redaction. No user CAD write during testing.
|
||||
|
||||
Steering: additionally recognize old Value's `_NC` and `_nc` as NC markers, using the existing `/NC` output convention, preventing duplicates, preserving original Value without a new Part Label, and rejecting longer tokens such as NC_OPTION. If a positively released read session still leaves the project unverifiable, report a released-project error so the BOM batch can continue with other projects.
|
||||
|
||||
The later `20261030-134255` bundle also shows the same final fingerprint error for BOB_XPON and CA_CARD_HIGH; several preceding projects passed and remaining rows were left unchecked. Its 512-file export cap omitted 485 records, so the exact underlying fingerprint issue for each project is not available. Do not assert they all have the same lock or are damaged. Port recognition is not tied to a project or fixed UID/name: named in.1/out.1 symbols with no Ref Designator are checked in both reports, including names with punctuation and non-ASCII text; unsupported or ambiguous cases still fall back to CAD. The existing CAD inventory handles no-reference objects generically across projects while retaining all addressable components.
|
||||
|
||||
Verification: 529 regression tests passed before the `_NC` and released-project reporting steering. Afterwards, 375 focused tests passed covering the modified NC flow, full actual VBS restoration on WSH fakes, cache safety, batch continuation, resource ownership, diagnostic export and UI. After further generalizing port-name characters, 73 impacted tests passed, including Chinese/punctuation names, ambiguous identities, actual WSH `_NC`, and verified-release skip behavior. The beta.12 VBS and final source differ only in the requested NC recognition regex. No real CAD engineering project was opened or written.
|
||||
|
||||
PyInstaller beta.13 build succeeded. Frozen supervisor, process identity and resource-release smoke passed with a fresh data root; ZIP CRC and SHA-256 sidecar passed, Python runtime included, source VBS matches bundled VBS, updated parser/cache modules archived, version 1.2.0.13, and no user data included. Deliverable: `dist/DxPartReplace-1.2.0-beta.13-Windows-x64.zip`, SHA-256 `855cffb0bfe3a3e98a2363ed22a4f612442905ea4b578c41a153b1f2a28a5fc2`.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Power port identity during BOM inventory
|
||||
|
||||
Evidence: the supplied 11:29 diagnostic bundle for `LDO_1117_1V5` records a successful CAD open, followed by `inventory_read_component ... component identity is incomplete`. The native flat report rejects `POWER_IN`, whose symbol name is `in.1` and whose reference designator is blank. The native report also shows actual components including CP04 with `$1I44`. The exact CAD object with the incomplete identity is not recorded, so the CAD-side cause is not proven to be the same port.
|
||||
|
||||
Fix both causes without changing replacement or attribute rules: the native parser excludes only unambiguously identified POWER_IN/in.1 or POWER_OUT/out.1 named ports, and verifies that their counts match between both reports. Other malformed or ambiguous symbols continue to require CAD fallback. During CAD inventory, objects without a reference designator cannot be addressed by a BOM row and are excluded with logged details and a visible progress message. A nonempty reference with missing UID continues to fail. The wildcard inventory still collects all addressable components to detect duplicate references. A true missing UID is reported as an identity issue, not conclusively as a corrupt project.
|
||||
|
||||
Verification: use report fixtures based on the observed evidence, negative cases for conflicting symbol types and mismatched reports, real WSH tests using fake COM-shaped objects for the actual discovery routine, read-only recovery/cleanup tests, the existing Value/NC and native replace contract tests, and a frozen portable build. No actual user CAD project is opened or modified during automated tests.
|
||||
|
||||
Completed: 486 selected regression tests passed in 84.51s, including actual WSH execution of the discovery routine with named POWER_IN, a valid component, and a duplicate reference using another part. Tests verify missing UID for a real reference still fails, ambiguous named ports do not bypass checks, and released resources permit subsequent work. The extracted recovery-label test needed a stub for the existing Value-readback reporter; the real readback is separately covered by integration tests.
|
||||
|
||||
Compared the previous beta.11 bundled VBS with the current source: every routine outside the discovery subroutine and its new helper is identical after newline normalization. Frozen beta.12 passed the packaged supervisor/resource-release smoke check. ZIP CRC, version metadata, bundled Python, new VBS/source match, parser presence and SHA-256 sidecar all verified; user data is excluded. Deliverable: `dist/DxPartReplace-1.2.0-beta.12-Windows-x64.zip`, SHA-256 `083cf51bd37c6c9a34081d325bd5c8a8220b9c5d66de6eb389f5e92ccc10bf8c`. Actual user project and the precise CAD object missing UID/refdes remain to be checked on the target computer.
|
||||
@@ -0,0 +1,17 @@
|
||||
# Read and parser diagnostics
|
||||
|
||||
User request: record the parsing process so a later diagnostic export identifies the stalled stage. This is observability only; preserve parser acceptance, UID checks, replacement/property rules, cancellation and resource ownership behavior.
|
||||
|
||||
Implementation: bounded, best-effort JSONL traces plus an atomic last-stage snapshot beside existing native/discovery evidence. Record timestamp/PID/project, parser stages, tool exits, exact failing UID and report line context, CAD startup/worker stages, progress and stop/timeout/exit outcomes. Keep the main application log useful by recording supervised read progress and row/project report outcomes. Extend the diagnostic allowlist for these artifacts, worker status/output and existing native metadata; export sampled report context rather than full source reports or databases.
|
||||
|
||||
- [x] Add failing tests for invalid UID context, trace bounds/non-interference, real worker stage traces and diagnostic export.
|
||||
- [x] Implement parser and read-stage evidence, application summaries, bundle coverage.
|
||||
- [x] Run focused regressions and packaged runtime verification; build portable beta.11 and document how to reproduce/export.
|
||||
|
||||
No user CAD writes during verification. Trace I/O failure must never alter a business result or bypass resource cleanup.
|
||||
|
||||
Verification so far: 6 new targeted checks initially failed for missing tracing/progress/export, then passed. Read/runtime/diagnostic regression: 169 passed. Combined selection including UI, native ASCII parsing, stop/restart, service, unchanged Value/NC policy, real WSH reports and packaging: 413 passed in 82.62s. After adding report-header samples, reran all affected native-parser/reader/trace/export tests: 60 passed in 1.95s. No acceptance criteria or native VBS replacement code changed.
|
||||
|
||||
Final package verification: PyInstaller build succeeded. Frozen EXE runtime smoke passed using a fresh `build/beta11-frozen-check` with Python environment overrides removed; real owned supervisor/desktop resources released and clean exit recorded. Confirmed the new read_trace module is archived in PYZ, EXE FileVersion 1.2.0.11 / ProductVersion 1.2.0-beta.11. ZIP CRC test passed, Python runtime present, no user data included, native VBS byte-identical to source and SHA-256 sidecar matched.
|
||||
|
||||
Deliverable: `dist/DxPartReplace-1.2.0-beta.11-Windows-x64.zip`, 51,655,699 bytes; SHA-256 `bd4b50eaf2263ca28b86ea13548df6d3876e643ad52ee913d41d5f12f7c88087`. No real user CAD project opened or modified. Reproduce after upgrade and send the full diagnostic ZIP; old incidents cannot be retroactively traced.
|
||||
@@ -0,0 +1,20 @@
|
||||
# 物料替换工作区重构
|
||||
|
||||
## 已确认的产品行为
|
||||
|
||||
- 单工程和批量替换分别提供入口,共用原生替换、属性恢复和保存回读执行链。默认使用自有独立后台 CAD。
|
||||
- 固定白色界面、蓝色主按钮、柔和玻璃卡片。工程列表与当前工程器件明细分别成框。紧凑进度栏保留阶段、时间、进度、日志和诊断导出;详细阶段按需展开。
|
||||
- 支持总表、多份 CBB 分表及分表目录。先精确匹配路径,再按相对目录和唯一 CBB 名称匹配。冲突必须人工指定,不能猜测同名工程。
|
||||
- 每次重新读取当前库存。相同器件当前料号为旧料号则待替换,为目标新料号则禁用并标记已是目标,其他料号或身份不唯一则报错。一个 Excel 行多个位号分别判定。
|
||||
- 部分工程校验失败时,通过的工程可先保存执行;不确定 CAD 资源或保存结果继续阻断执行。
|
||||
- 删除只移出当前列表,历史证据保留;再次导入新建处理轮次,不能重放有未核验结果的旧操作。
|
||||
- 默认替换后 Value 来源为新器件有效 Part Label。属性不存在或空白时使用替换前快照中的旧 Value。旧 Value 的独立 NC/nc 或 /NC、/nc 标记同步到新 Value,避免重复追加;不把 NCM、NC_OPTION 判为 NC。旧 Value 样式按现有机制恢复。
|
||||
- 实际保存回读结果在独立结果页可见,不能把计划当实际成功。日志记录运行版本、工程、阶段、目标、异常编号、堆栈、阶段耗时和后台退出证据,支持导出诊断 ZIP。
|
||||
|
||||
## 工程约束
|
||||
|
||||
继续使用 Python 3.12 / PySide6,原生对话框与 Library Wins、器件身份和连接完整性检查保持。保留旧服务和旧数据兼容入口。不得在用户真实 CAD 工程上自动做开发测试;使用 VBS 替身、临时工程和 Qt offscreen 验证。
|
||||
|
||||
## 交付
|
||||
|
||||
当前源码目录无 Git 元数据,在同级保存修改前 ZIP。交付更新源码、可运行桌面程序与使用说明,标注实机 CAD 验证范围。
|
||||
@@ -0,0 +1,13 @@
|
||||
# Interrupted import recovery and workspace polish
|
||||
|
||||
The user authorized fixing CBB import after a forced exit and improving the existing white workspace. Existing decisions remain binding: project list in the sidebar, large component table, compact progress, persistent history, original replacement and Value/NC rules.
|
||||
|
||||
Recovery runs under the existing exclusive supervisor lease before launching another native batch. Recheck exact process identities, reconcile abandoned supervisor journals, retain all interrupted-write markers, and release only resources proven inactive. A dead supervisor plus exited recorded workers/CAD and an empty private desktop can be reconciled without requiring the obsolete owner to publish a final handle-close certificate. Live or unreadable ownership stays blocked with an actionable message. Never delete project databases or replay replacement work.
|
||||
|
||||
Explicit resource recheck uses the same local reconciliation path rather than creating another cleanup supervisor. The UI reports pending versus released resources accurately. Diagnostics retain the underlying error; the banner presents a short actionable description.
|
||||
|
||||
Visual changes refine the existing layout: neutral white cards, clearer navigation and project selection, compact header/controls, muted project metadata, accessible table text and a compact status badge. No dark mode or larger progress area.
|
||||
|
||||
Approaches: deleting protection files would lose uncertainty evidence; always requiring manual cleanup reproduces the reported dead end. Automatic evidence-based reconciliation is selected within the user's existing authorized recovery scope.
|
||||
|
||||
Validation uses synthetic persistent crash records, real Windows supervisor child processes without CAD, mocked Win32 observations for empty/live desktop cases, existing safety tests, UI rendering, and portable packaging. Real project writes are not part of validation.
|
||||
Reference in new issue
Block a user