Skip to content
CAI
Software that uses CAICheck a score

typelevel/feral

57.4

Adequate · 20 September 2026

3.7k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Feral is a Scala framework for writing serverless functions that target AWS Lambda and Google Cloud Functions on both JVM and JavaScript runtimes. It provides adapters for integrating with HTTP4s and supports a wide range of AWS event sources, including API Gateway, SQS, DynamoDB Streams, and CloudFormation custom resources. The system includes tooling for automated code migration and build configuration, enabling developers to deploy observability-integrated serverless applications with minimal boilerplate.

How it got here

2021 — multi-platform runtime and API expansion

16 changes.

The project established its foundational build infrastructure and introduced a JavaScript runtime alongside the existing JVM implementation. Significant effort was directed toward re-architecting the core Lambda execution model, renaming types for clarity, and integrating distributed tracing support. The period also saw the addition of extensive AWS event type support, including CloudFormation custom resources and API Gateway v2, accompanied by comprehensive test coverage.

2022–2024 — Google Cloud support and migration tooling

12 changes.

This period focused on extending the framework to support Google Cloud Functions on both JVM and Scala.js, introducing IO-based adapters and corresponding examples. Concurrently, it established robust migration tooling for the v0.3.0 API breakage through automated Scalafix rules and comprehensive test coverage across all supported platforms.

Features

Add JS-specific Lambda runtime and context handling

This change introduces platform-specific implementations for the JavaScript runtime, adding \ContextPlatform.scala\ to parse AWS Lambda context data (including custom client context fields) from JavaScript objects, and \IOLambdaPlatform.scala\ to provide the actual JS entry point that registers the Lambda handler function and manages asynchronous execution via a dispatcher.

lambda/js/src/main/scala/feral/lambda · high confidence

Add Scala.js facade for AWS Lambda context including custom client data

A new Scala.js facade has been added to represent the AWS Lambda \Context\ object, enabling access to invocation details such as function name, ARN, and remaining time. The facade also exposes the \clientContext\ field, which now includes support for a \custom\ property (typed as \js.Any\), allowing users to access custom key-value pairs passed by the client application alongside standard client and environment metadata.

lambda/js/src/main/scala/feral/lambda/facade · high confidence

Added HTTP4s Google Cloud example

A new example file, Http4sGoogleCloud.scala, has been added to the examples/js module. It demonstrates how to implement an IOCloudHttpFunction using the HTTP4s framework, providing a simple 'Hello, \[name\]' endpoint for Google Cloud deployment.

examples/js · high confidence

Added IOCloudHttpFunction for Google Cloud HTTP functions on Scala.js

A new abstract class IOCloudHttpFunction has been introduced in the google-cloud-http4s/js module, enabling Scala.js applications to implement Google Cloud HTTP functions using http4s. This component bridges the Google Cloud Functions Framework with Cats Effect IO, allowing developers to define a handler as a Resource\[IO, HttpApp\[IO\]\] that is automatically wired to the underlying native http() entry point via a Dispatcher.

google-cloud-http4s/js · high confidence

Added JVM example for Google Cloud HTTP functions

The examples/jvm module now includes a new Scala file, Http4sGoogleCloud.scala, demonstrating how to implement a Google Cloud HTTP function using the Http4s framework on the JVM. This example defines a handler class that extends IOCloudHttpFunction and sets up a simple route returning a greeting message, providing a concrete reference for users deploying Http4s-based applications to Google Cloud Functions in a JVM environment.

examples/jvm · high confidence

Initial project scaffolding and configuration

The repository is initialized with essential build and development tooling, including a comprehensive scalafmt configuration (version 3.10.6) with specific dialects for Scala 2.13 and 3, a scalafix configuration for organizing imports, and JVM options for memory and garbage collection. CI automation is introduced via a Mergify configuration that automatically merges Scala Steward dependency updates and labels pull requests by module. The project also adds a detailed README describing feral as a framework for writing serverless functions in Scala targeting AWS Lambda on both JVM and JavaScript runtimes, along with updated .gitignore rules for modern Scala tooling like Metals and Bloop.

(repo-wide) · high confidence

Introduce sbt Lambda JS plugin

A new sbt plugin, LambdaJSPlugin, has been added to configure Scala.js projects for AWS Lambda deployment. It automatically sets up the build to produce a CommonJS module, optimizes the output for production, and names the generated artifact index.js, simplifying the packaging process for serverless JavaScript environments.

sbt-lambda/src/main · high confidence

New IO-based Google Cloud HTTP Function adapter

Added \IOCloudHttpFunction\, an abstract class that bridges Google Cloud HTTP Functions with http4s \IO\-based applications. This component allows users to implement Google Cloud functions by providing an \HttpApp\[IO\]\ handler, automatically handling the conversion between Google's \HttpRequest\/\HttpResponse\ objects and http4s types, including request parsing and response serialization. A corresponding test suite (\IOCloudHttpFunctionSuite\) validates the request decoding and response encoding logic.

google-cloud-http4s/jvm · high confidence

New Lambda examples for HTTP and SQS with distributed tracing

Added two new example implementations in the shared examples module: an HTTP API Lambda using Http4s and API Gateway v2 events, and an SQS event Lambda. Both examples demonstrate how to integrate distributed tracing via Natchez and AWS X-Ray, showing how to set up entry points and middleware for observability in serverless functions.

examples/shared · high confidence

New event types and CloudFormation support for AWS Lambda

This release adds support for AWS CloudFormation Custom Resources, including the \CloudFormationCustomResourceRequest\ and \CloudFormationCustomResourceResponse\ models with validation for \PhysicalResourceId\. It also introduces new event types for AWS services: \KafkaEvent\ (with \MskEvent\), \S3Event\, \S3BatchEvent\, \S3BatchResult\, \DynamoDbStreamEvent\, \AppSyncLambdaAuthorizerEvent\, and \ApiGatewayV2WebSocketEvent\. The \Context\ class is now generic over its effect type \F\[\_\]\, allowing for more flexible asynchronous handling of \remainingTime\. Additionally, \ApiGatewayProxyEventV2\ cookies are now optional, and several existing event models have been deprecated or renamed to align with AWS naming conventions.

repository · high confidence

Behavioural changes

Add explicit Instant decoder and deprecated type aliases

The library now includes an explicit circe decoder for java.time.Instant, enabling correct deserialization of timestamp fields in Lambda events. Additionally, deprecated aliases for API Gateway event types (APIGatewayProxyRequestEvent and APIGatewayProxyResponseEvent) have been added to maintain backward compatibility while encouraging migration to the new ApiGatewayProxyEvent and ApiGatewayProxyResult names.

lambda/shared/src/main/scala/feral/lambda/events · high confidence

Automated migration for Feral v0.3.0 API changes

A new Scalafix rule (V0\_3\_0Rewrites) is introduced to automatically update codebases migrating to Feral v0.3.0. This tool rewrites legacy type names (e.g., renaming \LambdaEnv\ to \Invocation\ and \APIGatewayProxyRequestEvent\ to \ApiGatewayProxyEvent\) and updates method calls on \ApiGatewayProxyHandler\ to their v2 equivalents, while also removing obsolete imports.

scalafix/rules · high confidence

CloudFormation custom resource handler now uses PUT and omits null values

The CloudFormation custom resource Lambda handler has been updated to send response events using the HTTP PUT method, aligning with AWS requirements, and configures the JSON encoder to drop null values from the response payload. Additionally, error responses now include only the first line of the stack trace to help ensure the total response size remains within the 4096-byte limit imposed by CloudFormation.

lambda-cloudformation-custom-resource/src/main · high confidence

Introduce ApiGatewayProxyHandlerV2 for HTTP API v2 support

The library now provides a dedicated handler for AWS API Gateway HTTP API v2 events via the new \ApiGatewayProxyHandlerV2\ object, which correctly decodes v2-specific fields such as cookies and raw query strings. The original \ApiGatewayProxyHandler\ remains available for REST API v1 events but is marked as deprecated in favor of the v2 handler. Users migrating to API Gateway HTTP APIs should switch to \ApiGatewayProxyHandlerV2\ to ensure proper handling of v2 event structures.

lambda-http4s/src/main · high confidence

JVM Lambda runtime re-architected for safer initialization and optimized execution

The JVM Lambda implementation has been rewritten to improve reliability and performance. Initialization is now non-lazy by default, with a fallback mechanism that detects startup errors and switches to lazy initialization to prevent cold-start failures. The runtime now uses a parallel Dispatcher for handling invocations and wraps the output stream in a Resource to ensure it is always closed, even if an error occurs. Additionally, JSON parsing and printing have been optimized by using Jawn directly, and the Context now supports custom fields from the client context.

lambda/jvm/src/main · high confidence

Refactored Lambda runtime with new Invocation model and tracing support

The Lambda runtime has been restructured to improve modularity and tracing integration. The \LambdaEnv\ has been renamed to \Invocation\, providing a cleaner abstraction for accessing event data and context. A new \IOLambda\ class simplifies handler definition by exposing a \handler\ method that returns a \Resource\, and a \Simple\ variant is available for basic use cases. Additionally, \TracedHandler\ and \AwsTags\ have been introduced to seamlessly integrate with Natchez for distributed tracing, automatically tagging spans with AWS ARN and request ID.

lambda/shared/src/main/scala/feral/lambda · high confidence

Renamed Lambda environment types and added Scala 3-specific INothing encoder

The \LambdaEnv\ type alias has been renamed to \Invocation\, with the old name retained as a deprecated alias for backward compatibility. Several specific invocation types (e.g., \ApiGatewayProxyLambdaEnv\, \DynamoDbStreamLambdaEnv\) have also been renamed to more consistent names like \ApiGatewayProxyInvocationV2\ and \DynamoDbStreamInvocation\. Additionally, a Scala 3-specific \INothing\ type and its corresponding identity encoder have been introduced to improve type inference and handle cases where no output is desired, replacing previous implementations that may have relied on external dependencies or different encoders.

lambda/shared/src/main/scala-3 · high confidence

Renamed core invocation types and deprecated legacy aliases

The \LambdaEnv\ type and companion object have been renamed to \Invocation\ to better reflect their role as the core abstraction for handling Lambda events. Several specific invocation types (e.g., \ApiGatewayProxyLambdaEnv\, \DynamoDbStreamLambdaEnv\, \SqsLambdaEnv\) have been renamed to more consistent names like \ApiGatewayProxyInvocation\, \DynamoDbStreamInvocation\, and \SqsInvocation\. The old names are now deprecated aliases that will be removed in a future version. Additionally, \KinesisStreamLambdaEnv\ has been deprecated with a note that Kinesis support has moved to the \kinesis4cats\ library. A new \S3BatchInvocation\ type has been added to support S3 Batch events.

lambda/shared/src/main/scala-2 · high confidence

Updated V0\_3\_0 rewrite rules for Feral Lambda API migration

The V0\_3\_0 rewrite rules have been updated to reflect breaking changes in the Feral Lambda library. Users migrating code will now see \ApiGatewayProxyHandler\ replaced with \ApiGatewayProxyHandlerV2\, and various environment types (such as \ApiGatewayProxyLambdaEnv\, \DynamoDbStreamLambdaEnv\, etc.) rewritten to their corresponding \Invocation\-based counterparts (e.g., \ApiGatewayProxyInvocationV2\, \DynamoDbStreamInvocation\). Additionally, event and result types like \APIGatewayProxyRequestEvent\ and \APIGatewayProxyResponseEvent\ are migrated to \ApiGatewayProxyEvent\ and \ApiGatewayProxyResult\ respectively.

scalafix/output · high confidence

Test coverage

Added JVM-specific tests for IOLambda initialization behavior; Added property-based tests for CloudFormation custom resource serialization; Added scripted test for simple I/O Lambda handler; Added test suite for TracedHandler syntax; Added test suite for scalafix rules; Added test suites for AWS Lambda event decoders; Added tests for API Gateway proxy event decoding; Added tests for IOLambda on JavaScript.

Dependencies

Upgrade to version 0.3 and update core dependencies

The project has been bumped to base version 0.3, updating the build configuration to use sbt-typelevel conventions and setting the Scala versions to 2.12.20, 2.13.17, and 3.3.7. Core library dependencies have been updated, including cats-effect to 3.6.3, circe to 0.14.15, fs2 to 3.12.2, http4s to 0.23.33, and natchez to 0.3.8. The sbt plugin (sbt-feral-lambda) now depends on sbt-npm-package 0.2.0 and targets Scala 2.12, while the root project aggregates new modules like lambdaCloudFormationCustomResource and googleCloudHttp4s.

(dependencies) · high confidence

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

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 57.

Lenses

  • Code Health 99
  • Architecture 100
  • Maturity 39
  • Readiness 64
  • Security 68

Changes since last survey

  • 300 commits — 282 feature/other, 18 fixes

By area

  • (repo) — 92 commits
  • (root) — 78 commits
  • lambda/shared — 51 commits
  • project/plugins.sbt — 16 commits
  • lambda-http4s/src — 12 commits
  • project/build.properties — 11 commits
  • .github/workflows — 9 commits
  • google-cloud-http4s/jvm — 8 commits
  • lambda/jvm — 7 commits
  • lambda/js — 4 commits
  • examples/src — 2 commits
  • scalafix/input — 2 commits
  • scalafix/rules — 2 commits
  • examples/jvm — 1 commit
  • examples/shared — 1 commit
  • google-cloud-events/js — 1 commit
  • google-cloud-http4s/js — 1 commit
  • scalafix/output — 1 commit
  • scalafix/tests — 1 commit

Notable commits

  • fix: ADT as nested classes and fix Headers representation
  • fix: Fix CI
  • fix: Fix IOLambdaSuite
  • fix: Fix deprecations
  • fix: Fix example
  • fix: Fix headers in ApiGatewayProxyHandler
  • fix: Fix import to pass (lambdaJVM / scalafixAll)
  • fix: Fix query parameters avoiding duplicates
  • fix: Fix test
  • fix: Fix test
  • fix: Fixed syntax errors (I hope)
  • fix: Merge pull request #434 from armanbilge/fix/0.3.0-deprecations
  • fix: Merge pull request #448 from armanbilge/fix/init-npe
  • fix: fix CI error
  • fix: fix CI error 2
  • fix: fix: CI errors resolved
  • fix: fix: headers
  • fix: fix: resolve scalaFixError
  • change: 1 more deprecation
  • change: Account for remaining time
  • …and 280 more

Architecture

  • 0 containers · 1 bounded contexts · 0 dependency edges (baseline)

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

Survey your own repository

typelevel/feral 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 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 44b325dc3f48e03d8ad385542340ca7db2a3dbba — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.