Skip to content

feat(approval-flow): Slack approval bridge for approvalRequired policy decisions#6

Merged
henryqingmo merged 14 commits into
mainfrom
feat/approval-flow-pr
May 16, 2026
Merged

feat(approval-flow): Slack approval bridge for approvalRequired policy decisions#6
henryqingmo merged 14 commits into
mainfrom
feat/approval-flow-pr

Conversation

@henryqingmo
Copy link
Copy Markdown
Contributor

Summary

  • Adds synchronous approval hold to PolicyGateHandler: when a tool call is classified approvalRequired, the gateway holds the HTTP connection open (up to 5 min) instead of returning a pending response immediately
  • Implements RedisApprovalBridge using Redis Pub/Sub for event-driven resume signaling, with periodic session lock TTL extension via SessionLocker.Extend()
  • Implements SlackClient that sends Block Kit messages (tool details + Approve/Deny buttons carrying the ticket ID) via chat.postMessage
  • Adds POST /slack/actions webhook endpoint with HMAC-SHA256 signature verification and 5-minute replay window protection
  • Extends TicketStore with an idempotent UpdateStatus() method; decisions are written to Postgres before the Redis resume signal is published
  • Adds Slack env var config (SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET, SLACK_CHANNEL) with startup fail-fast validation

Test plan

  • Unit tests: RedisApprovalBridge (approve/deny/timeout/channel-close/lock-extend-failure paths)
  • Unit tests: SlackWebhookHandler (valid approve, valid deny, bad signature, replay attack, UpdateStatus failure)
  • Unit tests: SlackClient (Block Kit payload structure, auth header) and PolicyGateHandler approval path (mock bridge/notifier)
  • Integration tests: full approve/deny/timeout flow with real Redis + Postgres, idempotent UpdateStatus
  • E2E: Docker Compose stack — HMAC-signed approve/deny via curl /slack/actions, unsigned request → HTTP 400

Spec

Driven by .kiro/specs/approval-flow/ — requirements, design, research, and tasks all in tree.

Depends on: bare-proxypolicy-gatesession-mgmt (all merged to main).

🤖 Generated with Claude Code

henryqingmo and others added 14 commits May 15, 2026 18:00
…(task 1.1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cted schema mismatch (task 1.2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and timeout (task 2.1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tion (task 2.3)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ng approval (task 3.1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@henryqingmo henryqingmo merged commit 45d903e into main May 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant