コンテンツにスキップ

ターンパイプライン

companion turn を実行する AsteronIris surface は、同じ turn contract に合流します。これは言うのは簡単ですが、維持するのは高コストです。そして continuity claim の mechanical backbone でもあります。Discord text は product として検証済みの channel です。他 channel と operator surfaces は turn を作成または replay するときに contract を再利用しますが、すべてが同じ成熟度の product surface ではありません。

[Accepted turn: Discord / CLI / gateway / operator surface]
Pickup / ingress policy
Turn enrichment
affect detection → memory recall → persona context
Response assembly + tool loop
Pre-send verification
Reply delivery
Post-turn update
relationship memory · persona drift · continuity cues

transport-facing path は src/runtime/services/companion_turn.rs にあります。pre/post-turn enrichment は src/core/agent/turn_enrichment.rs が所有します。tool loop は every tool call を固定の middleware chain に通します。

SecurityMiddleware → TaintMiddleware → AuditMiddleware → EntityRateLimitMiddleware

project が unification の maintenance cost を払う理由は三つあります。

  • continuity が surface ごとに静かに分岐してはいけない。 Discord-side enrichment と CLI-side enrichment が drift すると、companion は話す場所によって別 entity になります。runtime はその failure mode を防ぐためにあります。
  • verification は choke point であり decoration ではない。 pre-send verification は skippable であってはいけません。second pipeline は、それを実行し忘れる second chance です。
  • behavior が reproducible になる。 same accepted turn は origin に関係なく same code を通ります。これにより eval、replay、incident triage が可能になります。そうでなければ surface ごとに別の debugging surface になります。

すべての inbound event が turn になるわけではありません。enrichment の前に走る pickup / ingress policy が次を判断します。

  • この message は companion に向けられているか、それとも ambient chatter か
  • companion はこの channel で最近すでに十分話していないか
  • room は public、private、thread のどれで、それによって companion が保つべき距離は変わるか

この判断は memory recall と persona context の前に置かれています。every inbound event に enrichment を走らせる companion は budget を燃やし、eager で boundary-less に見えます。pickup gate は performance constraint であると同時に character constraint です。

Tool loop は subroutine であり product ではない

Section titled “Tool loop は subroutine であり product ではない”

mid-turn に tool call が必要な場合、tool loop は response assembly の内部で回ります。governed、audited、rate-limited、taint-tracked です。これは user から見た turn の shape には漏れません。tool call がある turn もない turn も、same pre-send verifier と same post-turn update を通って出ます。

これは意図的です。「今は agent、今は chat」と visible に mode switch する companion は二つの personality を持っているように見えます。AsteronIris は一つです。