Skip to content

feat(server): Slack mentor entry points (App Home, slash command, CTA) #1257

@FelixTJDietrich

Description

@FelixTJDietrich

Part of #1204.

What ships

Three Slack-side entry points into a mentor DM thread, all routing through the same SlackChannelAdapter from #1256 and the same orchestrator the web mentor uses:

All three entry points require the user to have a linked Slack identity (identity_link row with provider=SLACK, team_id=<team>, external_id=<slack_user_id> from #1238). Unlinked users see the nag flow from #1263 instead.

Why

A single, predictable entry surface is what makes the Slack mentor land. Three entries cover the three muscle memories: power users hit a slash command, light users open App Home, and the resume state catches anyone who lost their DM thread.

Acceptance criteria

  • App Home "Open mentor" CTA renders for linked users; clicking it opens a DM via conversations.open and triggers the orchestrator with surface=SLACK_DM
  • /hephaestus mentor is registered on the per-workspace Slack app; invocation in any channel returns an ephemeral 200 within 3 s and the DM thread arrives within 5 s
  • An in-flight SLACK_DM mentor_session for the viewing user renders a resume card on App Home with the session's last summary; clicking deep-links the DM thread
  • Unlinked users invoking any of the three entries trigger the nag flow from feat(server): identity-link nag flow with cap and stop button #1263 (a one-time linkage DM + the workspace daily-cap-counted reminder), never a mentor turn
  • An integration test installs the Slack app for two workspaces, opens App Home as a linked user in each, and asserts the DMs route to independent Bolt App instances (no cross-workspace leakage)
  • All three entry paths honor the kill switch from feat(server): DM safety rails for proactive mentor sends #1259; with the switch off, the slash command returns "Mentor temporarily unavailable" and the App Home CTA is hidden

Tests to write

  • SlackMentorEntryPointsIT — three test scenarios, one per entry, asserting the DM is opened and the orchestrator is triggered with the right surface.
  • A test for the unlinked-user → nag-flow path (composes with feat(server): identity-link nag flow with cap and stop button #1263).
  • A kill-switch-off test for the slash command response surface.

Implementation notes

  • The slash command's 3-second response budget is non-negotiable; the handler returns the ephemeral 200 immediately and the DM open is enqueued. The same pattern Slack OAuth install uses in feat(server): Slack OAuth install flow with Bolt InstallationService #1243.
  • App Home rendering is per-view; the App Home tab from feat(server): Slack App Home tab as primary onboarding surface #1248 is the host, and this sub-issue adds the mentor card to it. The card's data fetch reads mentor_session directly via the SPI, not via a webapp endpoint.
  • The resume card surfaces the session's last summary field (already populated by the orchestrator on each turn boundary). No new schema.
  • Slash command argument parsing is out of scope; /hephaestus mentor is the only sub-command this epic ships. Future sub-commands extend the same router.

Dependencies

Depends on #1256. Depends on #1242. Depends on #1244. Depends on #1248. Depends on #1238. Blocks #1258.

Metadata

Metadata

Assignees

No one assigned

    Labels

    application-serverSpring Boot server: APIs, business logic, databasefeatureNew feature or enhancementpriority:highAddress this sprint - Significant impact

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions