Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

feat(kora): KR-FEAT-SLACK-DM ST3 — Slack app runbook - #123

Merged
rafe-walker merged 1 commit into
feature/phase2-upgradesfrom
feat/kora-KR-FEAT-SLACK-DM-ST3
May 22, 2026
Merged

feat(kora): KR-FEAT-SLACK-DM ST3 — Slack app runbook#123
rafe-walker merged 1 commit into
feature/phase2-upgradesfrom
feat/kora-KR-FEAT-SLACK-DM-ST3

Conversation

@rafe-walker

Copy link
Copy Markdown
Owner

Summary

Final ST of Feature 5. Pure docs; closes the KR-FEAT-SLACK-DM arc. Operator-facing checklist from "no Slack app" to "Joshua DMs Kora's bot and gets an echo reply."

Bucket spec: `kora_docs/17_cc_bucket_prompts/KR-FEAT-SLACK-DM_kora_joshua_dm.md`.

Base: `feature/phase2-upgrades` — NOT main.

Single deliverable

`kora_docs/15_status_and_roadmap/slack_app_setup_runbook.md` (405 lines)

Sections

  1. Slack app creation — two paths:
    • Path A: Manual UI walkthrough
    • Path B: Paste-ready app manifest YAML (recommended) with all OAuth scopes (`chat:write` / `im:history` / `im:read` / `im:write`) + bot_events (`message.im`) + event_subscriptions request_url placeholder
  2. Install to workspace — OAuth consent + xoxb-... token grab
  3. Signing secret grab — Basic Information path + security framing
  4. Doppler secrets — three envs into `kora-runtime-gateways`; `flyctl secrets import` + `shred` pattern; calls out the `KORA_SLACK_JOSHUA_USER_ID` fail-CLOSED behavior
  5. Smoke test — DM → echo within 5s; operator-side log lines + JSONL round-trip schema (received + ok pair)
  6. Troubleshooting matrix — diagnoses + fixes for:
    • URL-verification "Failed" (4 modes: signing-secret mismatch / daemon down / TLS cert / timestamp skew)
    • No reply received (7 modes, each tied to a specific `[kora.slack_dm.*]` log line for self-diagnosis)
    • Reply content wrong/truncated (echo-format-locked framing)
    • Reply in wrong thread (thread_ts fallback explained)
  7. §4 Q4 — Dual signing-secret env transition note: legacy `gateway/platforms/slack.py` (`SLACK_SIGNING_SECRET`) vs new daemon listener (`KORA_SLACK_SIGNING_SECRET`); operator sets BOTH to same value during transition; rotates BOTH together; post-KR-2 cleanup path documented
  8. Promotion to production — same sequence with `-c prd`; Joshua-decides-when gate
  9. Operator obligations — monitor reply_failed rate, PAUSED-state communication, rotation cadence, JSONL rotation (operator-managed via logrotate / Fly log-tailing)
  10. What's NOT in this feature — deferred to KR-FEAT-AI-RESPONSE-LOOP / KR-MCP-SEND-TOOLS / etc.
  11. Cross-references — wires the runbook to all 4 prior PRs' code paths + the two existing roadmap docs + the R2 amendment

§5 ship checklist

  • Base `feature/phase2-upgrades`
  • Title format `feat(kora): KR-FEAT-SLACK-DM STn — `
  • No code changes (pure docs)
  • App manifest YAML paste-ready into Slack's import flow
  • §4 Q4 dual signing-secret note covered
  • Cross-references woven so operator can navigate without re-grepping

Test plan

  • Joshua reads end-to-end before walking the actual Slack app setup
  • Path B (manifest paste) verified: Slack accepts the YAML + shows Verified ✓ on Request URL
  • Echo round-trip verified: DM "ping" → "Kora received: ping" within 5s
  • At least one troubleshooting path validated by intentionally tripping it (e.g. unset `KORA_SLACK_JOSHUA_USER_ID` + verify the expected log line + fail-CLOSED drop)

Feature 5 closes

After this PR merges, the KR-FEAT-SLACK-DM 3-ST cascade is complete:

Joshua can DM Kora and get echo replies once the operator walks the runbook through staging + prod. The AI-driven response generation that replaces the echo is the deferred `KR-FEAT-AI-RESPONSE-LOOP` follow-on; the Slack-DM scaffold is the stable interface that follow-on consumes.

Next bucket candidates (PM's call)

  • KR-FEAT-AI-RESPONSE-LOOP — replace ST2's echo with LLM-driven response generation
  • KR-MCP-SEND-TOOLS — expose `kora__send_slack_dm` + `kora__send_email` via `/mcp` for agent-driven sends

🤖 Generated with Claude Code

Final ST of Feature 5. Pure docs; closes the KR-FEAT-SLACK-DM arc.
Operator-facing checklist from "no Slack app" to "Joshua DMs Kora's
bot and gets an echo reply."

## Single deliverable

`kora_docs/15_status_and_roadmap/slack_app_setup_runbook.md`
(405 lines)

## Sections

1. **Slack app creation** — two paths:
   - Path A: Manual UI walkthrough (Create New App → From scratch)
   - Path B: **Paste-ready app manifest YAML** (recommended) with
     all OAuth scopes (chat:write / im:history / im:read /
     im:write) + bot_events (message.im) + display_information +
     event_subscriptions request_url placeholder

2. **Install to workspace + bot token grab** — covers OAuth
   consent flow + where to find the xoxb-... token

3. **Signing secret grab** — Basic Information → App Credentials
   path with security framing

4. **Doppler secrets setup** — three envs (KORA_SLACK_SIGNING_SECRET,
   KORA_SLACK_BOT_TOKEN, KORA_SLACK_JOSHUA_USER_ID) into
   `kora-runtime-gateways` project; flyctl secrets import + shred
   cleanup pattern from the first-deploy runbook. Calls out the
   KORA_SLACK_JOSHUA_USER_ID fail-CLOSED behavior (unset → ALL
   messages dropped).

5. **Smoke test** — DM → echo within 5s. Operator-side log
   verification with the three expected log lines + the JSONL
   round-trip schema (received + ok pair).

6. **Troubleshooting matrix** — diagnoses + fixes for:
   - Slack URL-verification "Failed" (signing-secret mismatch /
     daemon down / TLS cert / timestamp skew)
   - No reply received (7 distinct failure modes, each tied to a
     specific [kora.slack_dm.*] log line so operator can
     self-diagnose)
   - Reply content wrong/truncated (echo-format-locked framing)
   - Reply in wrong thread (thread_ts fallback explained)

7. **§4 Q4 — Dual signing-secret env transition note**:
   - Legacy `gateway/platforms/slack.py` reads
     `SLACK_SIGNING_SECRET`
   - New daemon listener reads `KORA_SLACK_SIGNING_SECRET`
   - Both come from the same Slack app's Basic Information page
     → same value, different consumer paths
   - Operator sets BOTH env vars to the same value during the
     transition; rotates BOTH simultaneously
   - Post-KR-2 cleanup path documented (legacy env removable
     once gateway/platforms/slack.py is retired or refactored)

8. **Promotion to production** — same sequence with -c prd against
   kora-runtime app; Slack app Event Subscriptions Request URL
   update; Joshua-decides-when gate

9. **Operator obligations (ongoing)** — monitor reply_failed rate,
   PAUSED-state communication, rotation cadence, JSONL rotation
   (logrotate / Fly log-tailing — deferred from this bucket per
   ST1 non-scope)

10. **What's NOT in this feature (deferred)** — AI-driven response
    (KR-FEAT-AI-RESPONSE-LOOP), multi-turn state, kora__send_slack_dm
    MCP tool (KR-MCP-SEND-TOOLS), multi-user support, Slack
    interactivity

11. **Cross-references** — wires the runbook to:
    - kora_cli/listeners/webhooks.py:_handle_slack (KR-D-DAEMON ST3 +
      KR-FEAT-SLACK-DM ST1)
    - kora_cli/handlers/slack_dm_handler.py (ST1+ST2)
    - kora_cli/clients/slack_client.py (ST2)
    - kora_cli/listeners/webhook_signing.py:verify_slack_signature
    - kora_runtime_doppler_env_mapping.md
    - r2_amendments.md (Amendment 1 — why port 9118 exists)

## §5 ship checklist

- [x] Base `feature/phase2-upgrades`
- [x] Title format `feat(kora): KR-FEAT-SLACK-DM STn — <scope>`
- [x] No code changes (pure docs)
- [x] App manifest YAML paste-ready into Slack's import flow
- [x] §4 Q4 dual signing-secret note covered
- [x] Cross-references woven so operator can navigate without
      re-grepping

## Feature 5 closes

After this PR merges, the KR-FEAT-SLACK-DM 3-ST cascade is
complete (ST1 inbound + identity + JSONL + state-gate; ST2
outbound + echo + retry; ST3 operator runbook). Joshua can DM
Kora and get echo replies once the operator walks the runbook
through staging + prod.

The AI-driven response generation that replaces the echo is the
deferred KR-FEAT-AI-RESPONSE-LOOP follow-on; the Slack-DM scaffold
is the stable interface that follow-on consumes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rafe-walker
rafe-walker merged commit db677d3 into feature/phase2-upgrades May 22, 2026
@rafe-walker
rafe-walker deleted the feat/kora-KR-FEAT-SLACK-DM-ST3 branch May 22, 2026 17:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant