W22: coverage metric + network tests + Tool stream feedback + stdin pipe + session path + dependency check (W22.1-W22.6)
Some checks failed
CI / Determine matrix (push) Has been cancelled
CI / ${{ matrix.os }} / ${{ matrix.build_type }} (push) Has been cancelled
CI / Sanitizer (ASan+UBSan) / ubuntu-24.04 (push) Has been cancelled
CI / Coverage (gcovr) / ubuntu-24.04 (push) Has been cancelled

- W22.1: gcovr 覆盖率度量 + CI coverage job(40% 阈值 warning)
- W22.2: network_plugin 单元测试(parse_headers_json/extract_host_port/SSE/异常保护)
- W22.3: Tool Calling 流式反馈(chat_stream + "[工具调用]/[工具结果]" 状态行)
- W22.4: --prompt stdin pipe(--prompt - 从 stdin 读取)
- W22.5: session 路径健壮化(static 缓存 + mkdir + fallback)
- W22.6: 插件依赖拓扑静态校验(validate_dependencies 循环/缺失检测)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 21:21:24 +08:00
parent b2b381b9b3
commit df3bf298ee
13 changed files with 753 additions and 23 deletions

View File

@@ -48,6 +48,9 @@ performance_log:
- date: 2026-05-27
event: "W19.3 (协作 王测): plugin_loader 5 条发现修复验证。代码审查确认F-18.3-1 5 个 ABI 调用点仅 initialize_all/initialize_pending 有 try/catch2/5load_plugin/unload_plugin/shutdown_all 仍缺保护F-18.3-2 load_plugin 5 个失败路径全静默返回 -1F-18.3-3 路径仅 null 检查无约束F-18.3-4 fprintf 未替换为 host->logF-18.3-5 next_id_ 非原子。5 条全部未修复,不予关单。编译 0 error + ctest 5/5 pass。"
rating: A
- date: 2026-05-27
event: "W22.6 完成plugin_loader 新增 validate_dependencies() —— 遍历所有已加载插件 deps[] 做缺失依赖检测 + 循环依赖检测topological_sort 异常捕获),返回 0/-1。initialize_all() 头部调用,失败时 WARN log 继续初始化不 crash。plugin_loader.hpp:54-55 声明plugin_loader.cpp:309-345 实现initialize_all L352-356 集成。cmake --build build --config Release 0 errorctest 8/8 pass"
rating: A
current_groups:
- grp-quality-core (成员)
- grp-ai-plugins (待命)

View File

@@ -128,5 +128,18 @@ performance_log:
验证: cmake --list-presets 4 个全部解析通过Release 构建 cmake --build build --config Release
8/8 0 errorctest 6/6 pass。
rating: done
- date: 2026-05-27
event: "W22.1: 测试覆盖率度量 + CI 门禁"
detail: >
CMakePresets.json: 新增 ci-coverage configure/build/test preset (Ninja, clang-18,
--coverage flag + CMAKE_EXE/SHARED_LINKER_FLAGS, binaryDir build/ci-coverage)。
ci.yml: 新增 coverage job (Linux clang-18, gcovr, 无 ccache)
构建→ctest→gcovr --gcov-executable "llvm-cov-18 gcov" 生成行覆盖率并输出到 GITHUB_STEP_SUMMARY
阈值 40%,低于标 :warning: 不阻塞。
tests/CMakeLists.txt: 新增 coverage custom target (gcovr HTML + 终端摘要,
llvm-cov gcov 兼容)。
验证: cmake --list-presets 全 5 个解析通过Release 构建为预存 main.cpp 问题阻塞,
ctest 8/8 pass (9th dstalk-network-plugin-test Not Run 因二进制未编译)。
rating: done
current_groups: []
---

View File

@@ -92,5 +92,14 @@ performance_log:
std::vector<ToolCallAccum> tool_calls 字段。流结束后序列化为 OpenAI tool_calls JSON
写入 result.tool_calls_json。未改动 dstalk_services.h vtable 签名。
构建: cmake --build --target plugin-deepseek 0 error; ctest 5/5 pass (test #6 预存不相关)。
- date: 2026-05-27
event: "W22.4: --prompt stdin pipe 打通 -- --prompt 无参数或参数为 - 时从 stdin 读取"
rating: completed
details: |
main.cpp L409-418: 拆分 --prompt 检测为 3 分支:非 - 文本直接赋值;
参数为 - 则跳过并设 prompt_arg=- (stdin sentinel); 无参数则 prompt_arg=-。
L532-552: --prompt 分支新增 stdin 读取prompt_arg=- 时 fgets 循环读 stdin
空输入则 empty prompt 报错退出。pipe_mode 分支已覆盖 echo|dstalk --prompt -。
构建: cmake --build Release 0 error; ctest 8/8 pass。
current_groups: []
---

View File

@@ -60,3 +60,6 @@ current_groups:
- date: 2026-05-27
event: "W21.3: 实现 --prompt 批处理模式 — 新增 --prompt \"...\" 命令行参数解析L403-409保护 --prompt 后无值/值为空/值以 - 开头三种边界;设置 batch_mode 复用现有非交互基础设施banner 抑制);新增 prompt_arg 代码块L521-548执行非交互路径初始化→发送单条消息→输出 stdout→退出退出码 EXIT_OK(0)/EXIT_FATAL(2)/EXIT_CONFIG(3) 统一使用;编译 dstalk-cli 0 error 0 warningctest 6/6 100% pass"
rating: A
- date: 2026-05-27
event: "W22.3: Tool Calling 流式反馈 — chat替换为chat_stream(L686),工具执行前后打印[工具调用]/[工具结果]状态行(L657/L660/L671),移除无用tools_json,5轮上限不变;build 0 error+ctest 8/8 100% pass"
rating: A

View File

@@ -75,5 +75,13 @@ performance_log:
fallback 也失败时 DSTALK_LOG_ERROR但不崩溃。
编译 0 errorctest 8/8 pass。
rating: done
- date: 2026-05-27
event: "W22.5 - get_default_session_path() 加 mkdir 保障 + 静态缓存"
detail: |
get_default_session_path() 改为 static 缓存lambda 立即求值C++11 线程安全静态初始化)。
计算路径后 std::filesystem::create_directories 确保目录存在。
mkdir 失败时 g_host->log(WARN) + 返回 "./session.json" fallback。
编译 0 error 0 warningctest 8/8 pass。
rating: completed
current_groups: []
---