docs: record patrol fixes and formal multi-rule verification

This commit is contained in:
阿白叔 committed 2026-10-17 14:11:13 +08:00
1 parent b9193dbb21
commit bc36289059
3 files changed
+415 -1

No files matched your search

@@ -0,0 +1,363 @@
{
"date": "2026-10-17",
"baseline": "2ad0a3c",
"production_backend_changed": false,
"scope": "effective inventory, native target readiness, targeted queue preparation, session control sharing violations",
"source_sha256": {
"src\\dx_productivity\\trial_task_center\\native_inventory.py": "892876a777f0045238a19cd8c7fe3a84dbda404366c53801eeacd68ceb92d0fd",
"src\\dx_productivity\\trial_task_center\\native_inventory_protocol.py": "5f74effae184205955f3dd5af5f74c5674b5f968f6f6ca9cf856e6ef13363f55",
"src\\dx_productivity\\trial_task_center\\native_helper.py": "b83845da53ee822145ba5c68d7abeb50e5b34d6061c5499e3765c777341ae65e",
"src\\dx_productivity\\trial_task_center\\quick_run.py": "8baeca57b29954f4ba9326b7e84ddab684cb08d436e61348ba057406971e2bc8",
"src\\dx_productivity\\trial_task_center\\inventory.py": "5234a4c33b4d78aa096e105aba54c073e64b9091e031d5caa0ed5f0194dcccde",
"src\\dx_productivity\\trial_task_center\\project_session.py": "ef1896a3796ea019aae8279e9de450fef108fcdb34dc79905dc4eddec62bcc61"
},
"effective_inventory_live_cases": [
{
"project": "build\\headless-inplace-20261017-a\\project\\Audio_D2128.prj",
"seconds": 1.4069999999919673,
"components": {
"RV14": {
"uid": "$2I1766",
"part": "4100-CA1030-T7",
"value": "10K/NC"
},
"RV19": {
"uid": "$2I1885",
"part": "4100-CA1030-T7",
"value": "10K/NC"
},
"RV05": {
"uid": "$2I2014",
"part": "4100-CA0000-T0",
"value": "0R"
},
"RV11": {
"uid": "$2I2022",
"part": "4100-CA0000-T7",
"value": "0R"
},
"RV08": {
"uid": "$2I820",
"part": "4100-CA1030-T7",
"value": "10K/NC"
}
}
},
{
"project": "build\\speed-final-20261017-gui-many\\project\\Audio_D2128.prj",
"seconds": 1.25,
"components": {
"RV14": {
"uid": "$2I1766",
"part": "4100-CA0000-T0",
"value": "0R/NC"
},
"RV19": {
"uid": "$2I1885",
"part": "4100-CA1030-T7",
"value": "10K/NC"
},
"RV05": {
"uid": "$2I2014",
"part": "4100-CA0000-T7",
"value": "0R"
},
"RV11": {
"uid": "$2I2022",
"part": "4100-CA0000-T7",
"value": "0R"
},
"RV08": {
"uid": "$2I820",
"part": "4100-CA0000-T0",
"value": "0R/NC"
}
}
},
{
"project": "build\\speed-final-20261017-headless-rules\\project\\Audio_D2128.prj",
"seconds": 1.0310000000026776,
"components": {
"RV02": {
"uid": "$2I1428",
"part": "4100-CA0000-T0",
"value": "2.2K"
},
"RV14": {
"uid": "$2I1766",
"part": "4100-CA0000-T0",
"value": "0R/NC"
},
"RV19": {
"uid": "$2I1885",
"part": "4100-CA1030-T7",
"value": "10K/NC"
},
"RV05": {
"uid": "$2I2014",
"part": "4100-CA0000-T0",
"value": "0R"
},
"RV11": {
"uid": "$2I2022",
"part": "4100-CA0000-T7",
"value": "0R"
},
"RV08": {
"uid": "$2I820",
"part": "4100-CA1030-T7",
"value": "10K/NC"
}
}
}
],
"formal_queue": {
"verified": true,
"source_hashes_unchanged": true,
"selected_refs": [
"RV05",
"RV14"
],
"unchanged_refs": [
"RV11",
"RV08",
"RV19"
],
"native_results": [
{
"stage": "native_replace_verified",
"ok": true,
"target_text": "4100-CA0000-T0",
"symbol_text": "skyworth:res01.1",
"target_submit_enabled": true,
"replaced_uids": [
"$2I2014"
]
},
{
"stage": "native_replace_verified",
"ok": true,
"target_text": "4100-CA0000-T0",
"symbol_text": "skyworth:res01.1",
"target_submit_enabled": true,
"replaced_uids": [
"$2I1766"
]
}
],
"metrics": [
{
"phase": "collect_inventory",
"unit": "component",
"completed_units": 5,
"state": "completed",
"elapsed_seconds": 2.37478139999439,
"units_per_minute": 126.32741691538796
},
{
"phase": "prepare_queue",
"unit": "step",
"completed_units": 2,
"state": "completed",
"elapsed_seconds": 232.9237998000026,
"units_per_minute": 0.5151899466822911
},
{
"phase": "backup_project",
"unit": "operation",
"completed_units": 1,
"state": "completed",
"elapsed_seconds": 1.530766299998504,
"units_per_minute": 39.19605494323897
},
{
"phase": "persist_progress",
"unit": "operation",
"completed_units": 1,
"state": "completed",
"job_id": "759dda6d24bc4fcfafb1d23fe09ac188_0",
"elapsed_seconds": 0.02788229999714531,
"units_per_minute": 2151.9028202889654
},
{
"phase": "execute_step",
"unit": "step",
"completed_units": 1,
"state": "saved_ok",
"schematic_name": "Audio-D2128",
"sheet_number": "S905L CVBS-LR",
"old_part_number": "4100-CA0000-T7",
"new_part_number": "4100-CA0000-T0",
"job_id": "759dda6d24bc4fcfafb1d23fe09ac188_0",
"worker_stage_seconds": {
"starting": 0.9689999999973224,
"session_startup": 4.3439999999973224,
"check_project": 0.09399999999732245,
"open_project": 38.60900000001129,
"open_sheet": 23.577999999994063,
"session_ready": 0.15599999998812564,
"query_components": 2.4530000000086147,
"index_components": 10.408000000010361,
"find_components": 2.5780000000086147,
"index_pins": 14.515999999988708,
"snapshot_attributes": 1.4369999999908032,
"capture": 7.282000000006519,
"before_native": 0.20299999999406282,
"native_replace": 30.187000000005355,
"restore_preflight": 13.139999999984866,
"before_restore_transaction": 2.625,
"restore_attribute_fields": 7.094000000011874,
"restore_attributes": 0.030999999988125637,
"verify_restoration": 0.8599999999860302,
"verify_attribute_fields": 1.9060000000172295,
"finished": 14.218000000008033,
"save_and_close": 5.046999999991385,
"verify_saved_project": 0.04700000000593718
},
"elapsed_seconds": 232.98710869999195,
"units_per_minute": 0.2575249778186636
},
{
"phase": "persist_progress",
"unit": "operation",
"completed_units": 1,
"state": "completed",
"job_id": "759dda6d24bc4fcfafb1d23fe09ac188_1",
"elapsed_seconds": 0.011202500012586825,
"units_per_minute": 5355.94732716676
},
{
"phase": "execute_step",
"unit": "step",
"completed_units": 1,
"state": "saved_ok",
"schematic_name": "Audio-D2128",
"sheet_number": "S905L CVBS-LR",
"old_part_number": "4100-CA1030-T7",
"new_part_number": "4100-CA0000-T0",
"job_id": "759dda6d24bc4fcfafb1d23fe09ac188_1",
"worker_stage_seconds": {
"check_project": 0.09399999999732245,
"open_sheet": 13.625,
"query_components": 3.2809999999881256,
"index_components": 10.828000000023167,
"find_components": 2.75,
"index_pins": 12.98399999999674,
"snapshot_attributes": 1.6720000000059372,
"capture": 14.389999999999418,
"before_native": 0.40699999999196734,
"native_replace": 28.389999999999418,
"restore_preflight": 11.501000000003842,
"before_restore_transaction": 2.389999999999418,
"restore_attribute_fields": 8.078999999997905,
"restore_attributes": 0.07799999999406282,
"verify_restoration": 0.6720000000059372,
"verify_attribute_fields": 1.4219999999913853,
"finished": 13.906000000002678,
"save_and_close": 3.610000000000582,
"verify_saved_project": 0.014999999999417923,
"open_project": 13.577999999994063
},
"elapsed_seconds": 144.9269440000062,
"units_per_minute": 0.4140016917764956
},
{
"phase": "task_total",
"unit": "task",
"completed_units": 1,
"state": "completed",
"completed_steps": 2,
"saved_steps": 2,
"failed_steps": 0,
"elapsed_seconds": 623.6726321000024,
"units_per_minute": 0.09620431763691586
}
],
"owners": [
{
"stage": "quick-run",
"clean": true,
"cad_exit_code": 0,
"desktop_released": true,
"startup_seconds": 50.828000000008615,
"shutdown_seconds": 5.360000000000582
},
{
"stage": "sheet-discovery-2432783abf1d4597b6f3ee4207b455cb",
"clean": true,
"cad_exit_code": 0,
"desktop_released": true,
"startup_seconds": 44.85899999999674,
"shutdown_seconds": 7.0939999999973224
},
{
"stage": "sheet-discovery-b1479e2de99e48dabbc60e7f03578aac",
"clean": true,
"cad_exit_code": 0,
"desktop_released": true,
"startup_seconds": 37.38999999999942,
"shutdown_seconds": 4.202999999994063
},
{
"stage": "sheet-discovery-b3fcfc662ce144cda2f4b33bf6040a02",
"clean": true,
"cad_exit_code": 0,
"desktop_released": true,
"startup_seconds": 34.375,
"shutdown_seconds": 6.01600000000326
}
],
"independent_read": {
"RV14": {
"uid": "$2I1766",
"part": "4100-CA0000-T0",
"value": "0R/NC"
},
"RV19": {
"uid": "$2I1885",
"part": "4100-CA1030-T7",
"value": "10K/NC"
},
"RV05": {
"uid": "$2I2014",
"part": "4100-CA0000-T0",
"value": "0R"
},
"RV11": {
"uid": "$2I2022",
"part": "4100-CA0000-T7",
"value": "0R"
},
"RV08": {
"uid": "$2I820",
"part": "4100-CA1030-T7",
"value": "10K/NC"
}
},
"input_desktop_unchanged": true,
"no_owned_cad_on_input_desktop": true,
"no_owned_cad_foreground": true,
"all_owned_desktops_released": true,
"limits": "Formal queue completed after target-readiness change but before queue-preparation optimization was loaded. This is correctness evidence, not a final end-to-end speed comparison. Final context guard and control-file retry added afterward have separate targeted regression checks."
},
"optimized_preparation_live": {
"verified": true,
"inventory_seconds": 2.6410000000032596,
"prepare_seconds": 0.375,
"cad_startups": 0,
"native_inventory_sessions": 1,
"native_exports": 2,
"selected_refs": [
"RV05",
"RV14"
],
"queue_items": 2,
"source_hashes_unchanged": true
},
"limits": [
"single-machine samples, OS/library caches not reset",
"paired CLI inventory rejects nested/repeated/missing UID mapping and falls back to CAD; no universal native inventory coverage claim",
"optimized prepare timing excludes inventory, replacement, backup and save/reopen",
"no headless replacement backend promotion, packaging or release"
]
}
@@ -0,0 +1,51 @@
# 原生采集与执行流程巡检修复
本轮从 `2ad0a3c` 继续巡检,修复现有正式流程,不切换无弹窗替换后端,不打包发布。原始实测保存在本机 `build` 副本目录,精简结果见 [证据 JSON](2026-10-17-patrol-remediation-evidence.json)。
## 已修复
| 问题 | 原因与影响 | 修复 |
| --- | --- | --- |
| 原生采集可能返回旧料号/旧 Value | `icdb2ascii -h` 只有基础属性,实例层覆盖不一定生效;按旧料号过滤会静默漏项 | 同一数据库副本依次导出分层与展开报告,先按完整 UID 范围一一核对,再按展开后的生效料号过滤,保留分层中的工程、图页和 UID |
| 同一新料号被重复选择时,就绪判断过早 | 只等料号文本;符号/gate 和提交按钮可能尚未就绪 | 料号、合法符号/gate、提交按钮同时满足并稳定 0.45 秒;上下文校验后再次核对,若需要重新等待则重验工程、图页、选中 UID 和旧属性 |
| 位号队列准备重复启动 CAD 枚举全工程 | 已有精确位号清单,却按需要包含空白页的全图页发现流程准备队列 | 位号模式复用受内容指纹约束的器件清单,并逐目标检查 UID、位号、旧料号及旧 Value;普通全工程料号规则保留完整枚举 |
| 会话续执行指令写入可能被短时文件占用打断 | VBS 正在读取时,Windows 可能拒绝替换控制文件;原写入无重试 | 原子发布失败时最多重试 1 秒,成功或失败均清理本次临时文件;原控制内容在成功发布前保持完整 |
替换结果等待超时还会保存目标器件实际料号、封装、Part Label 和 Value,以及选料控件读数;两类诊断独立捕获,窗口失效不再连带丢掉器件诊断。不会自动重复执行可能已经发生的替换。
## 核验
原生采集在三个已有真实工程副本上验证:实例覆盖实验中的 RV05 正确返回新料号,RV11 保持旧料号;一对多及多规则副本中的目标、NC 和未选中位号读回正确。缺少展开报告、重复/嵌套 UID、配置不唯一、范围不一致、必需属性缺失时拒绝原生结果,安全回退 CAD;明确空属性与缺少属性行分开处理。两次 CLI 导出共用一个临时数据库副本和私有桌面,各自日志分别保留。
正式服务队列连续执行两个不同旧料号、相同新料号的规则:
| 位号 | 新料号 | 保存后 Value | 结果 |
| --- | --- | --- | --- |
| RV05 | 4100-CA0000-T0 | 0R | `saved_ok / session_verified` |
| RV14 | 4100-CA0000-T0 | 0R/NC | `saved_ok / session_verified` |
每条规则都由正式 VBS 保存关闭、重开核验;独立原生清单再次读回通过,RV11、RV08、RV19 保持原料号和 Value。源工程 `.prj`、`icdb.dat` 哈希未变。观察到的四个自有 CAD 会话全部正常退出,Job 清空、句柄关闭、私有桌面释放;主输入桌面未切换,自有 CAD 未占用主桌面或前台。
这次正式队列在队列准备优化载入前启动,用于验证新选料等待和正式多规则执行。它不能作为全部最终改动的完整执行测速。随后新增的提交前上下文守门和控制文件占用重试由针对性回归核验;本轮没有重跑一遍整批替换来制造速度对照。
另在全新测试副本单独核验优化后的准备路径:
| 指标 | 本次耗时/次数 |
| --- | ---: |
| 采集 5 个相关位号,分层及展开各导出一次 | 2.641 秒 |
| 生成 RV05、RV14 两项精确位号队列 | 0.375 秒 |
| CAD 启动 | 0 次 |
| 原生采集会话 | 1 次,2 份导出 |
较早的正式实跑中,准备队列耗时 232.924 秒,包含三次 CAD 读取;随后两步执行分别为 232.987、144.927 秒,任务总计 623.673 秒。优化后的 0.375 秒只对应队列准备,不含采集、备份、替换和保存重开;两次不是完整执行的重复对照,不计算整批加速百分比。
自动回归:涉及原生清单、BOM 导入结果、精确位号队列、发现缓存、多工程、失败恢复、会话控制和 Value 策略的 250 项检查通过;最后的选料守门增量另以 22 项针对性检查复核。Windows 文件共享拒绝和实例覆盖读取均在修复前复现失败,再验证修复后通过;独立代码复核未留下阻断项。
## 当前仍需改进
- CAD 启动、图页打开、全页属性/引脚快照和逐规则重开仍耗时明显。当前保留每条规则的保存校验,尚未做合并提交;跨任务复用 CAD 也未引入。
- 重复或嵌套层级实例无法用本轮简单 UID 一一对应方案认证,仍回退 CAD,不能承诺所有工程都使用原生快速采集。
- 无弹窗替换仍是研究原型,只验证同符号、单 gate、相同引脚映射;不同符号、多 gate、PCB 打包同步和任意库的覆盖尚未完成。
- `quick_run.py`、`service.py`、`store.py` 仍偏大。本轮将新增目标库存校验放在 `inventory.py`,没有进行大规模文件搬迁;后续可按队列协议、持久化、执行监督逐步拆分,并保持现有回归边界。
本轮针对读取正确性、精确目标校验、选料等待、文件共享、正式多规则流程和资源释放进行验证;不等于重新完成所有 UI 页面及发布包验收。
@@ -92,7 +92,7 @@ native_parts_query.exe <原生DLL目录> <分区副本.pdb> <料号>
正式切换前仍需要补齐:
- 当前分层采集对实例覆盖值的处理。实验已证明只读基础层会返回旧料号,需要正确合并有效值或退回 CAD 核验。
- 原生采集对实例覆盖值的读取已在[本轮巡检](2026-10-17-patrol-remediation.md)补齐:分层与展开清单按完整 UID 范围核对,读取生效值;嵌套、重复或范围无法对应时回退 CAD。复杂层级实例仍未覆盖。
- 不同符号、多 gate、不同引脚映射、重复层级实例及任意库的属性策略。这些不能直接使用此次受限路径。
- 打包/PCB 同步、Undo/取消恢复、连续多工程和重复执行的正式回归。完整原生图数据一致并不代替 PCB 打包实测。