Skip to content
CAI
Software that uses CAICheck a score

zotonic/cowmachine

68.4

Adequate · 17 September 2026

7.7k

lines of production code

Erlang

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Cowmachine is an Erlang web framework that implements the Webmachine request-decision pattern as middleware for the Cowboy HTTP server. It provides a simplified callback interface for building RESTful services, handling features such as content negotiation, proxy header parsing, and WebSocket connectivity. The system includes a comprehensive test suite and a suite of example applications demonstrating common web server patterns like static file serving, authentication, and streaming responses.

Features

Add Cowmachine example applications

Added a suite of example applications under the \examples/\ directory to demonstrate the Cowmachine web framework. These include \compress\_response\ (response compression), \controller\_functions\ (comprehensive controller callback usage), \cookie\ (cookie handling), \echo\_get\ and \echo\_post\ (query and body parameter echoing), \hello\_world\_chunked\ (streaming responses), \hello\_world\_rest\ (RESTful content negotiation), \hello\_world\_ssl\ (TLS support), \rest\_basic\_auth\ (HTTP Basic Authentication), and \upload\ (multipart file uploads). Each example provides a complete OTP application structure with controllers, middleware, and routing to illustrate specific Cowmachine features.

(repo-wide), examples · high confidence

Add EventSource example application

The examples/eventsource directory now contains a complete Erlang application that demonstrates Server-Sent Events (EventSource). The app runs on port 1234 and serves a static index page, assets, and a /eventsource endpoint that streams random emoji data to the client every 500ms. The implementation uses the Cowmachine framework for request handling and routing, with a dedicated controller and handler module to manage the persistent connection and event generation.

examples/eventsource · high confidence

Added documentation assets for EDoc generation

Added a new EDoc source file (doc/overview.edoc) providing project metadata and a standard CSS stylesheet (doc/style.css) to define the visual appearance of the generated documentation pages.

doc · high confidence

Added example applications for Cowmachine

This release includes a collection of example applications demonstrating Cowmachine usage, such as file serving, markdown conversion, and basic REST endpoints. These examples provide ready-to-run templates for common web server patterns, including static file serving with directory listing, dynamic content generation via middleware, and simple HTTP handlers.

(repo-wide) · high confidence

Added example applications for HTTP and WebSocket interactions

New example applications have been added to demonstrate the Cowmachine framework. The \hello\_world\ example provides a basic HTTP server that returns a static response. The \websocket\ and \websocket2\ examples demonstrate WebSocket connectivity, including route configuration for static assets and HTML, and a handler that echoes text messages and sends periodic status updates. These examples illustrate how to configure Cowboy listeners, define controllers, and manage WebSocket lifecycles within the framework.

_examples/hello\world/apps/main, examples/websocket/apps/main, examples/websocket2 · high confidence

Initial release of Cowmachine with rebar3 build and Hex publishing support

This entry introduces Cowmachine, a Webmachine-style request handler adapted for the Cowboy web server. The project is now built using rebar3 (minimum OTP 23) and published to Hex, with dependencies on cowboy (\~\> 2.14), cowlib (\~\> 2.16), ranch (\~\> 2.2), and zotonic\_stdlib (\~\> 1.6). It provides a simplified callback interface (single process/4) and includes build automation via Makefile, a Hex deployment script, and documentation generation targets.

(repo-wide) · high confidence

Initial release of Cowmachine, a Webmachine-style middleware for Cowboy

Introduces Cowmachine, a new Erlang application that implements the Webmachine request-decision pattern as middleware for the Cowboy HTTP server. This change adds the core request handling pipeline, including the decision core, controller abstraction, and response generation, enabling developers to build RESTful services using familiar Webmachine callbacks. The release also includes support for Accept-Language negotiation, proxy header parsing (Forwarded and X-Forwarded-For), and WebSocket handling.

src · high confidence

Test coverage

Added comprehensive test suite for Cowmachine

Added a new suite of EUnit and PropEr tests covering core library functions and end-to-end HTTP behavior. The tests verify language and media-type negotiation logic, proxy header parsing (Forwarded and X-Forwarded-\*), HTTP security constraints (invalid headers and dangerous Location values), query string parsing with limits, and the full HTTP decision flow including status codes for service availability, authorization, forbidden access, and method restrictions.

test · 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 68.

Lenses

  • Code Health 88
  • Architecture 100
  • Maturity 72
  • Readiness 54
  • Security 84
  • Event Sourcing 100

Changes since last survey

  • 144 commits — 118 feature/other, 26 fixes

By area

  • (root) — 58 commits
  • .github/workflows — 10 commits
  • src/cowmachine_decision_core.erl — 10 commits
  • src/cowmachine_response.erl — 10 commits
  • src/cowmachine.erl — 9 commits
  • src/cowmachine_req.erl — 8 commits
  • (repo) — 7 commits
  • docs/http-headers-status.dot — 4 commits
  • src/cowmachine_proxy.erl — 4 commits
  • docs/request-body-vs-response.md — 3 commits
  • src/cowmachine_accept_language.erl — 3 commits
  • src/cowmachine_websocket_upgrade.erl — 3 commits
  • examples/ex01_hello_world — 2 commits
  • examples/ex2_controller_functions — 2 commits
  • src/cowmachine.app.src — 2 commits
  • src/cowmachine_controller.erl — 2 commits
  • src/cowmachine_util.erl — 2 commits
  • examples/file_server — 1 commit
  • examples/hello_world_chunked — 1 commit
  • src/cowmachine_config.erl — 1 commit

Notable commits

  • fix: Add e2e tests, document webmachine→cowmachine differences, correct flow diagram, fix examples (#55)
  • fix: Fix a problem where '?' was missing in the raw_path.
  • fix: Fix a problem with 'undefined' response body
  • fix: Fix a problem with file streams.
  • fix: Fix a problem with matching content-type parameters for request content-type against provided content-types.
  • fix: Fix a problem with returning the server header
  • fix: Fix a problem with streams. Upgrade cowboy to 2.9.0
  • fix: Fix an issue where controllers could not set their own error body or content (#45)
  • fix: Fix an issue where using a streamed body could crash the decision core (#46)
  • fix: Fix config name for the ip_allowlist, allow old ip_whitelist (#48)
  • fix: Fix edoc and add edoc CI test (#58)
  • fix: Fix file streaming with writer function (#16)
  • fix: Fix handling POST without Accept header.
  • fix: Fix range request parsing for 'bytes=S-'
  • fix: Fix ref to cowlib (error in current cowboy pre-release)
  • fix: Fix setting content-type resp header
  • fix: Fix syntax error, ignore .rebar3 dir
  • fix: Fix type
  • fix: Fix typespec of cowmachine_accept_language. Add tests
  • fix: Fix websocket upgrade for cowboy 2.0.0-pre.10
  • …and 124 more

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

Survey your own repository

zotonic/cowmachine 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 17 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 e901f2474e6c3fd059a3a5cc6765638c1121144a — the exact code this score is about.
  • Scored under rubric-2026.09.13 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-d1ef6c0bd534.