Repository navigation
feat(logging): 接入 litheLogging 1 结构化诊断 - #5
Merged
Merged
Conversation
- Rust SDK 改为仓库内 vendor 副本(基线 lithe-plugin-docs 29b245c 加本轮日志改动), scripts/verify-sdk-source.mjs 按逐文件 SHA-256 校验;package.py 打包前校验, UPSTREAM.json 内嵌来源记录 - NOTICE 与 README 修正 SDK 许可证为 Apache-2.0,并改为指向来源记录 - requests.parse 与 response.previewInfo 的成功不再记 INFO;响应预览被截断时 每个后端只报一次 WARN(preview_truncated) - 启动失败不再向 stderr 打印,改为以退出码结束 - 协议测试协商 litheLogging、收集 lithe/log 帧并断言隐私与空 stderr; Core 测试断言成功终态 INFO - e2e 改为显式 --source/--ref,CI 指向宿主 preview
This was referenced Nov 4, 2026
SDK 在 initialize 时要求宿主提供 litheLogging 1,UI 测试客户端只提供了 litheFunctions,导致后端拒绝初始化、CI 失败。与 test_protocol.py 保持一致。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
HTTP Client 插件后端接入结构化日志 v2:改用支持
litheLogging1 的官方 Rust SDK,由 SDK 自动上报执行、打开、保存等调用的成功/失败终态;请求解析和预览能力探测不再产生 INFO;响应预览被截断时只报一次降级。诊断事实不含 URL、请求/响应正文、头部、环境变量、凭据或文件内容。顺带修正 NOTICE 和 README 里写错的 SDK 许可证(MIT → Apache-2.0)。依赖:
litheLogging协议与目录事件)SDK 来源:从 git rev 改为 vendor 源码快照
Cargo.toml的lithe-plugin-sdk从 gitrev = e689971…改为path = "vendor/lithe-plugin-sdk";Cargo.lock只删除了对应的 git source 行。vendor/lithe-plugin-sdk/(Apache-2.0)。基线是 lithe-plugin-docs29b245c0e1d77c761d9032a3144a301d1818bfc7,加上 SDK PR #17 的日志改动;source-provenance.json记录基线、本地改动和逐文件 SHA-256。scripts/verify-sdk-source.mjs,CI 新增对应步骤;scripts/package.py打包前先校验,安装包UPSTREAM.json的lithePluginSdk由固定 revision 改为内嵌整份来源记录。NOTICE:SDK 许可证从 MIT 更正为 Apache-2.0,revision 改为指向来源记录;README 的同一处说明同步修改。诊断行为(
src/main.rs)requests.parse、response.previewInfo;失败照常 ERROR。degraded("requests.execute", "preview_truncated"),每个后端生命周期只报一次,重复截断保持静默。main改为不返回Result:Tokio 运行时或后端准备在listen之前失败时直接以退出码结束,不再经过 Rust 的Termination把错误打印到 stderr,由宿主进程生命周期记录。测试
scripts/test_protocol.py:模拟宿主在 initialize 中提供litheLogging: {"versions":[1]}并断言插件回答 version 1;收集lithe/log帧,断言截断只报一条preview_truncated降级(带operationId),诊断里不出现 URL 和响应正文,stderr 保持为空;普通执行恰好一条operationFinished。scripts/test_core.py(通过 C ABI 驱动真实 Core,需要手动传--core):断言requests.execute恰好一条 INFO 终态,通道为plugins/<id>/host,带耗时;requests.parse不产生成功事实。src/files.rs:对应的函数注册调整。验证
cargo fmt --check、cargo clippy --locked -- -D warnings、cargo build --release --locked、node scripts/verify-sdk-source.mjs通过;python3 scripts/test_protocol.py --binary target/release/lithe-http-client12/12 通过。test_core.py连接本地宿主分支的 Core,通道、级别、op、耗时和隐私检查通过。CI 状态与合并顺序
litheLogging1,必须等宿主 #1699 进入可发布版本后才能发布本插件,否则在旧宿主上 initialize 会失败。限制
配套 PR: