Skip to content
CAI
Software that uses CAICheck a score

lolgab/snunit

51.1

Weak · 7 November 2026

6.5k

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 Cats Effect integration for NGINX Unit server

Introduces a new \CEAsyncServerBuilder\ in the \snunit-async-cats-effect\ module, enabling users to build and run NGINX Unit servers using the Cats Effect \IO\ monad. This component provides a builder API to configure request and WebSocket handlers, set up a \Dispatcher\ for asynchronous execution, and manage file descriptor polling, effectively bridging the NGINX Unit runtime with Cats Effect's concurrency model.

snunit-async-cats-effect · high confidence

Add http4s 1.x support with version-specific implementation

The library now supports http4s 1.x alongside the existing 0.23.x version. This location provides the version-specific adapter layer (\VersionSpecific.scala\) for http4s 1, which handles body conversion using \Entity.strict\ and response writing by distinguishing between strict, streamed, and empty entities to optimize sending.

snunit-http4s/http4s-1 · high confidence

Embedded unitd launcher with graceful shutdown and observability stack support

The launcher now embeds the unitd binary directly into the application executable, allowing the app to run standalone without an external unitd installation. It manages the lifecycle of unitd and optional sidecar processes, ensuring graceful shutdown by stopping listeners and waiting for active requests to complete before exiting. The launcher also integrates an observability stack, checking for required ports and installing missing components if needed, and exposes metrics via a control client that communicates with unitd over a Unix socket.

snunit/src/snunit/launcher · high confidence

Initial Undertow server implementation

This change introduces the \snunit-undertow\ module, providing a new HTTP server backend based on the Undertow engine. It adds the core server entry point (\Undertow\), request/response abstractions (\HttpServerExchange\, \HttpHandler\), and support for both blocking and asynchronous I/O via \Sender\ implementations. The implementation includes specific features such as query parameter parsing, cookie handling, and a foundation for WebSocket support, while also wiring in the necessary multi-threading configuration via \LinktimeInfo.isMultithreadingEnabled\.

snunit-undertow · high confidence

Initial release of SNUnit server, endpoints4s integration, and observability stack

This change introduces the core SNUnit HTTP server implementation, including a new endpoints4s interpreter for defining HTTP routes, and a comprehensive configuration system for managing application processes, listeners, TLS, and isolation. It also adds an observability stack featuring a Prometheus metrics exporter, OTLP metrics pushing, and a Loki-compatible log shipper, alongside initial WebSocket opcode support.

repository · high confidence

Introduce Http4sApp trait and otel4s tracing middleware

Users can now extend the new \snunit.Http4sApp\ trait to define their HTTP4s application, which standardizes the setup by requiring \routes\ and \unitConfig\ as \Resource\ types and handling server startup via \SNUnitServerBuilder\. Additionally, the \snunit.otel4s.Otel4sHttp4s\ object provides a middleware for integrating OpenTelemetry tracing with http4s, allowing users to wrap their routes with span creation and attribute recording for HTTP requests and responses.

snunit-http4s/src/snunit · high confidence

Introduce SNUnitBuild core library for build tool integration

Added the \SNUnitBuild.scala\ file, which provides build-tool independent logic shared between the \snunit\ CLI tool and the sbt plugin. This core library handles downloading and caching FreeUnit artifacts, computing linker options, and installing the observability stack (Prometheus, Jaeger, VictoriaLogs, and Perses) components. It also manages embedding the \unitd\ daemon into finished executables, supporting multiple platforms (Linux/macOS, aarch64/x86\_64) and ensuring thread-safe concurrent downloads.

snunit-build-core · high confidence

Introduce Tapir integration with WebSocket and OpenTelemetry support

This change adds the \snunit-tapir-cats-effect\ module, providing a \TapirApp\ trait and \SNUnitServerBuilder\ to run Tapir endpoints on the server. It enables WebSocket support via \Fs2Streams\ and \WebSockets\ capabilities, allowing applications to handle real-time connections. Additionally, it includes an \Otel4sTapir\ interceptor for distributed tracing using otel4s, integrating with the server's request handling pipeline.

snunit-tapir-cats-effect · high confidence

Introduce Tapir server interpreter for SNUnit

Added a new Tapir server interpreter (\SNUnitGenericServerInterpreter\ and \SNUnitIdServerInterpreter\) that enables using the Tapir HTTP library with the SNUnit server. This implementation maps Tapir's request/response model to SNUnit's native request handling, supporting standard body types (string, byte array, file) and header processing, while currently restricting streaming and WebSocket capabilities.

snunit-tapir · high confidence

Introduce http4s adapter for SNUnit server integration

Added a new http4s adapter module that allows users to run their existing http4s HttpApp on the SNUnit runtime. The implementation provides an SNUnitServerBuilder to configure the server, including setting a custom error handler, and handles the translation of SNUnit requests into http4s Request objects (mapping methods, URIs, headers, and versions) while managing asynchronous execution via a Cats Effect Dispatcher.

snunit-http4s/src/snunit/http4s · high confidence

Introduce snunit CLI for building and running SNUnit applications

A new command-line tool, \snunit\, is available to build, package, and run SNUnit applications. It wraps the \scalino\ compiler to produce single executables that embed the \unitd\ runtime, supports bundling existing binaries, and includes commands to install and manage an observability stack (metrics, traces, logs, dashboards) for local development.

snunit-cli · high confidence

Introduce the SNUnit Observability Stack

Adds a new \stack\ directory containing the build infrastructure and modified binaries for an observability suite (Prometheus for metrics, Jaeger for traces, VictoriaLogs for logs, and Perses for dashboards). These components are patched to serve their HTTP APIs through the FreeUnit runtime when the \NXT\_UNIT\_INIT\ environment variable is set, allowing them to run as integrated external applications alongside SNUnit apps. The entry includes the build scripts (\build.sh\), license compliance tools, and the \unitmux\ Go package that enables Jaeger to share a single FreeUnit handler between its query server and OTLP/HTTP receiver.

stack · high confidence

Programmatic observability and routing configuration

SNUnit now supports configuring observability (metrics, traces, logs) and routing rules programmatically via Scala case classes. Users can define OpenTelemetry endpoints, Prometheus scrape targets, and JSON access logs through the new \Observability\ configuration, and specify request routing, proxying, and static file serving via the \Routes\ module. This change also introduces a lightweight internal JSON builder to serialize these settings into the FreeUnit configuration format.

snunit/src/snunit/config · high confidence

Removals

Removal of snunit server interpreters and autowire support

The \snunit/endpoints\ module has removed the server-side interpreters for the \endpoints\ library, including implementations for routing, HTTP methods, status codes, URL parsing, JSON entities, and chunked transfers. Additionally, the \snunit/autowire\ module, which provided an autowire-based server implementation, has been deleted. Users relying on these specific \snunit\-backed server components will no longer have access to these features.

snunit/endpoints · high confidence

Removed duplicate example files

The \HelloWorld.scala\ and \LowLevelExample.scala\ files in the \snunit/examples\ directory have been removed as they were duplicates. This cleanup reduces redundancy in the example codebase without affecting the core library functionality.

snunit/src/snunit/examples · high confidence

Behavioural changes

1 commit (0 fixes) modifying sbt-snunit, snunit-undertow

A change to existing behaviour in sbt-snunit, snunit-undertow — 1 commit, 7 files: “Publish sbt-snunit, update dependencies (\#217)” (refs \#217). Also in this area: Introduce sbt plugin to bundle Scala Native apps with embedded unitd.

sbt-snunit · low confidence · unverified

Migrate build system from Mill 0.7.4 to 0.11+ and update project structure

The project has upgraded its build tool from Mill 0.7.4 to version 0.11.10 (as specified in .mill-version) and migrated the build definition from the legacy build.sc format to the new build.mill format. This change includes updating the Mill wrapper script to support the new versioning scheme and configuring the build for Scala 3. Additionally, the project now uses Scalafmt 3.8.3 with Scala 3 dialect support and introduces a .scalafix.conf to enforce code style rules such as disabling syntax violations and organizing imports.

(repo-wide) · high confidence

Redesign of core API types and request handling in snunit

The snunit library has been refactored to replace opaque value classes with opaque types for core entities like Request, Method, and StatusCode, and to introduce a dedicated Headers opaque type for managing HTTP headers. This change updates the Request API to expose query parameters via a new \query\ field and provides indexed access to headers, while the server builder now uses explicit \RequestHandler\ and \WebsocketHandler\ traits instead of raw function types. Additionally, the \Request\ API now supports sending responses with \Array\[Byte\]\ content and a new \Headers\ type, replacing the previous \Seq\[(String, String)\]\ approach.

snunit/src/snunit · high confidence

Stub implementations for scheduler, websocket, and logging utilities

The snunit-cask module now includes placeholder implementations for core utilities: a Scheduler for delayed execution, a WebsocketClientImpl for WebSocket communication, and a java.util.logging facade. These stubs allow the library to compile and run in environments where these specific runtime features are not yet fully implemented or required, supporting applications that may not have a main method by providing the necessary structural components.

snunit-cask · medium confidence

Unsafe layer refactored for Scala Native 0.5 and multithreading support

The unsafe interop layer for NGINX Unit has been redesigned to support Scala Native 0.5 and multithreading environments. The previous \CApi\ and \Utils\ modules were removed and replaced with new files (\unsafe.scala\, \constants.scala\, \newCharBuffer.scala\, \stringUtils.scala\) that use opaque types for C structures and inline functions for performance. String handling now relies on runtime-detected memory offsets (\StringCharArrayOffset\, etc.) to correctly deconstruct Java strings in both single-threaded and multithreading modes, ensuring safe and efficient conversion between C strings and Scala strings without relying on manual pointer arithmetic hacks.

snunit/src/snunit/unsafe · high confidence

Test coverage

1 commit adding/updating tests in integration/test, integration/tests/gc-background-thread; Add integration test for Undertow Hello World server; Added Tapir Hello World integration test; Added WebSocket integration tests for Tapir and http4s; Added endpoints4s integration test for Hello World server; Added integration test for Cask application; Added integration test for Http4sApp; Added integration test for Tapir with Cats Effect; Added integration test for TapirApp with IO; Added integration tests for WebSocket echo functionality; Added integration tests for hello-world and multiple-handlers scenarios; Added integration tests for server implementations and features; Added integration tests for snunit-otel4s with http4s and Tapir; Added tests for UnitConfig serialization and observability stack behavior; Added tests for the new Headers opaque type; Added tests for unsafe byte-string conversion utilities.

Dependencies

Add sbt plugin and Go module for the snunit observability stack

This change introduces the build infrastructure for the snunit project, including a new sbt plugin (\sbt-snunit\) that links libunit and embeds unitd into Scala Native executables, a Go module (\stack/unitmux\) for the OTLP/HTTP receiver, and associated test scripts. The sbt plugin defines dependencies on Scala Native 0.5.12 and supports Scala 2.12 and 3.8.4, while the Go module requires unit.nginx.org/go v0.0.0.

(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

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 55 → 51 (-3.4)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 49 → 49 (+0.1)
  • Architecture 90 → 90 (+0.2)
  • Maturity 56 → 66 (+9.5)
  • Readiness 50 → 42 (-8.1)
  • Security 71 → 57 (-14.2)
  • Performance 87 → 100 (+13.1)

Resolved (4)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)

New (9)

  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)

Changes since last survey

  • 9 commits — 7 feature/other, 2 fixes

By area

  • (root) — 3 commits
  • .github/workflows — 3 commits
  • .github/scripts — 1 commit
  • integration/test — 1 commit
  • sbt-snunit/src — 1 commit

Notable commits

  • fix: Fix nxt_unit_callbacks_t layout and short response writes (#218)
  • fix: Fix the GC aborting an idle SyncServer when other threads allocate (#222)
  • change: Add a static musl FreeUnit build and the linux-musl-* platforms (#221)
  • change: CHANGELOG: Scala 3.9.0 and Mill 1.1.10 stay, document the cask changes (#219)
  • change: CI: build the CLI and the tests on scalino 0.0.29 (#226)
  • change: CLI: build on scalino 0.0.27 (run -w, --post-link, --run-env), document the Scala.js client (#223)
  • change: Pin FreeUnit to the 1.37.1 release tag instead of a commit sha (#224)
  • change: Publish sbt-snunit, update dependencies (#217)
  • change: Release 0.13.0 (#220)

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

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

Survey your own repository

lolgab/snunit 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 7 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 d7bbbee8efa296117a5656cda8597d0cbe84283e — 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-c34be012586e.