Files
dxdesigner-part-replacement/docs/testing/evidence/2026-11-13-pr27/bom-review.md
T
阿白叔 f9d5e56bb8
Core regression / Python core, intervention UI and release configuration (push) Failing after 4m4s
Core regression / JavaScript syntax (push) Successful in 5s
Core regression / Python core, intervention UI and release configuration (pull_request) Failing after 4m20s
Core regression / JavaScript syntax (pull_request) Successful in 4s
fix: address PR27 lifecycle, BOM and netlist review findings
2026-11-13 16:03:59 +08:00

4.3 KiB

Independent read-only BOM review

Reviewed the current diff in execution_problems.py, bom_import_report.py, bom_pending.py, native_inventory.py, project_discovery.py, service.py, and tests/v1_1/test_pr27_bom_failures.py, including the later ready-state source hash/UTC provenance change. No tests, CAD, CLI, or external UI operations were run. Only this review report was written.

Finding

[P1] Preserve cleanup failure when final diagnostic I/O also fails.

At the reviewed native_inventory.py:191-199, _read performs copytree, rmtree, and the final native-inventory.json write from its outer finally without retaining the active primary exception. If a process/scope close has already raised TaskCenterError('inventory_cleanup', ...) and, for example, the final JSON write raises PermissionError, Python replaces the cleanup exception with that I/O exception. Disk/permission failures can affect both cleanup diagnostics and the final write, so this is a concrete combined failure.

The resulting path is:

  1. OwnedCliScope.close or _run_tool reports unconfirmed release as inventory_cleanup; the record is uncertain.
  2. Final evidence copy/write raises an OSError, replacing that primary error.
  3. inspect_batch catches only TaskCenterError from the collector, so the raw I/O exception bypasses BomInspectionError and original-row annotation.
  4. service._operation / logging_setup.py:64 wraps it as unhandled_exception.
  5. task_queue.py:328-332 classifies it with phase='read' while resolving BOM. That code is observe, with continue_allowed=True, so the next project may be attempted despite the unresolved cleanup.

The narrow fix is to preserve the active primary cleanup exception and its code/error ID across diagnostic failures, attaching/logging the secondary I/O failure instead. The producer regression should combine cleanup failure with a denied final JSON write or output copy and verify inventory_cleanup remains visible through BOM resolution/queue admission. Broadly banning unknown codes is not required.

Other reviewed boundaries

  • The new ReleasedProjectReadError producers themselves do not certify a genuine close failure on the normal path. _run_tool marks close errors uncertain; the scope close converts failures to inventory_cleanup; those paths do not enter the released read wrapper. Before-launch failures are safe to certify because no native process has been launched.
  • classify_execution_failure uses a precise code set. It does not infer uncertainty from substrings such as session or release. Known resource uncertainty takes precedence over phase='read' or certification.
  • Legacy inspection continues only for a released read error with a safe classification. Task-local resolution can continue through pure input/read failures. BomInspectionError preserves code/error ID and resolver annotation restores the original Excel file/row for the typed failures it receives.
  • The added lease does not introduce a same-thread queue conflict in the inspected execution path. _queue_lease owns the queue lock, and assert_task_queue_idle explicitly allows its current thread owner. resolve_pending_bom acquires/releases the quick-run lease before execute_quick_run_queue acquires its own quick-run lease; those are sequential. In a supervised worker, _worker_context(root) lets mutation_lease use its established owner context. capture_history=False avoids holding a history transaction across the native read. External mutations remain excluded.
  • The three strict zips fail on a count mismatch instead of silently truncating or misaligning source coordinates. write_routed_bom preserves row order.
  • Imported requests contain their frozen record, source file/row and source hash. Resolution rebuilds the temporary workbook from those records and does not require the original Excel file to remain present. Existing load_sources checks the source hash before and after reading.
  • The latest ready-state evidence now records the source project/database hashes and UTC start/finish times. This review did not independently execute its tests.

The reported finding concerns preserving an existing cleanup failure across a secondary diagnostic failure; it does not require a new global execution lock, new external-file gate, or a broader uncertain-code list.