An MCP-based chatbot | 一个基于MCP的聊天机器人
This report presents the forensic synthetic code analysis of 78/xiaozhi-esp32, a C++ project with 28,091 GitHub stars. SynthScan v2.0 examined 55,117 lines of code across 668 source files, recording 689 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 13.5 places this repository in the Low AI signal 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).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
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 689 distinct pattern matches across 10 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 |
|---|---|---|---|---|
| LOW | docs/custom-board_zh.md | 41 | 参考示例(来自lichuang-c3-dev): | COMMENT |
| LOW | docs/custom-board_zh.md | 61 | #define AUDIO_CODEC_I2C_SCL_PIN GPIO_NUM_1 | COMMENT |
| LOW | docs/custom-board_zh.md | 141 | 1. **类定义**:继承自`WifiBoard`或`Ml307Board` | COMMENT |
| LOW | docs/custom-board.md | 41 | - Display parameters and pins. | COMMENT |
| LOW | docs/custom-board.md | 61 | #define AUDIO_CODEC_PA_PIN GPIO_NUM_13 | COMMENT |
| LOW | docs/custom-board.md | 141 | COMMENT | |
| LOW | scripts/Image_Converter/LVGLImage.py | 321 | if premultiplied: | COMMENT |
| LOW | main/application.h | 1 | #ifndef _APPLICATION_H_ | COMMENT |
| LOW | main/application.h | 21 | // Main event bits | COMMENT |
| LOW | main/mcp_server.h | 1 | #ifndef MCP_SERVER_H | COMMENT |
| LOW | main/assets.h | 1 | #ifndef ASSETS_H | COMMENT |
| LOW | main/led/circular_strip.h | 1 | #ifndef _CIRCULAR_STRIP_H_ | COMMENT |
| LOW | main/audio/audio_service.h | 1 | #ifndef AUDIO_SERVICE_H | COMMENT |
| LOW | main/audio/audio_service.h | 41 | #define MAX_PLAYBACK_TASKS_IN_QUEUE 2 | COMMENT |
| LOW | main/audio/audio_codec.h | 1 | #ifndef _AUDIO_CODEC_H | COMMENT |
| LOW | main/audio/codecs/es8374_audio_codec.h | 41 | #endif // _ES8374_AUDIO_CODEC_H | COMMENT |
| LOW | main/audio/processors/afe_audio_processor.h | 1 | #ifndef AFE_AUDIO_PROCESSOR_H | COMMENT |
| LOW | main/audio/wake_words/custom_wake_word.h | 1 | #ifndef CUSTOM_WAKE_WORD_H | COMMENT |
| LOW | main/audio/wake_words/esp_wake_word.h | 1 | #ifndef ESP_WAKE_WORD_H | COMMENT |
| LOW | main/audio/wake_words/afe_wake_word.h | 1 | #ifndef AFE_WAKE_WORD_H | COMMENT |
| LOW | main/boards/movecall-moji-esp32s3/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/movecall-moji-esp32s3/config.h | 21 | COMMENT | |
| LOW | main/boards/zhengchen-1.54tft-ml307/config.h | 1 | COMMENT | |
| LOW | main/boards/zhengchen-1.54tft-ml307/config.h | 21 | #define DISPLAY_SDA GPIO_NUM_41 | COMMENT |
| LOW | main/boards/minsi-k08-dual/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/minsi-k08-dual/config.h | 21 | COMMENT | |
| LOW | main/boards/esp-s3-lcd-ev-board-2/pin_config.h | 1 | COMMENT | |
| LOW | main/boards/esp-s3-lcd-ev-board-2/pin_config.h | 21 | #define GC9503V_LCD_BK_LIGHT_OFF_LEVEL !GC9503V_LCD_BK_LIGHT_ON_LEVEL | COMMENT |
| LOW | main/boards/esp-s3-lcd-ev-board-2/pin_config.h | 41 | COMMENT | |
| LOW | main/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c | 1 | /* | COMMENT |
| LOW | main/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c | 181 | // *INDENT-OFF* | COMMENT |
| LOW | main/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c | 201 | // {0x71, (uint8_t []){0x48}, 1, 0}, | COMMENT |
| LOW | main/boards/esp-s3-lcd-ev-board-2/esp_lcd_gc9503.c | 221 | // {0x7b, (uint8_t []){0x08, 0x13}, 2, 0}, | COMMENT |
| LOW | main/boards/esp-s3-lcd-ev-board-2/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/esp-s3-lcd-ev-board-2/config.h | 21 | COMMENT | |
| LOW | main/boards/lichuang-dev/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/lichuang-dev/config.h | 21 | #define AUDIO_CODEC_ES7210_ADDR 0x82 | COMMENT |
| LOW | main/boards/lichuang-dev/config.h | 41 | #define CAMERA_PIN_PWDN GPIO_NUM_NC | COMMENT |
| LOW | main/boards/freenove-esp32s3-display-2.8-lcd/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/freenove-esp32s3-display-2.8-lcd/config.h | 21 | #define AUDIO_CODEC_ES8311_ADDR ES8311_CODEC_DEFAULT_ADDR | COMMENT |
| LOW | main/boards/freenove-esp32s3-display-2.8-lcd/config.h | 41 | #define DISPLAY_WIDTH 320 | COMMENT |
| LOW | main/boards/esp-box-lite/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/esp-box-lite/config.h | 21 | #define BUILTIN_LED_GPIO GPIO_NUM_NC | COMMENT |
| LOW | main/boards/esp-sensairshuttle/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/esp-sensairshuttle/config.h | 21 | #define DISPLAY_CS_PIN GPIO_NUM_25 | COMMENT |
| LOW | main/boards/esp-vocat/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/esp-vocat/config.h | 21 | #define AUDIO_I2S_GPIO_WS GPIO_NUM_39 | COMMENT |
| LOW | main/boards/esp-vocat/config.h | 41 | #define DISPLAY_MIRROR_X false | COMMENT |
| LOW | main/boards/esp-vocat/config.h | 61 | #define UART1_TX_2 GPIO_NUM_5 | COMMENT |
| LOW | main/boards/doit-s3-aibox/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/doit-s3-aibox/config.h | 21 | #define BUILTIN_LED_GPIO GPIO_NUM_45 | COMMENT |
| LOW | main/boards/labplus-mpython-v3/config.h | 1 | COMMENT | |
| LOW | main/boards/labplus-mpython-v3/config.h | 21 | #define BOOT_BUTTON_GPIO GPIO_NUM_0 | COMMENT |
| LOW | main/boards/atk-dnesp32s3-box2-4g/config.h | 21 | #define AUDIO_CODEC_I2C_SDA_PIN GPIO_NUM_48 | COMMENT |
| LOW | main/boards/atk-dnesp32s3-box2-4g/config.h | 41 | #define XIO_VBUS_EN (IO_EXPANDER_PIN_NUM_11) | COMMENT |
| LOW | main/boards/atk-dnesp32s3-box2-4g/config.h | 61 | #define LCD_PIN_D6 GPIO_NUM_4 | COMMENT |
| LOW | main/boards/bread-compact-wifi-lcd/config.h | 1 | #ifndef _BOARD_CONFIG_H_ | COMMENT |
| LOW | main/boards/bread-compact-wifi-lcd/config.h | 21 | #else | COMMENT |
| LOW | main/boards/bread-compact-wifi-lcd/config.h | 41 | #define DISPLAY_DC_PIN GPIO_NUM_40 | COMMENT |
| LOW | main/boards/bread-compact-wifi-lcd/config.h | 61 | #ifdef CONFIG_LCD_ST7789_240X320_NO_IPS | COMMENT |
| 523 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/download_github_runs.py | 209 | print("Error: GITHUB_TOKEN not found in environment variables.", file=sys.stderr) | CODE |
| LOW | scripts/download_github_runs.py | 287 | except Exception as e: | CODE |
| MEDIUM | scripts/download_github_runs.py | 288 | print(f"Error: {e}", file=sys.stderr) | CODE |
| LOW | scripts/release.py | 128 | except Exception as e: | CODE |
| LOW | scripts/gen_lang.py | 185 | except Exception as e: | CODE |
| MEDIUM | scripts/gen_lang.py | 186 | print(f"Error: {e}") | CODE |
| MEDIUM⚡ | scripts/build_default_assets.py | 799 | print(f"Error: Generated assets.bin not found: {image_file}") | CODE |
| MEDIUM⚡ | scripts/build_default_assets.py | 803 | print(f"Error: Failed to build assets: {e}") | CODE |
| MEDIUM | scripts/build_default_assets.py | 201 | print(f"Error: Failed to generate srmodels.bin: {e}") | CODE |
| MEDIUM | scripts/build_default_assets.py | 860 | print("Error: USE_CUSTOM_WAKE_WORD is enabled but no multinet models are selected in sdkconfig") | CODE |
| LOW⚡ | scripts/build_default_assets.py | 802 | except Exception as e: | CODE |
| LOW | scripts/build_default_assets.py | 200 | except Exception as e: | CODE |
| LOW | scripts/versions.py | 219 | except Exception as e: | CODE |
| MEDIUM | scripts/versions.py | 220 | print(f"Error uploading version info: {str(e)}") | CODE |
| LOW | scripts/ogg_converter/xiaozhi_ogg_converter.py | 186 | except Exception as e: | CODE |
| LOW | scripts/ogg_converter/xiaozhi_ogg_converter.py | 205 | except Exception as e: | CODE |
| LOW | scripts/ogg_converter/xiaozhi_ogg_converter.py | 224 | except Exception as e: | CODE |
| LOW | scripts/Image_Converter/lvgl_tools_gui.py | 245 | except Exception as e: | CODE |
| LOW | scripts/p3_tools/batch_convert_gui.py | 187 | except Exception as e: | CODE |
| LOW | scripts/p3_tools/batch_convert_gui.py | 201 | except Exception as e: | CODE |
| LOW | scripts/p3_tools/batch_convert_gui.py | 215 | except Exception as e: | CODE |
| MEDIUM | scripts/spiffs_assets/build.py | 72 | print(f"Error: Failed to generate srmodels.bin: {e}") | CODE |
| LOW⚡ | scripts/spiffs_assets/build.py | 134 | except Exception as e: | CODE |
| MEDIUM⚡ | scripts/spiffs_assets/build.py | 135 | print(f"Error loading config file {config_path}: {e}") | CODE |
| MEDIUM | scripts/spiffs_assets/build.py | 151 | print(f"Error: No src field found for emote '{emote_name}' in config") | CODE |
| LOW | scripts/spiffs_assets/build.py | 259 | except Exception as e: | CODE |
| MEDIUM | scripts/spiffs_assets/build.py | 260 | print(f"Error reading/processing layout.json: {e}") | CODE |
| MEDIUM | scripts/spiffs_assets/build.py | 391 | print(f"Error: Failed to package assets.bin: {e}") | CODE |
| MEDIUM | scripts/spiffs_assets/spiffs_assets_gen.py | 101 | print('Error: convert_path is NULL') | CODE |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 137 | except Exception as e: | CODE |
| MEDIUM | scripts/spiffs_assets/spiffs_assets_gen.py | 254 | print('An error occurred while executing LVGLImage.py:') | CODE |
| LOW⚡ | scripts/spiffs_assets/spiffs_assets_gen.py | 294 | except Exception as e: | CODE |
| MEDIUM⚡ | scripts/spiffs_assets/spiffs_assets_gen.py | 295 | print(f'An error occurred during conversion: {e}') | CODE |
| MEDIUM⚡ | scripts/spiffs_assets/spiffs_assets_gen.py | 305 | print('Error: Height must be a positive integer') | CODE |
| LOW⚡ | scripts/spiffs_assets/spiffs_assets_gen.py | 314 | except Exception as e: | CODE |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 418 | except Exception as e: | CODE |
| LOW | scripts/spiffs_assets/build_all.py | 75 | except Exception as e: | CODE |
| LOW | scripts/acoustic_check/graphic.py | 342 | except Exception as e: | CODE |
| LOW | scripts/acoustic_check/graphic.py | 418 | except Exception as e: | CODE |
| LOW | scripts/acoustic_check/main.py | 16 | except Exception as e: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | scripts/build_default_assets.py | 452 | # ============================================================================= | COMMENT |
| MEDIUM⚡ | scripts/build_default_assets.py | 454 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 23 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 25 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 126 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 128 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 354 | # ============================================================================= | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 356 | # ============================================================================= | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/release.py | 74 | CODE | |
| LOW | scripts/release.py | 143 | CODE | |
| LOW | scripts/release.py | 267 | CODE | |
| LOW | scripts/build_default_assets.py | 58 | CODE | |
| LOW | scripts/build_default_assets.py | 218 | CODE | |
| LOW | scripts/build_default_assets.py | 456 | CODE | |
| LOW | scripts/build_default_assets.py | 482 | CODE | |
| LOW | scripts/build_default_assets.py | 531 | CODE | |
| LOW | scripts/build_default_assets.py | 571 | CODE | |
| LOW | scripts/versions.py | 61 | CODE | |
| LOW | scripts/versions.py | 223 | CODE | |
| LOW | scripts/Image_Converter/lvgl_tools_gui.py | 195 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 212 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 576 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 787 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 839 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 875 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 978 | CODE | |
| LOW | scripts/Image_Converter/LVGLImage.py | 1287 | CODE | |
| LOW | scripts/p3_tools/convert_p3_to_audio.py | 9 | CODE | |
| LOW | scripts/p3_tools/play_p3.py | 8 | CODE | |
| LOW | scripts/p3_tools/p3_gui_player.py | 12 | CODE | |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 141 | CODE | |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 391 | CODE | |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 492 | CODE | |
| LOW | scripts/spiffs_assets/build_all.py | 80 | CODE | |
| LOW | scripts/spiffs_assets/pack_model.py | 41 | CODE | |
| LOW | scripts/acoustic_check/demod.py | 179 | CODE | |
| LOW | scripts/acoustic_check/graphic.py | 118 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/download_github_runs.py | 87 | # Check if there are more pages | COMMENT |
| LOW | scripts/download_github_runs.py | 254 | # Check if file already exists | COMMENT |
| LOW | scripts/audio_debug_server.py | 40 | # Close files and socket | COMMENT |
| LOW | scripts/build_default_assets.py | 225 | # Check if this is otto-gif collection | COMMENT |
| LOW | scripts/build_default_assets.py | 913 | # Check if we have anything to build | COMMENT |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 72 | # Check if convert_path is not empty | COMMENT |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 117 | # Check if the file already exists | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/release.py | 17 | def get_board_type_from_compile_commands() -> Optional[str]: | CODE |
| LOW | scripts/release.py | 143 | def _find_board_config_candidates(board_type: str) -> list[str]: | CODE |
| LOW | scripts/release.py | 163 | def _extract_board_config_from_sdkconfig_append(sdkconfig_append: list[str]) -> Optional[str]: | CODE |
| LOW⚡ | scripts/build_default_assets.py | 456 | def read_wakenet_from_sdkconfig(sdkconfig_path): | CODE |
| LOW | scripts/build_default_assets.py | 482 | def read_multinet_from_sdkconfig(sdkconfig_path): | CODE |
| LOW | scripts/build_default_assets.py | 531 | def read_wake_word_type_from_sdkconfig(sdkconfig_path): | CODE |
| LOW | scripts/build_default_assets.py | 571 | def read_custom_wake_word_from_sdkconfig(sdkconfig_path): | CODE |
| LOW | scripts/build_default_assets.py | 624 | def get_language_from_multinet_models(multinet_models): | CODE |
| LOW | scripts/build_default_assets.py | 709 | def get_emoji_collection_path(default_emoji_collection, xiaozhi_fonts_path, project_root=None): | CODE |
| LOW⚡ | scripts/spiffs_assets/build.py | 138 | def process_board_emoji_collection(emoji_collection_dir, target_board_dir, assets_dir): | CODE |
| LOW | scripts/spiffs_assets/build.py | 192 | def process_board_icon_collection(icon_collection_dir, assets_dir): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/audio_debug_server.py | 12 | # Create a UDP socket | COMMENT |
| MEDIUM | scripts/build_default_assets.py | 916 | # Create an empty assets.bin file | COMMENT |
| MEDIUM | scripts/spiffs_assets/spiffs_assets_gen.py | 123 | # Create the parent directories if they do not exist | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/download_github_runs.py | 17 | CODE | |
| LOW | scripts/download_github_runs.py | 19 | CODE | |
| LOW | scripts/spiffs_assets/build.py | 22 | CODE | |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 3 | CODE | |
| LOW | scripts/spiffs_assets/spiffs_assets_gen.py | 10 | CODE | |
| LOW | scripts/acoustic_check/graphic.py | 12 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | scripts/download_github_runs.py | 126 | Rename artifact according to the specified rules. Rules: - Remove "xiaozhi_" prefix - Remove hash | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/Image_Converter/LVGLImage.py | 1285 | CODE |