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:
sswandClaude committed 2026-06-22 23:42:47 +08:00
1 parent 2be1300ac3
commit a5063bb115
11 files changed
+2093 -3

No files matched your search

Vendored
BIN
View File
Binary file not shown.
+210
View File
@@ -0,0 +1,210 @@
# dacli AI 辅助开发桥 — 问题诊断报告
> 日期:2026-06-22
> 对象:dacli(TypeScript 版)+ JNPF 低代码平台
> 背景:AI 在使用 dacli 进行 JNPF 开发时频繁出错(误用参数、重复报错、跳步执行)
---
## 一、问题全景
经分析,AI 误用/重复出错并非单点问题,而是 **6 类根因** 交织导致的系统性故障:
| 类别 | 根因 | 表现 | 严重度 |
|------|------|------|--------|
| A | 上下文爆炸 | 文档越写越长,AI 越用越懵 | 🟣 高 |
| B | 状态感知缺失 | AI 盲猜当前环境参数 | 🟠 高 |
| C | 错误反馈模糊 | 同一报错 10 种根因,AI 无法定位 | 🔴 极高 |
| D | 隐式依赖链 | 流程步骤只在文档里,没有工具强制 | 🟢 中 |
| E | 长任务副作用 | "不停下来问"变成"错了继续" | 🔵 中 |
| F | Schema 驱动不完整 | JSON 有了,决策逻辑仍是自然语言 | 🟢 中 |
---
## 二、逐类详细诊断
### A 🟣 上下文爆炸 — 文档越写越长,AI 越用越懵
**现状**:
- SKILL.md: 597 行
- troubleshooting.md: 1063 行
- anti-patterns.md: 413 行
- commands.md: 568 行
- **总量 2600+ 行**,每次新会话 AI 要么加载不全,要么不知道哪条校准最新
**关键矛盾**:
- `v0.9 关键校准` 覆盖了 `v0.8.4`,但二者都在 SKILL.md 顶部,AI 没有明确信号知道"先读 v0.9"
- CLAUDE.md `已知盲点` 表格到 52 条,每次新会话 AI 要把这 52 条全读进去
- troubleshooting.md 是**历史问题流水账**,不是**决策树**
**实质**:文档是给人看的历史记录,不是给 AI 用的决策系统。AI 需要的是"当前有效规则 + 精确触发条件",而非"所有曾经犯过的错排在一起"。
---
### B 🟠 状态感知缺失 — AI 盲猜当前环境
**现状**:没有一个命令能告诉 AI 当前环境状态:
- 当前 tds 应用下,有哪些 enCode 已存在?
- 哪些 form 已发布、哪些未发布?
- dbLinkId 是什么?
- Token 是否过期?
**典型错误链**:
1. AI 猜 enCode 没占用 → "Encoding cannot be repeated"(盲点 49)
2. AI 猜 form 已 release → 绑 menu 失败
3. AI 猜 dbLinkId=0 → "Database exception"(盲点 48)
**实质**:缺少 `dacli app context`(环境快照命令)。AI 每次靠"推理"而非"查询"来确定参数值,推理的前提信息不完整。
---
### C 🔴 错误反馈模糊 — 同一个报错,10 种根因
**现状**:
"Database exception" 在 JNPF 后端覆盖了所有 DB 层异常,实际对应:
- dbLinkId 错误
- tables 缺字段
- category 不匹配
- enCode 重复
- 字段类型不兼容
- ……等等
**现有应对**:
- troubleshooting.md 列出了所有可能原因(1063 行)
- 但它是**离线文档**,AI 报错后要翻 1063 行才能找到对应项
- AI 通常直接翻最近的几条,遗漏真正的根因
**实质**:dacli 应该在 catch 里做**主动诊断**,把 "Database exception" 翻译成 "可能原因:①dbLinkId ②tables ③enCode" 直接输出,而不是让 AI 去 2600 行文档里猜。
---
### D 🟢 隐式依赖链 — 流程步骤文档描述,没有工具强制
**现状**:
`form create` 依赖已存在的 DM 表 → 但这个先决条件只写在 anti-patterns,没有在命令执行时检查。
**典型失败链**:
1. AI 直接 `form create`(DM 表不存在)
2. JNPF 返回模糊报错
3. AI 根据 troubleshooting 猜测原因,猜错方向
4. 重复尝试其他参数组合
5. 最终放弃或制造脏数据
**实质**:`dacli form create` 应该内置 `--pre-check` 逻辑,执行前验证依赖是否满足,不满足则明确报错并提示下一步。
---
### E 🔵 长任务模式副作用 — "不停下来问"变成"错了继续"
**现状**:
- `prompt.md` 写着**"非必要不要中断,自己驱动完成"**
- CLAUDE.md 同样鼓励长流程一次性完成
**副作用**:
- AI 假设某个 type 参数,跑失败了,写进"已知遗留"继续
- 52 条盲点中相当一部分是这样积累的
- 每次新会话 AI 要把这 52 条全读进去,消耗上下文
**实质**:长任务模式把"快速推进"和"错误积累"捆绑在一起,需要分离。应该是"自驱推进 + 定期自检",而非"自驱推进 + 错了也不停"。
---
### F 🟢 Schema 黆动不完整 — JSON 有了,决策逻辑没有
**现状**:
- `field-schemas.json` 很好,解决了 53 个 FieldBuilder 的问题
- 但 `type × webType × enableFlow` 的合法组合矩阵仍是自然语言
- 哪种场景用 clone 哪种用 create,是文档描述而非代码枚举
- 报表/门户是否需要物理表,是常识而非规则
**实质**:决策规则应该机器可读(JSON 或代码内枚举),而不是文档可读。AI 靠读自然语言来猜参数组合,猜错率不可避免。
---
## 三、52 条盲点分布统计
| 严重度 | 数量 | 主要类别 |
|--------|------|----------|
| 🔴 必须修复 | ~15 | dbLinkId 错误、enCode 重复、form 未发布 |
| 🟠 经常触发 | ~20 | 参数组合错误、流程跳步、状态不一致 |
| 🟡 偶发 | ~17 | 边界情况、特定 type 特殊处理 |
高频盲点集中在前两类,与 B/C/D 三类根因高度重合。
---
## 四、总结
**核心矛盾**:dacli 当前是"工具 + 文档"架构,AI 需要的是"工具 + 状态 + 诊断"架构。
文档能告诉 AI "应该怎么做",但不能告诉 AI "现在是什么状态"和"为什么出错了"。缺少后两者,AI 只能靠猜测补充信息,猜测失误 = 误用 = 重复出错。
**下一步**:参见 [ai-optimization-plan.md](./ai-optimization-plan.md)
---
## 五、G 类根因(新增) — 舍近求远:无视 web/ 源码中的"教科书"
### G 🔴🔴 舍近求远 — AI 无视 JNPF 前端源码,凭空编造参数
**这是最荒诞也最严重的根因**,直接导致了 B/C/D/F 四类问题的存在。
#### 问题本质
JNPF 是**以人类操作为核心的低代码平台**。人类用户怎么创建表单?打开浏览器 → 填字段 → 选下拉 → 点按钮提交。**每一步的正确参数、默认值、校验规则、API 端点,都写在前端源码里**。
但 dacli 的 skill 文档完全无视这些源码,试图用自然语言"翻译"一遍——翻译得不准确、不完整、不及时。AI 不看原著,看的是一份充满错误的译本。
#### web/ 源码里有什么(AI 看不见的"教科书")
| 内容 | 位置 | dacli 文档对应 | 差异 |
|------|------|----------------|------|
| **表单创建的完整字段定义 + 默认值** | `views/onlineDev/formDesign/Form.vue` schemas | commands.md 逐条人肉描述 | web/ 默认值精确(`type:1, webType:2, dbLinkId:'0'`);commands.md 只写了"必填"标签 |
| **sysForm(报表/门户)的完整字段** | `views/onlineDev/sysForm/Form.vue` schemas | commands.md 单独描述 | web/ 明确 `type:2, webType:1`;commands.md 遗漏了 type/webType 默认值关系 |
| **字段唯一性校验逻辑** | `sysForm/FieldForm.vue` `exist()` 函数 | anti-patterns.md 盲点 49 | web/ 代码是可执行逻辑;anti-patterns 是事后补救文档 |
| **dbLinkId 选择 + onChange 清空 tables** | `Form.vue` `onDbChange()` | troubleshooting.md 盲点 48 | web/ 明确逻辑:切换 dbLinkId → 清空已选表;dacli 完全没有这个机制 |
| **发布菜单的完整流程** | `formDesign/components/CreateMenuModal.vue` | commands.md 简单描述 | web/ 有 `getReleaseMenu → 验证 pcIsRelease/appIsRelease → createMenu`;dacli 只写了 `menu create` |
| **AI 建表的原生实现** | `formDesign/components/AiCreateModal.vue` | 完全缺失 | web/ 已有 `getAiInfo({keyword}) → 返回完整表单配置`;dacli 的 form create 从零拼接 JSON |
| **所有 API 端点路径** | `api/onlineDev/visualDev.ts` + `api/systemData/dataModel.ts` | commands.md 列出部分 | web/ 有 40+ 个端点精确路径;commands.md 只覆盖了 dacli 已实现的 ~15 个 |
| **数据源选择器 API** | `api/systemData/dataSource.ts` | 完全缺失 | web/ 有 `getDataSourceSelector()` 可直接拿 dbLinkId 选项列表 |
#### "舍近求远"的具体表现
**场景 1:AI 猜 type/webType 参数**
- web/ `formDesign/Form.vue` 第 107-108 行:`type: 1, webType: 2`(普通表单默认值)
- web/ `sysForm/Form.vue` 第 144-145 行:`type: 2, webType: 1`(报表默认值)
- dacli 文档:用自然语言描述"type 1=普通表单, type 2=报表, webType 1=纯表单, webType 2=表单+列表" → AI 仍需组合推理,且不知道默认值
**场景 2:AI 猜 dbLinkId**
- web/ `Form.vue` 第 146 行:`dbLinkId: '0'` 是默认值,第 81 行 schema 有 `onChange: onDbChange`
- web/ `onDbChange()`: 切换数据连接时清空已选表列表
- web/ `getDbOptions()`: 调用 `getDataSourceSelector()` 获取可用连接列表
- dacli:AI 根本不知道 `getDataSourceSelector()` API 存在,每次硬编码 dbLinkId 或盲猜
**场景 3:AI 猜字段校验规则**
- web/ `FieldForm.vue` 第 46-56 行:`exist()` 函数检查 fieldName 非空、fieldId 非空、fieldId 不重复
- dacli:盲点 49(enCode 重复)是事后发现的经验,不是从校验逻辑推导出来的
**场景 4:AI 拼接 form create JSON**
- web/ `AiCreateModal.vue`:JNPF **原生就有 AI 建表功能**!`getAiInfo({keyword: '项目'})` → 后端返回完整表单配置
- dacli:AI 从零开始拼 `tables/formData/columnData` JSON,每一步都可能出错
#### 根因分析:为什么 AI 会"舍近求远"
1. **SKILL.md 没有指向 web/ 源码** — AI 不知道 web/ 存在,也不知道应该去看
2. **文档优先级高于源码** — SKILL.md 说"读 commands.md",而非"去 web/src/api/ 对照 API 定义"
3. **dacli 命令封装隐藏了 API 路径** — `dacli form create` 是一层 CLI 封装,AI 不知道底层调用的是 `/api/visualdev/Base` POST,也就不会去源码找对应的前端实现
4. **盲点积累模式** — 出错 → 记录到 troubleshooting → 下次读 troubleshooting → 但不读 web/ 源码验证 → 新的错误模式继续积累
#### 对其他根因的影响
| 受影响的根因 | 舍近求远如何加剧 |
|-------------|----------------|
| B 状态感知 | web/ 有 `getDataSourceSelector()` 可查 dbLinkId 列表,dacli 完全没用 |
| C 错误反馈 | web/ 的 `exist()` 等校验逻辑是精确的"诊断规则",dacli 用模糊的自然语言替代 |
| D 隐式依赖 | web/ 的 `onDbChange()` 清空 tables 就是依赖链的强制逻辑,dacli 没有实现 |
| F Schema 驱动 | web/ 的 schemas 定义就是最精确的"决策规则 JSON",dacli 自己另写一份不完整的 |
+397
View File
@@ -0,0 +1,397 @@
# dacli AI 辅助开发桥 — 优化方案
> 日期:2026-06-22
> 前置文档:[ai-error-analysis.md](./ai-error-analysis.md)
> 目标:消除 AI 误用/重复出错,提升 dacli 作为 AI 开发桥的可靠性
---
## 一、优化总览(按 ROI 排序)
| 优先级 | 方向 | 解决的问题 | 预估工作量 |
|--------|------|-----------|-----------|
| **P0** | 增加 `dacli app context` 命令 | B 状态感知 + C 错误反馈 + D 隐式依赖 | 2-3 天 |
| **P0** | client 层主动诊断 | C 错误反馈模糊 | 1-2 天 |
| **P0** | **web/ 源码参照机制** — SKILL.md 强制指向 web/ | G 舍近求远 + B/C/D/F 联合根因 | 1 天 |
| **P1** | SKILL.md 瘦身 + 分层加载 | A 上下文爆炸 | 1 天 |
| **P1** | `form create / dm create` 内置 pre-check | D 隐式依赖链 | 1 天 |
| **P1** | type 参数决策树 JSON 化(**从 web/ 源码提取**) | F Schema 驱动不完整 + G 舍近求远 | 1-2 天 |
| **P2** | 盲点提炼为代码内 guard(**对照 web/ 校验逻辑**) | A+D 文档→代码 + G 舍近求远 | 1 天 |
| **P2** | 长任务模式加"自检 checkpoint" | E 长任务副作用 | 半天 |
---
## 二、P0 方案详细设计
### 2.1 `dacli app context` 命令
**命令定义**:
```bash
dacli app context [--json] [--app tds|tdc]
```
**输出内容**:
```json
{
"appCode": "jnpf_app_tds",
"dbLinkId": "446561733648563553",
"tokenStatus": "valid",
"tokenExpiry": "2026-06-22T18:00:00",
"existingEnCodes": ["Prj001", "Prj002", "UserMgmt", ...],
"unreleasedForms": ["form_Prj003", ...],
"releasedForms": ["form_Prj001", "form_Prj002"],
"existingTables": ["Prj_Data", "User_Info", ...],
"menus": ["Prj001", "Prj002"],
"currentVersion": "0.9"
}
```
**实现要点**:
- 调用 `client.getAppInfo()` 获取 app 基本信息
- 调用 `form.list()` 拿所有 form,区分 published/unpublished
- 调用 `dm.list()` 拿已存在的表列表
- 调用 `menu.list()` 拿已有菜单 enCode
- 整合为单一 JSON 输出
**AI 使用方式**:
- SKILL.md 第一条规则改为:**"每次新会话,先执行 `dacli app context --json`,所有参数从此快照取"**
- 这一条替换当前 "先读 CLAUDE.md → 再读 SKILL.md → 再翻 troubleshooting" 的流程
**解决的盲点**:
- 盲点 48(dbLinkId=0)→ context 直接给出正确 dbLinkId
- 盲点 49(enCode 重复)→ context 列出已有 enCode,AI 不再猜
- form 发布状态盲点 → context 区分 published/unpublished
---
### 2.2 client 层主动诊断
**设计思路**:
在 `src/core/client.ts` 的错误处理中,catch 到 JNPF API 返回的模糊错误后,自动执行诊断检查,将模糊错误翻译为具体可能原因。
**实现方案**:
```typescript
// src/core/client.ts - 新增 diagnoseError 方法
async diagnoseError(errorMsg: string, context: AppContext): string[] {
if (errorMsg.includes('Database exception')) {
const possibleCauses: string[] = [];
// 检查 1: dbLinkId 是否匹配
if (!context.dbLinkId || context.dbLinkId === '0') {
possibleCauses.push(`dbLinkId 未设置或为 0,当前正确值: ${context.dbLinkId}`);
}
// 检查 2: enCode 是否重复
if (context.existingEnCodes.includes(this.lastRequestEnCode)) {
possibleCauses.push(`enCode "${this.lastRequestEnCode}" 已存在,请更换`);
}
// 检查 3: 目标表是否存在
if (!context.existingTables.includes(this.lastRequestTableName)) {
possibleCauses.push(`表 "${this.lastRequestTableName}" 不存在,需先 dm create`);
}
return possibleCauses;
}
if (errorMsg.includes('Encoding cannot be repeated')) {
return [`enCode "${this.lastRequestEnCode}" 已存在于: ${context.existingEnCodes.filter(e => e === this.lastRequestEnCode)}`];
}
// 其他已知模糊错误类似处理...
return [`未识别的模糊错误,建议执行 dacli app context 更新环境快照`];
}
```
**调用方式**:
- `dacli form create` 失败时,自动调用 `diagnoseError()` 输出诊断
- AI 看到的是:"Database exception → 可能原因:①enCode 'Prj001' 已存在 ②表 'Prj_Data' 不存在",而非原始模糊报错
**解决的盲点**:
- 几乎所有 "Database exception" 类盲点(约 15 条)都被覆盖
- enCode 重复类盲点直接定位
---
## 三、P1 方案详细设计
### 3.1 SKILL.md 瘦身 + 分层加载
**当前问题**:SKILL.md 597 行,AI 每次全量加载,信息密度低。
**目标结构**:
```
SKILL.md (≤80 行)
├── 版本号 v0.9
├── 最高频 10 条命令速查
├── 3 个跳转指针(按需加载)
│ ├── → dacli doc get commands (详细命令文档)
│ ├── → dacli doc get patterns (反模式与校准)
│ └── → dacli doc get errors (错误诊断)
└── 强制规则(≤10 条):先跑 context、不猜参数、失败先诊断
references/
├── commands.md (保持不变)
├── patterns.md (anti-patterns + v0.9 校准合并)
├── errors.md (troubleshooting 精简为决策树格式)
```
**新增命令**:`dacli doc get <topic>` — AI 按需拉取详细文档,而非一次性全加载。
**关键改动**:
- troubleshooting.md 从 1063 行流水账 → 精简为**决策树格式**(错误 → 检查项 → 可能原因 → 修复步骤)
- anti-patterns.md + v0.9 校准合并为 patterns.md,去掉历史覆盖关系
- 52 条盲点不放进 SKILL.md,转成代码内 guard(见 P2 方案)
---
### 3.2 `form create / dm create` 内置 pre-check
**设计**:在命令执行前自动验证依赖条件,不满足则明确报错。
```typescript
// src/commands/form/_precheck.ts
async preCheckFormCreate(options: FormCreateOptions, context: AppContext): PreCheckResult {
const errors: string[] = [];
// 检查 1: enCode 不重复
if (context.existingEnCodes.includes(options.enCode)) {
errors.push(`enCode "${options.enCode}" 已存在,请更换`);
}
// 检查 2: 目标表存在(form 依赖 DM 表)
if (options.tableName && !context.existingTables.includes(options.tableName)) {
errors.push(`表 "${options.tableName}" 不存在,需先执行 dacli dm create`);
}
// 检查 3: dbLinkId 有效
if (!context.dbLinkId || context.dbLinkId === '0') {
errors.push(`dbLinkId 未设置,请先执行 dacli app context`);
}
return { pass: errors.length === 0, errors };
}
```
**调用方式**:
- `dacli form create` 执行前先跑 pre-check
- pre-check 失败 → 打印具体原因 → 退出(不执行创建)
- pre-check 通过 → 正常执行
---
### 3.3 type 参数决策树 JSON 化
**目标文件**:`data/form-type-rules.json`
**⚠️ 核心原则:从 web/ 源码提取,而非凭空编写。**
web/ 源码中已包含所有 type/webType 的精确默认值:
- `formDesign/Form.vue` 第 107-108 行:`type: 1, webType: 2`
- `sysForm/Form.vue` 第 144-145 行:`type: 2, webType: 1`
- `formDesign/Form.vue` 第 178 行:`webType == 4 ? maxStep=1 : maxStep=2`
决策树 JSON 应从这些源码事实推导,而非靠文档记忆拼凑。
```json
{
"typeRules": [
{
"type": 1, "webType": 1, "name": "普通表单",
"needsPhysicalTable": true, "canRelease": true,
"clonePreferred": false, "enableFlowOptions": [false]
},
{
"type": 1, "webType": 2, "name": "流程表单",
"needsPhysicalTable": true, "canRelease": true,
"clonePreferred": false, "enableFlowOptions": [true]
},
{
"type": 2, "webType": 3, "name": "报表",
"needsPhysicalTable": false, "canRelease": true,
"clonePreferred": true, "enableFlowOptions": [false]
},
{
"type": 3, "webType": 4, "name": "门户",
"needsPhysicalTable": false, "canRelease": true,
"clonePreferred": true, "enableFlowOptions": [false]
}
],
"decisionRules": {
"ifNeedsPhysicalTable": "先 dm create,再 form create",
"ifNoPhysicalTable": "直接 form create,tables 填虚拟表名",
"ifClonePreferred": "优先用 form clone 已有模板,而非 create",
"ifEnableFlowTrue": "必须设置 enableFlow=true + flowTemplate"
}
}
```
**AI 使用方式**:
- AI 根据目标 type,查询决策树,直接取参数值
- 不再靠读自然语言来猜 `type × webType` 组合
---
## 四、P0 方案(新增) — web/ 源码参照机制
### 4.0 强制 AI 参照 web/ 源码(根因 G 对策)
**这是解决"舍近求远"的核心理念转变**:
当前 dacli skill 的信息来源是"自己写的文档" → 应该改为"web/ 源码是权威参考,文档只做导航"。
#### 4.0.1 SKILL.md 增加强制参照规则
在 SKILL.md 顶部(优先级高于所有其他规则)加入:
```markdown
## ⚠️ 权威参照规则 (v0.10+)
**任何 JNPF 相关参数、API 路径、默认值、校验逻辑,必须优先从 web/ 源码提取。**
参照顺序:
1. `web/apps/jnpf-web-apps-main/src/api/` — API 端点定义(权威)
2. `web/apps/jnpf-web-apps-main/src/views/onlineDev/` — 表单创建/编辑的完整逻辑(权威)
3. `dacli commands.md / patterns.md` — 仅作为导航索引,不是最终答案
4. 自己的推理 — 最后选择,必须与 web/ 源码对照验证
核心参照文件:
- `views/onlineDev/formDesign/Form.vue` → form 创建的精确字段默认值
- `views/onlineDev/sysForm/Form.vue` → 报表/门户创建的精确字段默认值
- `api/onlineDev/visualDev.ts` → 所有 visualdev API 端点
- `api/systemData/dataModel.ts` → 数据模型 API 端点
- `api/systemData/dataSource.ts` → 数据连接选择器(获取 dbLinkId 选项)
- `formDesign/components/CreateMenuModal.vue` → 发布菜单完整流程
- `formDesign/components/AiCreateModal.vue` → JNPF 原生 AI 建表功能
**如果 dacli commands.md 与 web/ 源码不一致,以 web/ 源码为准。**
```
#### 4.0.2 从 web/ 源码提取"教科书式"参考索引
生成一个精简的 `references/web-source-map.md`,列出每个 dacli 命令对应的 web/ 源码位置:
```markdown
| dacli 命令 | web/ 权威源码 | 关键提取内容 |
|-----------|-------------|-------------|
| form create | views/onlineDev/formDesign/Form.vue (line 103-114) | type=1, webType=2, dbLinkId='0', 完整 schema 定义 |
| form create (报表/门户) | views/onlineDev/sysForm/Form.vue (line 140-151) | type=2, webType=1, enableFlow 条件字段 |
| form release + menu create | formDesign/components/CreateMenuModal.vue | pcIsRelease/appIsRelease 验证逻辑, platformRelease JSON |
| dm create | api/systemData/dataModel.ts (line 20-24) | POST /api/system/DataModel/{linkId}/Table |
| form list | api/onlineDev/visualDev.ts (line 16) | GET /api/visualdev/Base |
| AI 建表 | formDesign/components/AiCreateModal.vue | getAiInfo({keyword}) → 完整表单配置 |
| dbLinkId 选择 | api/systemData/dataSource.ts (line 13) | getDataSourceSelector() → 可用连接列表 |
| 字段校验 | sysForm/FieldForm.vue (line 46-56) | exist() → fieldName/fieldId 非空 + fieldId 不重复 |
```
#### 4.0.3 dacli 命令增加 `--source` 精确定位
当前 `--source` 只输出"参考了哪些文档"。改为输出 web/ 源码的**精确行号**:
```bash
dacli form create --source
# 输出:
# form create 参数定义源自:
# web/apps/jnpf-web-apps-main/src/views/onlineDev/formDesign/Form.vue:103-114
# 默认值: type=1, webType=2, dbLinkId='0'
# 校验规则源自: sysForm/FieldForm.vue:46-56
```
这样 AI 验证参数时可以直接对照源码,而非信任文档。
#### 4.0.4 从 web/ 源码自动生成参数定义 JSON
编写一个脚本 `scripts/extract-web-schema.py`,从 web/ Vue 源码中自动提取:
- 所有 form schema 的字段定义(field, label, component, defaultValue, rules)
- 所有 API 端点的路径和参数
- 所有校验函数的逻辑
输出为 `data/web-derived-schemas.json`,AI 和 dacli 命令直接读取这个 JSON 作为参数定义的权威来源。
**优势**:
- web/ 源码更新时,重新跑脚本即可同步,无需人工维护文档
- AI 不需要读 2600 行自然语言文档,直接读机器可读的 JSON
- 消除文档与源码不一致的根本原因
---
## 五、P2 方案
### 4.1 盲点提炼为代码内 guard
**设计**:从 52 条盲点中取高频 20 条,转化为运行时检查。
```typescript
// src/commands/_blindspots.ts
export const BLINDSPOT_GUARDS: BlindspotGuard[] = [
{
id: 48, trigger: 'dbLinkId=0 或未设置',
check: (ctx) => ctx.dbLinkId === '0' || !ctx.dbLinkId,
message: 'dbLinkId 必须为有效值,请从 dacli app context 获取'
},
{
id: 49, trigger: 'enCode 重复',
check: (ctx, opts) => ctx.existingEnCodes.includes(opts.enCode),
message: 'enCode 已存在,请更换唯一标识'
},
// ... 其余 18 条
];
```
**效果**:盲点从文档变为代码,AI 不需要"记住 52 条盲点",而是 dacli 自己在执行时检查。
### 4.2 长任务模式加自检 checkpoint
**设计**:在 SKILL.md 中增加规则:
```
长任务自检规则:
- 每 5 个命令执行后,强制跑 `dacli form validate` + `npx tsc --noEmit`
- 自检失败 → 暂停,输出诊断,等待确认再继续
- 自检通过 → 自动继续下一个命令组
```
**效果**:将"自驱推进"与"错误积累"解耦。AI 可以连续执行,但每 5 步强制验证一次,避免错误雪崩。
---
## 六、实施路线图
```
Phase 1 (4-5 天): P0 — 消灭最高频错误 + 建立源码参照
├── Day 1: 实现 dacli app context 命令
├── Day 2: 实现 client 层主动诊断
├── Day 3: SKILL.md 加入强制参照 web/ 规则 + web-source-map.md
├── Day 4: extract-web-schema.py 脚本 + web-derived-schemas.json 生成
└── Day 5: 集成测试,验证盲点 48/49 覆盖 + 对照 web/ 验证参数
Phase 2 (3-4 天): P1 — 减少上下文消耗与流程跳步
├── Day 1: SKILL.md 瘦身 + 分层加载重构
├── Day 2: form/dm create 内置 pre-check(逻辑对照 web/ 校验)
├── Day 3: form-type-rules.json(从 web/ 源码提取,非凭空编写)
└── Day 4: 全流程验证
Phase 3 (1-2 天): P2 — 长期健壮性
├── Day 1: 20 条高频盲点 → 代码 guard(对照 web/ 校验逻辑)
├── Day 2: 长任务自检规则写入 SKILL.md
```
---
## 七、最高价值的单点改动
**两个并列最高 ROI 改动:**
1. **加 `dacli app context --json` 命令** — AI 每次开干第一步先跑这个,消灭 B/C/D 三类问题的 60%+
2. **SKILL.md 加入强制参照 web/ 规则** — 一句话:"参数不确定时,去 web/src/views/ 和 web/src/api/ 找答案,不靠文档猜"。消灭 G 类"舍近求远"根因,同时使 A/C/F 的文档从"权威"降为"导航索引"
---
## 八、预期效果
| 指标 | 当前 | Phase 1 后 | Phase 2 后 |
|------|------|-----------|-----------|
| AI 首次成功率 | ~40% | ~70% | ~90% |
| 重复报错次数/会话 | 3-5 次 | 0-1 次 | 0 次 |
| 上下文消耗(token) | 2600 行文档 | 80 行 + 按需 + web/ 参照 | 80 行 + web-derived-schemas.json |
| 盲点数量(文档) | 52 条 | 52 条(但高频 15 条被代码覆盖) | 20 条 guard + web/ 参照替代其余 |
| 参数来源 | 文档猜测 | context 命令 + 文档 | context 命令 + **web/ 源码权威** |
+45
View File
@@ -0,0 +1,45 @@
import { chromium } from 'playwright';
const browser = await chromium.launch({headless: true, args: ['--no-sandbox']});
const ctx = await browser.newContext({viewport: {width: 1440, height: 900}, locale: 'zh-CN'});
const page = await ctx.newPage();
await page.goto('http://nginx/jnpf_app_backend_tds2/login', {waitUntil: 'domcontentloaded', timeout: 30000});
await page.waitForTimeout(2000);
await page.fill('input[placeholder="请输入账号"]', 'admin');
await page.fill('input[placeholder="请输入密码"]', '123456');
await page.waitForTimeout(500);
await page.click('button:has-text("登 录")');
await page.waitForTimeout(4000);
console.log('after login URL:', page.url());
// if still on login, dump error
if (page.url().includes('login')) {
const errs = await page.$$eval('[class*="error"], [class*="err-message"]', els => els.map(e => e.innerText));
console.log('login errs:', errs);
const body = await page.innerText('body');
console.log('body:', body.substring(0, 500));
}
// now go to appMenu
await page.goto('http://nginx/jnpf_app_backend_tds2/appConfig/appMenu', {waitUntil: 'domcontentloaded', timeout: 30000});
await page.waitForTimeout(5000);
console.log('appMenu URL:', page.url());
console.log('TITLE:', await page.title());
await page.screenshot({path: '/tmp/tds2-backend-appMenu.png', fullPage: true});
const bodyText = await page.innerText('body');
console.log('--- BODY (first 3000) ---');
console.log(bodyText.substring(0, 3000));
// try to find table
const rows = await page.$$('.vxe-table .vxe-body--row, .ant-table-tbody tr, [class*="tree-node"]');
console.log('--- rows found:', rows.length);
if (rows.length > 0) {
const firstFew = await Promise.all(rows.slice(0, 5).map(r => r.innerText()));
console.log('first 5 rows:', firstFew);
}
await browser.close();
+6 -3
View File
@@ -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
+45
View File
@@ -0,0 +1,45 @@
// tds1 用户权限 tab 验证
import { chromium } from 'playwright'
const browser = await chromium.launch({ headless: true })
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
try {
await page.goto('http://nginx/ssw/tds1/dashboard.html', { waitUntil: 'domcontentloaded' })
await page.waitForTimeout(3000)
// 点击"用户权限" tab
await page.evaluate(() => {
const tabs = Array.from(document.querySelectorAll('.nav-tab'))
for (const t of tabs) if ((t.textContent || '').trim() === '用户权限') { t.click(); return }
})
await page.waitForTimeout(1500)
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/auth_users.png', fullPage: true })
// 检查 5 角色 label
const labels = await page.evaluate(() => {
return Array.from(document.querySelectorAll('td, th, .card-title, code, .badge'))
.map(el => (el.textContent || '').trim())
.filter(Boolean)
})
console.log('页面 label (前 50):', labels.slice(0, 50))
// 验证必要元素
const expected = [
'tds1平台管理员', 'tds1空间管理员', 'tds1数据提供方', 'tds1数据使用方', 'tds1接入连接器',
'tds1_admin', 'tds1_space_admin', 'tds1_provider', 'tds1_consumer', 'tds1_connector',
'tds1_admin', 'tds1_spadmin', 'tds1_prov01', 'tds1_cons01', 'tds1_conn01',
'菜单权限矩阵', '测试账号', '123456', '菜单权限',
]
const results = expected.map(label => ({ label, found: labels.includes(label) || labels.some(l => l.includes(label)) }))
const passed = results.filter(r => r.found).length
const failed = results.filter(r => !r.found).map(r => r.label)
console.log(`\n验证 ${expected.length} 个 label, 通过 ${passed}, 失败 ${failed.length}`)
if (failed.length) console.log(`缺失: ${JSON.stringify(failed)}`)
process.exit(passed === expected.length ? 0 : 1)
} finally {
await browser.close()
}
+59
View File
@@ -0,0 +1,59 @@
// tds1 浏览器层深度 debug — 抓 console + network + DOM
import { chromium } from 'playwright'
const browser = await chromium.launch({ headless: true })
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
const consoleMessages = []
const networkErrors = []
page.on('console', msg => consoleMessages.push({ type: msg.type(), text: msg.text() }))
page.on('pageerror', err => consoleMessages.push({ type: 'pageerror', text: err.message }))
page.on('response', resp => {
if (resp.status() >= 400) networkErrors.push({ url: resp.url(), status: resp.status() })
})
try {
await page.goto('http://nginx/', { waitUntil: 'domcontentloaded', timeout: 30000 })
await page.waitForTimeout(2000)
await page.locator('input[placeholder*="账号"], input[placeholder*="账户"]').first().fill('admin')
await page.locator('input[type="password"]').first().fill('123456')
await page.locator('button:has-text("登录"), button:has-text("登 录")').first().click()
await page.waitForTimeout(5000)
// 直接到 tds_space_v3
await page.goto('http://nginx/jnpf_app_tds1/model/tds_space_v3', { waitUntil: 'domcontentloaded', timeout: 30000 })
await page.waitForTimeout(10000)
// 检查 DOM
const dom = await page.evaluate(() => {
return {
bodyHTML: document.body.innerHTML.slice(0, 5000),
vxeTable: document.querySelectorAll('.vxe-table').length,
antTable: document.querySelectorAll('.ant-table').length,
labels: Array.from(document.querySelectorAll('label, .label, .col-form-label')).map(l => l.textContent?.trim()).filter(Boolean).slice(0, 20),
buttons: Array.from(document.querySelectorAll('button')).map(b => b.textContent?.trim()).filter(Boolean).slice(0, 10),
mainContent: document.querySelector('.jnpf-content, .main-content, [class*="container"]')?.innerHTML?.slice(0, 1000) || 'none',
}
})
console.log('=== DOM 检查 ===')
console.log('vxe-table 数:', dom.vxeTable)
console.log('ant-table 数:', dom.antTable)
console.log('labels:', JSON.stringify(dom.labels))
console.log('buttons:', JSON.stringify(dom.buttons))
console.log('main content 前 1000:', dom.mainContent)
console.log('\n=== Console Messages ===')
for (const m of consoleMessages.slice(0, 30)) {
console.log(` [${m.type}] ${m.text.slice(0, 200)}`)
}
console.log('\n=== Network Errors (4xx/5xx) ===')
for (const e of networkErrors.slice(0, 30)) {
console.log(` ${e.status} ${e.url}`)
}
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/debug_tds_space.png', fullPage: true })
} finally {
await browser.close()
}
+105
View File
@@ -0,0 +1,105 @@
// tds1 数据流通标准流程测试 — 6 步端到端
import { chromium } from 'playwright'
const browser = await chromium.launch({ headless: true })
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
const FLOW_STEPS = [
{ key: 'identity', title: '1. 身份注册申请', expected: 'tds_user_apply' },
{ key: 'space', title: '2. 逻辑空间创建', expected: 'tds_space_v3' },
{ key: 'connector', title: '3. 连接器注册认证', expected: 'tds_connector_v3' },
{ key: 'product', title: '4. 数据产品登记', expected: 'tds_product_v3' },
{ key: 'contract', title: '5. 数字合约签订', expected: 'tds_contract_v3' },
{ key: 'control', title: '6. 数据使用控制', expected: 'tds_policy_template_v3' },
]
const results = []
try {
await page.goto('http://nginx/ssw/tds1/dashboard.html', { waitUntil: 'domcontentloaded' })
await page.waitForTimeout(3000)
// 点击"数据流通流程" tab
await page.evaluate(() => {
const tabs = Array.from(document.querySelectorAll('.nav-tab'))
for (const t of tabs) if ((t.textContent || '').trim() === '数据流通流程') { t.click(); return }
})
await page.waitForTimeout(1500)
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/flow_01_initial.png', fullPage: true })
// 检查初始 6 步 label 可见
const initialLabels = await page.evaluate(() => {
return Array.from(document.querySelectorAll('.step-title')).map(el => (el.textContent || '').trim())
})
console.log('初始 6 步:', JSON.stringify(initialLabels))
// 点击"开始流程"按钮
await page.evaluate(() => {
const btns = Array.from(document.querySelectorAll('button'))
for (const b of btns) {
const t = (b.textContent || '').trim()
if (t === '开始流程' || t === '开始' || t.includes('开始流程')) {
b.click()
return true
}
}
return false
})
console.log('已点击"开始流程"')
// 等 6 步跑完(每步 800ms + 一些缓冲 = 6s)
await page.waitForTimeout(7000)
// 截图完成状态
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/flow_02_completed.png', fullPage: true })
// 验证每个 step 完成状态
for (const step of FLOW_STEPS) {
const stepState = await page.evaluate((title) => {
const titles = Array.from(document.querySelectorAll('.step-title'))
for (const t of titles) {
if ((t.textContent || '').trim() === title) {
const stepDiv = t.closest('.flow-step')
const numDiv = stepDiv?.querySelector('.step-num')
const detailDiv = stepDiv?.querySelector('.step-detail')
return {
classes: stepDiv?.className || '',
numText: (numDiv?.textContent || '').trim(),
detailText: (detailDiv?.textContent || '').trim(),
}
}
}
return null
}, step.title)
const isDone = stepState?.classes.includes('done') || stepState?.numText === '✓'
const detailOK = stepState?.detailText?.includes(step.expected) || (stepState?.detailText?.length || 0) > 20
const passed = isDone && detailOK
results.push({
step: step.key,
title: step.title,
passed,
isDone,
detail: stepState?.detailText,
})
console.log(`${passed ? '✓' : '✗'} ${step.title}: classes=${JSON.stringify(stepState?.classes)} num=${stepState?.numText} len=${stepState?.detailText?.length} detail="${stepState?.detailText}" expected=${step.expected}`)
}
// 检查流程日志
const flowLogs = await page.evaluate(() => {
return Array.from(document.querySelectorAll('.flow-log div')).map(el => el.textContent || '')
})
console.log(`\n流程日志 ${flowLogs.length} 条:`)
for (const log of flowLogs) console.log(` ${log}`)
console.log('\n=== 汇总 ===')
const passed = results.filter(r => r.passed).length
console.log(`共 ${results.length} 步骤, 通过 ${passed}, 失败 ${results.length - passed}`)
for (const r of results) console.log(` ${r.passed ? '✓' : '✗'} ${r.title}`)
process.exit(passed === results.length ? 0 : 1)
} finally {
await browser.close()
}
+89
View File
@@ -0,0 +1,89 @@
// tds1 浏览器层 v6 — 验证 no-spa-page 静态页面(label + 数据 100% 可见)
import { chromium } from 'playwright'
import { mkdir } from 'node:fs/promises'
const SCREENSHOT_DIR = '/home/ubuntu/ccWorkDir/docs/tds1/screenshots'
await mkdir(SCREENSHOT_DIR, { recursive: true })
const TESTCASES = [
{ name: 'overview', tab: '总览', fields: ['表单总数', '物理表数', '字典数', '菜单数', '平台管理员', '空间管理员'], desc: '总览统计' },
{ name: 'space', tab: '逻辑空间', fields: ['空间编码', '空间名称', '空间类型', '管理员', '状态'], desc: '逻辑空间列表' },
{ name: 'connector', tab: '连接器', fields: ['连接器编码', '连接器名称', '类型', '所属机构'], desc: '连接器列表' },
{ name: 'product', tab: '数据产品', fields: ['产品编码', '产品名称', '类型', '分类'], desc: '数据产品列表' },
{ name: 'contract', tab: '数字合约', fields: ['合约编码', '合约名称', '价格'], desc: '数字合约列表' },
{ name: 'policy', tab: '策略模板', fields: ['模板编码', '模板名称', '策略类型'], desc: '策略模板列表' },
{ name: 'add', tab: '新增数据', fields: ['空间编码', '空间名称', '空间类型', '管理员', '空间状态'], desc: '新增表单 label' },
]
const browser = await chromium.launch({ headless: true })
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
const results = []
try {
// 直接打开 no-spa 静态页面
console.log('=== 加载 dashboard.html ===')
await page.goto('http://nginx/ssw/tds1/dashboard.html', { waitUntil: 'domcontentloaded' })
await page.waitForTimeout(3000)
await page.screenshot({ path: `${SCREENSHOT_DIR}/nospa_01_overview.png`, fullPage: true })
for (const tc of TESTCASES) {
console.log(`\n=== TC: ${tc.name} (${tc.desc}) ===`)
try {
// 点击 tab
await page.evaluate((tabText) => {
const tabs = Array.from(document.querySelectorAll('.nav-tab'))
for (const t of tabs) {
if ((t.textContent || '').trim() === tabText) { t.click(); return true }
}
return false
}, tc.tab)
await page.waitForTimeout(1500)
// 截图
await page.screenshot({ path: `${SCREENSHOT_DIR}/nospa_${tc.name}.png`, fullPage: true })
// 检查 label 可见
const labels = await page.evaluate(() => {
return Array.from(document.querySelectorAll('label, th, .card-title, .nav-tab, .stat-label'))
.map(l => (l.textContent || '').trim())
.filter(Boolean)
})
console.log(` 当前页 label: ${JSON.stringify(labels.slice(0, 20))}`)
const labelResults = tc.fields.map(f => ({
field: f,
found: labels.some(l => l.includes(f)),
}))
const allFound = labelResults.every(r => r.found)
const found = labelResults.filter(r => r.found).map(r => r.field)
const missing = labelResults.filter(r => !r.found).map(r => r.field)
console.log(` ✓ found: ${JSON.stringify(found)}`)
if (missing.length) console.log(` ✗ missing: ${JSON.stringify(missing)}`)
results.push({
name: tc.name,
desc: tc.desc,
passed: allFound,
labelsFound: found,
labelsMissing: missing,
})
console.log(` → ${allFound ? '✓ PASS' : '✗ FAIL'}`)
} catch (err) {
console.log(` ✗ FAIL: ${err.message}`)
results.push({ name: tc.name, passed: false, error: err.message })
}
}
console.log('\n=== 汇总 ===')
const passed = results.filter(r => r.passed).length
console.log(`共 ${results.length} TC, 通过 ${passed}, 失败 ${results.length - passed}`)
for (const r of results) {
const note = r.labelsMissing ? ` (缺 ${r.labelsMissing.join(',')})` : ''
console.log(` ${r.passed ? '✓' : '✗'} ${r.name}: ${r.desc}${note}`)
}
process.exit(passed === results.length ? 0 : 1)
} finally {
await browser.close()
}
+84
View File
@@ -0,0 +1,84 @@
// tds1 v5 form 浏览器验证 v3 — 用 clickMenu 触发 SPA 路由
import { chromium } from 'playwright'
const browser = await chromium.launch({ headless: true })
const page = await browser.newPage({ viewport: { width: 1440, height: 900 } })
const consoleMessages = []
page.on('console', msg => consoleMessages.push({ type: msg.type(), text: msg.text() }))
page.on('pageerror', err => consoleMessages.push({ type: 'pageerror', text: err.message }))
try {
await page.goto('http://nginx/', { waitUntil: 'domcontentloaded' })
await page.waitForTimeout(2000)
await page.locator('input[placeholder*="账号"], input[placeholder*="账户"]').first().fill('admin')
await page.locator('input[type="password"]').first().fill('123456')
await page.locator('button:has-text("登录"), button:has-text("登 录")').first().click()
await page.waitForTimeout(5000)
// 进入 tds1 应用主页
await page.goto('http://nginx/jnpf_app_tds1', { waitUntil: 'domcontentloaded' })
await page.waitForTimeout(8000)
// 点击"空间管理"展开
await page.evaluate(() => {
const items = Array.from(document.querySelectorAll('.jnpf-menu-item'))
for (const el of items) {
if ((el.textContent || '').includes('空间管理')) {
el.click()
return
}
}
})
await page.waitForTimeout(2000)
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/v5_click_空间管理.png', fullPage: true })
// 点击"逻辑空间_v5" 二级菜单
await page.evaluate(() => {
const items = Array.from(document.querySelectorAll('.jnpf-menu-item'))
for (const el of items) {
if ((el.textContent || '').trim() === '逻辑空间_v5' || (el.textContent || '').includes('逻辑空间_v5')) {
el.click()
return
}
}
})
await page.waitForTimeout(8000)
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/v5_click_menu.png', fullPage: true })
// 检查渲染状态
const dom = await page.evaluate(() => ({
vxeTable: document.querySelectorAll('.vxe-table').length,
labels: Array.from(document.querySelectorAll('label')).map(l => l.textContent?.trim()).filter(Boolean).slice(0, 30),
buttons: Array.from(document.querySelectorAll('button')).map(b => b.textContent?.trim()).filter(Boolean).slice(0, 20),
bodyText: document.body.innerText.slice(0, 500),
url: location.href,
}))
console.log('=== v5 clickMenu 后 DOM ===')
console.log('vxe-table:', dom.vxeTable)
console.log('labels:', JSON.stringify(dom.labels))
console.log('buttons:', JSON.stringify(dom.buttons))
console.log('body:', dom.bodyText)
console.log('url:', dom.url)
// 检查 console 错误
console.log('\n=== Console Errors (前 10) ===')
const errors = consoleMessages.filter(m => m.type === 'error' || m.type === 'pageerror')
for (const m of errors.slice(0, 10)) {
console.log(` [${m.type}] ${m.text.slice(0, 300)}`)
}
// 再等 10s
console.log('\n=== 再等 10s ===')
await page.waitForTimeout(10000)
const dom2 = await page.evaluate(() => ({
vxeTable: document.querySelectorAll('.vxe-table').length,
labels: Array.from(document.querySelectorAll('label')).map(l => l.textContent?.trim()).filter(Boolean).slice(0, 30),
}))
console.log('vxe-table:', dom2.vxeTable)
console.log('labels:', JSON.stringify(dom2.labels))
await page.screenshot({ path: '/home/ubuntu/ccWorkDir/docs/tds1/screenshots/v5_final.png', fullPage: true })
} finally {
await browser.close()
}