ticket: split plugin runtime redesign

This commit is contained in:
2026-06-25 04:56:03 +09:00
parent 79df31ccf6
commit 577bf75051
27 changed files with 543 additions and 17 deletions
@@ -0,0 +1,21 @@
{
"version": 1,
"relations": [
{
"ticket_id": "00001KVXK0WE4",
"kind": "depends_on",
"target": "00001KVXK0WDQ",
"note": "WebSocket frames are delivered through the service ingress queue.",
"author": "yoi ticket",
"at": "2026-06-24T19:55:30Z"
},
{
"ticket_id": "00001KVXK0WE4",
"kind": "depends_on",
"target": "00001KVXK0WDX",
"note": "WebSocket sends are executed through output commands.",
"author": "yoi ticket",
"at": "2026-06-24T19:55:30Z"
}
]
}
+46
View File
@@ -0,0 +1,46 @@
---
title: 'Add host-owned WebSocket driver for Plugin services'
state: 'ready'
created_at: '2026-06-24T19:51:56Z'
updated_at: '2026-06-24T19:55:30Z'
assignee: null
---
## 背景
Current `host_api.websocket` is a pull primitive: Plugin code must explicitly call `recv(timeout)` while an exported function is running. That is insufficient for Discord Gateway / Slack Socket Mode style long-lived integrations. Service Plugins need Host-owned WebSocket connections whose incoming frames are queued as ingress events and whose outgoing sends are requested through output commands.
This Ticket adds the WebSocket-specific event source and command executor on top of the Service ingress queue and output command model.
## 要件
- Host-owned WebSocket connection driver を追加する。
- Plugin manifest / grant で WebSocket subscription / target authority を表現できる。
- Host が connect / reader task / close / error detection を管理する。
- Incoming text frame を Plugin ingress event に変換し、service ingress queue に enqueue する。
- Close / error / reconnect-needed も ingress event または status diagnostic として扱う。
- Plugin からの WebSocket send は output command として受け取り、grant check 後に Host が送信する。
- v0 で扱う frame kind を明確にする。
- text frame required。
- binary / ping / pong / close の扱いを diagnostic / unsupported / control handling として定義する。
- Connection status、last frame time、last error、queue drops、send failures を diagnostics に出す。
- Existing `recv(timeout)` pull API は long-lived integration の recommended path にしない。
## Non-goals
- Discord protocol implementation。
- Full reconnect / resume policy の完成。
- Secret store / auth injection の全面設計。
- Binary frame application payload support。
- Browser-facing WebSocket API。
## 受け入れ条件
- Host-owned WebSocket driver が Service Plugin に紐づく connection を管理できる。
- Incoming text frame が Plugin ingress queue に event として入る。
- Plugin output command から WebSocket text send が実行される。
- Ungranted send / unauthorized target は fail closed で diagnostic になる。
- Connection close / error が service status diagnostics に反映される。
- Existing pull `recv(timeout)` API が docs/templates の recommended service integration path から外れている。
- WebSocket driver / ingress / send command の tests が追加されている。
- `cargo test -p pod``cargo check -p yoi``git diff --check``nix build .#yoi --no-link` が通る。
+24
View File
@@ -0,0 +1,24 @@
<!-- event: create author: "yoi ticket" at: 2026-06-24T19:51:56Z -->
## 作成
LocalTicketBackend によって作成されました。
---
<!-- event: intake_summary author: hare at: 2026-06-24T19:55:30Z -->
## Intake summary
Marked ready by `yoi ticket state`.
---
<!-- event: state_changed author: "yoi ticket" at: 2026-06-24T19:55:30Z from: planning to: ready reason: cli_state field: state -->
## State changed
Marked ready by `yoi ticket state`.
---