docs: record native CRUD frozen acceptance and candidate limits

This commit is contained in:
阿白叔 committed 2026-11-03 13:06:07 +08:00
1 parent b26e2f2f62
commit 5eac654c36
2 files changed
+94 -16

No files matched your search

+62 -16
View File
@@ -1,31 +1,77 @@
# Native CRUD integration and review follow-up
# 原生 CBB 增删改查接入与候选包验证
The shared native Add transport uses the proven private-desktop UIA executor, bounded field readback and exact native success message. It closes/reopens the library before comparing exact catalog name/partition and engineering identity. Missing registration or mismatched native logical/drawing/physical proof cannot become an accepted upload. Production Add/Update are now enabled only with the exact pinned EE7.9.5 core and all three identity exporters, for ASCII target names in the proven DxDesigner / Logical-Physical scope. Every mutation still requires the prepared engine transaction and complete recovery snapshot.
程序源码提交:`b26e2f2f6232c22a94ee1269bd4449fe0fe06623`。
分支:`codex/temp-issue-2-icdb-recovery`。本地候选包,未合并、未发布、未关闭工单。
The review of 07a9c1e identified that route readiness alone did not authorize existing-library mutation. The follow-up makes public `add()` refuse before reading a source or launching a worker. Research callers must use `add_owned_fixture(..., probe_token=...)` against the fixed library created by the diagnostic workflow and matching probe-owner record. It requires the calling thread's live library lease, checks its lease ID against the checkpoint, owns the management mutex during submission, creates a fresh staged source copy and verified library snapshot, and binds the transaction nonce to target, name, partition, source identity and manifests.
## 已接入的操作
Before native activation the worker revalidates that evidence, exact current lease and live supervisor. It duplicates the supervisor's still-open exclusive sidecar handle and checks its final path, so JSON metadata alone cannot establish ownership. Source alignment is confined to the newly copied worker source. Existing probe CreateLibrary/readd guards remain intact. Removal success matching again excludes both carriage returns and newlines.
| 操作 | 原生入口与验收条件 |
| --- | --- |
| 读取 | `LibraryManager.Application.OpenLibrary`、`Partitions(7)`;核对库身份、分区和条目,正常关闭会话。 |
| 新增 CBB | `OnReusableBlocksEditor` → Logical-Physical → New;私有桌面 UIA 和有时限的控件消息提交完整 PRJ,确认成功提示后关闭重开库,再核对工程内容。重名拒绝覆盖。 |
| 用工程替换已选 CBB | 完整工程及中心库备份 → 原生移除 → 原生重新导入 → 重新读库和内容核对。失败保留恢复证据并停止后续写操作。 |
| 移除已选 | 安装脚本确认的 `CleanWGLib.exe <lmc> F4 <list>`,输入为 `REUSE_BLOCK`;先完整备份,要求明确 Removed 输出,再重新读库确认不存在。 |
Verification is mocked/file-only: the original focused suite passed 86 tests plus two close/reopen checks. Follow-up tests reject public bypass, unprepared activation, missing current-thread ownership, invalid nonce/token/lease, substituted original source, changed backup and expired supervisor, and exercise a valid leased fixture with unchanged original source bytes. No Mentor processes, builds or full suite were launched by this implementation agent; serialized native evidence and semantic-identity research remain coordinator-owned.
“用工程替换已选 CBB…(原生重新导入)”与已有“从备份恢复 CBB…”是不同操作。前者更新中心库注册条目,采用移除后重新导入,**不是原子替换**;后者沿用备份 Work 的副本验证与安装恢复流程。
The follow-up focused suite passed 99 tests. After restoring ordinary catalog queries for non-DxDesigner flow readback, the native boundary/field subset passed 47 tests (including four additional flow cases). `git diff --check` passed. The original ignored scratch report remains on disk but is removed from version control.
新增和替换默认继续自动校验,允许批次开始前取消。结果分别显示上传失败、上传成功但校验失败、上传并校验通过;取消自动校验时明确显示“已上传 / 未自动校验”。
A second review found ownership lifetime and reverse containment gaps. The fixture route now nests the already-proven caller lease around worker dispatch and retains that same exclusive handle/checkpoint on unsafe return or exception, including callers that supply no release callback. It also rejects a fixture nested anywhere inside the original source tree before staging. Three new failure cases were observed before the fix; the final native-boundary/field subset passed 51 tests, including normal release and uploader-handle denial after uncertain release. No native processes were launched.
## 支持范围与保护
The subsequent `mentor795-native-content-v1` contract requires pinned native hierarchy/flat ASCII, CSV/property tables and schematic EDIF exports on disposable copies, plus exact raw physical/primary assets. Only the three observed ASCII metadata headers, CSV `System_Date` field and root EDIF `status/written/timestamp` node are normalized. All project library references must resolve to an approved library before their values can be normalized. Unknown primary files, layout data, drawing coordinates, properties and EDIF userData remain part of the comparison. Unsupported exports fail closed; this is not a claim of arbitrary unexported CES equivalence.
- 已验证本机 Mentor EE7.9.5、DxDesigner、Logical-Physical、ASCII CBB 名称。原生核心组件和三种内容导出程序均核对固定 SHA-256;接口或版本不符时禁用并显示原因。
- 所有写操作使用串行任务、共享互斥和上传工具兼容的库锁;暂存来源、完整备份、目标身份、事务随机标识、监督进程及实际独占句柄必须相互匹配。
- 不直接修改 LMC 二进制,不依赖独立上传工具安装目录,不退回前台鼠标。遇到中心库升级或流程选择提示拒绝自动迁移。
- 原生导入会改写 ICDB 存储字节。内容身份采用官方 ASCII、CSV 和 EDIF 原理图导出,加上 Layout、约束及其他主要资产的 SHA-256。只规范化已实测的报告时间和路径字段;未知工程文件继续参与比较。
- 原生复制可能留下不正确的 PCB 库相对引用。仅在本任务导入、会话释放及库锁持有得到确认后校正已导入副本,再复读目录与内容。原始来源不改写。
- 导出副本所有权随库检查点持久保存;超时、重启、地址记录仍存在或进程、独占访问无法确认时,不能解除库锁或接续维护。
- 完整来源和预计目标路径达到 260 个 UTF-16 单元时,在原生写入前拒绝;同名替换在移除旧条目前检查。保留所有文件,提示缩短操作数据或目标库路径,不宣称已实现原生长路径支持。
- 本轮已确认的原生复制失败即时记录。只正常确认本任务进程的已验证错误对话框;未知提示不自动点击,会话释放不明确时保留阻止状态。
The real management engine now captures a source baseline before any removal. Native Add requires a prepared transaction binding the verified full backup, staged source, baseline proof, exact target/name/partition, supervisor and exclusive lease. After normal native release, it corrects imported PRJ/PCB library references using the existing documented text helpers, reopens the exact native catalog and compares a target-only identity. Update remains remove plus Add; failures retain the recovery snapshot and checkpoint. The UI action is explicitly labeled “用工程替换已选 CBB…(原生重新导入)”; backup Work restoration is unchanged.
## 实际验证
Coordinator-native source/registered capture matched all three exports and primary assets after correcting the observed imported PCB reference; original source manifests were unchanged. Implementation verification remains file-only: 114 focused tests passed before the final bootstrap/lease refinement. `create_owned_fixture` and `run_owned_fixture_management` provide a token-bound empty-library/real-engine route for the coordinator's actual CRUD cycle. Production Add/Update remain disabled until that separate acceptance and promotion step.
环境:Windows 11,版本 `10.0.26200`;Mentor EE7.9.5。
The coordinator's native engine cycle subsequently passed empty-library creation, Add A, duplicate refusal, same-name replacement by B (with a different verified layout hash), removal with strict absence, and reimport from a complete backup. Every operation reported safe native release and both original source manifests stayed unchanged; evidence is under `diagnostics/issue2-native-crud-20261103/engine-e2e`.
### 原生完整管理引擎
Final safety review narrowed the additional iCDB runtime exclusions to known log directories, exact events files and the observed dated GUID log filenames. Unknown `cdbsvr` content remains primary, including unknown events/plog files, and a registered unknown-file change now requires recovery. Export capture binds its analysis copy to the existing library checkpoint before launch. That binding survives retention/restart and cannot be cleared by release or maintenance adoption until recorded processes/child handles have exited, known exporter/server processes are absent, copied addresses are absent and copied database files can be held exclusively. Missing/malformed ownership evidence remains blocked. The final focused safety/engine suite passed 167 tests; no native operations or full-suite run were performed by the implementation agent. Production promotion remains a separate reviewed change.
真实新建隔离库完成:新增 A、拒绝重复名称、替换为 B、备份后移除、将独立备份工程重新导入。各项会话均安全释放。B 的 Layout 哈希与 A 不同,并与来源 B 一致。原始来源主要文件清单未变。
After scoped review found both safety issues corrected, the separate capability-promotion change enabled the public prepared engine routes. The basis is the accepted native cycle in `engine-e2e/cycle-result.json` plus the matching integrated three-export/asset identity evidence. That cycle deliberately used `auto_verify=False`: it proves native registration/replacement/removal/reimport and content identity, not the separate default Verify result or frozen UI acceptance. Unsupported exporter versions, flows, partitions or export formats still fail closed. Replacement remains non-atomic Remove+Add with recovery evidence, and arbitrary unexported CES/version equivalence is not claimed.
证据:`diagnostics/issue2-native-crud-20261103/engine-e2e/cycle-result.json`。
The promotion focused suite passed 93 tests, including every required binary mismatch, unsupported flow/partition, engine identity/recovery and UI progress behavior. Native default description is blank; progress reads “正在核对来源工程内容”. Source input and backup Work restoration behavior are unchanged. Full-suite/build and fresh public frozen-UI acceptance remain coordinator-owned.
### 最终冻结程序公开界面
Frozen public Add exposed a confirmed legacy path limit: the staged tree contained a 264-character historical CES log path, versus a maximum of 253 in the successful engine cycle. Native output reported `Cannot copy iCDB base of Reusable Block project` and an owned “系统找不到指定的路径。” dialog. The coordinator reproduced Windows error 3 with legacy 32-bit `CopyFile` on that exact file; the same frozen executable, same target library and blank description then completed Add safely when only the operation data/staging root was shortened (`frozen-public-ui-shortpath-control/result.json`).
从应用真实按钮、来源文件选择器和确认清单执行,没有替换原生适配器或绕过能力检查。
The complete staged and projected target trees are now checked against the legacy 260-WCHAR path buffer before native identity capture or Update removal, and again before dialog submission. Unsupported paths produce an actionable shorter-data/target-root message; no source/log files are excluded or deleted. Native copy failure detection uses a bounded pre-submit log size/hash baseline and exact current block name, so old log errors do not fail later operations. The exact observed owned error dialog is recorded and acknowledged only through its known id-2 “确定” button; unknown prompts are recorded without confirmation. Normal child-first close and exact owner-release checks remain required. Confirmed errors now return promptly instead of waiting for the full operation timeout. Focused verification passed 142 tests, including unchanged source/history and no native Remove on long-path update rejection; final frozen acceptance remains coordinator-owned.
| 试验 | 结果 |
| --- | --- |
| 275 字符暂存路径 | `UPLOAD_FAILED`,明确 `NATIVE_PATH_TOO_LONG`,`safe_to_continue=true`;未启动内容导出或原生 Add。 |
| 正常路径新增 A | `UPLOADED`,重新读库与工程内容核对通过。 |
| 同名替换为 B | `UPLOADED`,实际 Layout 匹配 B 且不同于 A。 |
| 原生移除 | `REMOVED`,重新读库确认不存在。 |
| 最终退出与来源检查 | 原生进程已退出;两份来源的 153/147 个主要文件哈希及 541/506 个文件的大小、修改时间保持一致。 |
证据位于 `diagnostics/issue2-native-crud-20261103/`:
- `frozen-public-ui-path-block/result.json`:写入前长路径拒绝。
- `frozen-public-ui/result.json`:最终冻结程序完整按钮流程及截图。
- `final-source-baselines.json`、`final-acceptance.json`:来源和会话释放证据。
- `build-result.json`、`validation.json`、`package-result.json`:源码、测试、构建和包校验记录。
本轮 CRUD 原生及冻结界面试验均在批次开始前取消自动校验,**上传成功不等于 READY**。这些结果不能代替上传后完整 Verify/Save/Close 或现场 ICDB 失联修复验收。
### 实测发现并修正的长路径问题
初版冻结程序在 264 字符暂存文件路径下弹出“系统找不到指定的路径”,日志记录 `Cannot copy iCDB base of Reusable Block project`,旧逻辑只检查成功提示,直到超时才返回。该失败未计入通过。
对同一文件,旧式 32 位 Win32 CopyFile 复现错误码 3;保持同一冻结程序、测试库、完整来源和空描述,仅缩短暂存路径后,原生新增和内容核对通过。最终修订增加完整路径预检和本轮失败识别,并在新冻结包实测提前拒绝。没有删减长路径中的日志或其他文件来绕过问题。
保留原始失败、正常关闭及库锁重新核验记录:`frozen-public-ui-longpath-failed/`、`longpath-failure-release/`、`longpath-failure-catalog/`、`path-copy-probe/`、`frozen-public-ui-shortpath-control/`。
## 自动化验证与交付
- 全量 `python -m pytest -q`:**1071 passed**,90.98 秒,1 条已有 pywinauto COM 线程模式警告。
- `python -m compileall -q src tests`、`git diff --check`:通过。
- 独立整体代码审查及长路径修订复审:无未解决的实质问题。
- 从提交归档构建冻结程序,启动与退出冒烟测试通过;上述公开界面验收使用同一构建。
- 候选包:`dist/issue2-native-crud-20261103-b26e2f2.zip`,旁附 SHA-256;包内含使用说明及验证摘要。
尚未完成 Windows 10 实机验证,也未将本轮 CRUD 试验视作现场服务器会话失联修复通过。旧版库迁移、其他 Mentor 版本、非 Logical-Physical 分区及原生长路径支持不在已验证范围。原用户库不参与本轮写入试验。
@@ -0,0 +1,32 @@
# 原生 CBB 管理接入续作
沿用用户已批准的工单 #2 管理范围与临时分支。此次用户要求找到并尝试接入库的增删改查原生接口。
不直接修改 LMC 二进制,不采用前台鼠标,不强制结束持有数据库的原生进程;原用户库不参与写入试验。
## 已确认接口
- 查询:LibraryManager.Application.OpenLibrary → Partitions(7) → 名称、分区,核对库身份并正常退出。
- 新增:OnReusableBlocksEditor → 原生 Logical-Physical 页签 → New → 源 PRJ、名称、顶层块,提交原生对话框。字段使用有时限的窗口消息复读,提交后确认成功消息,再关闭重开目录。
- 移除:安装脚本确认的 CleanWGLib/F4/REUSE_BLOCK,必须完整备份且重新读库确认缺失。
- 同名替换:复用经过验证的移除与新增;它不是原子更新,删除后导入失败时保留恢复检查点并停止队列。与仅替换 Work 的“从备份恢复”明确区分。
## 接入步骤
1. 共享原生新增适配层,保留私有桌面、二进制版本、同库租约、监督进程、来源暂存及完整备份的验证。生产能力未通过时只有带隔离库所有权证据的研究入口可写。
2. 原生 ICDB 导入会重写存储。用安装版本锁定的 ASCII、CSV 和 EDIF 原理图导出建立内容指纹,并保留布局及其他工程资产的字节哈希。不能把注册成功或名称相同等同于工程内容一致。
3. 导出仅使用新建的完整工程副本。严格确认退出、有效输出与原生完成标记;仅规范化已经实际证明会变化的报告时间/路径字段。布局、坐标、连接、属性及未知工程文件变化一律阻止接受。
4. 新增后原生程序可能未正确重定位 PCB 配置的 CentralLibrary。仅在本任务注册成功、原生释放和租约持有时修正该已导入工程的库引用,再重新打开核对目录与内容。原始输入工程不改动。
5. 在实际新建隔离库运行新增、同名冲突、不同版本同名替换、备份后移除、从备份重新导入;逐项保存证据,验证源文件未变。随后才提升对应生产能力。
6. 运行相关回归、独立审查、全量测试与冻结包实际管理入口验证。缺少原生证据的能力继续禁用并准确说明原因。
## 已完成的内容指纹取证
`diagnostics/issue2-native-crud-20261103/` 保存真实导出对照:
- ASCII:层次与展开连接、组件、端口和属性,3,531 行;只差生成时间和数据库目录三行报告元数据。
- CSV:14 个表格文件;只差信息表的 System_Date 字段。
- EDIF `-schematic`:约 580 KB,包含坐标、图形、连线、旋转、文本位置及属性;只差根级 status/written/timestamp。
- 139 个主要工程资产一致;其余变化为 ICDB 数据文件、其运行时记录及两处 PCB CentralLibrary 引用。
以上为已验证格式的内容身份合同,不声称任意未知版本、任意外部工具私有元数据都可无差别转换。
导出格式、安装版本、必需文件或引用不符合时拒绝操作。