Summary
Signal channel landed (commit 160ab4dd) but isn't wired into the daemon yet. The existing Telegram gateway (src/steering/telegram-gateway.ts) bypasses the entire new security stack — no Casbin, no CapabilitySet, no quarantine processor, just a subprocess pipe. This issue formalizes the channel abstraction and closes both gaps while adding multi-channel support via Vercel Chat SDK.
Current State (Code-Verified, 2026-03-10)
- ✅ Signal adapter implemented (
src/channels/signal/) — not wired into daemon
- ✅ Casbin policy gate, capability resolver, quarantine processor — all implemented
- ✅
ChannelMessage / CapabilitySet types — channel-agnostic
- ❌
IChannelAdapter interface — does not exist (abstraction is implicit)
- ❌
ChannelManager — does not exist
- ❌ Audit log — does not exist (Phase 3 gap from Signal spec)
- ❌ Daemon wiring for any channel — not done
- ❌ Telegram in security stack — still using subprocess bypass in
src/steering/
The Telegram Security Gap
src/steering/telegram-gateway.ts currently:
- Checks
allowed_users[] string array only (no Casbin enforcement)
- Spawns
zora-agent ask as a subprocess — pipes raw CLI output back
- Has no quarantine processor, no action budget, no intent drift, no dry-run
- Predates the channel security layer
This is a security fix disguised as a feature addition.
What This Implements
1. IChannelAdapter interface (src/channels/channel-adapter.ts)
Formalizes the implicit abstraction — start(), stop(), onMessage(), send().
2. ChannelManager (src/channels/channel-manager.ts)
Single pipeline: policy gate → capability resolver → quarantine → orchestrator → audit → response.
Every channel uses this path. No bypass.
3. Append-only Audit Log (src/channels/channel-audit-log.ts)
JSONL at ~/.zora/audit/channel.log. Logs intake decisions, quarantine flags, tool calls, budget events. Never logs message content. Rotate at 10MB.
4. Signal wiring (Phase 3 completion)
Wire SignalIntakeAdapter into daemon.ts via ChannelManager. Add rate limiting (10 tasks/hr/sender). Add TOML config validation on startup.
5. Telegram migration (Phase 2)
Install @chat-adapter/telegram. Implement src/channels/telegram/telegram-adapter.ts → IChannelAdapter. Deprecate src/steering/telegram-gateway.ts.
6. Multi-channel via Vercel Chat SDK (Phases 3-5)
pnpm add chat @chat-adapter/slack @chat-adapter/teams @chat-adapter/discord @chat-adapter/whatsapp @chat-adapter/google-chat
Single webhook server on channels.webhook_port. Each platform adapter translates Chat SDK events → ChannelMessage → ChannelManager.handleMessage().
Implementation Phases
| Phase |
Deliverable |
Acceptance |
| 1 |
Signal wired, audit log, rate limiting |
All 11 Signal integration tests pass |
| 2 |
IChannelAdapter + Telegram migration |
Telegram through Casbin + quarantine; subprocess retired |
| 3 |
WebhookServer + WhatsApp |
WhatsApp works with full policy enforcement |
| 4 |
Slack + Teams |
Both channels operational |
| 5 |
Discord + Google Chat |
All 7 channels, full integration test suite |
New Security Invariants
INVARIANT-8: src/steering/telegram-gateway.ts MUST NOT be used after Phase 2
INVARIANT-9: All channels use ChannelManager.handleMessage() — no bypass path
INVARIANT-10: Webhook server validates platform signatures before processing
Files Changed
New: channel-adapter.ts, channel-manager.ts, channel-audit-log.ts, webhook-server.ts, src/channels/telegram/, src/channels/slack/, src/channels/teams/, src/channels/discord/, src/channels/whatsapp/, src/channels/google-chat/
Modified: daemon.ts, config/defaults.ts, config/loader.ts, signal adapter files
Deprecated: src/steering/telegram-gateway.ts
Full Spec
SPEC-multi-channel-architecture.md (Zora_Sims project)
Related
- Closes Signal Phase 3 gaps (companion to commit
160ab4dd)
- Supersedes
src/steering/telegram-gateway.ts design
- Vercel Chat SDK: https://github.com/vercel/chat (standalone, no Vercel hosting required)
Summary
Signal channel landed (commit
160ab4dd) but isn't wired into the daemon yet. The existing Telegram gateway (src/steering/telegram-gateway.ts) bypasses the entire new security stack — no Casbin, no CapabilitySet, no quarantine processor, just a subprocess pipe. This issue formalizes the channel abstraction and closes both gaps while adding multi-channel support via Vercel Chat SDK.Current State (Code-Verified, 2026-03-10)
src/channels/signal/) — not wired into daemonChannelMessage/CapabilitySettypes — channel-agnosticIChannelAdapterinterface — does not exist (abstraction is implicit)ChannelManager— does not existsrc/steering/The Telegram Security Gap
src/steering/telegram-gateway.tscurrently:allowed_users[]string array only (no Casbin enforcement)zora-agent askas a subprocess — pipes raw CLI output backThis is a security fix disguised as a feature addition.
What This Implements
1.
IChannelAdapterinterface (src/channels/channel-adapter.ts)Formalizes the implicit abstraction —
start(),stop(),onMessage(),send().2.
ChannelManager(src/channels/channel-manager.ts)Single pipeline: policy gate → capability resolver → quarantine → orchestrator → audit → response.
Every channel uses this path. No bypass.
3. Append-only Audit Log (
src/channels/channel-audit-log.ts)JSONL at
~/.zora/audit/channel.log. Logs intake decisions, quarantine flags, tool calls, budget events. Never logs message content. Rotate at 10MB.4. Signal wiring (Phase 3 completion)
Wire
SignalIntakeAdapterintodaemon.tsviaChannelManager. Add rate limiting (10 tasks/hr/sender). Add TOML config validation on startup.5. Telegram migration (Phase 2)
Install
@chat-adapter/telegram. Implementsrc/channels/telegram/telegram-adapter.ts→IChannelAdapter. Deprecatesrc/steering/telegram-gateway.ts.6. Multi-channel via Vercel Chat SDK (Phases 3-5)
pnpm add chat @chat-adapter/slack @chat-adapter/teams @chat-adapter/discord @chat-adapter/whatsapp @chat-adapter/google-chatSingle webhook server on
channels.webhook_port. Each platform adapter translates Chat SDK events →ChannelMessage→ChannelManager.handleMessage().Implementation Phases
New Security Invariants
Files Changed
New:
channel-adapter.ts,channel-manager.ts,channel-audit-log.ts,webhook-server.ts,src/channels/telegram/,src/channels/slack/,src/channels/teams/,src/channels/discord/,src/channels/whatsapp/,src/channels/google-chat/Modified:
daemon.ts,config/defaults.ts,config/loader.ts, signal adapter filesDeprecated:
src/steering/telegram-gateway.tsFull Spec
SPEC-multi-channel-architecture.md(Zora_Sims project)Related
160ab4dd)src/steering/telegram-gateway.tsdesign