 sswandClaude
|
571ac27ab2
|
refactor(paths): P5 — getCcWorkDir() single source, drop 37 hardcoded /home/ubuntu
Per audit §7 / H1: ~37 src files hardcoded '/home/ubuntu/ccWorkDir', welding the
whole pipeline to one container (external CI / other machines crash).
- new src/core/paths.ts: getCcWorkDir() (env CCWORKDIR || default) + getWebSrc()
- swept 36 files: '/home/ubuntu/ccWorkDir<sub>' literals → `${getCcWorkDir()}<sub>`
templates; collapsed 3 inline (process.env.CCWORKDIR || '...') dupes to getCcWorkDir()
- covers webapi mirror (_loader WEB_SRC/JNPF_UTILS_UUID + 24 module *_SRC), db/verify
paths, drift/coverage/selfcheck, buildformdata, codegen, render, blindspot boot paths
- playwright .cache path + doc-comment refs left as-is (not ccWorkDir-rooted)
Verified: tsc 0 (validates every inserted import path); runtime menu webapi
initWebapi OK; smoke form list returns real data (WEB_SRC end-to-end via getCcWorkDir);
vitest unit 336 pass.
Co-Authored-By: Claude <[email protected]>
|
2026-07-24 10:48:55 +08:00 |
|
 sswandClaude
|
76c2937020
|
fix(src): reroute 45 broken cmd-review/drift refs to archive paths (2026-07-23)
清理 src/ 注释 + DacliHelp ref 字段里指向 cmd-review/ + drift/Rxx 的 broken 引用, 全部改指到 archive/ 子目录 (随上一轮 cmd-review/drift 整体归档):
A. 8 处 DacliHelp 'ref:' 字段 (改 archive 路径, 保留 AI 溯源):
- src/commands/bigscreen/{list,info,release}.ts → archive/review/v0.14-webapi-rollout-plan.md §2.1
- src/commands/bigscreen/{construct,_validate}.ts → archive/review/v0.13-webapi-form-workflow-refactor.md §8.2.4
- src/commands/msg/templatecreate.ts → archive/cmd-review-2026-07/msg.md
- src/commands/integration/{smstest,webhooktest}.ts → archive/cmd-review-2026-07/integration.md
B. 16 处 anti-patterns.ts 'source: drift/Rxx' (改 archive 路径, 保持源唯一):
- R5/R9/R12/R17/R12-fix-batch1/R12-fix-batch2 → archive/drift-rounds-2026-07/<对应文件>
- BS-新38 / column_drift / F3 / BS-DI-1/2/3 子标签保留
C. 21 处注释里 broken 引用清理:
- 具体路径 (app/{list,info}, datascreen, print/create, regression-2026-06-29) → 改 archive 路径
- 通用引用 ('cmd-review/app.md 已识别' / 'cmd-review 已知 X') → 改 'v3.0+ 评审已识别/已知'
- 孤儿引用 (config.ts v0.15-token-home.md 不存在) → 改 archive/review/regression-2026-06-29.md (实际决策文件)
- 移除 '/cmd-review/xxx' path 引用, 保留描述信息
最终:
- src/ 只剩 3 处 'archive/cmd-review-2026-07/*' 引用 (正确指向 archive)
- tsc --noEmit 未引入新错误 (3 处现有 ts 错都在 tests/unit/, audit-2026-07-23-deep 已记录)
- 下一轮 anti-patterns.md 自动重生成会反映新的 archive 路径
Co-Authored-By: Claude <[email protected]>
|
2026-07-23 15:16:28 +08:00 |
|
ssw
|
7b95ae6d10
|
feat(dacli): v3.0+ webapi 镜像化 (app 命令族, regression audit P0)
新增 webapi 镜像模块 + app 命令 webapi 化 (详见 docs/cmd-review/regression-2026-06-29.md):
**新增 webapi 模块** (2 文件):
- src/webapi/auth.ts: 镜像 web/api/core/auth.ts (loginApi + logoutApi + saasLoginApi + getTenantMobileCode + applySaasApi)
- 6 个便捷包装函数 + AuthApi namespace 类型 + loadWebModule 真 import
- src/webapi/system.ts: 镜像 web/api/system/system.ts (15 函数)
- getSystemList / getAuthSystemList / create / update / getInfo / delSystem
- copySystem / exportSystem / getAppAuth / saveAppAuth / changeAppAuth / getDevUser
- getSystemSelector / getSystemlist / setPin
**重构 app 命令** (3 文件):
- app/list.ts: webapi/system.getSystemList (替代直接 c.get)
- app/info.ts: webapi/system.getInfo (替代直接 c.get)
- app/create.ts: webapi/system.getSystemList + create + saveAppAuth (step 1 + 4)
- step 2/3 保留 c.postJson (ssw-common 特有, web 无等价)
- step 5 保留 JnpfClient.login (有 encryptPassword 加密逻辑)
- 修复历史 TS 错误: installAiHelpHook.source 无 webapi 字段, 用 web 字段
- 修复历史 TS 错误: ClientOptions 无 checkSystem 字段, 用 any cast 透传
**应用隔离价值**:
- 之前缺失能力恢复: copySystem / exportSystem / saveAppAuth / changeAppAuth / setPin
- 与 web 端 schema 漂移风险消除 (复用 web 端类型 + query 参数处理 + 错误响应)
测试: TS 编译干净 + 3 项验证 PASS
- dacli app list 走 webapi 返回 11 个应用 ✓
- dacli app info 走 webapi 返回完整字段 ✓
- dacli apis list --tag=system 走 OR 匹配返回 364 API ✓
留给下个 turn: storage/org/report _validate.ts 补 formValidate + 校验项 (task 25)
|
2026-06-29 16:50:37 +08:00 |
|