fix: repair fibp transport integration — protocol bugs across 8 sites

Merged
VI
8mo ago
+163-164

Summary

  • conftest: Fix TLS config field names (cert_file/key_file/ca_file) and move bootstrap_apikey to [auth] section (was misplaced in [fibp])
  • conftest: Replace gRPC-based create_queue with FIBP OP_CREATE_QUEUE — gRPC was removed from fila-server; FIBP is now the sole transport
  • fibp: Fix consume stream registration — push frames arrive with corr_id=0, not the original corr_id; register consume queue under both
  • fibp: Fix consume ack handling — server sends OP_CONSUME + empty body as initial ack; was incorrectly treated as stream-closed signal
  • fibp: Replace decode_consume_message with decode_consume_push that reads the count:u16 batch prefix the server actually sends
  • fibp: Fix encode_auth to send raw UTF-8 bytes (server expects no u16-length prefix that _encode_str was adding)
  • fibp: Fix decode_error_frame to parse raw UTF-8 (server sends plain text, not u16 code + u16-prefixed message)
  • batcher: Use _map_fibp_error for transport-level FIBP errors so auth rejection raises TransportError, not EnqueueError
  • test_batcher: Update transport failure assertion to expect TransportError (was incorrectly expecting EnqueueError for a frame-level failure)

Test plan

  • All 33 tests pass locally (python -m pytest tests/ -v)
  • 2 TLS tests skip locally (missing cryptography package) — they run in CI which installs all deps
  • CI integration tests pass with downloaded fila-server binary

🤖 Generated with Claude Code


Summary by cubic

Fixes FIBP transport to match the server protocol so consume streaming, auth, and error handling work as expected. Also switches test admin ops from gRPC to FIBP to unblock CI.

  • Bug Fixes

    • Consume: register the stream under both the request corr_id and 0; treat empty OP_CONSUME as the stream ack; decode batch pushes via decode_consume_push.
    • Auth/errors: encode_auth sends raw UTF-8 bytes; error frames parsed as plain text; map ERR_AUTH_REQUIRED/ERR_PERMISSION_DENIED to TransportError.
    • Batcher: use _map_fibp_error so transport failures (e.g., auth reject) raise TransportError; tests updated.
    • Lint: address ruff errors (import order, line length, unused imports).
  • Migration

    • Test/admin: fila-server removed gRPC; fixtures now create queues via FIBP OP_CREATE_QUEUE.
    • TLS fixture config: rename [tls] keys to cert_file/key_file/ca_file; move bootstrap_apikey to [auth].