Skip to content
CAI
Software that uses CAICheck a score

Dolfik1/Funogram

62.9

Adequate · 2 October 2026

17.7k

lines of production code

F#

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Funogram is an F\# library that provides a type-safe interface for interacting with the Telegram Bot API. It features an automated code generator that creates idiomatic F\# bindings from official API documentation, supporting custom field remapping and version updates. The system handles JSON serialization with robust error handling and includes utilities for parsing bot commands and managing HTTP requests.

Features

Introduce code generator for Telegram Bot API types and methods

The Funogram.Generator project now provides a tool to automatically generate F\# type definitions and method bindings from the official Telegram Bot API documentation. It fetches the API specification (with optional local caching), parses the HTML, and applies configurable remapping rules (defined in RemapMethods.json and RemapTypes.json) and custom field definitions (CustomFields.json) to produce idiomatic F\# code. The generator outputs the resulting types and methods to Funogram.Telegram, updates the project version in Directory.Build.props based on the API version, and refreshes the README badge.

src/Funogram.Generator · high confidence

New example bots and test suite for Funogram

The examples directory now includes several new demonstration bots: a 'Hello World' bot, a 'Banhammer' bot that manages chat member bans via a persistent file, an 'Anonymous Chat' bot for pairing users, and a WebSocket-based bot example. Additionally, a comprehensive 'TestBot' has been added to exercise various Telegram Bot API features, including Markdown and MarkdownV2 formatting, HTML parsing, file uploads (both streams and byte arrays), reply and inline keyboards, and rich text messages. The TestBot also demonstrates graceful shutdown handling via cancellation tokens and includes a request logger.

src/examples · high confidence

Architecture

Refactored method generation into a modular parser and generator

The method generation logic has been split into three distinct components: a parser (MethodsParser.fs) that extracts API definitions from HTML documentation, a type definitions module (Types.fs) for the internal data structures, and a code generator (MethodsGenerator.fs) that produces the F\# source code. This change replaces the previous monolithic generator with a structured pipeline, improving maintainability and separation of concerns for how Telegram Bot API methods are processed and emitted.

src/Funogram.Generator/Methods · high confidence

Behavioural changes

Funogram.Telegram library updated to Bot API 10.3.0 with .NET 8 support

The Funogram.Telegram library has been updated to support Telegram Bot API version 10.3.0, introducing new types and request methods such as ForwardMessages, CopyMessage, and various business connection and subscription updates. The library now targets .NET 8.0 and includes a new Sscanf module for parsing command arguments, along with improved error handling for HTTP errors and better support for cancellation tokens.

src/Funogram.Telegram · high confidence

Migration to System.Text.Json with improved error handling and logging

The Funogram library has replaced the previous Utf8Json serialization backend with System.Text.Json. This change introduces custom converters for F\# discriminated unions, options, and Unix timestamps to maintain wire-format compatibility, and adds a SafeUpdateConverter that gracefully handles deserialization failures by logging the raw JSON and returning a fallback object instead of crashing. Additionally, a new request logger feature allows users to inspect the full details of HTTP requests and responses sent to the Telegram Bot API.

src/Funogram · high confidence

Refactored type generator to support custom field remapping and manual additions

The type generation pipeline now supports a remapping mechanism that allows customizing field names, types, and optionality based on external configuration, while also enabling the manual addition of new fields (such as deprecated ones) to existing types. This change introduces a new \Types.fs\ module defining the core data structures (\ApiType\, \ApiTypeField\, etc.) and updates the parser and generator to apply these remaps during code generation, ensuring the generated F\# types align with specific API requirements or legacy constraints.

src/Funogram.Generator/Types · high confidence

Test coverage

Added test suite for Funogram JSON serialization and command parsing

Added a new test project (src/Funogram.Tests) containing unit tests for the library's core functionality. The tests verify JSON serialization and deserialization of Telegram types (including MessageEntity, User, ChatMember, MaskPosition, and RichText), ensure correct parsing of bot commands (including username handling), and validate that the multipart serializer handles recursive RichText structures without stack overflow.

src/Funogram.Tests · high confidence

Dependencies

Upgrade to .NET 10 and update core dependencies

The Funogram library and its associated projects have been upgraded to target .NET 10 (net10.0) for executables and generators, while the core library and Telegram bindings remain on netstandard2.0 for compatibility. This change includes updating FSharp.Core to version 10.1.401, upgrading System.Text.Json to 10.0.12, and updating TypeShape to 10.0.0. Test and example projects also reflect the .NET 10 target framework.

(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

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 64 → 63 (-0.8)
  • Rubric changed (rubric-2026.09.13 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 90 → 90 (+0.1)
  • Architecture 100 → 100 (+0.2)
  • Maturity 59 → 59 (-0.2)
  • Readiness 55 → 53 (-1.9)
  • Security 76 → 77 (+0.9)

Resolved (6)

  • DiscriminatedUnionConverter`1.ReadShape (cognitive 17) (src/Funogram/Converters.fs)
  • Documentation: no usage examples (README.md)
  • High: security finding (details withheld)
  • Hotspot: src/Funogram.Generator/Types/TypesParser.fs (src/Funogram.Generator/Types/TypesParser.fs)
  • Medium: security finding (details withheld)
  • Workflow token permissions not restricted

New (5)

  • DiscriminatedUnionConverter`1.ResolveCase (cyclomatic 19) (src/Funogram/Converters/DiscriminatedUnionConverter.fs)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Hotspot: src/Funogram/Tools.fs (src/Funogram/Tools.fs)
  • PR-triggered workflow without a permissions block

Changes since last survey

  • 4 commits — 3 feature/other, 1 fixes

By area

  • .github/workflows — 2 commits
  • src/Funogram — 1 commit
  • src/examples — 1 commit

Notable commits

  • fix: fix: converters refactoring and fallback parser for updates on error (#98)
  • change: Bot API 10.3.0.0 (#99)
  • change: chore: deploy using actions (#100)
  • change: chore: migrate publish task to OIDC (#101)

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

Survey your own repository

Dolfik1/Funogram 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 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit f7149c312800372a463a738681c3999944dc52ae — the exact code this score is about.
  • Scored under rubric-2026.10.1 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-351388015767.