fix(types): Desktop type safety hardening (TYPE-01)
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- Unify ConnectionState: kernel-types.ts now canonical source
  with 'handshaking', gateway-types.ts re-exports
- PromptTemplateInfo source/status → union literals
- PromptVariable.type → union literal
- CreateRoleRequest id/permissions → optional
- PropertyPanel: replace 13 as any with typed accessor pattern
- chatStore: window cast via as unknown as Record
This commit is contained in:
iven
2026-04-05 01:30:29 +08:00
parent 36168d6978
commit 3b0ab1a7b7
6 changed files with 32 additions and 26 deletions

View File

@@ -32,7 +32,7 @@
| DEAD-05 | 39 个未调用 saas-client 方法 | **PARTIALLY_FIXED** | - | 2026-04-04 | 10 个零调用方法已删除 (healthCheck/listDevices/getRelayTask/getUsage×2/listPrompts/getPrompt/listPromptVersions/getPromptVersion/getPlan)29 个保留供 admin-v2 或未来接入 |
| DOC-01 | Tauri 命令数文档 58+ vs 实际 171 | **FIXED** | 06-tauri-backend 文档已更新 175→171 |
| DOC-02 | 智能层文档引用已删除模块 | **FALSE_POSITIVE** | 02-intelligence-layer 文档未引用已删除模块,
| TYPE-01 | Desktop/Admin 类型不一致 (6 组) | OPEN | - | - | 统一类型定义 |
| TYPE-01 | Desktop/Admin 类型不一致 (6 组) | **FIXED** | - | 2026-04-05 | ConnectionState 统一含 handshaking; PromptTemplate source/status + PromptVariable.type 改为 union literal; CreateRoleRequest id/permissions 改可选; PropertyPanel as any 消除; chatStore window cast 修正 |
| G-07 | account_api_keys 被 relay 绕过 | **N/A** | Intentional architecture: provider_keys (Key Pool) 做 upstream key rotation/429/failover; account_api_keys 为 account-level token |
## P3: 中优先级
@@ -135,7 +135,7 @@
| ID | 问题 | 状态 | 验证方法 |
|----|------|------|----------|
| V11-P4-01 | ContentBlock 4 处定义(不同域) | **FALSE_POSITIVE** | 4 个 crate 各自服务于不同协议域(消息/MCP/Driver/Hand按领域隔离是正确设计 |
| V11-P4-02 | Desktop ↔ Admin 13+ 类型名称不一致 | **DOCUMENTED** | TYPE-01 已在 V12 Batch 7 部分修复AgentInfo/KernelStatus),剩余为 admin-v2 独立类型系统 |
| V11-P4-02 | Desktop ↔ Admin 13+ 类型名称不一致 | **DOCUMENTED** | TYPE-01 完整修复ConnectionState union + PromptTemplate literal + CreateRoleRequest optional),剩余为 admin-v2 独立类型系统有意差异 |
| V11-P4-03 | 文档数字不一致 (Skills 76 vs 66/75/77) | **FALSE_POSITIVE** | find skills -name SKILL.md = 75文档统一为 75 |
| V11-P4-04 | A2A/WASM feature-gated 未启用 | **FALSE_POSITIVE** | a2a/wasm 在 Cargo.toml 正确 feature-gated默认不启用有意设计 |
| V11-P4-05 | embedding 生成已禁用 | **FALSE_POSITIVE** | generate_embedding.rs 分块功能已实现,向量生成是 Phase 2 有意延迟,注释已完善 |
@@ -272,6 +272,7 @@
| 2026-04-05 | SEC2-P3-01 | OPEN → DOCUMENTED | A2A feature-gated 默认不启用 |
| 2026-04-05 | SEC2-P3-02 | OPEN → DOCUMENTED | P4 级差异admin 独立类型系统 |
| 2026-04-05 | V11-P2-05 | 部分关闭 → FIXED | 完整审计: 160 @connected + 16 @reserved + 1 未注册 = 177 总命令 |
| 2026-04-05 | TYPE-01 | OPEN → FIXED | ConnectionState 统一(含 handshaking); saas-types PromptTemplate/PromptVariable union literal; CreateRoleRequest optional; PropertyPanel as any→类型安全; chatStore window cast |
## V12 模块化端到端审计修复 (2026-04-04)