Repository navigation
feat(logging): 事件目录与日志说明对齐 Viva 桌面端 - #46
Merged
Merged
Conversation
- 新增 terminal.session.start_failed(终端会话启动失败,WARN)、 vcs.provider.skipped(两个插件提供同一版本控制系统时未被选用的一方,WARN)、 app.background.operation_failed(窗口自行运行的后台工作失败并降级,WARN), 让桌面端不再把后台降级记成用户可见失败的 ERROR。 - 删除 90 个只为旧 macOS 客户端声明、Viva 桌面端和 Core 都不再使用的宿主事件; 保留 app.shell.environment、editor.sync.freeze、run.process.execution 三个 span 事件, 是否在 Viva 采用另行决定。 - 批量编码的失败结果带上输入序号 index,宿主据此知道去重后被拒的是哪一条。 - 测试、contract fixture 和文档里引用已删除事件的地方改用仍在目录里的事件。
- app.startup.leftovers_resolved:启动时上次会话留下的进程按策略或对话框处理完成,记录 结束、保留的数量和 decided_by。 - editor.recovery.applied:未保存草稿恢复进文档,conflict 表示磁盘文件在草稿之后变过。 - app.action.performed 的 surface 列表增加 drag_drop,桌面端拖放打开、移动和终端拖入路径 不再记成 menu。
- 恢复 app.storage.maintenance_failed:桌面端插件安装清理下载或暂存包失败时记录 - README 与 rust-core-api.md 去掉 Swift/MacLogStore 描述,改写为 desktop/internal/logstore 的 合批写入、唤醒回调、诊断开关、引擎事实转发和插件 logDir 规则 - 写明 debugAdapter/start 各阶段与构建命令式来源的宿主代记规则 - 用法门禁 verify-log-usage.mjs 不在仓库中,恢复由 Lithe-IDEA#1802 跟踪
xiaoyumuxi
marked this pull request as ready for review
November 14, 2026 17:45
1 task done
31 of 34 tasks
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.
关联
桌面端日志审计 1lck/Lithe-IDEA#1927:Viva 桌面端(Go)接入统一日志时,事件目录还停留在旧 macOS 客户端的状态,缺少桌面端实际记录的事件,留着 90 个已经没有宿主使用的事件;日志说明也仍按 Swift/MacLogStore 描述宿主。本 PR 让目录和说明与桌面端一致。桌面端改动在配套 PR 1lck/Lithe-IDEA#1945,它先固定在本 PR 的 commit,本 PR 合入后改为 main 上的 commit。
改动
事件目录(
rust/logging/events/*.json,catalog_generated.rs由生成器重新生成):terminal.session.start_failed(终端会话启动失败,WARN)、vcs.provider.skipped(两个插件提供同一版本控制系统时未被选用的一方,WARN)、app.background.operation_failed(窗口自己运行的后台工作失败并降级,WARN,字段与app.notification.operation_failed相同)。桌面端据此不再把后台降级记成用户可见失败的 ERROR。app.startup.leftovers_resolved:启动时上次会话留下的进程按策略或对话框处理完成,记录结束和保留的数量以及decided_by。editor.recovery.applied:未保存草稿恢复进文档,conflict表示磁盘文件在草稿之后改过。app.storage.maintenance_failed:桌面端插件安装清理下载包或暂存包失败时记录。app.action.performed的surface增加drag_drop:拖放打开、移动和拖入终端的路径不再记成menu。app.shell.environment、editor.sync.freeze、run.process.execution三个 span 事件保留,桌面端是否采用由 [Feature] 桌面端记录 span 事件:登录环境读取和运行进程接入,删除旧编辑器同步冻结事件 1lck/Lithe-IDEA#1944 决定。编码:
diagnostics.encodeLogBatch的失败结果带上输入序号index,宿主据此知道去重后被拒的是哪一条(record.rs、catalog.rs、core_events.rs)。rust/fixtures/diagnostics/logging-v2.json和文档里引用已删除事件的地方改用仍在目录里的事件。文档:
rust/logging/README.md:宿主改为 Viva 桌面端desktop/internal/logstore。宿主不传通道,由 Core 按模板推导;字段表写宿主传入的磁盘键和 JSON 值;写入器只经diagnostics.encodeLogBatch(validateCatalog: true)编码;app.action.performed与 op、origin { source, trigger, operation }的关系;写入器的唤醒回调、诊断开关和合批排空;引擎事实转发(event、catalogLevel、fields);插件${logDir};桌面端的目录一致性测试TestEveryLoggedEventIsAcceptedByTheKernel;示例改为 Go。用法门禁verify-log-usage.mjs不在仓库中,恢复由 [Feature] 恢复 Viva 日志事件类型生成和目录使用门禁 1lck/Lithe-IDEA#1802 跟踪。rust/contracts/rust-core-api.md:operationId语法说明(不含$,因为它同时作为记录的op);debugAdapter/start宿主代记的各阶段(resolve、launch、timeout、exit、initialize、finished,用户停止和 Core 拒绝不记录);构建命令式来源的代记规则(plan、resolve、launch、exit、decode、timeout,关闭项目取消不记录,provider 请求由插件自己记录);把 MacLogStore 一段改写为桌面宿主的写入器、唤醒回调、诊断开关、引擎事实转发和插件日志目录规则。不涉及插件契约、能力版本或插件函数协议,所以不需要更新协议记录。
验证
node scripts/logging/generate-log-events.mjs --check:通过,127 个事件。cargo test --workspace:全部通过(2015 个)。cargo fmt --all -- --check、cargo clippy -p lithe-diagnostics --all-targets -- -D warnings:通过。node shared/plugins/scripts/verify-docs.mjs:通过。LITHE_CORE_RUST_DIR指向本分支:TestEveryLoggedEventIsAcceptedByTheKernel按本目录校验全部调用点通过,scripts/desktop/desktop-go.sh test -race ./...全部通过。