DSHarness 系统拆解 固定基线 47f943859b · 36 已复核 / 0 撰写中 / 36 章
English
可靠性与产品面·第 28 章

可观测、Telemetry 与轨迹

事件日志、投影、脱敏、OTel 和 UI trajectory 的分工

已复核上游 47f943859b范围: 分析 session telemetry capture/redaction/handoff、OTel logs、stats、trace query、raw events 与运行日志。

结论:可观测性是四个协同平面,不是一条万能 Trace 流

DeepSeek Harness 没有把 OpenTelemetry、浏览器或运维日志中的任何一个当作事实源。持久、只追加的 Session 日志掌管交互事实;best-effort telemetry seam 把选定副本交给 OTel Logs 管线;host 与浏览器代码为人构建分页投影;本地 logger 则保留既不该进入模型 transcript、也不该泄露给不可信调用者的运维失败。session-query 的“trace”是建立在第一个平面上的第五种视图:它查询确定性的事件关系与 session 谱系,不是分布式 span tracing。

这种分离是本章的核心结论。即使 export 被禁用,重放与检查仍然成立;exporter 故障不会进入 agent loop;隐私策略也能落在外发副本边界。但代价是这里不存在单一、无损的可观测性数据流:ledger 在语义上最完整,却留在本地且高度敏感;telemetry 便于外部分析,但 capture handoff 只维护无持久 ack/outbox 的高水位 cursor,下游 SDK 仍可 retry,因此端到端既非无损也非 exactly-once;浏览器只持有已加载窗口加 host 投影;本地诊断可能包含其他所有表面都没有的 stack。

1. 信号所有权地图

平面基本单元权威范围丢失/可见性边界
Canonical Session ledger连续的原始 SessionEvent重放、模型可见历史、生命周期结果完整 payload 可能仅在本地,并可能含 secret
Session telemetry + OTelLedger 副本或运维记录外部上报与 collector 侧分析Best effort、依赖脱敏、capture-side 高水位 handoff;SDK 可 retry
Host/浏览器投影历史页、投影值、trajectory record人工检查与全日志汇总原始历史是窗口化的;派生值可独立降级
本地运维 loggerWarning/完整诊断插件、持久化、查询与投影健康不是可重放的 session 事实,也未必外发
Session-query trace谱系或事件关系结果基于 canonical log 的精确关系可选模型工具另加 workspace 授权与错误净化
推论

运维人员必须按 identity 与 sequence 关联这些平面,而不能要求一条流回答所有问题。“对话发生了什么?”从 ledger 开始;“export 是否失败?”从本地诊断开始;“什么离开了机器?”则从 sharing mode、redaction 与 OTel queue 开始。

2. Canonical ledger 是交互事实,也是最大的隐私表面

Session event map 明确定义为只追加、无损 JSON,sequence number 连续。它保留 turn/step 边界、原始 stream chunk、组装后的 message、原始工具参数、工具结果与私有展示 metadata、todo、request header、context marker,以及插件扩展事件。持久的 turn/end reason 区分 completed、aborted、blocked、结构化 error、max-token 与 crash repair 产生的 interrupted。OBS-SESSION-LOG

request/header 不是一个轻量 correlation header。它可携带有效模型配置、完整渲染后的 system prompt,以及含 schema 的完整工具目录;Agent 会在 dispatch 前按需追加 initial、resume 或 change snapshot。OBS-REQUEST-HEADER

权衡

记录足以重建模型可见状态的数据,带来了很强的重放与取证能力,也让本地日志成为高价值敏感资产。“Telemetry disabled”只表示没有 OTel export;它不表示 canonical log 中不存在消息、prompt、工具 payload 或本地路径。

3. Capture 把 ledger 事实转换成一份小型外发契约

canonical Session event
        │ structuredClone(event.data)
        ▼
SessionTelemetryRecord
  channel: ledger | ops
  time + severity
  最小 identity attributes
  完整 structured body
        │ synchronous redaction waterfall
        ▼
backend.emit()  ── 仅 enqueue ──→ exporter-owned queue

Ledger record 保留事件时间与完整克隆的 event.data,attribute 只重复 session/event identity 与可选谱系事实。运维 record 没有 event sequence,因此不会被误认作 ledger row。sink 契约要求 emit() 是同步、非阻塞的 enqueue;handoff 之后的 batching、retry、queue bound 与 loss 都归 backend SDK 所有。OBS-TELEMETRY-CONTRACT

Capture 只做一项固定的高频降采样:每个 (turn, step) 仅外发第一条 assistant/chunk,用作 stream-started 信号。之后的 assistant/message 承载字节完整的组装内容。其他事件类型都按完整 body 通过。OBS-TELEMETRY-PROJECTION

推论

这是带一项明确高频缩减的事件镜像,不是传统 span model。Collector 可按 (session.id, event.seq) 重建有序 ledger record,却不会收到每个 token delta 对应的 chunk record。

4. Redaction 同步、可组合、逐条 fail-closed——但默认不存在

session-telemetry/record 是作用于外发副本的同步 waterfall。规则围绕 next() 组合;规则可替换下层数据,抛错规则则扣留当前记录,同时 capture containment 保护 agent loop。Live 模式在 append 时执行规则;feedback-gated 模式在 feedback 触发时,对 handoff cursor 之后(无 cursor 时从 firstLiveSeq 起)到该 feedback 的 canonical suffix 执行当下规则。Canonical ledger 永远不会被重写。OBS-TELEMETRY-REDACTION

事实

测试分别钉住四个性质:没有 listener 时 secret 原样通过;一条规则可同时清洗 ledger 与 ops record;多个 listener 会叠加;抛错规则只压下自己的 candidate。测试还证明,外发副本已清洗后,canonical log 仍保留原始 secret。OBS-TEST-REDACTION

5. Handoff cursor 表示“已交给 backend”,不表示“collector 已收到”

Module-scope 的 WeakMap<Session, seq> 会在 Session 对象仍存活时跨 telemetry fiber reload 保留。adoption 时 coordinator 从 cursor 之后重放;没有 cursor 时从 firstLiveSeq 开始,因此恢复后的进程不会回填上一进程 export 失败的记录。Cursor 仅在 backend.emit() 返回后推进,其文档明确说它标记 handed-off,而非 delivered。OBS-TELEMETRY-HANDOFF

权衡

emit() 只确认一次 enqueue。之后的 queue overflow、exporter retry 耗尽或进程退出,都可能丢失已经推进 cursor 的记录。更微妙的是,若记录 N 抛错而 N+1 成功,高水位 cursor 会越过 N;hot reload 不会重试这个洞。这是 capture-side 的 at-most-once 高水位姿态;downstream SDK retry 是另一层,不能据此声称端到端 at-most-once 或 exactly-once。

事实

回归测试证明 coordinator reload 后保留 cursor、不重放已经 handoff 的事件,并证明中间事件被拒绝不会阻止后续事件继续交付。测试也覆盖 first-chunk-only 投影与非阻塞 flush hint。OBS-TEST-HANDOFF

6. 三种 sharing mode 把 consent 放在不同 commit point

模式捕获时刻释放内容运维记录
FULL每次 live append立即交付每条 projected、redacted eventagent-errorshutdown
FEEDBACK_ONLYCanonical feedback/recordhandoff cursor 之后(无 cursor 时从 firstLiveSeq 起)至该精确事件的 canonical suffixOn-demand capture 不产生 ops
DISABLED永不什么都不释放;不构建 SDK pipeline无;只有本地 feedback warning

Backend 先校验 mode,再配置 transport。FEEDBACK_ONLY 只在 emitted object 正是已提交在 session.events[event.seq] 的事件时接受 consent;外形相同的 bus value 会被忽略。随后它读取并清洗 handoff cursor 之后(无 cursor 时从 firstLiveSeq 起)至 feedback sequence 的 canonical suffix。DISABLED 既不创建 coordinator,也不创建 provider/processor/exporter state。OBS-TELEMETRY-MODESOBS-TEST-OTEL-MODES

/feedback producer 只记录一条 log-only event,不启动模型工作。acknowledgement 会区分 full、feedback-gated、disabled 与 unconfigured sharing,并且只宣告 entry 已记录——append 不会同步 flush 到磁盘。OBS-FEEDBACK-DISCLOSURE

权衡

Feedback-gated sharing 不是“只发送我的 feedback 文本”。它可能释放当前 lifecycle 内,无 cursor 时从 firstLiveSeq 起、有 cursor 时从其后起,并被当前 redaction policy 保留下来的全部 eligible content;resume/fork 的 constructor seed 不会在该进程重发。之后的事件仍留在本地,直到下一条 feedback。

7. 随包默认关闭;CLI 对已知 telemetry row 提供最终 export opt-out

Base bundle 会挂载 OTel plugin,但 mode 缺省时解析为 DISABLED。显式选择 FULLFEEDBACK_ONLY 后,会使用 OTLP/HTTP logs endpoint、gzip、10 秒 batch cadence、2,048 的 queue 与 batch size、1 秒 exporter timeout、1.5 秒 processor export timeout,以及 3 秒外层 shutdown deadline。Bundle 没有挂载 redaction listener。OBS-BASE-DEFAULTOBS-TEST-OTEL-COMPOSITION

apps/cli 的 profile composition 中,只要 DSH_TELEMETRY_DISABLED 非空——包括 0false——就会在常规 composition layer 之后对固定 id session-telemetry-otel 追加 disabling patch。若 composition 中没有该 id 的 row,launcher 不生成 patch;只有在它也未通过其他 row id/backend 挂载 telemetry 时,opt-out 才是自然满足。OBS-HARD-OPTOUT

推论

这套叠层策略偏向隐私:上传需要明确的正向 mode;含糊但非空的 kill switch 一律解析为关闭。仍应检查 effective configuration,因为 custom profile 可以选择不同 backend、endpoint、queue 或 redaction rule。

8. 当前“OTel”指 structured logs,不是 span 或 meter

实现构建 LoggerProvider → BatchLogRecordProcessor → OTLPLogExporter,分别创建 ledger 与 ops instrumentation scope,把 record time 映射到两个 OTel timestamp,把三级 severity 映射到 INFO/WARN/ERROR,并原样转发 body 与 attributes。Resource 包含产品 name/version 与一个 best-effort 持久化的匿名 user.idOBS-OTEL-PIPELINE

该 user id 是存放在 Harness home 下的随机 UUID:持久化成功并收敛后,后续进程会复用同一值;首次并发存在一个窄的 create-to-write 竞态,可能让该次运行产生两个进程 ID;home 不可写时则只保证当前进程内稳定。删除文件会在下次启动重置。它不从 hostname、IP address 或 Git metadata 派生。OBS-ANON-ID

事实

在固定 commit 上,telemetry package 的 OTel 依赖为通用 API、Logs API/SDK、resources、OTLP exporter base 与 OTLP log exporter,不含 trace 或 metrics SDK;实现只构建上一段所述 Logs pipeline。OBS-OTEL-DEPENDENCIESWire test 通过真实 OTel SDK pipeline 向本地 scripted node:http mock collector 发送 OTLP/HTTP JSON,并验证 service.nameuser.id、ledger/ops scope、source timestamp、severity、session.cwd/event attributes 与 shutdown marker。OBS-TEST-OTEL-WIRE

漂移守卫

不能因为 package 名称或 OTel 一词就推导“已支持 distributed traces”。若未来出现 trace/metrics SDK dependency、provider construction、span context propagation 或新 exporter,必须重新审计这一结论。

9. Batching 与 shutdown 改善尾部交付,但不构成 delivery guarantee

Backend 有意不实现逐 turn 的 flush();正常 export cadence 归 batch processor。dispose 时,live session 先 enqueue 一条 shutdown ops marker,再由 coordinator 等待 backend shutdown。Backend 将 provider.shutdown() 与自己的 deadline 竞速,因为 SDK transport force-flush 可能超出 processor export timeout。Deadline 到期会拒绝等待,却无法取消底层 transport;coordinator containment 允许应用 teardown 继续。OBS-OTEL-SHUTDOWN

时刻可以宣称不能宣称
backend.emit() 返回SDK 接受了一次同步 enqueue 尝试Collector 已存储记录
Scheduled batch export 成功该 SDK batch 完成了 export callback进程此前所有记录都无 gap
Provider shutdown resolveSDK 报告已静止远端 retention/query system 健康
外层 deadline 到期Teardown 不再被阻塞Pending record 能在进程退出后存活

10. Ledger 的 failure semantics 比外发 ops channel 更丰富

Capture 只把三类情况标成 error severity:自身 block 带 isError=true 的 tool result、reason 为 errorturn/end,以及 live agent-error。其他 core 与 plugin event 默认 info;因此 aborted turn、max-token stop 与 clean shutdown 不会仅因运维人员关心就自动成为 ERROR record。OBS-TELEMETRY-SEVERITY

持久 ledger 保留结构化 turn-end reason 与 tool-result error identity。另一路中,throwError() 在重新抛出前带 turn/step 发出 live agent/error;driver 随后 containment 已上报的失败。Telemetry 把任意 error 归一成 name 与 message,去掉 stack,并把坐标写入 ops attributes。OBS-DURABLE-FAILURE

推论

Severity 是保守的 capture default,不是完整 incident policy。若 collector alert 关心 abort 频率、max-token 饱和、缺失 closer、retry 或插件自定义 outcome,就必须检查 event type/body,而不能只筛 severity=ERROR

11. Live UI error 与本地日志暴露不同的故障细节

Host API contract 将 host/agent-error 定义为没有 turn position 的 live failure 唯一出口;其 frame shape 只有 session id 与 message,没有 turn/step。它属于 host stream,而非持久 Session event,所以断线浏览器可能错过。OBS-HOST-FAILURE

本地 warning 覆盖有意不进入 ledger 的失败:telemetry capture exception 与 backend shutdown failure;OBS-OPS-LOGS事件仍被保留在 buffer 中的 background persistence write failure;OBS-PERSISTENCE-DIAGNOSTIC以及让 session.listsubagent.history 降级而非阻断响应的 projection computation failure。OBS-PROJECTION-DEGRADEOBS-SESSION-LIST-PROJECTIONOBS-SUBAGENT-HISTORY-PROJECTION普通 session.history 的 projection 计算不在这两个 fail-soft catch 内。OBS-SESSION-HISTORY-PROJECTIONSession-query 会尽力在本地记录可打印的完整 stack/cause chain;不可打印值使用固定 placeholder,然后再把错误翻译给模型调用者。OBS-QUERY-DIAGNOSTIC

权衡

这避免用基础设施噪声污染 transcript,也避免通过产品 API 泄露 stack。代价是 postmortem 同时需要 durable log 与 process log。Transcript 干净不能证明 telemetry、projection、indexing 或 persistence background work 健康。

12. Session stats 是确定性的全日志 read model

sessionStats 投影报告:至少含一个 closed step 的 distinct turn、closed step、模型 wall time、matched tool wall time、TTFT 总和与样本数,以及 decode duration/tokens。其契约明确声明,这些值从完整 durable log fold,与 client 已加载多少历史无关。OBS-STATS-CONTRACT

Pure fold 在 step/start 打开 timing,在第一条非空 token delta 捕获 TTFT,在 assistant/message 结束 model/decode timing;按 callId 配对 tool call/result;在 step/end 计数;在 turn/end 清除未完成 call;负的 clock difference 被 clamp 到零。它还防守 provider usage 与 inherited object key,而不是盲信 event payload。OBS-STATS-FOLD

浏览器优先使用 host projection;当 sessionStats projection value 不可用时,才退化为可见窗口 fold。它展示 turn/step count、model/tool duration、平均 TTFT、decode token/s、cache hit ratio 与 token total;token billing 来自另一个独立 projection。OBS-STATS-UI

13. Stats 测量 recorded event interval,不是 provider billing 或 OTel metrics

指标记录定义重要排除/偏差
Turns/stepsstep/end 的 distinct turn;所有 closed stepRejected 或 empty turn 不计
Model timestep/start → assistant/message包含 step 内 retry wait;cancelled partial step 不计时
TTFTstep/start → 第一条非空 token delta第一 token 会跨 step 内 retry 保留
Decode rateProvider output token 除以 first-token → message durationusage 缺失/无效时不形成 token-rate sample
Tool time每个 matched call/result interval并行 interval 求和;未完成 call 排除
事实

Projection test 覆盖 closed、rejected、cancelled、max-token、retry、tool pair、invalid usage、clock skew、late mount 与 reload。OBS-TEST-STATS分页历史浏览器测试证明 tail page 已携带 whole-log total,加载更早事件不会改变这些值。OBS-TEST-STATS-PAGING

权衡

这些数字是可复现的产品 telemetry,但不是 OTel instrument、exclusive CPU time、纯网络延迟或账单事实。并行 tool duration 总和可以大于 wall-clock elapsed time;retry wait 也按设计留在 model interval 中。

14. 浏览器分页与修复 gap 时,raw history 仍保持连续

History API 按 append-origin message boundary 分页,因此不会把一条消息与其 chunk/tool event 截开。每项都包含 raw event 与可选 host-computed tool view。只有 tail page 带 in-flight partial 与 projection baseline;读取历史永远不会 resume 或 publish Agent。OBS-HISTORY-API

Client 只会 prepend 末尾 sequence 与当前 base 恰好相邻的页面;不连续的 older page 会写入 console 并被 fail-soft 丢弃。Live duplicate 按 sequence 去重。向前 gap 会把 incoming event 放入 buffer、重新拉取 tail page,再把 buffer 拼接成连续 raw window。loadOlder/gap-repair 抛出的 transport exception 也会写入 console,而 RPC error result 静默保留当前窗口。OBS-HISTORY-CLIENT

Live mux frame 直接携带原始 session/event。Projection update 明确定义为 transient,并可由 replay 重算;allowlist 中的 remote event 则可在该路径上不经 projection 或 redaction 原样转发。OBS-RAW-FRAMES

推论

浏览器 continuity 是已加载 slice 的一致性性质,不证明浏览器持有完整日志。Whole-log answer 应来自 host projection 或 exact query service;trajectory/search 对 UI window 的计数必须标注为 window-scoped。

15. Trajectory 是浏览器 event ledger,不是 OTel trace pipeline

Trajectory package 明确提供一个 turn-aware、virtualized 的浏览器 ledger,含 timeline、search、folding、local inspector 与 older-page loading。Selection、request total 与 navigation 只覆盖当前 loaded window;in-flight duration 留空而不伪造。它不提供 service,也不向模型请求贡献任何内容。OBS-TRAJECTORY-CONTRACT

Builder 按 raw sequence 排序 definition contribution,组装 finalized record、request、call schema、partial assistant output、running call、compaction boundary 与 turn error。这是共享 Session window 上的 target-specific read model;它既不改变 canonical log,也不把 chat view 当作权威输入。OBS-TRAJECTORY-BUILDER

权衡

Trajectory 优化的是本地取证理解——chronology、prompt change、tool causality 与 timing——而非远程 correlation。产品语义上称它为“trace view”可以理解,但它没有 trace/span id、parent span context、sampling policy 或 exporter semantics。

16. Prompt inspection 很强,也让浏览器访问成为隐私模型的一部分

Trajectory 消费每个 request/header,重建模型配置、完整 system text 与 tool schema,再与上一个 prompt snapshot 对比,计算 initial/system/tools change record。因此 inspector 能精确解释某次 request 使用了哪份 prompt 或工具目录。OBS-TRAJECTORY-PROMPT

推论

正是让 trajectory 适合分析 prompt drift 的完整性,也让“安全的 observability UI”成为产品安全问题,而不仅是渲染问题。

17. Session-query 的“trace”指确定性谱系与事件关系

统一 query service 把 exact read、filter、surface 与 trace 定义为 backend-independent;只有 full-text search 委托给 indexing backend。完整读取选择 live-preferred source,重放校验 raw log,并返回 detached clone。OBS-QUERY-SERVICE

traceEvent 标识 target 的 current/shadowed/log-only surface class、positional replacement chain、被替换 event、引用的 source event,以及之后直接从 target 派生的 event。traceSession 遍历 parent ancestry 与有序 descendant;遇到 unresolved parent 会明确报告,遇到 cycle 则拒绝,而不是编造完整 tree。OBS-QUERY-TRACE

单目标 exact load(如 readSessionreadEventtraceEvent)若 target 已知 live,会直接从内存读取而不查询 persistence,因此 backend failure 不会遮蔽这类当前历史读取;需要枚举完整 corpus 的 traceSession/list/filter 不享有这一保证。Persisted exact target 先 list、再 inspect;若 inspect 后仍 detached,才检查 loaded/listed header compatibility;若期间变成 live,则跳过 detached compatibility branch,由 live snapshot 胜出。OBS-QUERY-CORPUS

术语事实

这些 API 不蕴含 distributed tracing。输入是 session id 与 event sequence number,输出是从日志推导的关系;它们不会启动 span,也不会传播 trace context。

18. 模型侧历史访问是 opt-in、workspace-scoped,并在 observation 后重新授权

一个可选 plugin 注册五个工具:session search、event search、session lineage trace、event relationship trace 与 exact event read。随包 host composition 默认不挂载。Exact read 可返回完整、不删节的 target JSON;若要限制过大的 inline result,需要通用 spill policy,而不是本 package。OBS-QUERY-TOOLS

Caller identity 只来自执行中的 Agent。Self-read 允许;cross-session read 要求 cwd 精确相等;caller 没有 cwd 时只能查看自己。Direct target 在 service call 前授权,并在返回后对 observed header 再检查一次,限制 source-change/TOCTOU 逃逸。未授权 descendant subtree 变成不含隐藏 id 的 null boundary marker。OBS-QUERY-AUTH

当前 session 的 event search 截止在 active step/start 之前,因此 invoking output 与 tool call 不能搜索自己。OBS-QUERY-CURRENT-BOUNDARYService failure 会尽力在本地记录完整 diagnostic(不可打印时使用固定 placeholder),再经过统一 sanitizer,向模型只暴露稳定、安全的 code/message;caller cancellation 与精确 local authorization error 会被保留。OBS-QUERY-SANITIZE

权衡

按原始字符串比较 cwd 很保守,却不等价于 canonical filesystem identity:symlink-equivalent workspace 不共享权限,而刻意以同一字符串创建的所有 session 都共享。部署策略仍需决定是否应让模型看到这五个强力 read tool。

19. 隐私边界矩阵

数据Canonical log/浏览器无自定义规则的 FULL exportFEEDBACK_ONLY(无 cursor 时从 firstLiveSeq 起;否则从 cursor 后起)结构性缺席
User/assistant content完整完整捕获副本eligible suffix,截至 feedback
Tool argument/result、command output、file content记录时完整完整捕获副本eligible suffix,截至 feedback
System prompt 与 tool schema完整 request-header snapshot完整捕获副本eligible suffix,截至 feedback
Todo、compaction、hook summary、feedback完整 event data完整捕获副本eligible suffix,截至 feedback
本地 cwd 与 lineage idHeader/event contextAttribute/resource correlation已释放 record
Adapter API credential不是 Session event此路径中缺席此路径中缺席是,源于当前结构
Error stackTurn 保留 flattened/structured failure facts,不含完整 stackLedger 保留这些 turn failure facts;ops 仅 name/message;两者均无完整 stackEligible suffix 可含 turn failure facts;不产生 ops capture完整 stack 可能只留在本地日志

Backend README 枚举了上传模式下离开机器的完整数据类别,并明确说明 seam 不附带 redaction rule。API key 缺席,是因为 adapter credential 是 constructor input,不是 Session event;并不是因为系统会自动检测 prompt、file、command 或 tool result 中的任意 secret。OBS-PRIVACY-BOUNDARY

推论

持久化并收敛后的 anonymous UUID 是 pseudonymous correlation,不是 unlinkability。它避免从机器/网络 metadata 派生 identity,但该稳定值仍允许聚合同一 Harness home 下的多次运行。

20. 与 Codex 的公开契约比较:两者都默认关闭 OTel 日志外发,但可观测产品不同

维度固定源码下的 DeepSeek Harness仅限 Codex 公开文档
默认值Session telemetry mode 为 DISABLEDOTel 日志外发默认关闭;需将 [otel].exporter 显式设为 otlp-httpotlp-grpc;匿名 usage/health metrics 是独立通道,默认开启
Log modelCanonical session event 的近似镜像,加两种 ops record面向 conversation、API/SSE/WebSocket activity、prompt、tool decision 与 tool result 的专用事件
Prompt privacy无内置 redactor;deployment 提供 waterfall rule除非 log_user_prompt=true,否则 user prompt content 默认脱敏
信号类型审阅实现只有 OTLP Logs pipeline文档列出 log、metrics 与 trace exporter 配置;counter/histogram 覆盖 API、stream、WebSocket 与 tool call
ShutdownSDK shutdown 与 Harness-owned 外层 deadline 竞速文档称 exporter 异步 batch,并在 shutdown 时 flush
产品侧 trace另有从日志派生的 session/event relationship query不从公开 OTel 配置推断同等能力
公开事实

Codex 的 Observability and telemetry 文档描述了 opt-in OTel log export、默认清洗 user prompt、代表性 structured event、metrics、batching 与 shutdown flushing;其 configuration reference 暴露独立的 log、metrics 与 trace exporter setting(检索于 2026-08-13)。

21. 漂移观察项与开放运维问题

观察项结论可能改变的原因需要重新验证
OTel signal 扩展可能新增 trace/meter SDKProvider、exporter、span context、metric instrument、resource attribute
默认 sharing postureBundle 或 launcher composition 可能改变Effective mode、最终 opt-out 顺序、endpoint、header
Redaction baseline可能新增内置或 bundle-mounted ruleRule order、fail behavior、ledger/browser scope、test fixture
Delivery semanticsAcknowledged queue 或 persisted outbox 可能替换 handoff cursorAck point、retry identity、gap recovery、shutdown durability
Stats semantics新 event 或 timing anchor 可能改变 totalRetry/cancel/parallel-tool math 与 paging stability
History authorizationWorkspace identity 可能超越 raw cwd equalityCanonicalization、tenant/project identity、TOCTOU check
开放缺口

Source test 可以证明 mapping、containment、mode gate 与本地 batching behavior,却不能证明生产 collector 的 authentication、TLS policy、retention、deletion、access control、alert rule、持续 outage 下的 queue saturation behavior,或运维人员是否真的把 ledger gap 与 process log 关联起来。这些属于部署证据,不是 repository fact。

22. 本章验证范围

所有仓库结论均针对固定 upstream commit 47f943859bef60e4160492346772ded9b24f765a。聚焦验证覆盖 telemetry capture/redaction/handoff、OTel wire mapping 与 mode composition、whole-log stats、session-query tracing 与模型工具授权、浏览器 trajectory assembly,以及分页历史行为。

14 个聚焦 unit/source 文件  → 361 passed
1 个真实 Loader E2E 文件    →   3 passed
总计                        → 15 文件 / 364 passed
结构一致性                  → 23 sections / 45 evidence records,顺序完全相等

Built-web 分页历史 E2E 已作为证据检查,但没有执行:本隔离任务禁止 build,固定 checkout 也没有 web dist artifact。已执行的 364 个测试证明固定 revision 上的仓库行为;它们不能替代 live collector integration audit、真实部署 redaction rule 的隐私评审、long-outage queue test,或 retention/access-control verification。

我的学习体会

内容仅自动保存到当前浏览器,不上传、不进入仓库。你可以导出 Markdown 自行归档。