v0.14.0 — SlackAdapter tranche 4 + post-v0.13.3 docs/prompt polish
Why
Closes out the v0.13 SlackAdapter decomposition arc started in v0.13.0 (tranches 1–3: presence / envelope-dedup / concurrency / escalation / free-chat-turn / inflight-queue). After tranche 3 the adapter shell sat at 1043 lines — over the <800 dispatcher-cleanup target set during v0.13 planning. Tranche 4 ships two more focused coordinators and folds in two small post-v0.13.3 backlog items that surfaced while sweeping for release.
Fixed / Refactored
slack/index.ts1043 → 734 lines (closes the <800 target). Adapter shell now == lifecycle (start / waitForPending / stop) + event-routing glue (handleMessage / handleAppMention / handleDmMessage / handleReactionAdded / handleSlashCommandEnvelope) + the ambient Slack-event types. Behavior unchanged; 412 / 412 tests still pass.slack/slash-command.ts(new, 215 lines) —SlashCommandHandlerowns/pmk <verb>dispatch (help/open/show/close/cases/admin). Pure-helperslashCommandArgsFromBodyandSlashCommandScope/SlashCommandArgstypes move with it;slack/index.tsre-exports them so existing test imports (gateway.test.ts) keep working. Envelope-level glue (ack / dedup / blocklist / error logging) deliberately stays onSlackAdapter.handleSlashCommandEnvelope— those concerns are shared with every other Slack event type.slack/channel-mention.ts(new, 180 lines) —ChannelMentionHandlerowns channelapp_mentionrouting (slash forward / free-chat / case-mode LLM round + tracking summary).SlashCommandHandlerandFreeChatTurnRunnerinjected via constructor so the dependency graph stays explicit.#1 channels-override docs catch-up— README quick-start andlifecycle.mddeep-dive were missing theset-channel/unset-channeladmin surface even though the feature shipped in v0.11.0 (#23) with full CLI + Slack admin coverage and 9 tests. Three small doc patches catch them up; resolution order at turn time now documented inline (per-user → per-channel → workspace default).#3 PM/BIZ ad-tech reframe— BIZ jargon table (AdFormat/placement/inventory) and PM example table (vCPMformula,placement_id,PlacementRevenuevsAccountPayable) were lifted from real OneAD-like dogfood. Both tiers now lead the relevant block with a workspace-context meta-rule: "the examples below are from an ad-tech reference workspace; apply the same translation discipline to your domain's terms — do not citeAdFormat/placementliterally when they don't appear in the workspace." Workspace-configurable domain examples (cfg.audience.domainExamples) deferred to v0.14 backlog.
Tests
@pmk/cli 362 → 362 (unchanged — refactor preserves behavior). @pmk/shared 24 → 24 including the "audience prompts have distinct bodies (cross-wire regression)" test which still passes after the BIZ + PM meta-rule additions.
Live-Slack verify
Verified end-to-end on a real Slack workspace before tagging:
- DM
/pmk help→handleDmMessage→slashCommand.run({scope: user})— bot reply matchescase "help"text exactly. - Channel
@pmk /pmk help→handleAppMention→channelMention.run→ slash forward →slashCommand.run({scope: channel})— bot reply matchescase "help"text exactly. Confirms ChannelMentionHandler's/pmkforwarding branch. - Channel
@pmk <free-chat>→channelMention.run(no slash prefix, no activeCase) →freeChatTurn.run— bot answered per prompt;turn.processedevent emitted (audience: tech,hadMraAsk: false). - BIZ-tier reframe (temporarily removed user override to hit workspace default
biz) — asked a non-ad-tech permission-control question; bot returned a 3-layer structural answer applying the cheat-sheet translations (role→ 角色,scope→ 歸屬關係 二次過濾) with zero ad-tech leak (AdFormat/placement/inventorynever appear). Workspace-specific OneAD subsystem names (ODM/OAM/SuperDSP) DID appear because they are real workspace context, which is exactly what the reframe wants — meta-rule blocks unprompted cheat-sheet jargon insertion, not legitimate context references.
Operator note
This is a refactor + prompt + docs release. No config migration needed. The gateway picks up new code on next graceful restart:
git pull && npm run -w @pmk/cli build
kill -TERM $(cat ~/.pmk/gateway/gateway.pid) && pmk gateway startBacklog (deferred to v0.14.x)
- Workspace-configurable domain examples —
cfg.audience.domainExamplescarrying per-workspace translation pairs + example questions, injected into BIZ/PM prompts at assembly time. Enables ad-tech workspaces to keep concreteAdFormat/placementanchors while non-ad-tech workspaces get their own domain vocabulary. Punted from v0.14.0 because the current single-workspace dogfood doesn't justify the new config surface + admin commands yet.