feat(P3): DI 点事件统一走 tracer 事件流;直接移除 LLM 诊断通道 - #62
Merged
Conversation
All 95 logDITrace sites now publish dix.emitDIEvent point events (Operation=di) into the tracer stream; console (DIX_TRACE_DI) and the diag file become subscribers attached per tracer, keeping the output contract (di_trace <event> messages, kind:trace/error JSONL records). The dedicated LLM channel is removed outright per spec: DIX_LLM_DIAG_MODE env, the stderr DIX_LLM_DIAG line, emitDiagFileLLMRecord and the kind:llm record type. error_type/root_cause/hint structured fields stay on every export (stderr slog attrs, JSONL, /api/errors) — LLMs read the human logs fine; what matters is that the data is present. Also fixes GetFnName-free console sink ordering (kvArgs sorts keys) and drops the duplicate io/os/json imports that lost their users.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
概要
按 spec §5 实施 P3(计划:
docs/superpowers/plans/2026-09-04-p3-instrumentation-unification.md):dixinternal/di_event.go新增emitDIEvent——95 处logDITrace埋点全部改为向 tracer 事件流发布Event{Operation:"di", Event:<名>, Attrs}(私有 tracer 或全局,EmitTo路由)。consoleDISink(DIX_TRACE_DI 逐条 gating,输出di_trace <event>,key 排序保证属性顺序稳定)+diagTraceSink(写 kind:trace JSONL 记录);全局 tracer 由 init 挂载,WithTraceBuffer私有 tracer 在创建时挂载。logDITrace函数删除。DIX_LLM_DIAG_MODEenv、machine-only 丢弃人类日志的分支、emitLLMDiagnosticLine的 stderrDIX_LLM_DIAG行、diagkind:llm记录类型与llm_diag_mode元数据、example/http 重复的 env 解析。error_type/root_cause/hint结构化字段在 stderr slog 行、JSONL、/api/errors全部保留——数据在,LLM 就能读。锁测试口径(全部保持)
TestDITraceLogsInInjectFlow/TestDITraceLogsInProvideFlow:di_trace <event>子串断言原样通过TestDiagFileConfiguredCollectsTraceErrorAndLLM→ 改写为TestDiagFileConfiguredCollectsTraceAndError(trace+error 必须存在、"kind":"llm"必须不存在)TestShouldTraceDependencyFlow等原样验证
-race6 包 + example 19 包全绿;task lint0 issues