Skip to content

step: chat-scan — surface recent messages from a configured chat channel #53

Description

@hartsock

Summary

A chat-scan step type that queries a chat platform for recent messages in a set of configured channels and includes a structured summary in the routine report.

Motivation

Team awareness is a common morning-routine need: what happened in the support channel overnight, are there any unresolved escalations, did a key decision land in the team channel. Without a native step this requires either a bespoke script or wiring the full chat platform into a custom step. A generic chat-scan step with a pluggable transport covers the pattern once.

Proposed design

Step type: chat-scan

Config shape:

[[routines.morning.steps]]
name     = "team channel"
type     = "chat-scan"
platform = "slack"            # slack | msteams | discord (transport)
channels = ["#support", "#team-main"]
look_back_h = 24              # hours of history to fetch
max_results = 20
env      = { CHAT_TOKEN = { file = "~/.keys/chat-token" } }

Data contract (data field):

{
  "schema": "chat-scan/1",
  "channels": [
    {
      "name":          "#support",
      "message_count": 12,
      "unresolved":    3,
      "latest_ts":     "ISO 8601",
      "messages": [
        { "ts": "ISO 8601", "author": "string", "text": "string", "thread_count": 0 }
      ]
    }
  ]
}

Behavior:

  • Auth failure or unreachable platform: skipped = true — routine continues.
  • Each channel is fetched independently; one channel failing does not skip others.
  • All network I/O through agent-bridle net Caveats axis.
  • output field contains a human-readable summary (counts + flagged threads); data carries the full payload.

Transport model

Platforms differ enough that each transport is a feature-gated sub-module:

  • slack transport: Slack Web API conversations.history
  • msteams transport: MS Graph chats/messages (future)
  • discord transport: Discord REST API (future)

The platform key selects the transport; unavailable platforms produce a compile-time feature-gate error with a clear message.

Alternatives considered

  • script wrapper per channel: works today but produces opaque text and doesn't compose.
  • harness calling a chat CLI: viable; mcp-client could cover CLI-wrapped chat MCP servers, but a native step enables structured output without a separate CLI dependency.

Acceptance criteria

  • chat-scan step type in modulex-core (or a plugin crate)
  • slack transport behind a feature flag
  • Per-channel soft-failure
  • data schema pinned with golden file test
  • modulex doctor reports platform reachability and token validity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions