fix: restrict explicit force release to verified user document clients
This commit is contained in:
1 parent
e4266ae88c
commit
e53c5d0e92
18 files changed
+2090
-1623
No files matched your search
@@ -8,6 +8,14 @@
|
||||
|
||||
操作前正常关闭使用相同库的 PCB、Library Manager、原理图/符号编辑客户端,核对原服务器会话已结束,保留包含数据库、原备份和日志的完整一致副本。以下写入先在副本上进行。
|
||||
|
||||
## 残留客户端与共享服务器
|
||||
|
||||
0.2.4b1 的默认检查、校验、取消和释放流程不会强杀原生会话。操作员可以在独立确认界面强制结束属于当前 Windows 用户和会话、名单中的受支持客户端;这会影响该客户端内其他已打开工程,未保存更改可能丢失,属于异常退出处理,不能替代 Repair。
|
||||
|
||||
ICDB 数据库服务器即使命令行指向当前中心库,也可能服务其他用户,**本工具不允许强制结束服务器**。归属未知的进程、后台导入器和脚本宿主同样不允许强制结束;由库管理员核对用户和服务器状态后处理。
|
||||
|
||||
强制客户端动作必须先在库外证据目录持久写入确认名单、库和进程创建身份,再核对当前进程句柄、用户 SID 和 Windows 会话;记录失败或身份变化时不执行。客户端结束后仍需独立证明库已释放,重新打开工程并核对版本,必要时从人工一致备份或原生历史版本恢复。不能把“进程已结束”解释为“ICDB 已修复”。具体步骤见 [操作规程](../SOP.md)。
|
||||
|
||||
## 原生工程数据库 Repair
|
||||
|
||||
1. 启动本机的 iCDB Project Backup,并打开实际报错工程对应的 `.prj`。本机可用 PowerShell 命令形式如下,工程路径需替换为自己的隔离副本:
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"review_comment": "https://git.simgreek.com/Skyworth_Digital_Hardware/cbb-refresh-verify-795/pulls/3#issuecomment-249",
|
||||
"version": "0.2.4b1",
|
||||
"base_main": "a56fd17b60d9f67997d7f48c862f3367d4502f84",
|
||||
"tests": {
|
||||
"infrastructure": {
|
||||
"tests": 491,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0,
|
||||
"xml_sha256": "12c2cd40542cb01d4fa374e98908c8a77a8deb83f95d0833645b1666ea5574e9",
|
||||
"xml_file": "codex-review-infrastructure-pytest.xml",
|
||||
"seconds": 52.986
|
||||
},
|
||||
"native_backend": {
|
||||
"tests": 1376,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0,
|
||||
"xml_sha256": "8db65d11dd918d2a1b141d72627654a990ea903b68e20511e982dfb927d6be58",
|
||||
"xml_file": "codex-review-native-backend-pytest.xml",
|
||||
"seconds": 275.957
|
||||
},
|
||||
"ui_integration": {
|
||||
"tests": 1545,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0,
|
||||
"xml_sha256": "5a3e6d58d611240c6e34cc9bd2350a8bf605516ef453240333836c1f88233af6",
|
||||
"xml_file": "codex-review-ui-integration-pytest.xml",
|
||||
"seconds": 325.065
|
||||
},
|
||||
"final_stack": {
|
||||
"tests": 1601,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0,
|
||||
"xml_sha256": "bab74328facfbf512416b62a074fb5cb65ea39b04f0039d42083f96b5349c351",
|
||||
"xml_file": "codex-review-residual-release-pytest.xml",
|
||||
"seconds": 246.75
|
||||
},
|
||||
"umbrella": {
|
||||
"tests": 1601,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0,
|
||||
"xml_sha256": "566f50b4ba537d4e54939946a5b48cad9ed6dbd8fb69c5ffbabcc5da0fbaf507",
|
||||
"xml_file": "r10-pr-pytest.xml",
|
||||
"seconds": 313.479
|
||||
},
|
||||
"force_boundary": {
|
||||
"tests": 43,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0,
|
||||
"xml_sha256": "832425306b5fea3a150cc2188e00c97a771bb6d953e54b69c091d36e8062dca9",
|
||||
"xml_file": "pr249-force-focused.xml",
|
||||
"seconds": 3.231
|
||||
}
|
||||
},
|
||||
"compileall": "passed",
|
||||
"git_diff_check": "passed",
|
||||
"final_content": {
|
||||
"file_count": 195,
|
||||
"sha256": "2784b81ff0ae4d47f85ac8ea4b217292bbd9a1e716667e729863bfd4a6a372cd",
|
||||
"umbrella_equals_stack": true
|
||||
},
|
||||
"post_test_formatting": "MainWindow line endings aligned with UI review base (AST equality asserted); unchanged README lines retain main line endings",
|
||||
"regression_red": {
|
||||
"baseline": "e4266ae",
|
||||
"selected_new_ownership_tests": 3,
|
||||
"expected_failures": 3,
|
||||
"method": "in-memory baseline module; no production files or native processes modified"
|
||||
},
|
||||
"force_contract": {
|
||||
"clients_only": true,
|
||||
"same_user_sid_and_windows_session": true,
|
||||
"servers_never_terminated": true,
|
||||
"durable_consent_before_action": true,
|
||||
"independent_library_release_proof_required": true
|
||||
},
|
||||
"not_validated": [
|
||||
"field server-session loss recovery",
|
||||
"Windows 10",
|
||||
"cross-machine shared-library concurrency",
|
||||
"actual Mentor force termination",
|
||||
"new frozen package"
|
||||
],
|
||||
"delivery_policy": "Draft review only; no merge, publish, automatic issue closure or native production-library operation"
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# v0.2.4-beta.1(0.2.4b1)开发候选说明
|
||||
|
||||
状态:待评审、待现场验收。不是自动发布指令,工单保持开放。
|
||||
|
||||
## 用户可见变化
|
||||
|
||||
- 检验、ICDB 维护、中心库管理为独立入口。ICDB 检查在后台逐项运行,其他原生任务可排队,搜索/筛选保持可用。
|
||||
- 检查以当前 PCB 打开情况和本次原生错误为依据,只有明确 ICDB 错误才标记问题;不自动 Repair、Restore 或选择版本,CHECKED 不等于 READY。
|
||||
- 停止队列同时停止后续后台检查;执行前再次排除 READY,校验排队不隐藏检查进度;释放失败显示实际原因。
|
||||
- 原生新增、同名替换、移除和备份恢复继续要求确认及人工备份,失败结果和未完成任务逐项保留。
|
||||
- 默认残留释放为正常关闭。单独确认的强制结束仅允许属于当前 Windows 用户和会话、已确认作用域和精确身份的受支持文档客户端;服务器、后台导入器和未知进程不可强制结束。
|
||||
|
||||
## 强制客户端操作的契约
|
||||
|
||||
支持 Expedition PCB、Library Manager、viewdraw 和 iCDB Project Backup。操作员须知晓客户端中其他工程可能一并退出、未保存更改可能丢失、写入中的工程可能需要恢复。确认名单先持久记录为库外 `consent.json`,失败则不执行;派发与进程句柄两处复核,PID 复用、用户或 Windows 会话变化时拒绝。
|
||||
|
||||
数据库服务器可能服务同库其他用户,命令行归属不构成独占授权。本工具不会强制结束任何 ICDB 服务器;它仍活跃或库状态未知时保留 PARTIAL,不能通过结束客户端伪造释放或修复成功。
|
||||
|
||||
## 安全状态和回退
|
||||
|
||||
单项失败且本任务确已释放时可继续独立项;未释放时保留现场、检查点、映射和证据。客户端强制结束不可撤销,恢复使用人工一致备份或原生历史版本;不会自动重新导入、回退共享库或重放未完成写操作。
|
||||
|
||||
程序回退:先关闭正在使用的客户端,再使用此前候选包;程序回退不恢复原生事务或丢失更改。工程恢复:保留故障现场、选择确认过的备份,在隔离副本验证后恢复并重新校验。
|
||||
|
||||
## 验证与限制
|
||||
|
||||
PR #3 comment 249 的修复通过服务器排除、确认记录失败、PID 复用、客户端/服务器混合名单等 fake 边界回归;没有为了验证本功能终止真实 Mentor 客户端或服务器。
|
||||
|
||||
此前 r10 的原生隔离检查与界面排队证据只证明该候选包已记录的打开/释放行为,不能当成新强制客户端功能的现场验收。现场服务器失联恢复、ICDB 自动修复、Windows 10 和共享库跨机器并发仍未验收。
|
||||
|
||||
规范:[SOP](../../SOP.md)、[ICDB 手动修复手册](../ICDB-MANUAL-REPAIR-AND-UPDATE.md)。依赖和拆分顺序见 PR #3 的独立审查链。
|
||||
@@ -0,0 +1,13 @@
|
||||
# 独立审查 1:只读进程探测与原生任务准入队列
|
||||
|
||||
基于 main `a56fd17`,不叠加 PR #3 的历史提交。
|
||||
|
||||
**行为变化:** 增加有界、版本化、只读 owner-probe helper 和可取消的 FIFO 原生任务队列。应用仅新增隐藏的只读 helper 分派;现有 UI、验证和原生写操作保持原来的入口。
|
||||
|
||||
**失败安全:** 查询超时或协议/身份异常返回未确认;暂停或取消的队列票据不会运行其动作,也不阻止后面的可执行任务。不启动或终止 Mentor 进程。
|
||||
|
||||
**回滚方式:** 尚未合入下游时撤销本提交即可;下游接入后须按依赖从上层向下回退。
|
||||
|
||||
完整回归:491 passed,1 条既有 pywinauto STA 提示。编译和 diff 检查通过。
|
||||
|
||||
与原评论建议的差别:`management_transaction` 直接导入管理模型和库锁;`scoped_manifest` 的协调记录与独占快照依赖库锁协议。这两者在后端审查中一起交付,避免构造导入不完整的“纯工具”基线。
|
||||
@@ -0,0 +1,11 @@
|
||||
# Native backend review unit
|
||||
|
||||
Base: codex/review-infrastructure. This unit integrates ICDB open diagnostics, scoped content manifests, native CBB transactions and the library-release protocol; it does not expose the new UI or residual termination action. Verification and ICDB checks remain separate, READY items are excluded from maintenance, and a released single-item failure can continue independent targets.
|
||||
|
||||
Failure safety: no automatic Repair/version choice, no server termination, no direct LMC edits or native lock-file deletion. Native writes are serialized, uncertain ownership retains evidence and mappings, and unfinished writes are shown without replay.
|
||||
|
||||
Dependency rationale: library release imports native engineering identity and retained management workers; engineering identity imports management source models and scoped manifests. Separating these into nominally independent utilities would leave runtime imports unresolved. This PR therefore keeps the backend dependency closure together; UI and user-confirmed termination remain separate later PRs.
|
||||
|
||||
Rollback: before dependents are merged, revert this commit. After merging dependents, revert in reverse order or use the previous candidate package after closing the current app. Code rollback does not undo a native transaction; use a consistent manual backup or explicitly selected native history on an isolated copy.
|
||||
|
||||
Validation: full Python suite 1,376 passed (one existing pywinauto COM-threading warning); compileall and git diff --check passed. Native field recovery, Windows 10 and cross-machine shared-library acceptance remain pending.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Residual release contract review unit
|
||||
|
||||
Base: codex/review-ui-integration. Behavior: expose the residual-session preview and cooperative close entry, plus a separately confirmed force action limited to recognized document clients of the current Windows user and session. Database servers, importers, unknown scope and unverified identities cannot be force ended. Version becomes 0.2.4b1, with README, SOP, manual and rollback notes aligned.
|
||||
|
||||
Failure safety: persist the exact allowed/excluded confirmation list before any native action, recheck scope/creation/executable/user/session at dispatch and the held handle, and require independent library-release proof after exit. Unreadable owner metadata disables force only. A terminated client is not a repaired/READY project; partial release retains evidence and mappings.
|
||||
|
||||
Rollback: reverse the dependent commits before reverting the backend, or close the current app and use the earlier candidate. Process termination cannot be undone, and code rollback does not restore native transactions or unsaved data. Use a consistent manual backup or an explicitly chosen native history version on a copy.
|
||||
|
||||
Validation: 1,601 passed for this final stack, 1,601 passed for the umbrella, and 43 focused release tests passed after the final UI wording change. Compileall, diff checks and byte-level final implementation equality passed. Detailed XML counts/hashes and content digest are recorded in ../releases/2026-11-05-pr249-review-validation.json. No real Mentor client/server was terminated for these checks. Field recovery, Windows 10, shared-library concurrency and the new frozen package remain unverified.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Application integration review unit
|
||||
|
||||
Base: codex/review-native-backend. Behavior: verification, ICDB batch checking and CBB management have separate tabs; background checks yield between items, keep browsing responsive and let other native tasks queue. READY targets are excluded at execution, status refresh is scoped, and manual version/copy decisions remain explicit.
|
||||
|
||||
Failure safety: a released item failure can continue independent targets; uncertain native ownership retains evidence and mappings. There is no residual-session release backend in this review stage: its button and result actions are hidden, and its callback is inert. The next PR restores the complete release entry together with its tested backend, rather than exposing a button with a missing import. No automatic Repair or native version selection is added.
|
||||
|
||||
Rollback: revert this UI commit before its dependent release PR; after dependents, revert in reverse order or close the current program and use the prior candidate. This does not roll back library writes.
|
||||
|
||||
Validation: 1,545 passed (one existing pywinauto COM-threading warning), compileall and diff checks passed. Release-specific tests are introduced in the dependent PR, never discarded from the final tree. Windows 10, real shared-library concurrency and field ICDB recovery remain pending.
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
**Authorization:** The user requested implementation of comment 249. Earlier user decisions retain explicit user-confirmed residual release, manual backups and no release/issue closure before field acceptance. These decisions take precedence over changing Draft status merely to make a merge button available.
|
||||
|
||||
**Architecture:** Keep automatic verification and checking cooperative. A separate explicit force action can end supported document clients only after scope and exact process identity are checked. Native database servers and unknown processes remain observable and cannot be force terminated. Every force request must persist consent intent before any termination and still obtain independent library-release proof afterward.
|
||||
**Architecture:** Keep automatic verification and checking cooperative. A separate explicit force action can end supported document clients only after scope, exact process identity, current user SID and Windows session are checked. Native database servers and unknown processes remain observable and cannot be force terminated. Every force request must persist consent intent before any termination and still obtain independent library-release proof afterward.
|
||||
|
||||
**Review split:** Preserve #3 as an unmerged umbrella. Create a dependent review chain: (1) read-only owner probing and cooperative queue; (2) native backend, manifests, library coordination and transactions; (3) background checks and application UI integration; (4) residual-session release, its explicit contract, version and documentation. `management_transaction` imports management and lock APIs, and semantic manifests depend on recognized coordination checkpoints; they belong with the backend rather than pretending to be standalone read-only utilities. The existing #5 remains a prerequisite document review, not an automatically merged change.
|
||||
|
||||
@@ -20,25 +20,25 @@
|
||||
|
||||
Files: `residual_sessions.py`, `ui/residual_release_dialog.py`, `tests/test_residual_sessions.py`, `tests/test_residual_release_dialog.py`.
|
||||
|
||||
- [ ] Add failing tests: a scoped iCDB server cannot reach `_force_close`; direct force requests against server/unsupported names never obtain a terminate-capable handle; missing consent evidence causes zero termination calls; mixed client/server previews list only supported clients in the confirmation; rejected/reused process identities remain unchanged.
|
||||
- [ ] Define one shared force-eligibility function allowing only recognized document clients with confirmed scope and matching captured executable identity. Enforce it again at dispatch and at the exact handle boundary.
|
||||
- [ ] Persist `consent.json` with target library, exact preview identities and allowed/excluded targets before processing a force request. A write failure returns before native actions.
|
||||
- [ ] Keep excluded servers in the release result and require the existing independent release proof; process exit never means repaired/READY.
|
||||
- [ ] Run focused regressions and the complete suite with an isolated test mutex.
|
||||
- [x] Add failing tests: a scoped iCDB server cannot reach `_force_close`; direct force requests against server/unsupported names never obtain a terminate-capable handle; missing consent evidence causes zero termination calls; mixed client/server previews list only supported clients in the confirmation; rejected/reused process identities remain unchanged.
|
||||
- [x] Define one shared force-eligibility function allowing only recognized document clients with confirmed scope and matching captured executable identity. Enforce it again at dispatch and at the exact handle boundary.
|
||||
- [x] Persist `consent.json` with target library, exact preview identities and allowed/excluded targets before processing a force request. A write failure returns before native actions.
|
||||
- [x] Keep excluded servers in the release result and require the existing independent release proof; process exit never means repaired/READY.
|
||||
- [x] Run focused regressions and the complete suite with an isolated test mutex.
|
||||
|
||||
## Task 2: Version and operating contract
|
||||
|
||||
Files: `pyproject.toml`, `README.md`, `SOP-CBB-Refresh-After-Upload.md` (if present; otherwise the repository's actual SOP path), `docs/ICDB-MANUAL-REPAIR-AND-UPDATE.md`, `docs/releases/v0.2.4-beta.1.md`.
|
||||
Files: `pyproject.toml`, `README.md`, `SOP.md`, `docs/ICDB-MANUAL-REPAIR-AND-UPDATE.md`, `docs/releases/v0.2.4-beta.1.md`.
|
||||
|
||||
- [ ] Identify the actual tracked SOP before editing; update README, SOP and manual together.
|
||||
- [ ] Set `0.2.4b1` and document the user-confirmed client-only exception to the automatic no-force contract. Explain server handling, evidence, failure states, manual recovery and rollback.
|
||||
- [ ] Keep field ICDB recovery, Win10 and multiuser shared-library acceptance explicitly unverified.
|
||||
- [x] Identify the actual tracked SOP before editing; update README, SOP and manual together.
|
||||
- [x] Set `0.2.4b1` and document the user-confirmed client-only exception to the automatic no-force contract. Explain server handling, evidence, failure states, manual recovery and rollback.
|
||||
- [x] Keep field ICDB recovery, Win10 and multiuser shared-library acceptance explicitly unverified.
|
||||
|
||||
## Task 3: Review branches
|
||||
|
||||
- [ ] Inventory final files against main and assign each file to the smallest dependency-closed review stage. Keep UI/release hooks unavailable until their backend exists; do not publish branches with broken normal operation.
|
||||
- [ ] Create ordered branches with one concrete feature commit per review unit, no rewriting the existing umbrella history.
|
||||
- [ ] Test each review stage using appropriate unit/full checks; preserve all final regressions and verify the final source tree against the umbrella snapshot.
|
||||
- [x] Inventory final files against main and assign each file to the smallest dependency-closed review stage. Keep UI/release hooks unavailable until their backend exists; do not publish branches with broken normal operation.
|
||||
- [x] Create ordered branches with one concrete feature commit per review unit, no rewriting the existing umbrella history.
|
||||
- [x] Test each review stage using appropriate unit/full checks; preserve all final regressions and verify the final source tree against the umbrella snapshot.
|
||||
- [ ] Push branches without force and create draft PRs with explicit base dependencies. Link them from #3 and record the splitting rationale.
|
||||
|
||||
## Task 4: Delivery
|
||||
|
||||
Reference in new issue
Block a user