Skip to content
CAI
Software that uses CAICheck a score

fsharplang-ru/vahter-bot

61.6

Adequate · 3 October 2026

9.6k

lines of production code

F#

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET-based moderation platform for Telegram chats, centered around the VahterBanBot which automates spam detection and user management. It leverages machine learning and large language models to classify content, utilizing an event-sourced architecture with PostgreSQL for auditability and performance. The infrastructure includes shared libraries for distributed job scheduling, OCR, and observability, supported by a comprehensive containerized integration testing suite.

Features

New BotInfra shared infrastructure library

Introduced the BotInfra library, providing shared capabilities for all bots: an append-only event store with optional snapshotting and transactional projections, live bot settings reload without restarts, distributed scheduled job locking, Azure AI Vision OCR integration, structured JSON logging, OpenTelemetry observability with Telegram token redaction, and health-check endpoints.

src/BotInfra · high confidence

Vahter bot database schema and event-sourcing migrations

The vahter-bot database schema has been significantly expanded and refactored to support advanced moderation features and an event-sourced architecture. The core change is the introduction of an append-only \event\ table (V23) that replaces legacy tables like \user\, \message\, and \banned\, with debug views (\v\_users\, \v\_recent\_bans\, etc.) provided for compatibility. New capabilities include LLM-based triage with shadow classification (\llm\_triage\), ML model storage (\ml\_trained\_model\), and a verdict cache (\llm\_verdict\_cache\) to handle rate limits. The schema also supports reaction spam triage (\user\_profile\_cache\), OCR caching (\ocr\_cache\), and distributed scheduled jobs (\scheduled\_job\). Read-model snapshots (\snapshot\_user\, \snapshot\_message\) are introduced for efficient querying, and message IDs are widened to BIGINT to support Telegram's 64-bit IDs.

src/vahter-bot · high confidence

VahterBanBot moderation bot introduced with ML, LLM triage, and event sourcing

The VahterBanBot moderation bot is now available, providing automated spam detection and user management for Telegram chats. It features a machine learning model trained on message text and emoji usage, alongside an LLM-based triage system (Azure OpenAI) for complex spam classification. The bot supports manual and automatic bans, soft-bans, and admin commands for managing monitored chats and vahter permissions. It uses event sourcing for auditability and persists ML models in PostgreSQL for fast startup. Additional capabilities include OCR for image spam detection, distributed scheduled jobs for cleanup and stats, and comprehensive telemetry via OpenTelemetry.

src/VahterBanBot · high confidence

Behavioural changes

Upgrade to .NET 10 and update project structure

The application has been upgraded from .NET 8 to .NET 10, requiring the .NET SDK version 10.0.103 as specified in global.json. This change updates the target framework to net10.0 in Directory.Build.props and includes a copyright update in the LICENSE file. The project structure now utilizes a .slnx solution file and includes specific build properties such as treating warnings as errors and disabling the implicit FSharp.Core reference to resolve Package Central Manifest (CPM) issues.

(repo-wide) · high confidence

Test coverage

New BotTestInfra test infrastructure for containerized bot integration tests

Added a comprehensive test infrastructure library (BotTestInfra) that orchestrates Docker containers for integration testing, including a shared base class for managing Postgres, Flyway migrations, and fake Telegram/Azure API services. The update introduces helper modules for building Docker images with log capture, creating test fixtures for Telegram message types, and mocking Azure OCR and OpenAI/Gemini LLM endpoints to support deterministic testing of bot behaviors like concurrency races and error handling.

tests · high confidence

Dependencies

Centralized dependency management and security patching

The project now uses centralized package version management via Directory.Packages.props, defining specific versions for key libraries including Funogram 3.0.5, Azure.AI.OpenAI 2.9.0-beta.1, Microsoft.ML 5.0.0, and xunit.v3 3.2.2. This change also pins SSH.NET to version 2026.0.0 to address a security vulnerability ([CVE redacted]) in the transitive dependency chain from Testcontainers.

(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

Score

  • CAI 61 → 62 (+0.2)
  • Rubric changed (rubric-2026.09.15 → rubric-2026.10.1) — scores are not directly comparable.

Lenses

  • Code Health 79 → 75 (-3.2)
  • Architecture 94 → 96 (+2.7)
  • Maturity 53 → 52 (-0.1)
  • Readiness 53 → 55 (+2.3)
  • Security 96 → 95 (-1.1)

Resolved (3)

  • Documentation: no licence statement (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (12 lines × 2) (src/BotInfra/EventStore.fs)

New (12)

  • DbService.RebuildSnapshots (cognitive 16) (src/VahterBanBot/DB.fs)
  • EventStore.TransactWithProjection (cognitive 21) (src/BotInfra/EventStore.fs)
  • FileTooLong: BotInfra/EventStore.fs (src/BotInfra/EventStore.fs)
  • Low coverage: src/BotInfra/WebhookRegistration.fs (src/BotInfra/WebhookRegistration.fs)
  • Low coverage: src/VahterBanBot/ModerationQuality.fs (src/VahterBanBot/ModerationQuality.fs)
  • Low coverage: src/VahterBanBot/ModerationQualityHistory.fs (src/VahterBanBot/ModerationQualityHistory.fs)
  • ModerationQuality.evaluate (cognitive 45) (src/VahterBanBot/ModerationQuality.fs)
  • ModerationQuality.evaluate (cyclomatic 42) (src/VahterBanBot/ModerationQuality.fs)
  • Outdated: Funogram
  • Outdated: Funogram.Telegram
  • SnapshotShape.render (cognitive 27) (src/BotInfra/EventSnapshot.fs)
  • SnapshotShape.render (cyclomatic 17) (src/BotInfra/EventSnapshot.fs)

Changes since last survey

  • 11 commits — 11 feature/other, 0 fixes

By area

  • src/BotInfra — 4 commits
  • src/VahterBanBot — 4 commits
  • (root) — 1 commit
  • .github/workflows — 1 commit
  • src/vahter-bot — 1 commit

Notable commits

  • change: Sync from monorepo (306ac09) (#253)
  • change: Sync from monorepo (38ab186) (#250)
  • change: Sync from monorepo (49a6e35) (#254)
  • change: Sync from monorepo (5e7ec91) (#255)
  • change: Sync from monorepo (6e4f632) (#257)
  • change: Sync from monorepo (79adeee) (#248)
  • change: Sync from monorepo (8587c8a) (#258)
  • change: Sync from monorepo (970708d) (#252)
  • change: Sync from monorepo (bba1761) (#256)
  • change: Sync from monorepo (c2fc69c) (#249)
  • change: Sync from monorepo (da188ec) (#251)

API surface

  • 1 added · 0 removed (a removed endpoint is potentially breaking)

Added endpoints (1)

  • POST /quality-history

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

Survey your own repository

fsharplang-ru/vahter-bot 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 3 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 6cf8c826046c45ce8106ff2b58effc6f04bb83a6 — 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-4f4226d619ea.