Skip to content
CAI
Software that uses CAICheck a score

lfr/FSharp.Domain.Validation

48.5

Weak · 21 September 2026

792

lines of production code

F#

primary language

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This is a F\# domain validation library that provides a 'Box' abstraction for wrapping and validating domain values. It enforces constraints on types like text and integers, returning structured error lists. The system supports JSON serialization via Thoth and includes a Fable-compatible API for browser-based interactive demos.

Features

Add IBox validation interface

A new IBox interface and its generic variants are introduced in the FSharp.Domain.Validation.Common module. This adds a validation contract where IBox\<'baseType, 'error\> defines a Validate method that returns a list of errors, and provides a default NoValidation implementation that returns an empty error list.

FSharp.Domain.Validation.Common · high confidence

Add validation types for text and integer fields

A new F\# module, Types.fs, introduces domain types for validating text and integer inputs. It defines discriminated unions for specific validation errors (e.g., missing, blank, invalid integer) and implements the IBox interface for FreeText, Text, and Integer types to enforce these constraints.

demo · medium confidence

Added .NET 5.0 and Fable/webpack build infrastructure for the demo

The demo application now includes configuration files to support a .NET 5.0 runtime and a Fable/webpack build pipeline. An Aptfile is added to install the Microsoft package repository and the dotnet-sdk-5.0 package, while a NuGet.Config file is introduced to manage package sources. Additionally, a webpack configuration is provided to compile F\# (Fable) source code into JavaScript, and a Node.js server is set up to serve the static assets. These changes enable the demo to be built and run using this specific .NET and JavaScript toolchain.

src/demo · medium confidence

Added interactive demo page for F\# domain validation

A new demo page has been added to the public directory, featuring an HTML template and CSS styles that showcase the F\# domain validation library. The page provides an interactive interface where users can input text to see how different validation rules (such as text, free text, and integer parsing) are applied in real-time.

src/demo/public · high confidence

Added interactive validation demo with Thoth serialization support

A new demo application has been introduced in the src/demo/src directory, featuring an interactive text area that performs real-time validation on three different types (Text, FreeText, and Integer) and displays the results in separate boxes. The demo also includes a sandbox mode that demonstrates Thoth JSON serialization capabilities for custom types, allowing users to see how validation results can be serialized into JSON format.

src/demo/src · high confidence

Introduce Box-based validation with serialization support

The FSharp.Domain.Validation library now provides a new 'Box' abstraction for validating domain values. This includes core validation logic in Box.fs, helper modules for operators and reflection, and a JSON serialization converter (Serialization.fs) that enables serializing and deserializing validated boxes. An example module (Example/Text.fs) demonstrates defining text-based validation rules (e.g., Tweet, Text) using the new Box API. A deprecated compatibility layer (\_deprecated.fs) maps old 'Block' names to the new 'Box' names to ease migration.

FSharp.Domain.Validation, src/FSharp.Domain.Validation · high confidence

New validation box API for Fable

The Fable-specific namespace \FSharp.Domain.Validation.Fable\ is now deprecated in favor of the new \FSharp.Domain.Validation\ namespace. The library introduces a \Box\ type for validating and wrapping values, with \Box.validate\ and \Box.verbatim\ methods to create validated boxes. A new \Unchecked\ type provides an unchecked variant. Operators for error handling (\==\>\, \=\>\, \!?\) and a \\~%\ operator for extracting values are added. Additionally, a \Thoth\ module provides custom JSON encoders and decoders for boxes, allowing them to be serialized as their inner types. The old \Block\ types and related operators are marked obsolete and redirect to the new \Box\ implementation.

src/FSharp.Domain.Validation.Fable · high confidence

Behavioural changes

Split validation logic into a new common module

The validation utilities (canonicalize, depascalize, containsControlCharacters) and related types have been moved to a new shared library, FSharp.Domain.Validation.Common. This new module exposes internal helpers via InternalsVisibleTo and provides the core string manipulation and control-character detection logic previously located in the main validation assembly, allowing other projects to reuse these utilities without depending on the full validation framework.

src/FSharp.Domain.Validation.Common · medium confidence

Dependencies

Add .NET 5.0 project files and demo dependencies

The repository now includes .NET 5.0 project files for the core library (FSharp.Domain.Validation), the Fable-specific library (FSharp.Domain.Validation.Fable), and a shared common project (FSharp.Domain.Validation.Common). The Fable and main libraries reference Thoth.Json (v5.1.0 and v5.0.0 respectively) and FSharp.Core (v5.0.0/5.0.1). The demo application is also added, depending on Fable.Core (v3.2.4), Thoth.Json (v5.1.0), and various Babel/React/webpack packages for the frontend build.

(dependencies) · medium 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

Score

  • CAI 50 → 49 (-1.6)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 99 → 98 (-0.9)
  • Architecture 100 → 98 (-2.3)
  • Maturity 53 → 52 (-1.0)
  • Readiness 21 → 21 (+0.0)
  • Security 99 → 91 (-8.0)

Resolved (6)

  • Dependency hygiene not measured — no packages were read
  • Duplicated block (16 lines × 2) (src/FSharp.Domain.Validation.Fable/Operators.fs)
  • Duplicated block (16 lines × 2) (src/FSharp.Domain.Validation.Fable/_deprecated.fs)
  • No exposed public API
  • The live demo link points to 'https://fable-validation.herokuapp.com/', which does not exist at time of writing (April 2025), so readers cannot run it locally. (docs/demo.md)
  • dormant codebase — no living knowledge left to concentrate

New (7)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (22 lines × 2) (src/FSharp.Domain.Validation.Fable/Operators.fs)
  • Duplicated block (30 lines × 2) (src/FSharp.Domain.Validation.Fable/_deprecated.Fable.fs)
  • Duplicated block (32 lines × 2) (src/FSharp.Domain.Validation.Fable/_deprecated.Fable.fs)
  • Duplicated block (8 lines × 2) (src/FSharp.Domain.Validation.Fable/_deprecated.Fable.fs)
  • End-of-life runtime: .NET net5.0

Architecture

  • Unchanged — 0 containers · 3 contexts · 2 edges

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

Survey your own repository

lfr/FSharp.Domain.Validation 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 21 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 08c669f3e2fa429daedae9026fa671b1f0d8846c — 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-b84573e22831.