Session Log、Surface 与多种投影

Session Log、Surface 与多种投影 由 Archify 生成的数据流图。 01 / 运行时事件 02 / 事实源 03 / 选择与存储 04 / 派生视图 05 / 消费者 SessionEvent · message / chunk / tool · 01 / 运行时事件 · 有序追加 SessionEvent message / chunk / tool 有序追加 Session Log · 发生过什么 · 02 / 事实源 · source of truth Session Log 发生过什么 source of truth SurfaceManager · append / replace · 03 / 选择与存储 · 模型可见选择 SurfaceManager append / replace 模型可见选择 Persistence · JSONL / SQLite · 03 / 选择与存储 · flush + checkpoint Persistence JSONL / SQLite flush + checkpoint Telemetry · 事件与 trace · 03 / 选择与存储 · OpenTelemetry Telemetry 事件与 trace OpenTelemetry deriveMessages() · 从 Surface 派生模型历史 · 04 / 派生视图 deriveMessages() 从 Surface 派生模型历史 Projection · 消息、Todo、工具树、统计 · 04 / 派生视图 Projection 消息、Todo、工具树、统计 LLM Context · user / assistant / tool · 05 / 消费者 LLM Context user / assistant / tool UI 与 Replay · 历史、chunk、审计 · 05 / 消费者 UI 与 Replay 历史、chunk、审计 可观测性后端 · 日志、指标、追踪 · 05 / 消费者 可观测性后端 日志、指标、追踪 append(event) durable surfaceOp append / replace 事件 + flush lossless 异步事件 async 当前可见节点 model-visible 顺序回放 derived state 模型消息 prompt 不可变快照 render model spans / metrics operations 图例 主要数据 异步批处理 数据存储 数据流

三种真相

  • • Durable log 保存发生过什么
  • • Surface 决定模型当前能看到什么
  • • UI 与统计是可丢弃、可重建的投影

Compaction

  • • 压缩只替换 Surface 节点
  • • 原始日志仍保留,用于回放与审计