Skip to content

feat(gateway): add VK adapter contract - #447

Closed
esafwan wants to merge 1 commit into
feature/gateway-adapter-sdkfrom
feature/vk-gateway-adapter
Closed

feat(gateway): add VK adapter contract#447
esafwan wants to merge 1 commit into
feature/gateway-adapter-sdkfrom
feature/vk-gateway-adapter

Conversation

@esafwan

@esafwan esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the first region-specific Gateway Adapter SDK implementation for VK Community Bots.

  • Verifies only message_new Callback API events with a constant-time callback-secret comparison.
  • Handles VK group confirmation separately from message ingestion.
  • Normalizes a verified callback into the Gateway Adapter SDK event shape.
  • Delivers text replies through api.vk.ru/method/messages.send with required API version, community token, and random_id.
  • Uses an injected HTTP POST transport, so the adapter needs no new runtime dependency and fixtures do not call VK.

Scope boundary

This is a provider adapter only. A later integration slice, after Gateway foundation PR #441, will connect verified events to Gateway persistence/routing.

Verification

  • python3 -m py_compile huf/ai/gateway_adapters/*.py huf/ai/tests/test_gateway_adapter_sdk.py huf/ai/tests/test_vk_gateway_adapter.py
  • Disposable Frappe-environment clone: 11/11 unit tests passing across SDK + VK fixtures.

Evidence

VK Callback API / Community Bots Long Poll provide inbound options and messages.send provides outbound messaging. The adapter deliberately does not trust user-supplied callback payload fields beyond VK’s configured Callback secret; idempotency and admission are delegated to Gateway foundation.

Related PRs

Runtime bridge

@esafwan

esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by consolidated Gateway PR #473, preserving the foundation, SDK, adapter, runtime bridge, security, and documentation scope.

@esafwan

esafwan commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by / consolidated into #473.\n\nRelated gateway PRs: #441 #442 #443 #446 #447 #448 #449

esafwan added a commit that referenced this pull request Jul 26, 2026
…me list (#481)

- gatewayApi.ts: replace stale access_policy with direct_policy/room_policy/
  room_sender_policy/mention_required/pairing_ttl_minutes; expand provider type.
- GatewaysPage.tsx: use direct_policy; add TODO comments; fallback icons/names
  for providers without adapter UIs.
- App.tsx / app-sidebar.tsx: comment out /gateways route and sidebar item while
  the feature is incomplete.
- flow_run.json: remove Gateway from trigger_type options.
- gateway_service.py: add TODO where Gateway trigger_type is used.
- docs/gateway-todo.md: new shame list / restoration checklist.
- AGENTS.md: link to docs/gateway-todo.md.

Refs #473, #441, #442, #443, #446, #447, #448, #449.
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