fix(blindspot): BS-5 + BS-47 false-positive (jxcj 28 form 重跑实战)
- BS-5: 仅 ctx 完全缺失时阻塞, 不再因 existingEnCodes.length===0 误报 (场景: 全删 form 后重建, AppContext 仍有但 list 空, 旧逻辑会无限循环阻断) - BS-47: 仅 dict typeCreate 命令触发, 不再在 menu create 时误判 (场景: menu enCode 与 form enCode 共享合法, 但 BS-47 把 form enCode 看作 dict 冲突) Co-Authored-By: Claude <[email protected]>
This commit is contained in:
1 parent
2be1300ac3
commit
a5063bb115
11 files changed
+2093
-3
No files matched your search
@@ -93,11 +93,13 @@ export const BLINDSPOT_GUARDS: BlindspotGuard[] = [
|
||||
},
|
||||
|
||||
// 盲点 47: dict typeCreate 报 "The name cannot be repeated" — 全平台唯一
|
||||
// v0.10.1 fix: 仅 dict typeCreate 命令触发; menu create 时 enCode 与 form 共享合法
|
||||
{
|
||||
id: 'BS-47',
|
||||
trigger: 'dict typeCreate 报 "The name cannot be repeated"',
|
||||
level: 'ERROR',
|
||||
check: (ctx, opts) => {
|
||||
if (opts?.__command !== 'dict typeCreate') return false
|
||||
const name = opts?.fullName as string | undefined
|
||||
const enc = opts?.enCode as string | undefined
|
||||
// 字典是全平台唯一, 不分 app, 检查 enCode 或 fullName 冲突
|
||||
@@ -202,12 +204,13 @@ export const BLINDSPOT_GUARDS: BlindspotGuard[] = [
|
||||
},
|
||||
|
||||
// 盲点 5: AI 不先查 context 直接开干
|
||||
// v0.10.1 fix: 仅 ctx 完全缺失才报; existingEnCodes 空是合法状态 (新建空 app / 全删后重建)
|
||||
{
|
||||
id: 'BS-5',
|
||||
trigger: 'AppContext 为空, AI 凭猜测操作',
|
||||
trigger: 'AppContext 完全缺失, AI 凭猜测操作',
|
||||
level: 'ERROR',
|
||||
check: (ctx) => !ctx || ctx.existingEnCodes.length === 0,
|
||||
message: 'AppContext 缺少 existingEnCodes/existingTables, AI 必先跑 dacli app context --json',
|
||||
check: (ctx) => ctx === null || ctx === undefined,
|
||||
message: 'AppContext 未加载, AI 必先跑 dacli app context --json',
|
||||
fix: 'dacli app context --json 取环境快照, 不要凭 "经验" 猜 dbLinkId/enCode',
|
||||
},
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user