Phase 4: Structured activity log for ADF

未关闭
#641 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
30/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
rust

调研方向

Start with the proposed terraphim_orchestrator/activity.rs module and review the Paperclip activity log references at packages/db/src/schema/activity_log.ts and server/src/services/activity.ts. Trace existing telemetry.jsonl writes before defining the structured event integration. Done means orchestrator mutations emit consistent append-only activity.jsonl events, existing telemetry remains compatible, and the adf activity CLI command can tail or query recent events.

由索引模型根据 Issue 内容生成。

描述

enhancement

Parent Epic

#637

Summary

Extend telemetry JSONL with structured activity events for all orchestrator mutations and agent lifecycle events.

Changes Required

terraphim_orchestrator
  • New activity.rs module with ActivityEvent enum and JSONL writer
  • Events to log:
    • ConfigChanged {before_hash, after_hash, changed_keys}
    • BudgetWarning {agent, spent_cents, budget_cents, percentage}
    • BudgetPaused {agent, spent_cents, budget_cents}
    • AgentDriftDetected {agent, score, level, action_taken}
    • AgentRestarted {agent, reason, restart_count, session_resumed}
    • CompoundReviewCompleted {findings_count, pr_created, duration}
    • ApprovalRequested {id, type, agent}
    • ApprovalDecided {id, decision, actor}
  • Schema: {timestamp, event_type, agent_name, details: {}, actor: "system"|"human"|agent_name}
  • Write to activity.jsonl in logs directory
Integration
  • Replace ad-hoc telemetry.jsonl writes with structured ActivityEvent emissions
  • Activity log is append-only, rotatable by external logrotate

Reference

  • Paperclip activity log: packages/db/src/schema/activity_log.ts
  • Paperclip activity service: server/src/services/activity.ts

Acceptance Criteria

  • All orchestrator mutations emit structured activity events
  • Events written to activity.jsonl with consistent schema
  • Events include timestamp, event_type, agent_name, details
  • Backward compatible with existing telemetry (can coexist)
  • adf activity CLI command to tail/query recent events
主要语言
Rust
星标
62
派生
5
平均合并
2 小时 27 分钟
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

terraphim/terraphim-ai 的其他 Issue

查看 terraphim/terraphim-ai 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。