W23: close mailroom metadata and network validation tests
Some checks failed
Some checks failed
- Refresh agents STATUS to W22.6 and exclude mailroom from metadata scans - Add mailroom dispatch checklist and defensive rules - Register F-23.D-1 and tag network input validation defense-in-depth - Update network plugin tests for header length limits - Fix LSP test metadata and remove orphan anthropic_internal.hpp Verification: - cmake --build build --config Release: 0 error, 0 warning - ctest --test-dir build --output-on-failure: 10/10 passed - ctest --test-dir build -R dstalk_smoke_test --output-on-failure: passed - python scripts/check_agents_metadata.py --strict: passed Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -213,7 +213,7 @@ target_link_libraries(dstalk_network_plugin_test
|
||||
add_test(NAME dstalk_network_plugin_test COMMAND dstalk_network_plugin_test)
|
||||
|
||||
# ============================================================
|
||||
# dstalk_lsp_plugin_test — LSP 插件单元测试 (GoogleTest, 新增)
|
||||
# dstalk_lsp_plugin_test — LSP 插件单元测试 (hand-rolled CHECK, 新增)
|
||||
# 覆盖: lsp_trim / lsp_frame_message / lsp_parse_content_length
|
||||
# ============================================================
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
// - lsp_trim: 字符串 trim 逻辑
|
||||
// - lsp_frame_message: Content-Length header 构建
|
||||
// - lsp_parse_content_length: Content-Length header 解析
|
||||
// 说明: 本测试仅覆盖纯函数路径;不覆盖 reader_loop 并发、进程生命周期或
|
||||
// Server->Client Request 集成路径,这些需由 smoke/集成测试覆盖。
|
||||
// ============================================================================
|
||||
|
||||
#include "lsp_internal.hpp"
|
||||
|
||||
@@ -205,15 +205,15 @@ int main()
|
||||
std::string long_key(1000, 'K');
|
||||
std::string json = "{\"" + long_key + "\":\"v\"}";
|
||||
auto h = parse_headers_json(json.c_str());
|
||||
CHECK(h.size() == 1, "T4.3: 1000-char key, size=1");
|
||||
CHECK(h[long_key] == "v", "T4.4: long key lookup works");
|
||||
CHECK(h.empty(), "T4.3: 1000-char key rejected by MAX_HEADER_KEY_LENGTH");
|
||||
CHECK(h.find(long_key) == h.end(), "T4.4: overlong key not inserted");
|
||||
}
|
||||
{
|
||||
std::string huge(10000, 'Z');
|
||||
std::string json = "{\"huge\":\"" + huge + "\"}";
|
||||
auto h = parse_headers_json(json.c_str());
|
||||
CHECK(h.size() == 1, "T4.5: 10000-char value parsed");
|
||||
CHECK(h["huge"].size() == 10000, "T4.6: size preserved");
|
||||
CHECK(h.size() == 1, "T4.5: overlong value key parsed");
|
||||
CHECK(h["huge"].size() == 8192, "T4.6: value truncated at MAX_HEADER_VALUE_LENGTH");
|
||||
}
|
||||
{
|
||||
auto h = parse_headers_json("{\"\":\"value\"}");
|
||||
|
||||
Reference in New Issue
Block a user