ADR-0006 — pmk gateway runs on the host machine; chat surfaces are Slack/LINE bots, not a hosted SaaS
Status
Accepted — 2026-04-27.
Context
After v0.6.0 (case files + auto-tracking), pmk's CLI surface is functionally complete for a single power user. The next gap is reach: how do non-engineering stakeholders, or fellow PMs who never touch a terminal, benefit from pmk-grounded conversations against the host's mra-indexed codebase?
Three options surfaced:
- A. Web app at a public URL (SaaS). Sign up, sign in, chat. Maximum reach.
- B. Localhost web app (
pmk serve). Host runspmk serve, opens browser tolocalhost:8421. Minimum infra; loses cross-machine access without a tunnel. - C. Chat-platform bot. Host runs
pmk gateway; other users interact via Slack / LINE / Teams. The chat platform itself becomes the UI.
Decision
Adopt Option C: pmk gateway runs on the host's machine and bridges to existing chat platforms (Slack first, LINE next). v0.7.0 ships the Slack adapter using Socket Mode.
Concretely:
- pmk gateway is a long-running process started by the host (
pmk gateway start). - It connects out to Slack via Socket Mode, so no public URL or tunnel is required — works behind NAT, on home WiFi, on coffee-shop WiFi.
- All LLM calls go through the host's existing
resolveProvider(Claude Code OAuth by default). - Per-user state lives under
~/.pmk/gateway/slack/users/<userId>/; channel state under~/.pmk/gateway/slack/channels/<channelId>/. - mra integration is unchanged — it works because the gateway runs on the host machine that has the repos.