terraphim / terraphim/terraphim-ai

Phase 4: Nightly extraction -- automated workflow crystallisation via ADF

オープン
#696 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement
主要言語
Rust
スター
62
フォーク
5
平均マージ
2時間 27分
マージ済み PR(30日)
1

説明

Parent Epic

Part of #692 (Operational Skill Store)

Summary

Add a new Core-tier ADF agent that runs nightly to automatically discover and crystallise successful multi-step workflows from session history into reusable procedures. This closes the loop -- instead of manual capture-success, the system learns from its own history.

What Changes

New ADF agent: procedure-crystalliser

Tier: Core (cron-scheduled, runs nightly)
CLI: terraphim-agent (uses sessions + learn subcommands)

Nightly workflow:

  1. terraphim-agent sessions import -- refresh session cache
  2. Scan recent sessions for successful multi-step sequences (exit code 0 chains)
  3. Classify sequences by task type using KG concept matching
  4. Deduplicate against existing procedures (Aho-Corasick)
  5. Store novel sequences as new CapturedProcedure entries
  6. Run learn health across all procedures
  7. Generate daily report: new procedures, degraded procedures, statistics
Orchestrator config addition
[[agents]]
name = "procedure-crystalliser"
tier = "Core"
cli = "terraphim-agent"
schedule = "0 2 * * *"   # 02:00 daily
working_dir = "/home/alex/terraphim-ai"
Session extraction API in terraphim_sessions
pub async fn extract_successful_sequences(
    since: DateTime<Utc>,
    min_steps: usize,
) -> Vec<CommandSequence>;

Affected Crates

  • terraphim_orchestrator (new agent config)
  • terraphim_sessions (extraction API)
  • terraphim_agent (orchestration entry point)

Dependencies

  • Phase 1 (#693) -- CapturedProcedure type
  • Phase 3 (#695) -- health monitoring
  • #637 Paperclip leverage into ADF (orchestrator infrastructure)
  • #639 Session persistence for Claude Code agents
  • #683 Tree-structured session storage

Acceptance Criteria

  • procedure-crystalliser agent defined in orchestrator config
  • Session extraction API returns successful command sequences
  • KG-based task type classification for discovered sequences
  • Aho-Corasick deduplication prevents storing known procedures
  • Daily report generated with new/degraded procedure counts
  • Integration test with sample session data

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Start with the existing structures in terraphim_orchestrator, terraphim_sessions, and terraphim_agent, then trace the sessions and learn subcommands used by the nightly workflow. Implement the procedure-crystalliser configuration, successful-sequence extraction, classification, deduplication, health checks, and daily report, and validate the result with integration tests using sample session data.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
ai, backend, cli
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。