MTProxy for Telegram on Rust + Tokio
This report presents the forensic synthetic code analysis of telemt/telemt, a Rust project with 5,486 GitHub stars. SynthScan v2.0 examined 174,348 lines of code across 370 source files, recording 207 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 2.5 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 207 distinct pattern matches across 8 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | IMPLEMENTATION_PLAN.md | 87 | // ── RecordingWriter ───────────────────────────────────────────────── | COMMENT |
| MEDIUM | IMPLEMENTATION_PLAN.md | 143 | // ── PendingCountWriter ────────────────────────────────────────────── | COMMENT |
| MEDIUM | IMPLEMENTATION_PLAN.md | 199 | // ── Deterministic seeded RNG ──────────────────────────────────────── | COMMENT |
| MEDIUM | IMPLEMENTATION_PLAN.md | 211 | // ── Config builders ───────────────────────────────────────────────── | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 177 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 179 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 189 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 191 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 201 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 203 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 284 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 286 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 296 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 298 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 429 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 431 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 439 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | tools/telemt_api.py | 441 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 23 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 25 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 42 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 44 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 57 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 59 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 87 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | tools/telemt_api.py | 89 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | tools/telemt_api.py | 217 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | tools/telemt_api.py | 219 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | tools/telemt_api.py | 245 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | tools/telemt_api.py | 247 | # ------------------------------------------------------------------ | COMMENT |
| MEDIUM | tools/telemt_api.py | 456 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tools/telemt_api.py | 458 | # --------------------------------------------------------------------------- | COMMENT |
| MEDIUM | .github/workflows/release.yml | 63 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 65 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 174 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 176 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 310 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 312 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 343 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/release.yml | 345 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 17 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 19 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 36 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 38 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 72 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 74 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 105 | # ========================== | COMMENT |
| MEDIUM | .github/workflows/check.yml | 107 | # ========================== | COMMENT |
| MEDIUM | src/proxy/relay.rs | 290 | // ── Combine split halves into bidirectional streams ────────────── | COMMENT |
| MEDIUM | src/proxy/relay.rs | 306 | // ── Watchdog: activity timeout + periodic rate logging ────────── | COMMENT |
| MEDIUM | src/proxy/relay.rs | 326 | // ── Activity timeout ──────────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/relay.rs | 340 | // ── Periodic rate logging ─────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/relay.rs | 363 | // ── Run bidirectional copy + watchdog concurrently ─────────────── | COMMENT |
| MEDIUM | src/proxy/relay.rs | 399 | // ── Clean shutdown ────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/relay.rs | 405 | // ── Final logging ─────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/tests/adaptive_buffers_security_tests.rs | 13 | // ── Positive / Lifecycle ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/tests/adaptive_buffers_security_tests.rs | 55 | // ── Edge Cases ────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/tests/adaptive_buffers_security_tests.rs | 94 | // ── Stale Entry Handling ──────────────────────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/tests/adaptive_buffers_security_tests.rs | 139 | // ── Cardinality Attack / Unbounded Growth ─────────────────────────────── | COMMENT |
| MEDIUM | src/proxy/tests/adaptive_buffers_security_tests.rs | 188 | // ── Key Length Validation ──────────────────────────────────────────────── | COMMENT |
| 45 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | config.toml | 1 | ### Telemt Based Config.toml | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 201 | // | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 341 | handshake_baseline_probe_always_falls_back_to_masking | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 801 | // Adversarial: inner writer returns Pending on first 5 poll_write calls. | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 881 | // NOTE: Unlike real TLS 1.3, FakeTlsWriter does NOT add a content-type byte | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1441 | COMMENT | |
| LOW | …tions/self-explanatory-code-commenting.instructions.md | 101 | COMMENT | |
| LOW | src/crypto/aes.rs | 1 | //! AES encryption implementations | COMMENT |
| LOW | src/crypto/hash.rs | 1 | //! Cryptographic hash functions | COMMENT |
| LOW | src/tls_front/types.rs | 141 | #[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Default)] | COMMENT |
| LOW | src/tls_front/types.rs | 161 | Fallback, | COMMENT |
| LOW | src/transport/middle_proxy/health.rs | 1541 | /// Last-resort safety net for draining writers stuck past their deadline. | COMMENT |
| LOW | src/proxy/relay.rs | 1 | //! Bidirectional Relay — poll-based, no head-of-line blocking | COMMENT |
| LOW | src/proxy/relay.rs | 21 | //! Old (select! + write_all — BLOCKING): | COMMENT |
| LOW | src/proxy/relay.rs | 41 | //! - No head-of-line blocking: slow client download doesn't block uploads | COMMENT |
| LOW | src/proxy/relay.rs | 101 | /// ## API compatibility | COMMENT |
| LOW | src/proxy/relay.rs | 361 | }; | COMMENT |
| LOW | src/proxy/relay/io.rs | 21 | refund_reserved_quota_bytes, | COMMENT |
| LOW | src/proxy/relay/io/combined.rs | 1 | use std::io; | COMMENT |
| LOW | src/config/types.rs | 341 | /// Per-user unique source IP limit mode. | COMMENT |
| LOW | src/config/types.rs | 521 | /// Deprecated legacy single STUN server for NAT probing. | COMMENT |
| LOW | src/config/types.rs | 561 | /// Keepalive interval in seconds. | COMMENT |
| LOW | src/config/types.rs | 581 | COMMENT | |
| LOW | src/config/types.rs | 621 | /// Additional bytes above strict per-user quota allowed in hot-path soft mode. | COMMENT |
| LOW | src/config/types.rs | 641 | #[serde(default = "default_direct_relay_copy_buf_s2c_bytes")] | COMMENT |
| LOW | src/config/types.rs | 761 | /// Override logical CPU core count for adaptive floor calculations. | COMMENT |
| LOW | src/config/types.rs | 881 | /// Maximum wait time in milliseconds for async-recovery failfast mode. | COMMENT |
| LOW | src/config/types.rs | 901 | COMMENT | |
| LOW | src/config/types.rs | 1001 | /// Cooldown for repetitive soft-eviction on the same writer in milliseconds. | COMMENT |
| LOW | src/config/types.rs | 1061 | /// NTP servers for drift check. | COMMENT |
| LOW | src/config/types.rs | 1321 | /// CIDR whitelist allowed to access API. | COMMENT |
| LOW | src/config/types.rs | 1541 | /// Tracks whether inline_conntrack_control was explicitly set in config. | COMMENT |
| LOW | src/config/types.rs | 1601 | #[serde(default = "default_listen_addr_ipv6_opt")] | COMMENT |
| LOW | src/config/types.rs | 1621 | COMMENT | |
| LOW | src/config/types.rs | 1641 | /// | COMMENT |
| LOW | src/config/types.rs | 1661 | COMMENT | |
| LOW | src/config/types.rs | 1721 | COMMENT | |
| LOW | src/config/types.rs | 1941 | COMMENT | |
| LOW | src/config/types.rs | 1961 | pub alpn_enforce: bool, | COMMENT |
| LOW | src/config/types.rs | 1981 | #[serde(default = "default_mask_shape_bucket_floor_bytes")] | COMMENT |
| LOW | src/config/types.rs | 2001 | COMMENT | |
| LOW | src/config/types.rs | 2101 | /// Per-user transport rate limits in bits-per-second. | COMMENT |
| LOW | src/config/types.rs | 2381 | pub struct UpstreamConfig { | COMMENT |
| LOW | src/config/types.rs | 2421 | pub port: Option<u16>, | COMMENT |
| LOW | src/config/types.rs | 2441 | /// iOS-like SYN-fix token-bucket rate amount. | COMMENT |
| LOW | src/config/hot_reload.rs | 1 | //! Hot-reload: watches the config file via inotify (Linux) / FSEvents (macOS) | COMMENT |
| LOW | src/config/load.rs | 81 | /// Anti-censorship behavior and traffic shaping configuration. | COMMENT |
| LOW | src/maestro/shutdown.rs | 1 | //! Shutdown and signal handling for telemt. | COMMENT |
| LOW | src/maestro/mod.rs | 1 | //! telemt — Telegram MTProto Proxy | COMMENT |
| LOW | src/maestro/mod.rs | 61 | COMMENT | |
| LOW | src/stream/tls_stream.rs | 1 | //! Fake TLS 1.3 stream wrappers | COMMENT |
| LOW | src/stream/tls_stream.rs | 21 | COMMENT | |
| LOW | src/stream/tls_stream.rs | 241 | COMMENT | |
| LOW | src/stream/tls_stream.rs | 261 | /// │ <-------- (CCS) -------- │ │ | COMMENT |
| LOW | src/stream/crypto_stream.rs | 1 | //! Encrypted stream wrappers using AES-CTR | COMMENT |
| LOW | src/stream/crypto_stream.rs | 21 | COMMENT | |
| LOW | src/stream/crypto_stream.rs | 41 | //! -> poll_write returns Poll::Pending | COMMENT |
| LOW | src/stream/frame.rs | 121 | /// Trait for frame codecs that can encode and decode frames | COMMENT |
| LOW | src/protocol/constants.rs | 201 | pub const MIN_CERT_LEN: usize = 1024; | COMMENT |
| LOW | src/protocol/tls.rs | 81 | /// Length to store for replay protection (first 16 bytes of digest) | COMMENT |
| 4 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | IMPLEMENTATION_PLAN.md | 559 | ### Step 1: Add seam, then write red tests (must fail on then-current code) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 605 | ### Step 2: Implement `ProxySharedState` | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 652 | ### Step 3: Thread `Arc<ProxySharedState>` through the call chain | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 711 | ### Step 4: Remove test helpers and migrate test files | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 776 | ### Step 1: Write red tests (must fail on current code) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 860 | ### Step 2: Implement `DrsWriter` | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 946 | ### Step 3: Wire into relay path with compatibility | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1031 | ### Step 5: Add `drs_enabled` config flag | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1090 | ### Step 1: Write red tests for remaining gaps (must fail on current code) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1115 | ### Step 2: Keep current hardening, remove outdated dead-code suppression | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1128 | ### Step 3: Add explicit throughput mapping API | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1153 | ### Step 4: Wire into `direct_relay.rs` | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1221 | ### Step 1: Required deterministic decision tests (CI required) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1246 | ### Step 2: Optional feasibility experiments (ignored by default) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1274 | ### Step 3: Option B boundary validation experiment (ignored by default) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1293 | ### Step 4: Decision artifact | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1379 | ### Step 1: Write red tests only for missing coverage (must fail on current code) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1408 | ### Step 2: Keep current masking implementation, harden where needed | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1472 | ### Step 3: Implement in `handshake.rs` | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1542 | ### Step 1: Write red tests (must fail on current code) | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1620 | ### Step 2: Implement `IptController` | COMMENT |
| LOW | IMPLEMENTATION_PLAN.md | 1726 | ### Step 3: Integrate into relay path | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/dc.py | 3 | CODE | |
| LOW | tools/telemt_api.py | 13 | CODE | |
| LOW | tools/telemt_api.py | 17 | CODE | |
| LOW | tools/telemt_api.py | 18 | CODE | |
| LOW | tools/telemt_api.py | 18 | CODE | |
| LOW | tools/telemt_api.py | 18 | CODE | |
| LOW | tools/tlsearch.py | 12 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/telemt_api.py | 135 | except Exception: | CODE |
| LOW | tools/aesdiag.py | 316 | except Exception as e: | CODE |
| LOW | tools/tlsearch.py | 387 | except Exception as e: # noqa: BLE001 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/telemt_api.py | 269 | def runtime_connections_summary(self) -> APIResponse: | CODE |
| LOW | tools/tlsearch.py | 125 | def decode_supported_versions(data: list[int]) -> str: | CODE |
| LOW | …tions/self-explanatory-code-commenting.instructions.md | 97 | function calculateCompoundInterest(principal, rate, time, compoundFrequency = 1) { | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/aesdiag.py | 106 | CODE | |
| LOW | tools/tlsearch.py | 190 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/aesdiag.py | 222 | # Check if the extra bytes after hs_plain in decrypted are all zero (zero padding) | COMMENT |