Skip to content
CAI
Software that uses CAICheck a score

typelevel/fs2-grpc

54.4

Adequate · 6 November 2026

3.8k

lines of production code

Scala

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add fs2-grpc-otel4s-trace module for OpenTelemetry tracing

Introduces the new fs2-grpc-otel4s-trace module, providing client and service tracing aspects that integrate fs2-grpc with the otel4s library. This addition enables automatic OpenTelemetry span creation for gRPC calls, including context propagation via gRPC metadata, semantic attribute recording (such as RPC system and method), and span finalization logic that correctly handles success, cancellation, and error states for both unary and streaming interactions.

otel4s-trace · high confidence

Added e2e protobuf definitions for codegen verification

New Protocol Buffer definitions have been added to the e2e project to support code generation verification. These include proto2 and proto3 schemas defining test messages (with nested types and optional fields), a logger configuration message demonstrating proto3 optional support, and a gRPC service interface covering unary, client-streaming, server-streaming, and bidirectional streaming RPCs.

e2e/src/main · high confidence

Initial project setup and documentation

The repository is initialized with the fs2-grpc library, including a comprehensive README that details SBT configuration, client and server creation, code generation options, and OpenTelemetry tracing support. The project is configured with scalafmt 3.11.5 for code formatting, Scala Steward for automated dependency updates, and updated gitignore rules to exclude IDE and build artifacts.

(repo-wide) · high confidence

Introduce Fs2UnaryCallHandler for unary and client-streaming calls

Added Fs2UnaryCallHandler, an internal component that manages the lifecycle of unary and client-streaming gRPC calls. It implements state-machine logic to handle message reception, trailers, and error conditions, ensuring that unary calls strictly receive a single response and that client-streaming calls properly handle the request stream and half-close events.

runtime/src/main/scala/fs2/grpc/client/internal · high confidence

Introduce client aspects and middleware for intercepting gRPC calls

The client runtime now supports intercepting and transforming gRPC client calls through a new \ClientAspect\ and \ClientAspectMiddleware\ system. This allows users to inject custom logic—such as logging, metrics, or error handling—around unary and streaming calls without modifying the underlying client implementation. The changes include new \ClientAspect\ and \ClientAspectMiddleware\ files that define the interception interface and composition logic, \ClientOptions\ to configure call behavior (like prefetching and error adaptation), and updated \Fs2ClientCall\ and \Fs2StreamClientCallListener\ implementations to integrate these aspects into the actual gRPC call flow.

runtime/src/main/scala/fs2/grpc/client · high confidence

Introduces GeneratedCompanion for client and server aspect support

Adds the GeneratedCompanion trait to the fs2-grpc runtime, providing a unified interface for creating gRPC clients and server bindings. This change introduces support for client and server aspects, allowing users to inject custom logic via ClientAspect and ServiceAspect when constructing clients (mkClient, client, clientResource) and server services (service, serviceResource). The trait also exposes the underlying ServiceDescriptor, enabling better introspection and integration with the gRPC framework.

runtime/src/main/scala/fs2/grpc · high confidence

New code generator options for trailers, context rendering, and service suffixes

The sbt-fs2-grpc plugin now exposes several new configuration options to customize generated gRPC code. Users can disable the generation of trailer-handling code via \Fs2GrpcDisableTrailers\, control how context parameters are rendered in Scala 3 using \Fs2GrpcRenderContextAsImplicit\ (switching between \implicit\ and \using\), and customize the suffix appended to generated service names via \Fs2GrpcServiceSuffix\. Additionally, support for Scala 3 source generation (\Scala3Sources\) and the removal of lens-based accessors (\NoLenses\) are now available as explicit code generator options.

plugin · high confidence

Behavioural changes

Configurable shutdown timeouts for gRPC server and channel resources

The \fs2.grpc.syntax\ package now provides syntax extensions for \ManagedChannelBuilder\ and \ServerBuilder\ that allow users to control how long the system waits for orderly shutdown before forcing termination. In addition to the existing default 30-second timeout, new \resourceWithShutdownTimeout\ and \streamWithShutdownTimeout\ methods accept a \FiniteDuration\ parameter, enabling precise control over cleanup behavior. The API also exposes \resourceWithShutdown\ and \streamWithShutdown\ for fully custom shutdown logic, while maintaining binary compatibility with existing code.

runtime/src/main/scala/fs2/grpc/syntax · high confidence

Implement backpressure for streaming gRPC messages

The runtime now enforces backpressure for both sending and receiving streams. Incoming messages are buffered in an unbounded queue with a configurable prefetch limit to control memory usage, while outgoing streams wait for the underlying gRPC call to signal readiness before sending, preventing unbounded memory growth during high-throughput streaming.

runtime/src/main/scala/fs2/grpc/shared · high confidence

Refactored code generator with new configuration options and Scala 3 support

The code generator has been restructured to support Scala 3 wildcard imports and new configuration parameters. Users can now customize the generated service suffix via the \fs2\_grpc:service\_suffix\ option, disable trailer metadata handling with \fs2\_grpc:disable\_trailers\, and render the context parameter as an implicit (using Scala 3 \using\ clauses) with \fs2\_grpc:render\_context\_as\_implicit\. The internal printer classes have been refactored into a sealed trait hierarchy to support these variations.

codegen · high confidence

Server runtime refactored with new call handling and service aspect middleware

The server runtime in \runtime/src/main/scala/fs2/grpc/server\ has been restructured to introduce a new \ServiceAspect\ and \ServiceAspectMiddleware\ system, allowing users to inject custom logic like logging or metrics around gRPC service calls. This change also brings a new \Fs2ServerCallHandler\ and internal \Fs2UnaryServerCallHandler\ that implement non-blocking unary request handling and support for trailers metadata in streaming calls. Additionally, server configuration is now exposed via \ServerOptions\ (including a \prefetchN\ parameter) and \ServerCallOptions\ (for compression settings), providing finer control over server behavior.

runtime/src/main/scala/fs2/grpc/server · high confidence

Test coverage

Added Fs2GrpcSuite base test class; Added e2e tests for code generator output and client/server aspects; Added end-to-end tests for OpenTelemetry tracing aspects; Added test coverage for gRPC server call handling and middleware composition; Added tests for StreamIngest prefetch behavior; Added tests for the new async client runtime and middleware support.

Dependencies

Initial build configuration with Scala 3, Cats Effect 3, and fs2 3

The project establishes its initial build structure, setting the SBT version to 1.13.0 and adopting the sbt-typelevel 0.8.7 plugin. It upgrades core runtime dependencies to Cats Effect 3.7.1, fs2 3.14.0, and ScalaPB 0.11.20, while adding support for OpenTelemetry via otel4s 1.1.0. The build also includes plugins for code generation (sbt-protoc 1.0.8), build info, and dependency updates.

project · high confidence

Upgrade to Scala 3.3.8 and Scala 2.13.18

The project has updated its default Scala versions to 3.3.8 and 2.13.18 (with 2.12.21 still supported), upgrading the underlying Scala libraries and tooling. This change ensures compatibility with the latest Scala releases and includes necessary build configuration adjustments, such as updated MiMa binary compatibility filters and SBT plugin settings, to support the new language features and runtime behaviors.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 56 → 54 (-1.6)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 75 → 75 (+0.0)
  • Architecture 99 → 99 (+0.0)
  • Maturity 47 → 47 (+0.0)
  • Readiness 50 → 47 (-2.7)
  • Security 82 → 70 (-12.1)
  • Performance 70 → 70 (+0.0)

Resolved (4)

  • Ambiguous relationship between Fs2Grpc and Fs2GrpcPlugin. Both types expose requires(), trigger(), and projectSettings(). It is unclear if Fs2Grpc is a configuration object used by Fs2GrpcPlugin, or if they are two different entry points for the same functionality. The presence of convertOptionsToScalapbGen only on Fs2GrpcPlugin suggests Fs2Grpc might be a subset or a different abstraction, but the overlapping method signatures (requires, trigger, projectSettings) are highly redundant and confusing.
  • Documentation: no architecture or design documentation
  • Duplicate type definition with different scopes. CodeGeneratorOption is defined at the top level of the codegen package and also re-exported/defined inside Fs2GrpcPlugin.autoImport. This creates confusion about which type to use in user code (e.g., import fs2.grpc.codegen.CodeGeneratorOption vs import Fs2GrpcPlugin.autoImport.CodeGeneratorOption), and suggests a lack of clear ownership for the configuration options.
  • Off-boarding risk: anonymized user #1

New (2)

  • Dependency hygiene PARTLY measured — sbt declarations read, dependency currency not (Maven Central unreachable)
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 2 commits — 2 feature/other, 0 fixes

By area

  • (repo) — 1 commit
  • project/build.properties — 1 commit

Notable commits

  • change: Merge pull request #885 from typelevel/update/sbt-1.13.1
  • change: Update sbt, scripted-plugin to 1.13.1

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

typelevel/fs2-grpc was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 833cc0a016e38d234b3b0d6878746ed9b8b8d98b — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.